简体   繁体   English

在 Azure AD 中重新创建恶意登录

[英]Recreating Malicious login in Azure AD

We had a user's creds exposed and a threat actor used them to successfully log in to Azure CLI with the user's creds.我们暴露了一个用户的凭据,一个威胁者利用它们成功地使用用户的凭据登录到 Azure CLI。 We've since resolved the access issue using conditional access and our MFA (which admittedly was a hole).我们已经使用条件访问和我们的 MFA 解决了访问问题(不可否认这是一个漏洞)。 I'm trying to recreate the method of attack though and I can't seem to get it right.不过,我正在尝试重新创建攻击方法,但我似乎无法做到正确。 Here is the activity details for the malicious sign-in:以下是恶意登录的活动详细信息:

Application
Microsoft Azure CLI
Application ID
04b07795-8ddb-461a-bbee-02f9e1bf7b46
Resource
Windows Azure Service Management API
Resource ID
797f4846-ba00-4fd7-ba43-dac1f8f63013
Resource tenant ID
LEft out
Home tenant ID
Left out 
Home tenant name
Client app
Mobile Apps and Desktop clients
Client credential type
None
Service principal ID
Service principal name
Resource service principal ID
d2b4c9e3-9a2a-4360-8ba4-6ece086335c5
Unique token identifier
Left Out
Token issuer type
Azure AD
Token issuer name
Incoming token type
None
Authentication Protocol
ROPC
Latency
90ms
Flagged for review
No
User agent

Looks like they used ROPC detailed here https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc看起来他们使用了此处详述的ROPC https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc

I've tried emulating it through Azure CLI directly but it doesn't report back "ROPC" as authentication.我已经尝试通过 Azure CLI 直接模拟它,但它不会将“ROPC”作为身份验证报告回来。 So they are definitely calling through ROPC.所以他们肯定是通过 ROPC 调用的。 Then I tried emulating it with my creds in Postman and I get almost the same result as above in the sign-in log:然后我尝试用我在 Postman 中的信用来模拟它,我在登录日志中得到与上面几乎相同的结果:

Application
Microsoft Azure CLI
Application ID
04b07795-8ddb-461a-bbee-02f9e1bf7b46
Resource
Microsoft Graph
Resource ID
00000003-0000-0000-c000-000000000000
Resource tenant ID
Left out
Home tenant ID
Left out
Home tenant name
Client app
Mobile Apps and Desktop clients
Client credential type
None
Service principal ID
Service principal name
Resource service principal ID
e10569b0-24e4-4495-9d9b-698b01290eae
Unique token identifier
Left out
Token issuer type
Azure AD
Token issuer name
Incoming token type
None
Authentication Protocol
ROPC
Latency
108ms
Flagged for review
No
User agent
PostmanRuntime/7.30.0

As you can see it's very similar, but mine is reporting "Microsoft Graph" while the malicious entry reports Windows Azure Service Management API. Can someone point me in the right direction?如您所见,它非常相似,但我的正在报告“Microsoft Graph”,而恶意条目报告 Windows Azure 服务管理 API。有人能指出我正确的方向吗?

Windows Azure Service Management API refers to the Azure Resource management API. Windows Azure 服务管理 API 指 Azure 资源管理 API。

I tried checking Sign in Logs and the Service Principal Sign In' Logs has Windows Azure Service Management API refer here:-我尝试检查登录日志,服务主体登录日志有 Windows Azure 服务管理 API 参考这里:-

在此处输入图像描述

Note- The above sign in log is of the Service principal sign in with Client credentials flow.注意 - 上面的登录日志是使用客户端凭据流程登录的服务主体。 You can find that Service principal by copying its Application ID and pasting it in app registrations page or enterprise application page of Azure AD.您可以通过复制其应用程序 ID 并将其粘贴到 Azure AD 的应用程序注册页面或企业应用程序页面来找到该服务主体。

I tried to log in to Azure with service principal named Powershell with ROPC Flow via Postman我尝试使用名为 Powershell 的服务主体通过 Postman 使用 ROPC Flow 登录到Azure

在此处输入图像描述

Received Access token like below:-收到的访问令牌如下: -

在此处输入图像描述

Called Graph API称为图API

在此处输入图像描述

Got resource as Microsoft Graph in Sign in Logs similar to you:-在与您类似的登录日志中获得 Microsoft Graph 资源:-

在此处输入图像描述

Now, I tried calling Azure Resource management API to get list of Azure resources from my account with the same Flow and got the Resource set to Windows Azure Service Management API like below:-现在,我尝试调用Azure Resource management API从我的帐户中获取Azure 资源列表,并将资源设置为Windows Azure Service Management API ,如下所示:-

Added Azure Service Management API permissions:添加Azure服务管理API权限:

在此处输入图像描述

Now, I changed the scope to https://management.azure.com/default like below:现在,我将 scope 更改为https://management.azure.com/default如下所示:

在此处输入图像描述

Fetch the access token from above call and ran below query to get list of resources:从上面的调用中获取访问令牌并运行下面的查询以获取资源列表:

在此处输入图像描述

When I checked sign in logs now, it's showing ROPC with Windows Azure Service Management API resource like below:当我现在检查登录日志时,它显示ROPC with Windows Azure Service Management API资源,如下所示:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM