Skip to content

Commit d752d81

Browse files
authored
Add files via upload
1 parent e008246 commit d752d81

20 files changed

+488
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import ctypes
2+
3+
def CheckTitles():
4+
user32 = ctypes.windll.user32
5+
EnumWindows = user32.EnumWindows
6+
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int))
7+
GetWindowText = user32.GetWindowTextW
8+
GetWindowTextLength = user32.GetWindowTextLengthW
9+
IsWindowVisible = user32.IsWindowVisible
10+
11+
forbidden_titles = {
12+
"proxifier", "graywolf", "extremedumper", "zed", "exeinfope", "dnspy",
13+
"titanHide", "ilspy", "titanhide", "x32dbg", "codecracker", "simpleassembly",
14+
"process hacker 2", "pc-ret", "http debugger", "Centos", "process monitor",
15+
"debug", "ILSpy", "reverse", "simpleassemblyexplorer", "process", "de4dotmodded",
16+
"dojandqwklndoqwd-x86", "sharpod", "folderchangesview", "fiddler", "die", "pizza",
17+
"crack", "strongod", "ida -", "brute", "dump", "StringDecryptor", "wireshark",
18+
"debugger", "httpdebugger", "gdb", "kdb", "x64_dbg", "windbg", "x64netdumper",
19+
"petools", "scyllahide", "megadumper", "reversal", "ksdumper v1.1 - by equifox",
20+
"dbgclr", "HxD", "monitor", "peek", "ollydbg", "ksdumper", "http", "wpe pro", "dbg",
21+
"httpanalyzer", "httpdebug", "PhantOm", "kgdb", "james", "x32_dbg", "proxy", "phantom",
22+
"mdbg", "WPE PRO", "system explorer", "de4dot", "X64NetDumper", "protection_id",
23+
"charles", "systemexplorer", "pepper", "hxd", "procmon64", "MegaDumper", "ghidra", "xd",
24+
"0harmony", "dojandqwklndoqwd", "hacker", "process hacker", "SAE", "mdb", "checker",
25+
"harmony", "Protection_ID", "PETools", "scyllaHide", "x96dbg", "systemexplorerservice",
26+
"folder", "mitmproxy", "dbx", "sniffer", "Process Hacker", "Process Explorer",
27+
"Sysinternals", "www.sysinternals.com", "binary ninja"
28+
}
29+
30+
31+
def foreach_window(hwnd, lParam):
32+
length = GetWindowTextLength(hwnd)
33+
buff = ctypes.create_unicode_buffer(length + 1)
34+
GetWindowText(hwnd, buff, length + 1)
35+
title = buff.value
36+
37+
if IsWindowVisible(hwnd) and title.lower() in forbidden_titles:
38+
return True
39+
return False
40+
41+
found_forbidden = EnumWindows(EnumWindowsProc(foreach_window), 0)
42+
return found_forbidden
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import socket
2+
3+
def check_connection():
4+
try:
5+
socket.create_connection(("google.com", 80), timeout=5)
6+
return True, None
7+
except socket.error as ex:
8+
error_message = f"Error checking internet connection: {ex}"
9+
print(f"[DEBUG] {error_message}")
10+
return False, Exception(error_message)

AntiDebug/ComputerUptime.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import ctypes
2+
3+
kernel32 = ctypes.windll.kernel32
4+
getTickCount = kernel32.GetTickCount
5+
getTickCount.restype = ctypes.c_ulong
6+
7+
def GetUptimeInSeconds():
8+
uptime = getTickCount()
9+
return int(uptime / 1000)
10+
11+
def CheckUptime(durationInSeconds):
12+
uptime = GetUptimeInSeconds()
13+
if uptime < durationInSeconds:
14+
return True, None
15+
else:
16+
return False, None

AntiDebug/IsDebuggerPresent.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import ctypes
2+
3+
kernel32 = ctypes.windll.kernel32
4+
5+
def is_debugger_present():
6+
return kernel32.IsDebuggerPresent() != 0

AntiDebug/KillBadProcesses.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import subprocess
2+
3+
def KillBadProcesses():
4+
processes_to_kill = [
5+
"taskmgr.exe", "process.exe", "processhacker.exe", "ksdumper.exe", "fiddler.exe",
6+
"httpdebuggerui.exe", "wireshark.exe", "httpanalyzerv7.exe", "fiddler.exe", "decoder.exe",
7+
"regedit.exe", "procexp.exe", "dnspy.exe", "vboxservice.exe", "burpsuit.exe",
8+
"DbgX.Shell.exe", "ILSpy.exe", "ollydbg.exe", "x32dbg.exe", "x64dbg.exe", "gdb.exe",
9+
"idaq.exe", "idag.exe", "idaw.exe", "ida64.exe", "idag64.exe", "idaw64.exe",
10+
"idaq64.exe", "windbg.exe", "ollydbg.exe", "immunitydebugger.exe", "windasm.exe"
11+
]
12+
13+
for process in processes_to_kill:
14+
subprocess.run(["taskkill", "/F", "/IM", process], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

AntiDebug/ParentAntiDebug.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import ctypes,os,pathlib,sys
2+
3+
PROCESS_QUERY_INFORMATION = 0x0400
4+
MAX_PATH = 260
5+
6+
class PROCESS_BASIC_INFORMATION(ctypes.Structure):
7+
_fields_ = [
8+
("Reserved1", ctypes.c_void_p),
9+
("PebBaseAddress", ctypes.c_void_p),
10+
("Reserved2", ctypes.c_void_p * 2),
11+
("UniqueProcessId", ctypes.c_ulong),
12+
("InheritedFromUniqueProcessId", ctypes.c_void_p)
13+
]
14+
15+
ntdll = ctypes.WinDLL("ntdll.dll")
16+
ntquery = ntdll.NtQueryInformationProcess
17+
ntquery.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(PROCESS_BASIC_INFORMATION), ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)]
18+
19+
def NtQueryProc(handle, class_type):
20+
proc_basic_info = PROCESS_BASIC_INFORMATION()
21+
return_length = ctypes.c_uint32()
22+
status = ntquery(handle, class_type, ctypes.byref(proc_basic_info), ctypes.sizeof(proc_basic_info), ctypes.byref(return_length))
23+
if status != 0x0:
24+
raise ctypes.WinError(ctypes.get_last_error())
25+
return proc_basic_info
26+
27+
def QueryImageName(handle):
28+
name_buffer = ctypes.create_unicode_buffer(MAX_PATH)
29+
size = ctypes.c_uint32(MAX_PATH)
30+
if not ctypes.windll.kernel32.QueryFullProcessImageNameW(handle, 0, name_buffer, ctypes.byref(size)):
31+
raise ctypes.WinError(ctypes.get_last_error())
32+
return name_buffer.value
33+
34+
def CurrentProcName():
35+
return pathlib.Path(os.path.abspath(sys.argv[0])).name
36+
37+
def ParentAntiDebug():
38+
try:
39+
current_process = ctypes.windll.kernel32.GetCurrentProcess()
40+
proc_info = NtQueryProc(current_process, 0)
41+
parent_process = ctypes.windll.kernel32.OpenProcess(PROCESS_QUERY_INFORMATION, False, proc_info.InheritedFromUniqueProcessId)
42+
if not parent_process:
43+
raise ctypes.WinError(ctypes.get_last_error())
44+
parent_process_name = QueryImageName(parent_process)
45+
ctypes.windll.kernel32.CloseHandle(parent_process)
46+
if not (parent_process_name.endswith("explorer.exe") or parent_process_name.endswith("cmd.exe")):
47+
return True
48+
else:
49+
return False
50+
except Exception as e:
51+
print(f"Error: {e}")
52+
return False

AntiDebug/RemoteDebugger.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import ctypes
2+
3+
kernel32 = ctypes.windll.kernel32
4+
5+
def CheckRemoteDebugger():
6+
process_handle = kernel32.GetCurrentProcess()
7+
is_debugger_detected = ctypes.c_int(0)
8+
kernel32.CheckRemoteDebuggerPresent(process_handle, ctypes.byref(is_debugger_detected))
9+
return is_debugger_detected.value != 0

AntiVirtulization/KVMCheck.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import os
2+
import glob
3+
4+
def CheckForKVM():
5+
bad_drivers_list = ["balloon.sys", "netkvm.sys", "vioinput*", "viofs.sys", "vioser.sys"]
6+
system32_folder = os.path.join(os.getenv("SystemRoot", ""), "System32")
7+
8+
for driver in bad_drivers_list:
9+
files = glob.glob(os.path.join(system32_folder, driver))
10+
if files:
11+
return True, None
12+
13+
return False, None
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import ctypes
2+
3+
def IsScreenSmall():
4+
try:
5+
user32 = ctypes.windll.user32
6+
width = user32.GetSystemMetrics(0)
7+
height = user32.GetSystemMetrics(1)
8+
9+
is_small = width < 800 or height < 600
10+
return is_small, None
11+
except Exception as e:
12+
return False, f"Error checking screen size: {e}"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import glob
3+
4+
def CheckForParallels():
5+
parallels_drivers = ["prl_sf", "prl_tg", "prl_eth"]
6+
sys32_folder = os.path.join(os.getenv("SystemRoot", ""), "System32")
7+
8+
try:
9+
files = os.listdir(sys32_folder)
10+
for file in files:
11+
for driver in parallels_drivers:
12+
if driver in file.lower():
13+
return True, None
14+
except Exception as e:
15+
return False, f"Error accessing System32 directory: {e}"
16+
17+
return False, None

0 commit comments

Comments
 (0)