Skip to content

Instantly share code, notes, and snippets.

@inodee
Created January 21, 2025 15:59
Show Gist options
  • Select an option

  • Save inodee/dec2550ae15ba7f0aeca7e911c96db90 to your computer and use it in GitHub Desktop.

Select an option

Save inodee/dec2550ae15ba7f0aeca7e911c96db90 to your computer and use it in GitHub Desktop.
Successful network connections towards SpamHaus's DROP ranges, excluding common browsers as client
// This is a prototype, do not run against long periods before tuning
let SpamHausDROP = externaldata(cidr: string) [@"https://www.spamhaus.org/drop/drop_v4.json"] with (format="json", ignoreFirstRecord=False);
DeviceNetworkEvents
| where LocalIPType == 'Private' and RemoteIPType == 'Public'and ActionType == 'ConnectionSuccess'
| where not(InitiatingProcessFileName has_any ('chrome.exe','firefox.exe','msedge.exe','brave.exe'))
| evaluate ipv4_lookup(SpamHausDROP, RemoteIP, cidr, return_unmatched = false)
| where isnotempty(cidr)
| summarize InitiatingProcessCommandLine=make_set(InitiatingProcessCommandLine), RemoteUrl=make_set(RemoteUrl), LastSeen=max(Timestamp) by RemoteIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment