From 26ee41d8135cb24a964887ec9fa8434f588e285e Mon Sep 17 00:00:00 2001 From: kdot227 Date: Wed, 27 Dec 2023 17:14:51 -0600 Subject: [PATCH] fixed every issue I could think of --- src/main.py | 2 +- src/util/methods/anti_methods/anti_changes.py | 8 +++++--- src/util/obfuscation/rans.py | 9 +++++++-- test_all.py | 2 -- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main.py b/src/main.py index 60c729c..e765476 100644 --- a/src/main.py +++ b/src/main.py @@ -21,7 +21,7 @@ from argparse import ArgumentParser -__version__ = "2.7.0" +__version__ = "2.7.1" class Main: diff --git a/src/util/methods/anti_methods/anti_changes.py b/src/util/methods/anti_methods/anti_changes.py index 4af6524..1be533a 100644 --- a/src/util/methods/anti_methods/anti_changes.py +++ b/src/util/methods/anti_methods/anti_changes.py @@ -44,12 +44,14 @@ def vm_test(*args, **kwargs): # r"""for /f "tokens=2 delims==" %%a in ('wmic computersystem get manufacturer /value') do set manufacturer=%%a\nfor /f "tokens=2 delims==" %%a in ('wmic computersystem get model /value') do set model=%%a\nif "%manufacturer%"=="Microsoft Corporation" if "%model%"=="Virtual Machine" exit\nif "%manufacturer%"=="VMware, Inc." exit\nif "%model%"=="VirtualBox" exit""", # r"""for /f "tokens=2 delims=:" %%a in ('systeminfo ^| find "Total Physical Memory"') do ( set available_memory=%%a ) & set available_memory=%available_memory: =% & set available_memory=%available_memory:M=% & set available_memory=%available_memory:B=% & set /a available_memory=%available_memory% / 1024 / 1024 & if not %available_memory% gtr 4 ( exit /b 1 )""", # I love batch so much I gave up and used powershell + # Now that I think about it it would have been a LOT more logical to use encoded command since its all base64 """powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command \"$VM=Get-WmiObject -Class Win32_ComputerSystem ; if ($VM.Model -match 'Virtual') { Write-Host 'Virtual Machine Detected. Exiting script.' ; taskkill /F /IM cmd.exe }\"""" - # """powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "$tr=(Get-WmiObject Win32_ComputerSystem).TotalPhysicalMemory / 1KB ; $trgb=[math]::Round($tr / 1024, 2) ; if ($trgb -lt 8) { Write-Host 'Less than 8gb ram exiting' ; pause }\"""" + """powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "$tr=(Get-WmiObject Win32_ComputerSystem).TotalPhysicalMemory / 1KB ; $trgb=[math]::Round($tr / 1024, 2) ; if ($trgb -lt 8) { Write-Host 'Less than 8gb ram exiting' ; pause }\"""" ] # ill add more one day - # return random.choice(codes) - return codes[0] + ran_choice = random.choice(codes) + return ran_choice + # return codes[0] @staticmethod def anti_wifi(*args, **kwargs) -> str: diff --git a/src/util/obfuscation/rans.py b/src/util/obfuscation/rans.py index 1a6646f..bc44708 100644 --- a/src/util/obfuscation/rans.py +++ b/src/util/obfuscation/rans.py @@ -80,8 +80,15 @@ def ran2(char, random_order: str, return_ran1: bool = True, *args, **kwargs) -> "TMP": ("\\AppData\\Local\\Temp", "L"), "LOCALAPPDATA": ("\\AppData\\Local", "L"), "APPDATA": ("\\AppData\\Roaming", "L"), + "ONEDRIVE": ("\\OneDrive", "L"), + "ONEDRIVECONSUMER": ("\\OneDrive", "L"), + "OS": ("Windows_NT", "None"), + "SYSTEMDRIVE": ("C:", "None"), } + if Settings.double_click_check: + key_vars["SESSIONNAME"] = ("Console", "None") + # see if the first value of any of the keys contains the char possible_vars = [] for key, value in key_vars.items(): @@ -103,13 +110,11 @@ def ran2(char, random_order: str, return_ran1: bool = True, *args, **kwargs) -> return f"%{random_var}:~{negative_index},1%" elif modifier == "R": random_positive_index = random.choice(valid_indexs) - log.info(f"Right index being used") return f"%{random_var}:~{random_positive_index},1%" elif modifier == "L": random_positive_index = random.choice(valid_indexs) negative_index = random_positive_index - len(value) - log.info(f"Left index being used") return f"%{random_var}:~{negative_index},1%" if return_ran1: return ran1(char) diff --git a/test_all.py b/test_all.py index 78e6120..13dcc16 100644 --- a/test_all.py +++ b/test_all.py @@ -173,8 +173,6 @@ def full_test_sequence(self, *args, **kwargs) -> None: except FileNotFoundError: pass - time.sleep(3) - try: os.remove("output1.txt") os.remove("output2.txt")