The usual stuff:
workspace -a host42 // To create a new workspace
workspace host42 // To open an existing workspace
db_nmap ...
hosts
services
...
search smb type:auxiliary
...
vulns // Shows all found vulnerabilities
creds // Shows all found credentials
General usage
- back — delete the current context
- check — performs a check if the target is vulnerable (not supported from all modules)
- connect — Telnet
- edit — Opens VI(m)
- info <module> — shows usage
- irb — irb 🙂
- route — rereouted all traffic from a network/host through a metasploit session
- search — searches for anything, options can be combined:
- search name:mysql
- search platform:linux
- search type:post
- can be combined: search name:mysql platform:linux
- grep can be used: grep pattern cmd
- sessions — managing concurrent running sessions
- set — sets framework options and parameters like set RHOST 127.0.0.1
- unset — unsets framework options and parameters
- setg — sets global variable to be used in the console later. Example: setg LHOST 10.1.1.1
- show — shows many things:
- show auxiliary
- show exploits
- show payloads
- show options
- show targets
- show advanced
- show encoders
- show nops
- use <module> — activates a module
- creds — manage found credentials
- Add manually: creds ‑a 172.16.194.134 ‑p 445 ‑u Administrator ‑P test
- hosts — shows retrieved host information
- db_nmap performs nmap and stores the information to the DB. Then, informations can be looked up directly, e.g. via services ‑p 443.
Payloads
- Staged payload with /:
payload/linux/x86/shell/reverse_tcp - Non-Staged payload without /:
payload/linux/x86/shell_reverse_tcp
Working with sessions
- Singles single payload which can be integrated in an attack
- Stagers Payload is loaded directly from the attacker’s system after an attack.
- Stages Payloads is loaded via the network from anywhere after an attack.
Using the database
A database can be used to store informations, payloads, etc. To create a initial db, use msfdb init before opening msfconsole.
- workspace — shows all workspaces
- worksapace ‑a <name> — creates a workspace
- workspace <name> — switches to a workspace
- workspace ‑d <name> — deletes a workspace
With db_export ‑f xml /root/e.xml, a workspace can be exported.
Leave a Reply
You must be logged in to post a comment.