Detect Advanced IP and Port Scanner Files (KQL, ES|QL)
Detects: files created, modified or renamed under the default Advanced IP Scanner 2 and Advanced Port Scanner 2 folders.
ATT&CK: T1018 Remote System Discovery, T1046 Network Service Discovery
Works on: Microsoft Defender for Endpoint, KQL (DeviceFileEvents); Elastic with Sysmon Event ID 11, ES|QL
Tested on: my lab, against Sliver C2, on both stacks
Full write-up: Hunt Ransomware Before It Encrypts: The Three Tools 45+ Gangs Reach For
Folder paths catch the install artifacts
The discovery hunt for ransomware’s favourite scanners is four signals layered on each other: vendor metadata catches the renames, command-line flags catch the headless runs, network thresholds catch the sweep shape, and folder paths catch the install artifacts. This page is the fourth.
Advanced IP Scanner and Advanced Port Scanner, both signed by Famatech, are portable and usually GUI-driven, and 45+ ransomware groups reach for the same three discovery tools. The file query catches their install artifacts in the default folders.
The queries
Published from the newsletter issue with one change: the ES|QL time window is relative, the last 30 days. Widen it if you need more history.
KQL (Microsoft Defender for Endpoint):
DeviceFileEvents
| where Timestamp > ago(30d)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FolderPath has_any (@"\Advanced IP Scanner 2", @"\Advanced Port Scanner 2")
| summarize FilesDropped = make_set(FileName, 20), FileCount = dcount(FileName), FirstDrop = min(Timestamp)
by DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName,
InitiatingProcessCommandLine, InitiatingProcessParentFileName
| order by FirstDrop asc

ES|QL (Elastic, Sysmon Event ID 11):
FROM logs-windows.sysmon_operational-default
| WHERE @timestamp >= NOW() - 30 days AND @timestamp <= NOW()
AND event.code == "11" AND file.path IS NOT NULL
| EVAL path_lc = TO_LOWER(file.path)
| WHERE path_lc LIKE "*advanced ip scanner 2*" OR path_lc LIKE "*advanced port scanner 2*"
| EVAL Tool = CASE(
path_lc LIKE "*advanced ip scanner 2*","Advanced IP Scanner", "Advanced Port Scanner")
| STATS FilesDropped = TOP(file.name, 20, "asc"),
FileCount = COUNT_DISTINCT(file.name),
FirstDrop = MIN(@timestamp),
LastDrop = MAX(@timestamp)
BY host.name, Tool, user.name, process.executable
| SORT FirstDrop ASC
| LIMIT 500

What it catches
Per host and per writing process: the files dropped, how many, and when the first one landed. The ES|QL version also labels each row as Advanced IP Scanner or Advanced Port Scanner from the path.
Get the next detection in your inbox
One lab-proven detection per issue: the attacker command, the telemetry it leaves, and the KQL / ES|QL that catches it.
You confirm on Substack in one tap.
No spam. Unsubscribe anytime.
Tuning note
Tune the folder path patterns if attackers stage to non-default locations.
Legitimate IT teams use these tools too, so allowlist by hostname or account, not by tool name.
For each remaining hit, check the parent process and account: a parent of cmd.exe, powershell.exe or bitsadmin.exe, or anything launched from
C:\Users\Public\or a Temp directory, is an immediate escalation.
For a hit on the Advanced IP Scanner or Advanced Port Scanner GUI binary, also run the same-host pivot to RDP and RMM tools. If RDP or RMM activity surfaces within 2 hours either side of the scanner hit, scope the incident and start IR containment.
Did this query fire in your environment, or miss something? Email me what you saw: ayush@securityinbits.com (open in Gmail). I read every reply, and it decides what I test next.
Questions
Does this cover SoftPerfect NetScan?
No. NetScan is already covered by the process query. This one catches the Advanced IP Scanner and Advanced Port Scanner install artifacts.
What if the attacker stages the tool somewhere else?
Then the default folder names will not match. Tune the folder path patterns if attackers stage to non-default locations.