Recon-ng / modules / discovery / exploitable / http /

Jay Turla 1c9a9da 

Tim Tomes ad591fb 
Jay Turla 1c9a9da 

Tim Tomes 1a7628b 
Jay Turla 1c9a9da 

import framework
# unique to module

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)') = {
                     'Name': 'Webwiz Rich Text Editor File Upload Page Finder',
                     'Author': 'Jay Turla (@shipcod3)',
                     'Description': 'Checks the given hosts for Webwiz RTE remote file upload pages.',
                     'Comments': [
                                  'Source options: [ db | <hostname> | ./path/to/file | query <sql> ]',
                                  'Google Dork: inurl:"RTE_popup_file_atch.asp"',

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

        protocols = ['http', 'https']
        files = [
                 'admin/RTE_popup_file_atch.asp', 'asp/RTE/RTE_popup_file_atch.asp',
                 'admin/rte/RTE_popup_file_atch.asp', 'RTE/RTE_popup_file_atch.asp',
                 'rte/RTE_popup_file_atch.asp', 'RTE_popup_file_atch.asp',
                 'rte_popup_file_atch.asp', 'apps/rte/RTE_popup_file_atch.asp',
        cnt = 0
        for host in hosts:
            for proto in protocols:
                for fileupload in files: 
                    url = '%s://%s/%s' % (proto, host, fileupload)
                        resp = self.request(url, redirect=False)
                        code = resp.status_code
                    except KeyboardInterrupt:
                        raise KeyboardInterrupt
                        code = 'Error'
                    if code == 200 and 'Attach File Properties' in resp.text:
                        self.alert('%s => %s. Possible Webwiz RTE file upload  page found!' % (url, code))
                        cnt += 1
                        self.verbose('%s => %s' % (url, code))
        self.output('%d Webwiz RTE file upload pages found' % (cnt))