Detection rules › Kusto Query Language

Qakbot Campaign Self Deletion

Source
upstream

This query was originally published in the threat analytics report, Qakbot blight lingers, seeds ransomware Qakbot is malware that steals login credentials from banking and financial services. It has been deployed against small businesses as well as major corporations. Some outbreaks have involved targeted ransomware campaigns that use a similar set of techniques. Links to related queries are listed under See also. The following query detects if an instance of Qakbot has attempted to overwrite its original binary. Reference - https://www.microsoft.com/security/blog/2017/11/06/mitigating-and-eliminating-info-stealing-qakbot-and-emotet-in-corporate-networks/

MITRE ATT&CK coverage

TacticTechniques
Defense EvasionT1070 Indicator Removal

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation
Security-Auditing4688A new process has been created.
Defender-DeviceProcessEvents9001000Process activity (any)

Stages and Predicates

Stage 1: source

DeviceProcessEvents

Stage 2: where

FileName eq "ping.exe"

Stage 3: where

InitiatingProcessFileName eq "cmd.exe"

Stage 4: where

and
  InitiatingProcessCommandLine match "-n 6"
  InitiatingProcessCommandLine match "127.0.0.1"
  InitiatingProcessCommandLine match "calc.exe"

Stage 5: project

Stage 6: extend

Stage 7: extend

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
FileNameeq
  • ping.exe
InitiatingProcessCommandLinematch
  • -n 6
  • 127.0.0.1 corpus 2 (sigma 2)
  • calc.exe
InitiatingProcessFileNameeq
  • cmd.exe