what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Interesting File Finder For Recon-NG

Interesting File Finder For Recon-NG
Posted Oct 26, 2013
Authored by Jay Turla, LaNMaSteR53, thrapt

Interesting File Finder is a discovery module for Recon-NG framework which checks hosts for interesting files in predictable locations.

tags | tool, scanner
systems | unix
SHA-256 | ba1e26712709fcad3a38f2e0d4785244718cd606547b70a24fcd141746e55868

Interesting File Finder For Recon-NG

Change Mirror Download
import framework
# unique to module
import warnings
import gzip
from StringIO import StringIO

class Module(framework.module):

def __init__(self, params):
framework.module.__init__(self, params)
self.register_option('source', 'db', 'yes', 'source of hosts for module input (see \'info\' for options)')
self.register_option('download', True, 'yes', 'download discovered files')
self.info = {
'Name': 'Interesting File Finder',
'Author': 'Tim Tomes (@LaNMaSteR53), thrapt (thrapt@gmail.com), and Jay Turla (@shipcod3)',
'Description': 'Checks hosts for interesting files in predictable locations.',
'Comments': [
'Source options: [ db | <hostname> | ./path/to/file | query <sql> ]',
'Files: robots.txt, sitemap.xml, sitemap.xml.gz, crossdomain.xml, phpinfo.php, test.php, elmah.axd, server-status/',
'Google Dorks:',
'%sinurl:robots.txt ext:txt' % (self.spacer),
'%sinurl:elmah.axd ext:axd intitle:"Error log for"' % (self.spacer),
]
}

def uncompress(self, data_gz):
inbuffer = StringIO(data_gz)
data_ct = ''
f = gzip.GzipFile(mode='rb', fileobj=inbuffer)
try:
data_ct = f.read()
except IOError:
pass
f.close()
return data_ct

def module_run(self):
hosts = self.get_source(self.options['source']['value'], 'SELECT DISTINCT host FROM hosts WHERE host IS NOT NULL ORDER BY host')
download = self.options['download']['value']
# ignore unicode warnings when trying to ungzip text type 200 repsonses
warnings.simplefilter("ignore")
protocols = ['http', 'https']
# (filename, string to search for to prevent false positive)
filetypes = [
('robots.txt', 'user-agent:'),
('sitemap.xml', '<?xml'),
('sitemap.xml.gz', '<?xml'),
('crossdomain.xml', '<?xml'),
('phpinfo.php', 'phpinfo()'),
('test.php', 'phpinfo()'),
('elmah.axd', 'Error Log for'),
('server-status', '>Apache Status<'),
]
cnt = 0
for host in hosts:
for proto in protocols:
for (filename, verify) in filetypes:
url = '%s://%s/%s' % (proto, host, filename)
try:
resp = self.request(url, timeout=2, redirect=False)
code = resp.status_code
except KeyboardInterrupt:
raise KeyboardInterrupt
except:
code = 'Error'
if code == 200:
# uncompress if necessary
text = ('.gz' in filename and self.uncompress(resp.text)) or resp.text
# check for file type since many custom 404s are returned as 200s
if verify.lower() in text.lower():
self.alert('%s => %s. \'%s\' found!' % (url, code, filename))
if download:
filepath = '%s/%s_%s_%s' % (self.workspace, proto, host, filename)
dl = open(filepath, 'wb')
dl.write(resp.text.encode(resp.encoding) if resp.encoding else resp.text)
dl.close()
cnt += 1
else:
self.output('%s => %s. \'%s\' found but unverified.' % (url, code, filename))
else:
self.verbose('%s => %s' % (url, code))
self.output('%d interesting files found.' % (cnt))
if download: self.output('...downloaded to \'%s/\'' % (self.workspace))
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    23 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    43 Files
  • 20
    Aug 20th
    29 Files
  • 21
    Aug 21st
    42 Files
  • 22
    Aug 22nd
    26 Files
  • 23
    Aug 23rd
    25 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    21 Files
  • 27
    Aug 27th
    28 Files
  • 28
    Aug 28th
    15 Files
  • 29
    Aug 29th
    41 Files
  • 30
    Aug 30th
    13 Files
  • 31
    Aug 31st
    467 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close