The Ultimate Command Cheat Sheet For Metasploit
The Ultimate Command Cheat Sheet For Metasploit
By occupytheweb
05/27/2016 12:42 am
Metasploit Basics
I've done numerous tutorials in Null Byte demonstrating the power of Metasploit's meterpreter. With the
meterpreter on the target system, you have nearly total command of the victim!
As a result, several of you have asked me for a complete list of commands available for the meterpreter
because there doesn't seem to be a complete list anywhere on the web. So here it goes! Hack a system
and have fun testing out these commands!
At its most basic use, meterpreter is a Linux terminal on the victim's computer. As such, many of our basic
Linux commands can be used on the meterpreter even if it's on a Windows or other operating system.
Here are some of the core commands we can use on the meterpreter.
? - help menu
background - moves the current session to the background
bgkill - kills a background meterpreter script
bglist - provides a list of all running background scripts
bgrun - runs a script as a background thread
channel - displays active channels
close - closes a channel
exit - terminates a meterpreter session
help - help menu
interact - interacts with a channel
irb - go into Ruby scripting mode
migrate - moves the active process to a designated PID
quit - terminates the meterpreter session
read - reads the data from a channel
run - executes the meterpreter script designated after it
use - loads a meterpreter extension
write - writes data to a channel
ipconfig - displays network interfaces with key information including IP address, etc.
portfwd - forwards a port on the victim system to a remote service
route - view or modify the victim routing table
clearav - clears the event logs on the victim's computer
drop_token - drops a stolen token
execute - executes a command
getpid - gets the current process ID (PID)
getprivs - gets as many privileges as possible
getuid - get the user that the server is running as
kill - terminate the process designated by the PID
ps - list running processes
reboot - reboots the victim computer
reg - interact with the victim's registry
rev2self - calls RevertToSelf() on the victim machine
shell - opens a command shell on the victim machine
shutdown - shuts down the victim's computer
steal_token - attempts to steal the token of a specified (PID) process
sysinfo - gets the details about the victim computer such as OS and name
enumdesktops - lists all accessible desktops
getdesktop - get the current meterpreter desktop
idletime - checks to see how long since the victim system has been idle
keyscan_dump - dumps the contents of the software keylogger
keyscan_start - starts the software keylogger when associated with a process such as Word or
browser
keyscan_stop - stops the software keylogger
screenshot - grabs a screenshot of the meterpreter desktop
set_desktop - changes the meterpreter desktop
uictl - enables control of some of the user interface components
I've already used many of these commands in previous tutorials, and I will be using more in future guides
as well to show you how they work. Also, bookmark this page as it is possibly the most complete cheat
sheet of meterpreter commands found anywhere on the web, so you'll want it to refer back to this sheet
often.
Finally, check out my second meterpreter cheat sheet with the 135 scripts available for the meterpreter to
continue hacking with metasploit.
Metasploit framework is an incredible hacking and pentesting tool that every hacker worth their salt
should be conversant and capable on.
In a previous post, I had provided you a cheat sheet of meterpreter commands. These commands
are essential to running Metasploit's meterpreter, but in recent years, numerous hackers and security
pros have developed scripts that we can run from the meterpreter that can be much more effective
and malicious.
In this post, I will try to provide you the most complete list and description available anywhere on
the web. You will want to bookmark this page too, as no one remembers all these scripts and it's
likely you will want to return here at a later time to find a particular script for a particular hack.
Please note that new meterpreter scripts are being developed every day. This list attempts to provide
you with a complete list of scripts as of this writing. If you find errors or typos, please feel free to
post them here, so I will try correct them as soon as humanly possible.