-
Notifications
You must be signed in to change notification settings - Fork 13
/
nero.py
153 lines (127 loc) · 4.96 KB
/
nero.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# NERO Main shell
import sys
import httpd
import urllib
import os
import sys
import time
modules = {
0 : 'DNS Spoof => Ative sniffing to spoof the DNS from the client to this machine',
1 : 'Port Scanning => Basic port scanning',
2 : 'Host Discovery => Detect the host from the client',
3 : 'SSL => Setup an encrypted server (default SSL file should be named "cert.pem" from dir "cert". Same with the private key)',
4 : 'Costum Page => Dont download a webpage, will use any index.html from the root directory with a full HTTP server. You can set a full directory, NERO will parse everthing'
}
status = [False,False,False,False,False]
_dns = ""
T_URL = "" or "None"
LHOST = "" or 0
LPORT = 0 or 0
def set_module(_ID):
try:
if status[_ID] == False:
if _ID == 4:
T_URL = "None"
if _ID == 0:
_dns = str(input("nero (dns) > "))
if len(_dns) == 0 or _dns == "":
print("[!] Please provide a valid dns!!")
_dns = ""
else:
pass
print("[+] Module sent: {}".format(modules[_ID]))
status[_ID] = True
elif status[_ID] == True:
print("[+] Module disabled: {}".format(modules[_ID]))
status[_ID] = False
except:
print("[!] Module not found!")
def get_extensions():
x = 0
print("\n")
while x < len(modules):
print("\t[{}] {} ".format(x,modules[x]))
x = x + 1
print("\n")
def banner():
x = "\033[1;37m"+str(open("core/banner.txt","r").read()[:-1])+"\033[m"
print(x)
def main():
print("\n")
try:
while True:
command = input("\033[1;36mnero > \033[m").split() or None
if command[0] == "set":
if command[1] == "url":
try:
T_URL = command[2]
print("\033[1;32m[+] URL sent: {}\033[m".format(T_URL))
except:
print("\033[1;31m[!] Please provide an argument for the option!\033[m")
if command[1] == "port":
try:
LPORT = command[2]
print("\033[1;32m[+] PORT sent: {}\033[m".format(LPORT))
except:
print("\033[1;31m[!] Please provide an argument for the option!\033[m")
if command[1] == "ip":
try:
import socket
try:
socket.inet_aton(command[2])
LHOST = command[2]
print("\033[1;32m[+] IP sent: {}\033[m".format(LHOST))
except:
print("\033[1;31m[!] Not a valid IP adress!\033[m")
except:
print("\033[1;31m[!] Please provide an argument for the option!\033[m")
if command[1] == "module":
try:
#module_id = int(input("\033[1;37mnero (run\module_id) > \033[m"))
module_id = int(command[2])
try:
set_module(module_id)
except:
print("\033[1;31m[!] PORT not configured!\033[m")
except:
print("\033[1;31m[!] Please provide a valid option!\033[m")
if command[0] == "options":
try:
print("\n\tCurrent options:\n\n")
print("\tHOST = {}".format(LHOST))
print("\tPORT = {}".format(LPORT))
print("\tURL = {}".format(T_URL))
except:
pass
if command[0] == "help":
import help
help.help_()
if command[0] == "list":
get_extensions()
if command[0] == "clear":
os.system("clear")
if command[0] == "run":
if T_URL == "":
print("[!] No URL provided!")
elif T_URL != "":
try:
if LPORT != 0:
pass
except:
print("[!] No port configured, using 8080")
LPORT = 8080
httpd.run(LHOST,LPORT,T_URL)
if command[0] == "exit" or command[0] == "close" or command[0] == "bye":
print("[*] Quiting...")
return
if command[0] == "banner":
banner()
print("\n")
except KeyboardInterrupt:
print("[*] Quiting...")
if __name__ == "__main__":
print("[!] Starting NERO in fews seconds...")
time.sleep(2)
os.system("clear")
banner()
main()