Hold on to your butts cause here we go.

This should resolve:
* Issue #307
* Issue #309
* Issue #302
* Issue #294

Apperently, Twisted made some fairly heavy API changes in their 16.x
release which kinda fucked all the plugins up.
This commit is contained in:
byt3bl33d3r 2016-06-08 23:39:58 -06:00
parent 06ef1da084
commit 2dc1dd4f12
6 changed files with 13 additions and 13 deletions

View file

@ -611,14 +611,14 @@ class FilePwn(Plugin):
def response(self, response, request, data): def response(self, response, request, data):
content_header = response.headers['content-type'] content_header = response.responseHeaders.getRawHeaders('Content-Type')[0]
client_ip = request.client.getClientIP() client_ip = request.client.getClientIP()
host = request.headers['host'] host = request.headers['host']
try: if not response.responseHeaders.hasHeader('content-length'):
content_length = int(response.headers['content-length']) content_length = None
except KeyError: else:
content_length = None content_length = int(response.responseHeaders.getRawHeaders('content-length')[0])
for target in self.user_config['targets'].keys(): for target in self.user_config['targets'].keys():
if target == 'ALL': if target == 'ALL':

View file

@ -35,7 +35,7 @@ class ImageRandomizer(Plugin):
if request.isImageRequest: if request.isImageRequest:
request.isImageRequest = False request.isImageRequest = False
request.isImage = True request.isImage = True
self.imageType = response.headers['content-type'].split('/')[1].upper() self.imageType = response.responseHeaders.getRawHeaders('content-type')[0].split('/')[1].upper()
def response(self, response, request, data): def response(self, response, request, data):
try: try:

View file

@ -61,11 +61,11 @@ class Inject(Plugin):
ip = response.getClientIP() ip = response.getClientIP()
hn = response.getRequestHostname() hn = response.getRequestHostname()
try: if not response.responseHeaders.hasHeader('Content-Type'):
mime = response.headers['Content-Type']
except KeyError:
return {'response': response, 'request':request, 'data': data} return {'response': response, 'request':request, 'data': data}
mime = response.responseHeaders.getRawHeaders('Content-Type')[0]
if "text/html" not in mime: if "text/html" not in mime:
return {'response': response, 'request':request, 'data': data} return {'response': response, 'request':request, 'data': data}

View file

@ -35,7 +35,7 @@ class Replace(Plugin):
self.options = options self.options = options
def response(self, response, request, data): def response(self, response, request, data):
mime = response.headers['Content-Type'] mime = response.responseHeaders.getRawHeaders('Content-Type')[0]
hn = response.getRequestHostname() hn = response.getRequestHostname()
if "text/html" in mime: if "text/html" in mime:

View file

@ -33,6 +33,6 @@ class SMBTrap(Plugin):
return {"request": request, "version": version, "code": 302, "message": "Found"} return {"request": request, "version": version, "code": 302, "message": "Found"}
def responseheaders(self, response, request): def responseheaders(self, response, request):
self.clientlog.info("Trapping request to {}".format(request.headers['host'])) self.clientlog.info("Trapping request to {}".format(request.headers['host']), extra=request.clientInfo)
rand_path = ''.join(random.sample(string.ascii_uppercase + string.digits, 8)) rand_path = ''.join(random.sample(string.ascii_uppercase + string.digits, 8))
response.headers["Location"] = "file://{}/{}".format(self.ip, rand_path) response.responseHeaders.setRawHeaders('Location', ["file://{}/{}".format(self.ip, rand_path)])

View file

@ -34,7 +34,7 @@ class Upsidedownternet(Plugin):
if request.isImageRequest: if request.isImageRequest:
request.isImageRequest = False request.isImageRequest = False
request.isImage = True request.isImage = True
self.imageType = response.headers['content-type'].split('/')[1].upper() self.imageType = response.responseHeaders.getRawHeaders('content-type')[0].split('/')[1].upper()
def response(self, response, request, data): def response(self, response, request, data):
try: try: