forked from shakenetwork/Recon-ng
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrecon-ng
executable file
·47 lines (44 loc) · 1.96 KB
/
recon-ng
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
#!/usr/bin/env python
import argparse
import re
import sys
# prevent creation of compiled bytecode files
sys.dont_write_bytecode = True
from recon.core import base
from recon.core.framework import Colors
def recon_ui(args):
# set up command completion
try:
import readline
except ImportError:
print('%s[!] Module \'readline\' not available. Tab complete disabled.%s' % (Colors.R, Colors.N))
else:
import rlcompleter
if 'libedit' in readline.__doc__:
readline.parse_and_bind('bind ^I rl_complete')
else:
readline.parse_and_bind('tab: complete')
readline.set_completer_delims(re.sub('[/-]', '', readline.get_completer_delims()))
# for possible future use to format command completion output
#readline.set_completion_display_matches_hook(display_hook)
x = base.Recon(base.Mode.CONSOLE)
# check for and run version check
if args.check:
if not x.version_check(): return
# check for and enable analytics
if args.analytics:
x.analytics = True
# check for and load workspace
if args.workspace: x.init_workspace(args.workspace)
# check for and run script session
if args.script_file: x.do_resource(args.script_file)
try: x.cmdloop()
except KeyboardInterrupt: print('')
description = '%%(prog)s - %s %s' % (base.__author__, base.__email__)
parser = argparse.ArgumentParser(description=description, version=base.__version__)
parser.add_argument('-w', help='load/create a workspace', metavar='workspace', dest='workspace', action='store')
parser.add_argument('-r', help='load commands from a resource file', metavar='filename', dest='script_file', action='store')
parser.add_argument('--no-check', help='disable version check', dest='check', default=True, action='store_false')
parser.add_argument('--no-analytics', help='disable analytics reporting', dest='analytics', default=True, action='store_false')
args = parser.parse_args()
recon_ui(args)