Meterpreter
Metasploit payload that supports penetration testing.
How it Works
Meterpreter runs on the target but is not installed, it runs in memory. It runs in RAM to avoid being detected by any antivirus scans, this way it is seen as a process rather than a file on the system. Meterpreter also uses encrypted communication on the server where Metasploit is running to evade IDS/IPS. Most antivirus will still be able to detect meterpreter.
Available versions of Meterpreter can be listed using msfvenom --list payloads | grep meterpeter
. The decision on which version to use should be based on:
Target system : is it Linux? Windows? Mac? Android?
Components on target : is Python installed? Is it a PHP website?
Network connection types within target : can you have raw TCP? Can you only have HTTPS? Are IPv6 addresses monitored?
Each version of Meterpreter has different commands, so running help
is always useful. Common commands in each category will be covered here.
Core Commands
background
: background current sessionexit
: terminate sessionguid
: get session GUIDhelp
: show helpinfo
: shows info about a post moduleirb
: open interactive Ruby shellload
: load one or more extensionsmigrate
: migrate meterpreter to another processrun
: execute meterpreter script or post modulesessions
: switch to another session
File System Commands
cd
: change directoryls
: list current directory filespwd
: print working directoryedit
: allows editing of a filecat
: output file contentsrm
: delete filesearch
: search for filesupload
: upload a file or directorydownload
: download a file or directory
Networking Commands
arp
: display host ARP cacheifconfig
: display available network interfacesnetstat
: display network connectionsportfwd
: forward local port to remote serviceroute
: view and modify routing table
System Commands
clearev
: clear event logsexecute
: execute commandgetpid
: show current process IDgetuid
: show user Meterpreter is running askill
: terminate a processpkill
: terminate a process by nameps
: list running processesreboot
: reboot the computershell
: drop into system command shellshutdown
: shuts down computersysinfo
: get remote system info
Misc Commands
idletime
: returns number of seconds remote user has been idlekeyscan_dump
: dumps keystroke bufferkeyscan_start
: starts capturing keystrokeskeyscan_stop
: stops capturing keystrokesscreenshare
: see remote users desktop in real timescreenshot
: screenshot interactive desktoprecord_mic
: record audio from default devicewebcam_chat
: start video chatwebcam_list
: lists webcamswebcam_snap
: takes screenshot from webcamwebcam_stream
: plays video stream from webcamgetsystem
: attempt to elevate to local system privilegehashdump
: dumps contents of SAM database
Last updated