-
Notifications
You must be signed in to change notification settings - Fork 2
/
nmshell.py
executable file
·53 lines (38 loc) · 1008 Bytes
/
nmshell.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
#!/usr/bin/env python3
from importlib.util import find_spec
import os
import sys
import signal
nmap_mod_found = find_spec("nmap")
if not nmap_mod_found:
print("""python-nmap for python 3 is not found but is required.
Package name : python3-nmap or python-nmap
Archlinux : pacman -S python-nmap
Debian : apt install python3-nmap
https://pypi.python.org/pypi/python-nmap""")
sys.exit(1)
from console.Console import *
def signal_handler(signal, frame):
print('Exit ...')
sys.exit(0)
def start():
c = Console()
if __name__ == '__main__':
"""
run program
"""
if(os.getuid() != 0):
print("Nop, must be root")
sys.exit(1)
print("""
_____________________________________
< NmapShell v2.0 >
Not sure what to do ? type 'help'
\ ^__^
\ (oo)\_______
(__)\ )\/o
||----w |
|| ||
""")
signal.signal(signal.SIGINT, signal_handler)
start()