Meterpreter is a killer in the Metasploit framework, usually used as an attack payload after a vulnerability overflow, and the attack payload can be returned to us as a control channel after the vulnerability is triggered.
Common Meterpreter Commands
- Run ScriptName runs the Meterpreter script, where you can see all the script names in the Scripts/meterpreter directory.
- SysInfo lists system information for the managed host.
- LS lists the file and folder information for the target host.
- Use Priv to load the elevation of Privilege extension module to extend the Meterpreter library.
- PS Displays all running processes and associated user accounts.
- Migrate PID is migrated to a specified process ID (PID can be obtained from the target host via PS).
- Use Incognito loads the Incognito function (used to steal the target host's token or impersonate the user).
- List_tokens-u lists the available tokens for the target host user.
- LIST_TOKENS-G lists the available tokens for the target host user group.
- Impersonate_token Domain_name\\username the available tokens on the target host.
- The Steal_token PID steals the available tokens for a given process and makes a token impersonation.
- Drop_token Stop impersonating the current token.
- Getsystem uses various attack vectors to elevate system user rights.
- The shell runs an interactive shell with all available tokens.
- Execute-f Cmd.exe-i executes the cmd.exe command and interacts.
- Execute-f Cmd.exe-i-T executes the cmd command with all available tokens.
- Execute-f cmd.exe-i-h-t executes the cmd command with all the available tokens and hides the process.
- Rev2self back to the initialized user account that controls the target host.
- The reg command interacts, creates, deletes, queries, and so on in the target host registry.
- Setdesktop number switches to another user interface (the feature is based on which users are logged on).
- Screenshot to the screen of the target host.
- Upload file uploads files to the target host
- Download file downloads files from the target host.
- Keyscan_start enable keylogger for remote target host.
- Keyscan_dump stores the keylogger captured on the target host.
- Keyscan_stop stops the Keylogger function for the target host.
- Getprivs as much as possible to get privileges on the target host.
- Uictl enable Keyboard/mouse takes over the target host's keyboard and mouse.
- Background your current Meterpreter shell to the background.
- Hashdump Export the password hash value in the destination host.
- Use sniffer to load the sniffer module.
- Sniffer_interfaces lists all open network interfaces of the target host.
- Sniffer_dump InterfaceID pcapname start sniffing on the target host.
- Sniffer_stats InterfaceID Gets the statistics that are implementing the sniffer network interface.
- Sniffer_start InterfaceID Packet-buffer initiates a sniffer on the target host for a specific range of packet buffers.
- Sniffer_stop InterfaceID stop sniffing.
- Add_user username password-h IP Adds a user to the remote destination host.
- Add_group_user "Domain Admins" username-h IP adds the user to the Domain Admins group of the target host.
- Clearev clears the log records on the target host.
- Timestomp modify file properties, such as modifying the creation time of a file (anti-forensics investigation).
- Reboot restart the target host.
Meterpreter command in Metasploit