def _createFuzzable( freq ): ''' @return: This function verifies the configuration, and creates a map of things that can be fuzzed. ''' _fuzzable = {} _fuzzable['dc'] = freq.getDc() # Add the fuzzable headers tmp = {} for header in cf.cf.getData('fuzzableHeaders') or []: tmp[ header ] = '' if len( tmp.keys() ): _fuzzable['headers'] = tmp if cf.cf.getData('fuzzableCookie'): _fuzzable['cookie'] = cookie() if cf.cf.getData('fuzzFileName'): _fuzzable['fuzzedFname'] = None if cf.cf.getData('fuzzFileContent' ): _fuzzable['fuzzFileContent'] = None return _fuzzable
def _createFuzzable(freq): """ @return: This function verifies the configuration, and creates a map of things that can be fuzzed. """ _fuzzable = {} _fuzzable["dc"] = freq.getDc() # Add the fuzzable headers tmp = {} for header in cf.cf.getData("fuzzableHeaders") or []: tmp[header] = "" if len(tmp.keys()): _fuzzable["headers"] = tmp if cf.cf.getData("fuzzableCookie"): _fuzzable["cookie"] = cookie() if cf.cf.getData("fuzzFileName"): _fuzzable["fuzzedFname"] = None if cf.cf.getData("fuzzFileContent"): _fuzzable["fuzzFileContent"] = None return _fuzzable
def _createCookie( httpResponse ): ''' Create a cookie object based on a HTTP response. ''' responseHeaders = httpResponse.getHeaders() responseCookies = [] for headerName in responseHeaders: if 'cookie' in headerName.lower(): responseCookies.append( responseHeaders[ headerName ] ) tmp = '' for c in responseCookies: tmp += c return cookie( tmp )
def setCookie( self , c ): ''' @parameter cookie: A cookie object as defined in core.data.dc.cookie, or a string. ''' if isinstance( c, cookie): self._cookie = c elif isinstance( c, basestring ): self._cookie = cookie( c ) elif c is None: self._cookie = None else: om.out.error('[fuzzableRequest error] setCookie received: "' + str(type(c)) + '" , "' + repr(c) + '"' ) raise w3afException('Invalid call to fuzzableRequest.setCookie()')
def _createCookie(httpResponse): """ Create a cookie object based on a HTTP response. """ responseHeaders = httpResponse.getHeaders() responseCookies = [] for headerName in responseHeaders: if "cookie" in headerName.lower(): responseCookies.append(responseHeaders[headerName]) tmp = "" for c in responseCookies: tmp += c return cookie(tmp)