fix(tests): recognize sysmon, wevtutil, auditpol as detection commands
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Blue's detect_procedure extraction had zero Blue-team-oriented tool names in its known-binaries list — sysmon.exe, one of the most common Windows detection tools, silently produced no suggestion at all. Verified against the exact production input that surfaced this.
This commit is contained in:
@@ -48,7 +48,9 @@ _COMMAND_LINE_RE = re.compile(
|
|||||||
netsh|wmic|schtasks|sc|rundll32|regsvr32|msiexec|certutil|
|
netsh|wmic|schtasks|sc|rundll32|regsvr32|msiexec|certutil|
|
||||||
mimikatz\S*|cscript|wscript|osascript|openssl|systemctl|service|
|
mimikatz\S*|cscript|wscript|osascript|openssl|systemctl|service|
|
||||||
reg\s+query|whoami|nslookup|dig|ping|tasklist|ps\s|kill|
|
reg\s+query|whoami|nslookup|dig|ping|tasklist|ps\s|kill|
|
||||||
Invoke-\S+|iex|dsquery|nltest)\b
|
Invoke-\S+|iex|dsquery|nltest|
|
||||||
|
sysmon\S*|wevtutil|auditpol|tcpdump|tshark|procmon\S*|autorunsc\S*|
|
||||||
|
volatility\S*)\b
|
||||||
|
|
|
|
||||||
\bSELECT\s+.+\s+FROM\b # SQL
|
\bSELECT\s+.+\s+FROM\b # SQL
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -95,3 +95,15 @@ def test_known_binary_at_start_of_line_is_recognized():
|
|||||||
text = "Notes: used the following.\nsudo tcpdump -i eth0 -w capture.pcap\nCaptured 500 packets."
|
text = "Notes: used the following.\nsudo tcpdump -i eth0 -w capture.pcap\nCaptured 500 packets."
|
||||||
result = extract_commands(text)
|
result = extract_commands(text)
|
||||||
assert result == "sudo tcpdump -i eth0 -w capture.pcap"
|
assert result == "sudo tcpdump -i eth0 -w capture.pcap"
|
||||||
|
|
||||||
|
|
||||||
|
def test_recognizes_sysmon_as_a_detection_command():
|
||||||
|
text = "launch sysmon to detect\nsysmon.exe\nthen search this query\n\\? mimikatz \\n"
|
||||||
|
result = extract_commands(text)
|
||||||
|
assert result == "sysmon.exe"
|
||||||
|
|
||||||
|
|
||||||
|
def test_recognizes_wevtutil_and_auditpol():
|
||||||
|
text = "Pulled the security log.\nwevtutil qe Security /c:5\nThen checked audit policy.\nauditpol /get /category:*"
|
||||||
|
result = extract_commands(text)
|
||||||
|
assert result == "wevtutil qe Security /c:5\nauditpol /get /category:*"
|
||||||
|
|||||||
Reference in New Issue
Block a user