Skip to content

Commit

Permalink
Merge pull request #205 from P0cL4bs/tmp-hotfix
Browse files Browse the repository at this point in the history
fix pumpkinproxy error builtins.KeyError: 'host'
  • Loading branch information
mh4x0f authored Aug 7, 2022
2 parents 10e528e + 3f6a088 commit 424040e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 70 deletions.
4 changes: 0 additions & 4 deletions config/app/pumpkinproxy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ downloadspoof=false
js_inject=false
html_inject=false
beef=false
replaceImages=false
no-cache=false

[set_js_inject]
url=http://example.com/foo.js

[set_replaceImages]
path=docs/logo.png

[set_beef]
url_hook=http://172.16.149.141:3000/hook.js

Expand Down
8 changes: 4 additions & 4 deletions wifipumpkin3/core/wirelessmode/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ def Configure(self):
% (self.DHCP["subnet"], self.DHCP["netmask"], self.DHCP["router"]),
],
"kill": [
"iptables -w --flush",
"iptables -w --table nat --flush",
"iptables -w --delete-chain",
"iptables -w --table nat --delete-chain",
"{} -w --flush".format(self.getIptablesPath),
"{} -w --table nat --flush".format(self.getIptablesPath),
"{} -w --delete-chain".format(self.getIptablesPath),
"{} -w --table nat --delete-chain".format(self.getIptablesPath),
"killall dhpcd 2>/dev/null",
"ifconfig {} down".format(self.ifaceHostapd),
"ifconfig {} up".format(self.ifaceHostapd),
Expand Down
1 change: 1 addition & 0 deletions wifipumpkin3/plugins/bin/sslstrip3.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def init(argv):
all_plugins = base.BasePumpkin.__subclasses__()
for p in all_plugins:
if config.get("plugins", p.getName(), format=bool):
print("plugin: {} [enabled]".format(p.getName()))
plugins_manager.plugins = p

reactor.run()
Expand Down
18 changes: 9 additions & 9 deletions wifipumpkin3/plugins/external/sslstrip/ServerConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def sendPostData(self):
print(
self.getPostPrefix()
+ " Data ("
+ self.headers["host"]
+ self.headers.get("host") if self.headers.get("host") else ' '
+ "):\n"
+ str(self.postData)
+ str(self.postData) if self.postData else ''
)
self.transport.write(self.postData)

Expand All @@ -92,7 +92,7 @@ def connectionMade(self):
self.sendRequest()
self.sendHeaders()

if self.command == "POST":
if self.command.decode() == "POST":
self.sendPostData()

def handleStatus(self, version, code, message):
Expand All @@ -113,15 +113,15 @@ def handleHeader(self, key, value):
pass

if key.decode().lower() == "content-encoding":
if value.decode().find("gzip") != -1:
if "gzip" in value.decode():
self.isCompressed = True

if key.lower() == "location":
if key.decode().lower() == "location":
value = self.replaceSecureLinks(value)
self.urlMonitor.addRedirection(self.client.uri, value)

if key.lower() == "content-type":
if value.find("image") != -1:
if key.decode().lower() == "content-type":
if "image" in value.decode():
self.isImageRequest = True
print("Response is image content, not scanning...")

Expand Down Expand Up @@ -185,7 +185,7 @@ def handleResponse(self, data):
self.shutdown()

def replaceSecureLinks(self, data):
iterator = re.finditer(ServerConnection.urlExpression, data)
iterator = re.finditer(ServerConnection.urlExpression, data.decode())

for match in iterator:
url = match.group()
Expand All @@ -196,7 +196,7 @@ def replaceSecureLinks(self, data):
url = url.replace("&", "&")
self.urlMonitor.addSecureLink(self.client.getClientIP(), url)

data = re.sub(ServerConnection.urlExplicitPort, r"http://\1/", data)
data = re.sub(ServerConnection.urlExplicitPort, r"http://\1/", data.decode())
return re.sub(ServerConnection.urlType, "http://", data)

def shutdown(self):
Expand Down
53 changes: 0 additions & 53 deletions wifipumpkin3/plugins/pumpkinproxy/replace_image.py

This file was deleted.

0 comments on commit 424040e

Please sign in to comment.