Example #1
0
 def __init__(self):
     logger.debug("Analyzer object instansiated")
     self.data = None
     self.count = -1
     self.plugins = {}
     self.inuse = False
     self.stats = []
     self.regex_hits = []
Example #2
0
 def __init__(self):
     logger.debug("Plugin Manager instansiated")
     
     self.thread_pool = []
     self.loaded_plugins = {}
     # This queue is the job queue for the threads
     self.request_queue = Queue.Queue()
     # This list is filled by the attackThreads
     self.response_list = []
     # This dict will tell us which plugin sent a given payload
     self.plugin_payload = {}
     self.loadDefault()
Example #3
0
    def detectProtocolAuth(self, url):
        """
		This function will try to connect first to the server to check if any HTTP authentication
		method is enabled (e.g. Basic, Windows auth). 
		
		Return parameter tells the UI which authentication method was discovered in order for it
		to do the rest 
		"""
        ret = None
        wsdl = None
        try:
            # This should raise HTTPError if we find an authentication method
            self.currSettings['control']['url'] = url
            wsdl = urllib2.urlopen(url)
        except HTTPError as e:
            print e.headers
            rsp = e.headers.getheader('WWW-Authenticate')
            if rsp:
                rsp = rsp.lower()
                if 'basic' in rsp:
                    ret = AUTH_BASIC
                elif 'negotiate' in rsp or 'ntlm' in rsp:
                    ret = AUTH_WINDOWS
            else:
                logger.debug(
                    "Unsupported/Unknown authentication method detected: %s" %
                    rsp)
                ret = AUTH_UNKNOWN
        except URLError as e:
            # Known reasons are: connection refused, no route to host
            try:
                ret = e.reason[1]
            except:
                # Timeout
                ret = e.reason
        """
		finally:
			try:
				# urllib2 won't raise exception if you try to connect to the server for the second time!
				if wsdl.code == 401:
					rsp = wsdl.headers.getheader('WWW-Authenticate').lower()
					if 'basic' in rsp:
						ret = AUTH_BASIC
					elif 'negotiate' in rsp or 'ntlm' in rsp:
						ret = AUTH_WINDOWS
					else:
						logger.debug("Unsupported/Unknown authentication method detected: %s" % rsp )
						ret = AUTH_UNKNOWN
			except:
				pass
		"""
        return ret
Example #4
0
    def __init__(self):
        #logging.basicConfig(level=logging.DEBUG)
        #logging.getLogger('suds.client').setLevel(logging.DEBUG)
        self.project_manager = ProjectManager()
        self.ws_client = None
        # client lib, used when loading wsdl from file
        self.server_client = None
        # WSDL Descriptor
        self.wsdl_desc = None

        #control variables
        self.serviceName = ''
        self.portName = ''
        #online/offline switch
        self.is_offline = True
        logger.debug("WSDLHelper object instansiated")
Example #5
0
    def __init__(self):
        self.proj_name = ''
        self.proj_url = ''

        #currSettings is a dictionary with keys [control,server] which values are as presented in the config widget
        self.currSettings = {}
        self.currSettings['control'] = {'name': None, 'url': None}
        self.currSettings['server'] = {}
        self.currSettings['auth'] = {
            'type': None,
            'domain': None,
            'user': None,
            'password': None
        }
        #automatic wsdl save flag
        self.save_flag = False
        logger.debug("Project manager instansiated")
Example #6
0
	def main(self):
		#TODO: Print banner, 
		try:
			self.wsdlhelper = WSDLHelper()
			self.proj_manager = ProjectManager()
			self.analyzer = responseAnalyzer()
			self.plugin_manager = PluginManager()
			self.core = Core()
			self.gui.start(self)
			
			"""
			#paths['main_path'] = self.mainPath()
			#logger.debug("Main path is: %s" % paths['main_path'])
			parser = optparse.OptionParser('usage %prog -t <seconds>')
			parser.add_option('-t', dest='tout', type='int', default='60', help='specify HTTP timeout in seconds')
			(opts, args) = parser.parse_args()
			if opts.tout:
				socket.setdefaulttimeout(opts.tout)
			else:
				socket.setdefaulttimeout(60)
			logger.info("Setting default timeout to %d seconds" % socket.getdefaulttimeout())
			"""
		except antaresDependenciesException:
			logger.debug("antaresDependenciesException @ Launcher")
Example #7
0
    def __init__(self):
        """
		Main core function.
		"""
        logger.debug("Core module instansiated")