|
| 1 | +# Detect rundll.exe being used for reconnaissance and command-and-control |
| 2 | + |
| 3 | +This query was originally published in the threat analytics report, *Trickbot: Pervasive & underestimated*. |
| 4 | + |
| 5 | +[Trickbot](https://attack.mitre.org/software/S0266/) is a very prevalent piece of malware with an array of malicious capabilities. Originally designed to steal banking credentials, it has since evolved into a modular trojan that can deploy other malware, disable security software, and perform command and control. |
| 6 | + |
| 7 | +Trickbot operators are known to use the legitimate Windows process *rundll.exe* to perform malicious activities, such as reconnaissance. Once a target is infected, the operator will drop a batch file that runs several commands and connects to a command-and-control (C2) server for further action. |
| 8 | + |
| 9 | +The following query detects suspicious rundll.exe activity associated with Trickbot campaigns. |
| 10 | + |
| 11 | +See [Office applications launching wscript.exe to run JScript](../Execution/office-apps-launching-wscipt.md) for another query related to Trickbot activity. |
| 12 | + |
| 13 | +## Query |
| 14 | + |
| 15 | +```Kusto |
| 16 | +DeviceNetworkEvents |
| 17 | +| where InitiatingProcessFileName =~ "rundll32.exe" |
| 18 | +// Empty command line |
| 19 | +| where InitiatingProcessCommandLine has "rundll32.exe" and InitiatingProcessCommandLine !contains " " |
| 20 | +and InitiatingProcessCommandLine != "" |
| 21 | +| summarize DestinationIPCount = dcount(RemoteIP), make_set(RemoteIP), make_set(RemoteUrl), |
| 22 | +make_set(RemotePort) by InitiatingProcessCommandLine, DeviceId, bin(Timestamp, 5m) |
| 23 | +``` |
| 24 | + |
| 25 | +## Category |
| 26 | + |
| 27 | +This query can be used to detect the following attack techniques and tactics ([see MITRE ATT&CK framework](https://attack.mitre.org/)) or security configuration states. |
| 28 | + |
| 29 | +| Technique, tactic, or state | Covered? (v=yes) | Notes | |
| 30 | +|-|-|-| |
| 31 | +| Initial access | | | |
| 32 | +| Execution | | | |
| 33 | +| Persistence | | | |
| 34 | +| Privilege escalation | | | |
| 35 | +| Defense evasion | | | |
| 36 | +| Credential Access | | | |
| 37 | +| Discovery | v | | |
| 38 | +| Lateral movement | | | |
| 39 | +| Collection | v | | |
| 40 | +| Command and control | v | | |
| 41 | +| Exfiltration | | | |
| 42 | +| Impact | | | |
| 43 | +| Vulnerability | | | |
| 44 | +| Misconfiguration | | | |
| 45 | +| Malware, component | | | |
| 46 | + |
| 47 | +## Contributor info |
| 48 | + |
| 49 | +**Contributor:** Microsoft Threat Protection team |
0 commit comments