|
| 1 | +# Find RDP persistance attempts related to Wadhrama ransomware |
| 2 | + |
| 3 | +This query was originally published in the threat analytics report, *RDP ransomware persists as Wadhrama*. |
| 4 | + |
| 5 | +The ransomware known as [Wadhrama](https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Ransom:Win32/Wadhrama) has been used in human-operated attacks that follow a particular pattern. The attackers often use Remote Desktop Protocol (RDP) to gain initial access to a device or network, exfiltrate credentials, and maintain persistance. |
| 6 | + |
| 7 | +The following query checks for possible Wadhrama-related activity, by searching for attempts to establish RDP persistance via the registry. |
| 8 | + |
| 9 | +Other techniques used by the group associated with Wadhrama are listed under [See also](#see-also). |
| 10 | + |
| 11 | +## Query |
| 12 | + |
| 13 | +```Kusto |
| 14 | +// Find attempts to establish RDP persistence via the registry |
| 15 | +let Allow = DeviceProcessEvents |
| 16 | +| where Timestamp > ago(7d) |
| 17 | +| where FileName == "reg.exe" |
| 18 | +| where ProcessCommandLine has "AllowTSConnections" |
| 19 | +| extend AllowReport = Timestamp ; |
| 20 | +// |
| 21 | +let Deny = DeviceProcessEvents |
| 22 | +| where Timestamp > ago(7d) |
| 23 | +| where FileName == "reg.exe" |
| 24 | +| where ProcessCommandLine has "fDenyTSConnections" |
| 25 | +| extend DenyReport = Timestamp; |
| 26 | +// |
| 27 | +let Special = DeviceProcessEvents |
| 28 | +| where Timestamp > ago(7d) |
| 29 | +| where FileName == "reg.exe" |
| 30 | +| where ProcessCommandLine has "SpecialAccounts" |
| 31 | +| extend SpecialReport = Timestamp; |
| 32 | +// |
| 33 | +Special | join kind=inner (Deny | join kind=inner Allow on DeviceId) on DeviceId |
| 34 | +| where AllowReport < Timestamp +10s and AllowReport > Timestamp -10s |
| 35 | +| where DenyReport < Timestamp +10s and DenyReport > Timestamp -10s |
| 36 | +| where SpecialReport < Timestamp +10s and SpecialReport > Timestamp -10s |
| 37 | +``` |
| 38 | + |
| 39 | +## Category |
| 40 | + |
| 41 | +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. |
| 42 | + |
| 43 | +| Technique, tactic, or state | Covered? (v=yes) | Notes | |
| 44 | +|-|-|-| |
| 45 | +| Initial access | | | |
| 46 | +| Execution | | | |
| 47 | +| Persistence | v | | |
| 48 | +| Privilege escalation | | | |
| 49 | +| Defense evasion | | | |
| 50 | +| Credential Access | | | |
| 51 | +| Discovery | | | |
| 52 | +| Lateral movement | | | |
| 53 | +| Collection | | | |
| 54 | +| Command and control | | | |
| 55 | +| Exfiltration | | | |
| 56 | +| Impact | | | |
| 57 | +| Vulnerability | | | |
| 58 | +| Misconfiguration | | | |
| 59 | +| Malware, component | | | |
| 60 | + |
| 61 | +## See also |
| 62 | + |
| 63 | +* [Find data destruction related to Wadhrama ransomware](../Impact/wadhrama-data-destruction.md) |
| 64 | +* [Image File Execution Options and .bat file usage in association with Wadhrama ransomware](../Credential%20Access/wadhrama-credential-dump.md) |
| 65 | + |
| 66 | +## Contributor info |
| 67 | + |
| 68 | +**Contributor:** Microsoft Threat Protection team |
0 commit comments