Skip to content

Commit

Permalink
option to specify custom export directory added
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhiteh4t committed May 18, 2024
1 parent 09712af commit facda44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions finalrecon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -100,6 +102,7 @@
output = args.o
show_banner = args.nb
add_key = args.k
output_dir = args.cd

import socket
import datetime
Expand Down Expand Up @@ -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}'
Expand Down
8 changes: 5 additions & 3 deletions modules/dirrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
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
last_yr = curr_yr - 1


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}')


Expand Down Expand Up @@ -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})
Expand Down

0 comments on commit facda44

Please sign in to comment.