Vous êtes sur la page 1sur 5

Step 2 - File System Commands

Metasploit Cheatsheet cat - read and output to stdout the contents of a file

cd - change directory on the victim


Step 1 - Core Commands
At its most basic use, meterpreter is a Linux terminal on the victim's computer. As del - delete a file on the victim
such, many of our basic Linux commands can be used on the meterpreter even if
download - download a file from the victim system to the attacker system
it's on a Windows or other operating system.
edit - edit a file with vim
Here are some of the core commands we can use on the meterpreter.
getlwd - print the local directory
? - help menu
getwd - print working directory
background - moves the current session to the background
lcd - change local directory
bgkill - kills a background meterpreter script
lpwd - print local directory
bglist - provides a list of all running background scripts
ls - list files in current directory
bgrun - runs a script as a background thread
mkdir - make a directory on the victim system
channel - displays active channels
pwd - print working directory
close - closes a channel
rm - delete a file
exit - terminates a meterpreter session
rmdir - remove directory on the victim system
help - help menu
upload - upload a file from the attacker system to the victim
interact - interacts with a channel

irb - go into Ruby scripting mode Step 3 - Networking Commands


ipconfig - displays network interfaces with key information including IP
migrate - moves the active process to a designated PID
address, etc.
quit - terminates the meterpreter session
portfwd - forwards a port on the victim system to a remote service
read - reads the data from a channel
route - view or modify the victim routing table
run - executes the meterpreter script designated after it

use - loads a meterpreter extension Step 4 - System Commands


clearav - clears the event logs on the victim's computer
write - writes data to a channel
drop_token - drops a stolen token set_desktop - changes the meterpreter desktop

execute - executes a command uictl - enables control of some of the user interface components

getpid - gets the current process ID (PID)


Step 6 - Privilege Escalation Commands
getprivs - gets as many privileges as possible getsystem - uses 15 built-in methods to gain sysadmin privileges
getuid - get the user that the server is running as
Step 7 - Password Dump Commands
kill - terminate the process designated by the PID hashdump - grabs the hashes in the password (SAM) file
ps - list running processes Note that hashdump will often trip AV software, but there are now two scripts
reboot - reboots the victim computer that are more stealthy, "run hashdump" and "run smart_hashdump". Look for
more on those on my upcoming meterpreter script cheat sheet.
reg - interact with the victim's registry

rev2self - calls RevertToSelf() on the victim machine Step 8 - Timestomp Commands


timestomp - manipulates the modify, access, and create attributes of a
shell - opens a command shell on the victim machine
file
shutdown - shuts down the victim's computer

steal_token - attempts to steal the token of a specified (PID) process


Script Commands with Brief Descriptions
arp_scanner.rb - Script for performing an ARP's Scan Discovery.
sysinfo - gets the details about the victim computer such as OS and name
autoroute.rb - Meterpreter session without having to background the
current session.
Step 5 - User Interface Commands
enumdesktops - lists all accessible desktops checkvm.rb - Script for detecting if target host is a virtual machine.

getdesktop - get the current meterpreter desktop credcollect.rb - Script to harvest credentials found on the host and store
them in the database.
idletime - checks to see how long since the victim system has been idle
domain_list_gen.rb - Script for extracting domain admin account list for
keyscan_dump - dumps the contents of the software keylogger use.
keyscan_start - starts the software keylogger when associated with a dumplinks.rb - Dumplinks parses .lnk files from a user's recent documents
process such as Word or browser folder and Microsoft Office's Recent documents folder, if present. The
keyscan_stop - stops the software keylogger .lnk files contain time stamps, file locations, including share names,
volume serial #s and more. This info may help you target additional
screenshot - grabs a screenshot of the meterpreter desktop systems.
duplicate.rb - Uses a meterpreter session to spawn a new meterpreter getgui.rb - Script to enable Windows RDP.
session in a different process. A new process allows the session to take
get_local_subnets.rb - Get a list of local subnets based on the host's
"risky" actions that might get the process killed by A/V, giving a
routes.
meterpreter session to another controller, or start a keylogger on another
process. get_pidgen_creds.rb - Script for extracting configured services with
username and passwords.
enum_chrome.rb - Script to extract data from a chrome installation.
gettelnet.rb - Checks to see whether telnet is installed.
enum_firefox.rb - Script for extracting data from
Firefox. enum_logged_on_users.rb - Script for enumerating current get_valid_community.rb - Gets a valid community string from SNMP.
logged users and users that have logged in to the
system. enum_powershell_env.rb - Enumerates PowerShell and WSH getvncpw.rb - Gets the VNC password.
configurations. hashdump.rb - Grabs password hashes from the SAM.
enum_putty.rb - Enumerates Putty connections. hostedit.rb - Script for adding entries in to the Windows Hosts file.
enum_shares.rb - Script for Enumerating shares offered and history of keylogrecorder.rb - Script for running keylogger and saving all the
mounted shares. keystrokes.
enum_vmware.rb - Enumerates VMware configurations for VMware killav.rb - Terminates nearly every antivirus software on victim.
products.
metsvc.rb - Delete one meterpreter service and start another.
event_manager.rb - Show information about Event Logs on the target
system and their configuration. migrate - Moves the meterpreter service to another process.

file_collector.rb - Script for searching and downloading files that match a multicommand.rb - Script for running multiple commands on Windows
specific pattern. 2003, Windows Vistaand Windows XP and Windows 2008 targets.

get_application_list.rb - Script for extracting a list of installed applications multi_console_command.rb - Script for running multiple console
and their version. commands on a meterpreter session.

getcountermeasure.rb - Script for detecting AV, HIPS, Third Party multi_meter_inject.rb - Script for injecting a reverce tcp Meterpreter
Firewalls, DEP Configuration and Windows Firewall configuration. Payload into memory of multiple PIDs, if none is provided a notepad
Provides also the option to kill the processes of detected products and process will be created and a Meterpreter Payload will be injected in to
disable the built-in firewall. each.

get_env.rb - Script for extracting a list of all System and User multiscript.rb - Script for running multiple scripts on a Meterpreter
environment variables. session.

getfilezillacreds.rb - Script for extracting servers and credentials from


Filezilla.
netenum.rb - Script for ping sweeps on Windows 2003, Windows Vista, schelevator.rb - Exploit for Windows Vista/7/2008 Task Scheduler 2.0
Windows 2008 and Windows XP targets using native Windows Privilege Escalation. This script exploits the Task Scheduler 2.0 XML 0day
commands. exploited by Stuxnet.

packetrecorder.rb - Script for capturing packets in to a PCAP file. schtasksabuse.rb - Meterpreter script for abusing the scheduler service in
Windows by scheduling and running a list of command against one or
panda2007pavsrv51.rb - This module exploits a privilege escalation
more targets. Using schtasks command to run them as system. This script
vulnerability in Panda Antivirus 2007. Due to insecure permission issues, a
works with Windows XP, Windows 2003, Windows Vista and Windows
local attacker can gain elevated privileges.
2008.
persistence.rb - Script for creating a persistent backdoor on a target host.
scraper.rb - The goal of this script is to obtain system information from a
pml_driver_config.rb - Exploits a privilege escalation vulnerability in victim through an existing Meterpreter session.
Hewlett-Packard's PML Driver HPZ12. Due to an insecure
screenspy.rb - This script will open an interactive view of remote hosts.
SERVICE_CHANGE_CONFIG DACL permission, a local attacker can gain
You will need Firefox installed on your machine.
elevated privileges.
screen_unlock.rb - Script to unlock a windows screen. Needs system
powerdump.rb - Meterpreter script for utilizing purely PowerShell to
privileges to run and known signatures for the target system.
extract username and password hashes through registry keys. This script
requires you to be running as system in order to work properly. This has screen_dwld.rb - Script that recursively search and download files
currently been tested on Server 2008 and Windows 7, which installs matching a given pattern.
PowerShell by default.
service_manager.rb - Script for managing Windows services.
prefetchtool.rb - Script for extracting information from windows prefetch
service_permissions_escalate.rb This script attempts to create a service,
folder.
then searches through a list of existing services to look for insecure file or
process_memdump.rb - Script is based on the paper Neurosurgery With configuration permissions that will let it replace the executable with a
Meterpreter. payload. It will then attempt to restart the replaced service to run the
payload. If that fails, the next time the service is started (such as on
remotewinenum.rb - This script will enumerate windows hosts in the
reboot) the attacker will gain elevated privileges.
target environment given a username and password or using the
credential under which Meterpeter is running using WMI wmic windows sound_recorder.rb - Script for recording in intervals the sound capture by
native tool. a target host microphone.

scheduleme.rb - Script for automating the most common scheduling tasks srt_webdrive_priv.rb - Exploits a privilege escalation vulnerability in
during a pentest. This script works with Windows XP, Windows 2003, South River Technologies WebDrive.
Windows Vista and Windows 2008.
uploadexec.rb - Script to upload executable file to host.

virtualbox_sysenter_dos - Script to DoS Virtual Box.


virusscan_bypass.rb - Script that kills Mcafee VirusScan Enterprise
v8.7.0i+ processes.

vnc.rb - Meterpreter script for obtaining a quick VNC session.

webcam.rb - Script to enable and capture images from the host webcam.

win32-sshclient.rb - Script to deploy & run the "plink" commandline ssh-


client. Supports only MS-Windows-2k/XP/Vista Hosts.

win32-sshserver.rb - Script to deploy and run OpenSSH on the target


machine.

winbf.rb - Function for checking the password policy of current system.


This policy may resemble the policy of other servers in the target
environment.

winenum.rb - Enumerates Windows system including environment


variables, network interfaces, routing, user accounts, etc

wmic.rb - Script for running WMIC commands on Windows 2003,


Windows Vista and Windows XP and Windows 2008 targets.

Vous aimerez peut-être aussi