Skip to content

Commit 7031527

Browse files
committed
fixes
1 parent e6ef6bd commit 7031527

File tree

10 files changed

+22
-24
lines changed

10 files changed

+22
-24
lines changed

modules/signatures/windows/abuse_hvci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(self, *args, **kwargs):
9292
self.falseProcess = ("securityhealthservice", "ikernel.exe")
9393

9494
def on_call(self, call, process):
95-
if not process["process_name"].lower() in self.falseProcess:
95+
if process["process_name"].lower() not in self.falseProcess:
9696
if call["api"] in ("RegSetValueExA", "RegSetValueExW"):
9797
regKeyPath = self.get_argument(call, "FullName").lower()
9898
buf = self.get_argument(call, "Buffer")

modules/signatures/windows/bootkit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class AccessesPrimaryPartition(Signature):
122122

123123
def run(self):
124124
ret = False
125-
match = self.check_write_file(pattern="^\\Device\\HarddiskVolume0\\DR0$", regex=True)
125+
match = self.check_write_file(pattern=r"^\\Device\\HarddiskVolume0\\DR0$", regex=True)
126126
if match:
127127
self.data.append({"file": match})
128128
ret = True

modules/signatures/windows/bypass_uac.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class ChecksUACStatus(Signature):
229229

230230
def run(self):
231231
match = self.check_key(
232-
pattern=r".*\SOFTWARE\(Wow6432Node\)?Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA$", regex=True
232+
pattern=r".*\\SOFTWARE\(Wow6432Node\)?Microsoft\\Windows\\CurrentVersion\\Policies\\System\\EnableLUA$", regex=True
233233
)
234234
if match:
235235
self.data.append({"regkey": match})
@@ -253,8 +253,6 @@ class UACBypassWindowsBackup(Signature):
253253
filter_apinames = set(["CreateProcessInternalW"])
254254

255255
def on_call(self, call, process):
256-
pname = process["process_name"].lower()
257-
258256
# Checking parent process for false positives.
259257
if process["process_name"].lower() == "sdclt.exe" and call["api"] == "CreateProcessInternalW":
260258
cmdline = self.get_argument(call, "CommandLine")

modules/signatures/windows/disables_windefender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def run(self):
127127
r"HKEY_CLASSES_ROOT\\Directory\\shellex\\ContextMenuHandlers\\EPP$",
128128
r"HKEY_CLASSES_ROOT\\Drive\\shellex\\ContextMenuHandlers\\EPP$",
129129
)
130-
pat = re.compile(".*\\shellex\\contextmenuhandlers\\epp")
130+
pat = re.compile(r".*\\shellex\\contextmenuhandlers\\epp")
131131

132132
for indicator in indicators:
133133
match = self.check_write_key(pattern=indicator, regex=True)

modules/signatures/windows/infostealer_mail.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ def run(self):
3232
r".*\\Thunderbird\\Profiles\\.*\.default$",
3333
r".*\\AppData\\Roaming\\Thunderbird\\profiles.ini$",
3434
)
35-
registry_indicators = (
35+
registry_indicators = [
3636
r".*\\Microsoft\\Windows\\ Messaging\\ Subsystem\\MSMapiApps.*",
3737
r".*\\Microsoft\\Windows\\ Messaging\\ Subsystem\\Profiles.*",
3838
r".*\\Microsoft\\Windows\\ NT\\CurrentVersion\\Windows\\ Messaging\\ Subsystem\\Profiles.*",
3939
r".*\\Microsoft\\Office\\.*\\Outlook\\Profiles\\Outlook.*",
4040
r".*\\Microsoft\\Office\\Outlook\\OMI\\ Account\\ Manager\\Accounts.*",
4141
r".*\\Microsoft\\Internet\\ Account\\ Manager\\Accounts.*",
4242
r".*\\Software\\(Wow6432Node\\)?IncrediMail.*" r".*\\Software\\(Wow6432Node\\)?Microsoft\\Windows\\ Live\\ Mail.*",
43-
)
43+
]
4444
if self.results.get("target", {}).get("category", "") == "file":
45-
registry_indicators.append(".*\\Software\\(Wow6432Node\\)?Clients\\Mail.*")
45+
registry_indicators.append(r".*\\Software\\(Wow6432Node\\)?Clients\\Mail.*")
4646

4747
found_stealer = False
4848
for indicator in file_indicators:

modules/signatures/windows/office_dll_loading.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class OfficeAddinLoading(Signature):
3434

3535
def run(self):
3636
indicators = [
37-
".*\\AppData\\Roaming\\Microsoft\\Word\\startup\\*.wll",
38-
".*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*.xll",
39-
".*\\AppData\\Roaming\\Microsoft\\AddIns\\*.xlam",
40-
".*\\AppData\\Roaming\\Microsoft\\AddIns\\*.xla",
37+
r".*\\AppData\\Roaming\\Microsoft\\Word\\startup\\*.wll",
38+
r".*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*.xll",
39+
r".*\\AppData\\Roaming\\Microsoft\\AddIns\\*.xlam",
40+
r".*\\AppData\\Roaming\\Microsoft\\AddIns\\*.xla",
4141
]
4242

4343
for indicator in indicators:
@@ -61,7 +61,7 @@ class OfficePerfKey(Signature):
6161
mbcs += ["OC0008", "C0036"] # micro-behaviour
6262

6363
def run(self):
64-
indicators = ["HKEY_CURRENT_USER\\Software\\Microsoft\\Office test\\Special\\Perf$"]
64+
indicators = [r"HKEY_CURRENT_USER\\Software\\Microsoft\\Office test\\Special\\Perf$"]
6565

6666
for indicator in indicators:
6767
match = self.check_write_key(pattern=indicator, regex=True)

modules/signatures/windows/rat_modi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class ModiRATBehavior(Signature):
2828

2929
def run(self):
3030
reg_indicators = (
31-
"HKEY_CURRENT_USER\\Software\\FFMPEG_URL.*",
32-
"HKEY_CURRENT_USER\\Software\\Telegram_Notifier.*",
31+
r"HKEY_CURRENT_USER\\Software\\FFMPEG_URL.*",
32+
r"HKEY_CURRENT_USER\\Software\\Telegram_Notifier.*",
3333
)
3434
file_indicators = (
3535
r"[A-Z]:\\ProgramData\\ffmpeg\.exe$",

modules/signatures/windows/rat_nanocore.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ def on_call(self, call, process):
5353

5454
def on_complete(self):
5555
badness = 0
56-
guid = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}" "-[0-9a-fA-F]{12}"
56+
guid = r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}" "-[0-9a-fA-F]{12}"
5757
fileiocs = (
58-
r".*\\" + guid + "\\run\.dat$",
59-
r".*\\" + guid + "\\task\.dat$",
60-
r".*\\" + guid + "\\catelog\.dat$",
61-
r".*\\" + guid + "\\storage\.dat$",
62-
r".*\\" + guid + "\\settings\.bin$",
58+
r".*\\" + guid + r"\\run\.dat$",
59+
r".*\\" + guid + r"\\task\.dat$",
60+
r".*\\" + guid + r"\\catelog\.dat$",
61+
r".*\\" + guid + r"\\storage\.dat$",
62+
r".*\\" + guid + r"\\settings\.bin$",
6363
)
6464
for ioc in fileiocs:
6565
if self.check_write_file(pattern=ioc, regex=True):

modules/signatures/windows/stealth_webhistory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def run(self):
2020
r".*\\Temporary\\ Internet\\ Files\\Content\.IE5\\.*",
2121
]
2222
if self.results.get("target", {}).get("category", "") == "file":
23-
file_indicators.append(".*\\Cookies\\.*")
23+
file_indicators.append(r".*\\Cookies\\.*")
2424
found_cleaner = False
2525
for indicator in file_indicators:
2626
file_match = self.check_delete_file(pattern=indicator, regex=True, all=True)

modules/signatures/windows/trojan_ursnif.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run(self):
4343
mutex_indicators = r"^Local\\\{[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}$"
4444

4545
for rkey in regkeys:
46-
registry_indicators.append(regpath + "\\" + guid + "\\" + rkey + "$")
46+
registry_indicators.append(regpath + r"\\" + guid + r"\\" + rkey + "$")
4747

4848
registry_indicators.append(r".*\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\EnableSPDY3_0$")
4949

0 commit comments

Comments
 (0)