File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 104104from lib .core .settings import MIN_TIME_RESPONSES
105105from lib .core .settings import MIN_VALID_DELAYED_RESPONSE
106106from lib .core .settings import ML
107+ from lib .core .settings import NETSCAPE_FORMAT_HEADER_COOKIES
107108from lib .core .settings import NULL
108109from lib .core .settings import PARAMETER_AMP_MARKER
109110from lib .core .settings import PARAMETER_SEMICOLON_MARKER
@@ -3354,8 +3355,15 @@ def resetCookieJar(cookieJar):
33543355 cookieJar .clear ()
33553356 else :
33563357 try :
3357- cookieJar .load (conf .loadCookies )
3358- cookieJar .clear_expired_cookies ()
3358+ content = readCachedFileContent (conf .loadCookies )
3359+ lines = filter (None , (line .strip () for line in content .split ("\n " ) if not line .startswith ('#' )))
3360+ handle , filename = tempfile .mkstemp ()
3361+ os .close (handle )
3362+ with open (filename , "w+b" ) as f :
3363+ f .write ("%s\n " % NETSCAPE_FORMAT_HEADER_COOKIES )
3364+ for line in lines :
3365+ f .write ("\n %s" % "\t " .join (line .split ()))
3366+ cookieJar .load (filename )
33593367 except cookielib .LoadError , msg :
33603368 errMsg = "there was a problem loading "
33613369 errMsg += "cookies file ('%s')" % msg
Original file line number Diff line number Diff line change 516516# Timeout in seconds in which Metasploit remote session has to be initialized
517517METASPLOIT_SESSION_TIMEOUT = 120
518518
519+ # Reference: http://www.cookiecentral.com/faq/#3.5
520+ NETSCAPE_FORMAT_HEADER_COOKIES = "# Netscape HTTP Cookie File."
521+
519522# CSS style used in HTML dump format
520523HTML_DUMP_CSS_STYLE = """<style>
521524table{
You can’t perform that action at this time.
0 commit comments