T1606.001

Web Cookies

Adversaries may forge web cookies to gain unauthorized access to web applications or internet services. Unlike cookie theft (T1539), forged cookies are newly crafted by the adversary using stolen cryptographic material such as HMAC signing keys, private keys, or application secrets. Common targets include JWT bearer tokens, Flask session cookies (signed with itsdangerous using SECRET_KEY), Django session tokens, and platform-specific SaaS session identifiers. Because forged cookies appear as valid, trusted session credentials, they can bypass multi-factor authentication — the application trusts the cookie without re-challenging the user. The SolarWinds (SUNBURST) attack demonstrated this technique at scale when UNC2452/Dark Halo forged SAML assertion cookies after stealing ADFS signing certificates, enabling persistent access to cloud tenants that bypassed MFA entirely. Detection focuses on authentication anomalies in identity provider logs (sessions appearing from new locations without prior interactive authentication), endpoint activity where signing key material is accessed prior to token generation, and web server log patterns indicating session anomalies such as the same session ID appearing from multiple IPs.

Microsoft Sentinel / Defender
kusto
// T1606.001 — Forged Web Cookie Detection via Azure AD Authentication Anomalies
// Three complementary detection branches targeting different forgery indicators

// Branch 1: Non-interactive sign-ins with anomalous token risk signals
// 'anomalousToken' risk detail fires when Microsoft detects unusual JWT characteristics
let AnomalousTokenSignIns = AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(24h)
| where RiskDetail in ("anomalousToken", "unfamiliarFeatures", "maliciousIPAddress", "suspiciousIPAddress")
    or RiskLevelDuringSignIn in ("high", "medium")
| project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName,
          TokenIssuerType, AuthenticationProtocol,
          RiskDetail, RiskLevelDuringSignIn, CorrelationId,
          DetectionBranch = "AnomalousToken";

// Branch 2: Successful single-factor authentication from anonymizing network
// Forged cookies used from Tor/anonymized IPs bypassing MFA Conditional Access
let AnonymousNetworkCookieAuth = SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType == 0
| where NetworkLocationDetails has_any ("anonymizedIPAddress", "tor")
| where AuthenticationRequirement == "singleFactorAuthentication"
| project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName,
          NetworkLocationDetails, AuthenticationRequirement,
          ConditionalAccessStatus, CorrelationId,
          DetectionBranch = "AnonymousNetworkAuth";

// Branch 3: Same session correlation ID used from multiple distinct source IPs
// Indicates forged cookie being simultaneously used from multiple attacker hosts
let MultiIPSession = SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType == 0
| summarize
    UniqueIPCount = dcount(IPAddress),
    IPList = make_set(IPAddress, 5),
    LocationList = make_set(Location, 5),
    SignInCount = count(),
    SessionStart = min(TimeGenerated),
    SessionEnd = max(TimeGenerated)
    by UserPrincipalName, AppDisplayName, CorrelationId
| where UniqueIPCount > 1
| where datetime_diff("minute", SessionEnd, SessionStart) < 120
| project SessionStart, UserPrincipalName, AppDisplayName,
          UniqueIPCount, IPList, LocationList, SignInCount, CorrelationId,
          DetectionBranch = "MultiIPSession";

// Union all branches
AnomalousTokenSignIns
| union AnonymousNetworkCookieAuth
| union (
    MultiIPSession
    | project TimeGenerated = SessionStart, UserPrincipalName,
              IPAddress = tostring(IPList), AppDisplayName,
              RiskDetail = "MultipleIPsInSession", RiskLevelDuringSignIn = "medium",
              TokenIssuerType = "", AuthenticationProtocol = "",
              NetworkLocationDetails = tostring(LocationList),
              AuthenticationRequirement = "", ConditionalAccessStatus = "",
              CorrelationId, DetectionBranch
)
| sort by TimeGenerated desc
high severity medium confidence

Data Sources

Logon Session: Logon Session Creation Web Credential: Web Credential Usage Application Log: Application Log Content Azure Active Directory: Non-Interactive Sign-in Logs Microsoft Identity Protection: Risk Events

Required Tables

AADNonInteractiveUserSignInLogs SigninLogs

False Positives

  • Corporate VPN users whose traffic egresses through shared or anonymized IP ranges — establish Conditional Access Named Locations for known corporate VPN egress IPs and exclude them from Branch 2
  • Mobile or desktop applications using OAuth token refresh flows that generate non-interactive sign-ins from changing IPs as users roam between WiFi and cellular networks — review DeviceDetail and AppDisplayName to confirm legitimate client patterns
  • Office 365 service accounts and automation scripts performing scheduled tasks can trigger non-interactive high-risk sign-in signals due to unusual IP ranges or off-hours scheduling
  • Users with international travel whose sessions span multiple countries — correlate with HR travel records or look for preceding interactive re-authentication events
  • Azure AD Identity Protection 'anomalousToken' risk detail may fire on legitimate tokens issued by older authentication library versions that produce non-standard claim structures

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections