Skip to content

Commit

Permalink
cmd/corectl: fix display-http-requests (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
nil0x42 committed May 25, 2020
1 parent 7929933 commit 98fde09
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/core/tunnel/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def send(self, data):
# fixes: https://github.com/nil0x42/phpsploit/issues/65
if data.startswith(b"GET /") or data.startswith(b"POST /"):
_RAW_REQUESTS_LIST.append(data)
else:
elif _RAW_REQUESTS_LIST:
_RAW_REQUESTS_LIST[-1] += data
else:
_RAW_REQUESTS_LIST.append(data)

super().send(data)
http.client.__HTTPConnection__ = http.client.HTTPConnection
Expand All @@ -58,6 +60,13 @@ def send(self, data):
# http.client.__HTTPSConnection__ = http.client.HTTPSConnection
# http.client.HTTPSConnection = _CustomHTTPSConnection

# fixes https://github.com/nil0x42/phpsploit/issues/135
# but i don't know how ... :(
class _CustomHTTPHandler(urllib.request.HTTPHandler):
pass
urllib.request.__HTTPHandler__ = urllib.request.HTTPHandler
urllib.request.HTTPHandler = _CustomHTTPHandler


def _load_template(filepath):
"""load a PHP tunnel data template file"""
Expand Down

0 comments on commit 98fde09

Please # to comment.