T1586.001 Microsoft Sentinel · KQL

Detect Social Media Accounts in Microsoft Sentinel

Adversaries may compromise existing social media accounts to conduct operations against target organizations. Rather than creating new personas, adversaries compromise legitimate accounts to leverage existing trust relationships and follower networks. Compromised accounts are used to deliver spearphishing messages via social platforms (T1566.003), conduct OAuth-based initial access attacks, or establish connections with target employees as a precursor to further social engineering. Threat groups including Sandworm Team (credential capture webpages) and Leviathan/APT40 (social engineering campaigns) have leveraged compromised social media accounts in operations. Detection focuses on observable effects when compromised accounts interact with the organization: anomalous OAuth authentication events using social identity providers, suspicious OAuth consent grants that may follow social media phishing, and Microsoft Defender for Cloud Apps anomalies on monitored corporate social accounts.

MITRE ATT&CK

Tactic
Resource Development
Technique
T1586 Compromise Accounts
Sub-technique
T1586.001 Social Media Accounts
Canonical reference
https://attack.mitre.org/techniques/T1586/001/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// T1586.001 — Social Media Account Compromise
// Detect anomalous sign-ins via social identity providers with composite risk scoring
// A compromised social media account used to access corporate resources via OAuth federation
// generates exactly this pattern: social IdP + elevated risk indicators
let SocialProviders = dynamic(["google", "facebook", "linkedin", "twitter", "github", "slack", "yahoo"]);
let RiskyCountryCodes = dynamic(["CN", "RU", "IR", "KP", "BY", "VE", "CU", "SY"]);
let LookbackPeriod = 24h;
SigninLogs
| where TimeGenerated > ago(LookbackPeriod)
| where IdentityProvider has_any (SocialProviders)
    or (AuthenticationProtocol == "oAuth2" and AppDisplayName has_any (SocialProviders))
| extend CountryCode = tostring(LocationDetails.countryOrRegion)
| extend IsCompliant = tostring(DeviceDetail.isCompliant)
| extend TrustType = tostring(DeviceDetail.trustType)
| extend BrowserUA = tostring(DeviceDetail.browser)
| extend RiskScore = 0
| extend RiskScore = RiskScore + iif(RiskLevelAggregated in ("high", "medium"), 3, 0)
| extend RiskScore = RiskScore + iif(CountryCode in (RiskyCountryCodes), 2, 0)
| extend RiskScore = RiskScore + iif(IsCompliant != "true", 1, 0)
| extend RiskScore = RiskScore + iif(TrustType == "", 1, 0)
| extend RiskScore = RiskScore + iif(RiskEventTypes has_any ("anonymizedIPAddress", "unfamiliarFeatures", "maliciousIPAddress", "impossibleTravel", "leakedCredentials"), 3, 0)
| extend RiskScore = RiskScore + iif(IsInteractive == false, 1, 0)
| extend RiskScore = RiskScore + iif(ResultType != 0, 1, 0)
| where RiskScore >= 2
| project TimeGenerated, UserPrincipalName, IPAddress, CountryCode,
         IdentityProvider, AppDisplayName, AuthenticationProtocol,
         RiskLevelAggregated, RiskEventTypes, RiskScore,
         IsCompliant, TrustType, BrowserUA, CorrelationId, ResultType, ResultDescription
| sort by RiskScore desc, TimeGenerated desc
medium severity low confidence

Detects anomalous sign-ins via social identity providers (Google, LinkedIn, Facebook, GitHub, Slack, Yahoo) using Azure AD SigninLogs. Builds a composite risk score from multiple indicators: elevated Azure AD risk level, sign-in from high-risk/sanctioned countries, non-compliant or unknown device trust, risky sign-in event types (impossible travel, anonymous IP, leaked credentials), non-interactive flows, and failed authentication results. A compromised social media account used to access corporate resources via OAuth federation generates this exact signature — social IdP combined with one or more risk indicators. Confidence is low because this is a PRE-ATT&CK technique where the primary adversary action occurs outside the victim environment.

Data Sources

Azure AD: Sign-in LogsIdentity: AuthenticationMicrosoft Entra ID / Azure Active Directory

Required Tables

SigninLogs

False Positives & Tuning

  • Employees traveling internationally who use social identity provider SSO to access corporate applications, generating legitimate sign-ins from foreign country codes
  • Developers using GitHub or Google OAuth to access internal developer tools and cloud services from personal non-compliant devices outside MDM enrollment
  • Service accounts or CI/CD pipelines using OAuth federation with social identity providers for non-interactive automation (GitHub Actions, Google Cloud service accounts)
  • Employees using corporate VPN with split tunneling that causes their exit IP to appear in a high-risk country classification despite being physically in a legitimate location
  • New employees authenticating via social identity providers before their corporate device completes MDM enrollment and appears compliant in Azure AD
Download portable Sigma rule (.yml)

Other platforms for T1586.001


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate OAuth Consent Grant Following Social Media Phishing Link

    Expected signal: Azure AD AuditLogs: OperationName='Add application' showing new app registration with AppName matching df00tech-oauth-test-*. If test user navigates to URL and consents: SigninLogs entry for test user with AppDisplayName matching test app, followed by AuditLogs OperationName='Consent to application' with Scope='Mail.Read Contacts.Read offline_access'. Microsoft Defender for Cloud Apps will generate an OAuth app governance alert if MCAS is configured with tenant OAuth monitoring.

  2. Test 2Test Anomalous Social Identity Provider Sign-in Detection

    Expected signal: Azure AD SigninLogs: entry with IdentityProvider='github' (or Microsoft external identity), UserAgent containing 'Googlebot', DeviceDetail.browser='Other' or unknown classification, DeviceDetail.isCompliant='false' (non-MDM device). Azure AD risk engine may flag as 'unfamiliarFeatures' risk detection, incrementing RiskLevelAggregated. The sign-in will result in a redirect (not a full authentication) but is still captured in logs.

  3. Test 3Credential Stuffing Simulation Against Social Identity Federated Account

    Expected signal: Azure AD SigninLogs: 5 entries with ResultType=50126 (AADSTS50126: Invalid username or password) or 50053 (AADSTS50053: account locked) for TEST_USER within a 20-second window. IPAddress and UserAgent fields match curl defaults. Azure AD Identity Protection may generate 'Password spray' or 'Leaked credentials' risk detection. This simulates the upstream account compromise that precedes T1586.001 use against a victim organization.

  4. Test 4Corporate Social Media Account Exposure Enumeration (Authorized OSINT)

    Expected signal: DNS queries to linkedin.com, github.com from the network running this script — visible in proxy and DNS logs. No authentication events generated against the target organization's Azure AD. GitHub API calls logged in GitHub audit log if an org membership query is made.

Unlock Pro Content

Get the full detection package for T1586.001 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections