Hack Like a Pro: The Ultimate Command Cheat Sheet for Metasploit's Meterpreter « Null Byte :: WonderHowTo

I've donenumerous tutorialsin Null Byte demonstrating the power ofMetasploit'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.Step 1: Core CommandsAt 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
exploit         executes the meterpreter script designated after it
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 channelStep 2: File System Commandscat             read and output to stdout the contents of a file
cd              change directory on the victim
del             delete a file on the victim
download        download a file from the victim system to the attacker system
edit            edit a file with vim
getlwd          print the local directory
getwd           print working directory
lcd             change local directory
lpwd            print local directory
ls              list files in current directory
mkdir           make a directory on the victim system
pwd             print working directory
rm              delete (remove) a file
rmdir           remove directory on the victim system
upload          upload a file from the attacker system to the victimStep 3: Networking Commandsipconfig        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 tableStep 4: System Commandsclearev         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 nameStep 5: User Interface Commandsenumdesktops    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 componentsStep 6: Privilege Escalation Commandsgetsystem       uses 15 built-in methods to gain sysadmin privilegesStep 7: Password Dump Commandshashdump        grabs the hashes in the password (SAM) fileNote that hashdump will often trip AV software, but there are now two scripts that are more stealthy,run hashdumpandrun smart_hashdump. Look for more on those in mymeterpreter script cheat sheet.Step 8: Timestomp Commandstimestomp       manipulates the modify, access, and create attributes of a fileStay Tuned for More Meterpreter TipsI've already used many of these commands inprevious 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 outmy second meterpreter cheat sheetwith the 135 scripts available for the meterpreter to continue hacking with metasploit.Follow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo by Justin Meyers/Null ByteRelatedHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:How to Remotely Install a Keylogger onto Your Girlfriend's ComputerHack Like a Pro:Metasploit for the Aspiring Hacker, Part 2 (Keywords)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Metasploit for the Aspiring Hacker, Part 11 (Post-Exploitation with Mimikatz)How To:Use Meterpeter on OS XHack Like a Pro:How to Remotely Grab a Screenshot of Someone's Compromised ComputerHack Like a Pro:Metasploit for the Aspiring Hacker, Part 1 (Primer & Overview)How To:Elevate a Netcat Shell to a Meterpreter Session for More Power & ControlHow To:Run an VNC Server on Win7Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 6 (Gaining Access to Tokens)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 14 (Creating Resource Script Files)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 5 (Msfvenom)Hack Like a Pro:How to Remotely Install an Auto-Reconnecting Persistent Back Door on Someone's PCHack Like a Pro:How to Secretly Hack Into, Switch On, & Watch Anyone's Webcam RemotelyHow to Hack Databases:Cracking SQL Server Passwords & Owning the ServerHack Like a Pro:How to Remotely Record & Listen to the Microphone on Anyone's ComputerHow To:Get Root Access on OS X Mavericks and YosemiteHack Like a Pro:The Ultimate List of Hacking Scripts for Metasploit's MeterpreterHow To:Get Root with Metasploit's Local Exploit SuggesterHack Like a Pro:How to Hack Your School's Server to Download Final Exam AnswersSPLOIT:Forensics with Metasploit ~ ( Recovering Deleted Files )Hack Like a Pro:Hacking Windows XP Through Windows 8 Using Adobe Flash PlayerHow To:Upgrade a Normal Command Shell to a Metasploit MeterpreterHack Like a Pro:Metasploit for the Aspiring Hacker, Part 12 (Web Delivery for Linux or Mac)How To:Exploit Java Remote Method Invocation to Get RootHack Like a Pro:Metasploit for the Aspiring Hacker, Part 7 (Autopwn)Hack Like a Pro:How to Cover Your Tracks So You Aren't DetectedHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterNews:The Sims Social Ultimate Cheat EngineNews:Great photography cheat sheets