From ec3349cb1e771738f1cf62554b41b7a32f5ae801 Mon Sep 17 00:00:00 2001 From: lgandx Date: Thu, 4 Jan 2024 18:22:08 -0300 Subject: [PATCH] minor bugs --- packets.py | 4 ++-- servers/HTTP.py | 19 +------------------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/packets.py b/packets.py index 8fbcc87..12351f4 100644 --- a/packets.py +++ b/packets.py @@ -569,9 +569,9 @@ background-color:#555555;} class WPADScript(Packet): fields = OrderedDict([ ("Code", "HTTP/1.1 200 OK\r\n"), - ("ServerType", "Server: Microsoft-IIS/10.0\r\n"), - ("Date", "Date: "+HTTPCurrentDate()+"\r\n"), ("Type", "Content-Type: application/x-ns-proxy-autoconfig\r\n"), + ("Cache", "Pragma: no-cache\r\n"), + ("Server", "Server: BigIP\r\n"), ("ContentLen", "Content-Length: "), ("ActualLen", "76"), ("CRLF", "\r\n\r\n"), diff --git a/servers/HTTP.py b/servers/HTTP.py index c35df51..70b6b63 100644 --- a/servers/HTTP.py +++ b/servers/HTTP.py @@ -96,26 +96,9 @@ def GrabReferer(data, host): return Referer return False -def SpotFirefox(data): - UserAgent = re.findall(r'(?<=User-Agent: )[^\r]*', data) - if UserAgent: - print(text("[HTTP] %s" % color("User-Agent : "+UserAgent[0], 2))) - IsFirefox = re.search('Firefox', UserAgent[0]) - if IsFirefox: - print(color("[WARNING]: Mozilla doesn't switch to fail-over proxies (as it should) when one's failing.", 1)) - print(color("[WARNING]: The current WPAD script will cause disruption on this host. Sending a dummy wpad script (DIRECT connect)", 1)) - return True - else: - return False - def WpadCustom(data, client): Wpad = re.search(r'(/wpad.dat|/*\.pac)', data) - if Wpad and SpotFirefox(data): - Buffer = WPADScript(Payload="function FindProxyForURL(url, host){return 'DIRECT';}") - Buffer.calculate() - return str(Buffer) - - if Wpad and SpotFirefox(data) == False: + if Wpad: Buffer = WPADScript(Payload=settings.Config.WPAD_Script) Buffer.calculate() return str(Buffer)