forked from threat9/routersploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsf.py
executable file
·31 lines (25 loc) · 884 Bytes
/
rsf.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
#!/usr/bin/env python3
from __future__ import print_function
import logging.handlers
import sys
if sys.version_info.major < 3:
print("RouterSploit supports only Python3. Rerun application in Python3 environment.")
exit(0)
from routersploit.interpreter import RoutersploitInterpreter
log_handler = logging.handlers.RotatingFileHandler(filename="routersploit.log", maxBytes=500000)
log_formatter = logging.Formatter("%(asctime)s %(levelname)s %(name)s %(message)s")
log_handler.setFormatter(log_formatter)
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.DEBUG)
LOGGER.addHandler(log_handler)
def routersploit(argv):
rsf = RoutersploitInterpreter()
if len(argv[1:]):
rsf.nonInteractive(argv)
else:
rsf.start()
if __name__ == "__main__":
try:
routersploit(sys.argv)
except (KeyboardInterrupt, SystemExit):
pass