-
Notifications
You must be signed in to change notification settings - Fork 45
/
netpwn.py
221 lines (189 loc) · 6.02 KB
/
netpwn.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/usr/bin/python
"""netpwn pentesting tool."""
# Created by 3XPL017
# Member of @togetherwehack
import os
import readline
import sys
from modules import address
from modules import backdoor
from modules import base64_convert
from modules import cert
from modules import cmd
from modules import crypto
from modules import hasher
from modules import hex_convert
from modules import html
from modules import identity
from modules import no_endian
from modules import page
from modules import password
from modules import reverse
from modules import rot13
from modules import send
from modules import spider
from modules import url_coding
from modules import who
from resources import cheat_sheet
from resources import links
from resources import opcodes
from termcolor import colored
OPTIONS_SL = [
'reverse_shell',
'send_file',
'php_backdoor',
'hash_check',
'base64_converter',
'address_info',
'hex_converter',
'page_contents',
'password_checker',
'fake_identity',
'web_spider',
'ssl_cert',
'bash',
'whois',
'crypto',
'no_endian',
'rot13_converter',
'url_converter',
'html_converter',
'cheat_sheet',
'useful_links',
'opcodes',
'help',
'resources',
'modules'
]
TABCOMP = OPTIONS_SL
def completer(text, state):
"""Tab complete."""
options = [x for x in TABCOMP if x.startswith(text)]
try:
return options[state]
except IndexError:
return None
readline.set_completer(completer)
readline.parse_and_bind("tab: complete")
def check_root():
"""Check for root privileges."""
if not os.geteuid() == 0 and not os.getgid() == 0:
return False
def banner():
"""Display the netpwn banner."""
print colored(r' __ ', 'blue',)
print colored(r' ____ _____/ |_________ _ ______ ', 'blue')
print colored(r' / \_/ __ \ __\____ \ \/ \/ / \ ', 'blue')
print colored(r'| | \ ___/| | | |_> > / | \ ', 'blue')
print colored(r'|___| /\___ >__| | __/ \/\_/|___| /', 'blue')
print colored(r' \/ \/ |__| \/ ', 'blue')
print ' '
print colored(r' | Created by 3XPL017 |', 'blue')
print colored(r' | twitter: @3XPL017GH057 |', 'blue')
print colored(r' | https://github.com/3XPL017 |', 'blue')
print '\n' * 11
def modules():
"""Print available modules."""
print ' '
print colored('Modules', 'green')
print colored('===================', 'green')
print colored('reverse_shell', 'green')
print colored('send_file', 'green')
print colored('php_backdoor', 'green')
print colored('hash_check', 'green')
print colored('base64_converter', 'green')
print colored('address_info', 'green')
print colored('hex_converter', 'green')
print colored('page_contents', 'green')
print colored('password_checker', 'green')
print colored('fake_identity', 'green')
print colored('web_spider', 'green')
print colored('ssl_cert', 'green')
print colored('bash', 'green')
print colored('whois', 'green')
print colored('crypto', 'green')
print colored('no_endian', 'green')
print colored('rot13_converter', 'green')
print colored('url_converter', 'green')
print colored('html_converter', 'green')
print ' '
def list_resources():
"""List resource types."""
print ''
print colored('Resources', 'green')
print colored('=============', 'green')
print colored('useful_links', 'green')
print colored('cheat_sheet', 'green')
print colored('opcodes', 'green')
print ''
def help_menu():
"""Print help menu."""
print ' '
print colored('Commands', 'green')
print colored(
'==================================================',
'green')
print colored(
'[module name] runs the selected module', 'green')
print colored(
'[resource name] lists the selected resource', 'green')
print colored(
'modules lists available modules', 'green')
print colored(
'resources lists types of resources to list', 'green')
print colored(
'banner displays the banner', 'green')
print colored(
'clear clears the screen', 'green')
print colored(
'exit exits netpwn', 'green')
print ' '
def main():
"""Handle which function to run."""
if check_root() is False:
sys.exit(colored('netpwn must be run as root', 'yellow'))
choice = raw_input(colored('(netpwn) > ', 'red'))
options = {
'reverse_shell': reverse.reverse_shell,
'send_file': send.send_file,
'php_backdoor': backdoor.php_backdoor,
'hash_check': hasher.hash_check,
'base64_converter': base64_convert.base64_converter,
'address_info': address.address_info,
'hex_converter': hex_convert.hex_converter,
'page_contents': page.page_contents,
'password_checker': password.password_checker,
'fake_identity': identity.fake_identity,
'web_spider': spider.web_spider,
'ssl_cert': cert.ssl_cert,
'bash': cmd.bash,
'whois': who.whois_lookup,
'cheat_sheet': cheat_sheet.reverse_shells,
'crypto': crypto.crypt,
'no_endian': no_endian.no_little,
'rot13_converter': rot13.convert,
'url_converter': url_coding.converting,
'html_converter': html.convert,
'useful_links': links.useful_links,
'opcodes': opcodes.list_opcodes,
'resources': list_resources,
'help': help_menu,
'modules': modules,
'clear': lambda: os.system('clear'),
'banner': banner,
'exit': lambda: exit(0),
'': lambda: 1 + 1
}
if choice not in options:
print colored('Unknown command: ' + choice, 'yellow')
options.get(choice, lambda: None)()
main()
if __name__ == '__main__':
check_root()
banner()
try:
main()
except KeyboardInterrupt:
print ''
print colored('Quitting', 'yellow')
exit(0)