diff --git a/finalrecon.py b/finalrecon.py index 14c7d75..b7935b7 100644 --- a/finalrecon.py +++ b/finalrecon.py @@ -31,7 +31,7 @@ VERSION = '1.1.6' log_writer(f'FinalRecon v{VERSION}') -parser = argparse.ArgumentParser(description=f'FinalRecon - The Last Web Recon Tool You Will Need | v{VERSION}') +parser = argparse.ArgumentParser(description=f'FinalRecon - All in One Web Recon | v{VERSION}') parser.add_argument('--url', help='Target URL') parser.add_argument('--headers', help='Header Information', action='store_true') parser.add_argument('--sslinfo', help='SSL Certificate Information', action='store_true') @@ -56,6 +56,7 @@ ext_help.add_argument('-d', help='Custom DNS Servers [ Default : 1.1.1.1 ]') ext_help.add_argument('-e', help='File Extensions [ Example : txt, xml, php ]') ext_help.add_argument('-o', help='Export Format [ Default : txt ]') +ext_help.add_argument('-cd', help='Change export directory [ Default : ~/.local/share/finalrecon ]') ext_help.add_argument('-k', help='Add API key [ Example : shodan@key ]') ext_help.set_defaults( dt=config.dir_enum_th, @@ -67,7 +68,8 @@ sp=config.ssl_port, d=config.dir_enum_dns, e=config.dir_enum_ext, - o=config.export_fmt + o=config.export_fmt, + cd=config.usr_data ) try: @@ -100,6 +102,7 @@ output = args.o show_banner = args.nb add_key = args.k +output_dir = args.cd import socket import datetime @@ -219,7 +222,7 @@ def save_key(key_string): start_time = datetime.datetime.now() if output != 'None': - fpath = usr_data + fpath = output_dir dt_now = str(datetime.datetime.now().strftime('%d-%m-%Y_%H:%M:%S')) fname = f'{fpath}fr_{hostname}_{dt_now}.{output}' respath = f'{fpath}fr_{hostname}_{dt_now}' diff --git a/modules/dirrec.py b/modules/dirrec.py index a44b2b7..d176869 100644 --- a/modules/dirrec.py +++ b/modules/dirrec.py @@ -16,6 +16,7 @@ header = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0'} count = 0 wm_count = 0 +exc_count = 0 found = [] responses = [] curr_yr = date.today().year @@ -23,13 +24,13 @@ async def fetch(url, session, redir): - global responses + global responses, exc_count try: async with session.get(url, headers=header, allow_redirects=redir) as response: responses.append((url, response.status)) return response.status except Exception as exc: - print(f'{R}[-] {C}Exception : {W}' + str(exc).strip('\n')) + exc_count += 1 log_writer(f'[dirrec] Exception : {exc}') @@ -119,7 +120,8 @@ def dir_output(output, data): if output != 'None': result.setdefault('Status 403', []).append(f'{entry[1]}, {entry[0]}') - print(f'\n\n{G}[+] {C}Directories Found : {W}{len(found)}') + print(f'\n\n{G}[+] {C}Directories Found : {W}{len(found)}\n') + print(f'{Y}[!] {C}Exceptions : {W}{exc_count}') if output != 'None': result.update({'exported': False})