SharpHound

This commit is contained in:
2023-10-08 13:08:42 +02:00
parent 47f5da3983
commit 4fc654c6b6
4 changed files with 442 additions and 4 deletions

View File

@@ -236,13 +236,20 @@ class HttpFileServer(HTTPServer):
self.listen_thread.start()
return self.listen_thread
def get_base_url():
def get_base_url(self, ip_addr=None):
addr, port = self.server_address
if port != 80:
port = f":{port}"
protocol = "https" if gettype(self.socket) == ssl.SSLSocket else "http"
if ip_addr is not None:
addr = ip_addr
protocol = "https" if type(self.socket) == ssl.SSLSocket else "http"
return f"{protocol}://{addr}{port}"
def get_full_url(self, uri):
if not uri.startswith("/"):
uri = "/" + uri
return self.get_base_url() + uri
def stop(self):
self.is_running = False
time.sleep(1)
@@ -278,4 +285,4 @@ if __name__ == "__main__":
print("Exfiltrate data using:")
print(xss)
fileServer.start()
fileServer.serve_forever()