Skip to content

Instantly share code, notes, and snippets.

@Clixo
Clixo / Known Evilginx Redirect Patterns
Created April 17, 2026 18:51
If your web proxy logs show multiple users being redirected to the same suspicious YouTube URL (like the default RickRoll used in Evilginx), you’ve found a "burnt" lure.
index=web_proxy
search url="*youtube.com/watch?v=dQw4w9WgXcQ*" OR url_path="*/aB12cD34*"
stats count by src_ip, user, url
sort - count
@Clixo
Clixo / Detection: Session Hijacking (Cookie used by new IP)
Created April 17, 2026 18:44
This query compares the IP that initially authenticated vs. the IP that is currently using that session ID/token.
@Clixo
Clixo / Detection: Anomalous Multi-Account Sign-in from One IP
Created April 17, 2026 18:43
If an attacker is successful, they may use the same Evilginx infrastructure to hit multiple users in your org.
SigninLogs
where TimeGenerated > ago(1d)
summarize UserCount = dcount(UserPrincipalName) by IPAddress
where UserCount > 3 // Adjust threshold based on your org size
extend Location = LocationDetails_string
order by UserCount desc
@Clixo
Clixo / Detection: Impossible Device Shift (User Agent Change)
Last active April 17, 2026 18:43
This query looks for a session where the user's IP or User Agent changes abruptly between the time they entered their credentials and the time the "authenticated" session starts.
// Find sessions where the User Agent changes mid-stream (common in Evilginx proxies)
SigninLogs
where TimeGenerated > ago(24h)
where ResultType == 0 // Successful sign-in
summarize UserAgents = make_set(UserAgent), IPs = make_set(IPAddress), AppCount = dcount(AppDisplayName)
by UserPrincipalName, CorrelationId
where array_length(UserAgents) > 1 or array_length(IPs) > 1
project TimeGenerated, UserPrincipalName, UserAgents, IPs, CorrelationId
Detection A: Okta Session Hijacking (Fingerprint Change)
This search looks for successful Okta events where the deviceToken remains the same, but the client.ipAddress or client.userAgent suddenly shifts.
Code snippet
index=okta sourcetype="OktaIM2:log" outcome.result=SUCCESS
| stats dc(client.ipAddress) as ip_count, values(client.ipAddress) as ips, dc(client.userAgent.rawUserAgent) as ua_count by authenticationContext.externalSessionId, user
| where ip_count > 1 OR ua_count > 1
| table user, authenticationContext.externalSessionId, ips, ua_count
Detection B: M365 Token Theft (New Device/Location)
Identifies a successful login where the MFA requirement was satisfied by a "Claim in the token" (meaning no actual MFA prompt happened) from an IP address the user has never used before.
@Clixo
Clixo / Microsoft Sentinel (KQL) Detections
Last active April 16, 2026 15:54
Microsoft Sentinel (KQL) Detections
Detection A: The "Impossible Travel" Session
Detects when a single session ID is used across two different IP addresses or geographic locations within a short window—a classic sign of a stolen cookie being "replayed."
Code snippet
// Detect session reuse from multiple IP addresses
SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType == 0 // Successful logins
| summarize IPCount = dcount(IPAddress), IPs = make_set(IPAddress), Locations = make_set(Location) by SessionId, UserPrincipalName
| where IPCount > 1
| project SessionId, UserPrincipalName, IPCount, IPs, Locations
1. Microsoft Sentinel (KQL) Detections
These queries target the Sign-in Logs and Audit Logs to find anomalies typical of a proxied session.
Detection A: The "Impossible Travel" Session
Detects when a single session ID is used across two different IP addresses or geographic locations within a short window—a classic sign of a stolen cookie being "replayed."
Code snippet
// Detect session reuse from multiple IP addresses
SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType == 0 // Successful logins
| summarize IPCount = dcount(IPAddress), IPs = make_set(IPAddress), Locations = make_set(Location) by SessionId, UserPrincipalName
### Keybase proof
I hereby claim:
* I am clixo on github.
* I am clixo (https://keybase.io/clixo) on keybase.
* I have a public key ASBQjP6SfCKY78V2Yub07UzYHl9GA-4ODaoK6ymu1Wna4Ao
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am clixo on github.
  • I am clixo (https://keybase.io/clixo) on keybase.
  • I have a public key ASBQjP6SfCKY78V2Yub07UzYHl9GA-4ODaoK6ymu1Wna4Ao

To claim this, I am signing this object: