Skip to content

Commit 1ce5ba5

Browse files
committed
Added feature to scan for particular URIs
1 parent 494e023 commit 1ce5ba5

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

httpscreenshot.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ def signal_handler(signal, frame):
436436
parser.add_argument("-a","--autodetect",action='store_true',default=False,help='Automatically detect if listening services are HTTP or HTTPS. Ignores NMAP service detction and URL schemes.')
437437
parser.add_argument("-vH","--vhosts",action='store_true',default=False,help='Attempt to scrape hostnames from SSL certificates and add these to the URL queue')
438438
parser.add_argument("-dB","--dns_brute",help='Specify a DNS subdomain wordlist for bruteforcing on wildcard SSL certs')
439+
parser.add_argument("-uL","--uri_list",help='Specify a list of URIs to fetch in addition to the root')
439440
parser.add_argument("-r","--retries",type=int,default=0,help='Number of retries if a URL fails or timesout')
440441
parser.add_argument("-tG","--trygui",action='store_true',default=False,help='Try to fetch the page with FireFox when headless fails')
441442
parser.add_argument("-sF","--smartfetch",action='store_true',default=False,help='Enables smart fetching to reduce network traffic, also increases speed if certain conditions are met.')
@@ -448,19 +449,27 @@ def signal_handler(signal, frame):
448449
parser.print_help()
449450
sys.exit(0)
450451

452+
453+
#read in the URI list if specificed
454+
uris = ['']
455+
if(args.uri_list != None):
456+
uris = open(args.uri_list,'r').readlines()
457+
uris.append('')
458+
451459
if(args.input is not None):
452460
inFile = open(args.input,'r')
453461
if(detectFileType(inFile) == 'gnmap'):
454462
hosts = parseGnmap(inFile,args.autodetect)
455463
urls = []
456464
for host,ports in hosts.items():
457465
for port in ports:
458-
url = ''
459-
if port[1] == True:
460-
url = ['https://'+host+':'+port[0],args.vhosts,args.retries]
461-
else:
462-
url = ['http://'+host+':'+port[0],args.vhosts,args.retries]
463-
urls.append(url)
466+
for uri in uris:
467+
url = ''
468+
if port[1] == True:
469+
url = ['https://'+host+':'+port[0]+uri,args.vhosts,args.retries]
470+
else:
471+
url = ['http://'+host+':'+port[0]+uri,args.vhosts,args.retries]
472+
urls.append(url)
464473
else:
465474
print 'Invalid input file - must be Nmap GNMAP'
466475

0 commit comments

Comments
 (0)