Skip to content

Commit 738769f

Browse files
authored
Merge pull request #561 from kevross33/patch-622144
Add FIPS query sig and rename crypto_apis.py to cryptography.py
2 parents 63cb958 + cb20a85 commit 738769f

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

modules/signatures/windows/crypto_apis.py renamed to modules/signatures/windows/cryptography.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,43 @@ def on_call(self, _, process):
3838
if self.pid:
3939
self.mark_call()
4040
return True
41+
42+
43+
class QueryFipsReconnaissance(Signature):
44+
name = "query_fips_reconnaissance"
45+
description = "Queried the FIPS cryptography policy, can be used to adapt C2 network encryption or by legitimate encryption software"
46+
severity = 2
47+
confidence = 50
48+
categories = ["discovery", "c2"]
49+
authors = ["Kevin Ross"]
50+
minimum = "1.3"
51+
evented = True
52+
ttps = ["T1082", "T1008"]
53+
54+
filter_apinames = {
55+
"NtOpenKey", "NtOpenKeyEx", "NtQueryValueKey", "RegQueryValueExA", "RegQueryValueExW"
56+
}
57+
58+
def __init__(self, *args, **kwargs):
59+
Signature.__init__(self, *args, **kwargs)
60+
self.ret = False
61+
self.fips_events = set()
62+
63+
def on_call(self, call, process):
64+
key_name = self.get_argument(call, "FullName") or self.get_argument(call, "ObjectAttributes") or ""
65+
66+
if "lsa\\fipsalgorithmpolicy" in str(key_name).lower():
67+
proc_name = process.get("process_name", "unknown")
68+
pid = process.get("process_id", "unknown")
69+
70+
event_msg = "{} (PID: {}) probed FIPS encryption policy at '{}'".format(proc_name, pid, key_name)
71+
72+
if event_msg not in self.fips_events:
73+
self.fips_events.add(event_msg)
74+
self.mark_call()
75+
self.ret = True
76+
77+
def on_complete(self):
78+
if self.ret:
79+
self.data.append({"behavioral_fips_reconnaissance": list(self.fips_events)})
80+
return self.ret

0 commit comments

Comments
 (0)