SharpHound

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

@ -236,13 +236,20 @@ class HttpFileServer(HTTPServer):
self.listen_thread.start() self.listen_thread.start()
return self.listen_thread return self.listen_thread
def get_base_url(): def get_base_url(self, ip_addr=None):
addr, port = self.server_address addr, port = self.server_address
if port != 80: if port != 80:
port = f":{port}" 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}" 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): def stop(self):
self.is_running = False self.is_running = False
time.sleep(1) time.sleep(1)
@ -278,4 +285,4 @@ if __name__ == "__main__":
print("Exfiltrate data using:") print("Exfiltrate data using:")
print(xss) print(xss)
fileServer.start() fileServer.serve_forever()

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
# Usage: download_zip <url> <destination file>
download () { download () {
tmpfile=$(mktemp /tmp/wget.XXXXXX) tmpfile=$(mktemp /tmp/wget.XXXXXX)
wget --no-verbose "$1" -O "$tmpfile" wget --no-verbose "$1" -O "$tmpfile"
@ -15,6 +16,17 @@ download () {
fi fi
} }
# Usage: download_zip <url> <destination directory> [files]
download_zip () {
tmpfile=$(mktemp /tmp/wget.XXXXXX)
wget --no-verbose "$1" -O "$tmpfile"
status=$?
if [ $status -eq 0 ]; then
unzip -o "$tmpfile" -d $2 "${@:3}"
fi
}
# Usage: get_latest_version <url> <version prefix>
get_latest_version () { get_latest_version () {
repository=$1 repository=$1
prefix=$2 prefix=$2
@ -69,3 +81,4 @@ download https://github.com/k4sth4/Juicy-Potato/raw/main/x86/jp32.exe win/JuicyP
download https://github.com/k4sth4/Juicy-Potato/raw/main/x64/jp.exe win/JuicyPotato64.exe download https://github.com/k4sth4/Juicy-Potato/raw/main/x64/jp.exe win/JuicyPotato64.exe
download https://github.com/uknowsec/SweetPotato/raw/master/SweetPotato-Webshell-new/bin/Release/SweetPotato.exe win/SweetPotato.exe download https://github.com/uknowsec/SweetPotato/raw/master/SweetPotato-Webshell-new/bin/Release/SweetPotato.exe win/SweetPotato.exe
download https://github.com/BeichenDream/GodPotato/releases/latest/download/GodPotato-NET4.exe win/GodPotato.exe download https://github.com/BeichenDream/GodPotato/releases/latest/download/GodPotato-NET4.exe win/GodPotato.exe
download_zip https://github.com/BloodHoundAD/SharpHound/releases/download/v2.0.1/SharpHound-v2.0.1.zip win/ SharpHound.exe SharpHound.ps1

Binary file not shown.

418
win/SharpHound.ps1 Normal file

File diff suppressed because one or more lines are too long