Rundll32.exe Was Only Following Orders
Microsoft trusted it.
Windows signed it. The file lived exactly where defenders expected it to live: System32.
But the command line told a different story.
rundll32.exe was not the attacker.
It was simply executing the instructions someone else had given it.
LOLBins Investigation
The alert named rundll32.exe, but the investigation was not about the filename. It was about the DLL, the parent process, the command line and what happened next.
The signed binary was not the whole story
Why attackers abuse rundll32.exe
Find rundll32.exe execution
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceProcessEvents | where Timestamp > ago(7d) | where FileName =~ "rundll32.exe" | project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine | order by Timestamp desc
Look for suspicious DLL paths
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "rundll32.exe"
| where ProcessCommandLine has_any ("AppData", "Temp", "Downloads", "Users\\Public")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine
| order by Timestamp desc
Follow child processes from rundll32.exe
- 1
- 2
- 3
- 4
- 5
- 6
DeviceProcessEvents | where Timestamp > ago(7d) | where InitiatingProcessFileName =~ "rundll32.exe" | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessCommandLine | order by Timestamp asc
Check whether rundll32.exe contacted the network
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceNetworkEvents | where Timestamp > ago(7d) | where InitiatingProcessFileName =~ "rundll32.exe" | project Timestamp, DeviceName, RemoteUrl, RemoteIP, RemotePort, InitiatingProcessCommandLine | order by Timestamp desc
