Recon-ng / modules / recon / hosts / enum / http / web /

Full commit
import framework
# unique to module
import re

class Module(framework.module):

    def __init__(self, params):
        framework.module.__init__(self, params)
        self.register_option('source', 'db', 'yes', 'source of addresses for module input (see \'info\' for options)') = {
                     'Name': 'IPVoid IP Address Lookup',
                     'Author': 'Micah Hoffman (@WebBreacher)',
                     'Description': 'Checks for information about the security of the given IP Address.',
                     'Comments': [
                                  'Source options: [ db | <address> | ./path/to/file | query <sql> ]',
    def module_run(self):
        addresses = self.get_source(self.options['source']['value'], 'SELECT DISTINCT ip_address FROM hosts WHERE ip_address IS NOT NULL')

        for address in addresses:
            url = '' % (address)
            self.verbose('URL: %s' % url)
            resp = self.request(url)

            if '<h1>AN ERROR OCCURRED</h1>' in resp.text:
                self.output('No data returned for \'%s\'' % (address))

            # Get and display the results
            blacklisted ='Blacklist Status</td><td><span.+>(\w.+)</span>', resp.text)
            if == "BLACKLISTED":
                self.alert('\'%s\' is BLACKLISTED! (ruhroh)' % (address))
                detection ='Detection Ratio</td><td>(\d+ / \d+) \(<font', resp.text)
                self.output('Detection Ratio was %s' %
                detected_sites = re.findall(r'Favicon" />(.+?)</td><td><img src=".+?" alt="Alert" title="Detected!".+?"nofollow" href="(.+?)" title', resp.text)
                tdata = [['Site', 'Link']]
                for site in detected_sites:
                    tdata.append([site[0].strip(), site[1].strip()])
                self.table(tdata, True)
                self.output('\'%s\' not blacklisted...whew!' % (address))
            # Other Data scraped from the page
            reverse_dns ='Reverse DNS</td><td>(.+)</td>', resp.text)
            city ='City</td><td>(\w.+)</td>', resp.text)
            region ='Region</td><td>(\w.+)</td>', resp.text)
            country ='alt="Flag" /> \(\w+\) (.+)</td>', resp.text)
            lat_long ='Latitude / Longitude</td><td>(.+)</td>',resp.text)
            # Output that additional stuff above
            self.output('Reverse DNS entry: %s' % (
            self.output('Location: %s, %s, %s at %s' % (,,,