Metasploit

Database

Init Metaspolit database.

sudo msfdb init

Run postgresql service.

sudo systemctl enable postgresql

Workspaces

Change between workspaces for sperating the projects' databases.

workspace -a <workspace_name>

Nmap

db_nmap is a Nmap binary wrapper which saves results into Metasploit's database enables explore results later combined.

hosts - show found hosts and their operating system.

services - show found services and which host runs them.

Search Module

Metasploit module types:

  • Exploit Modules: Code to exploit vulnerabilities in systems.

  • Payload Modules: Code executed on the target post-exploitation.

  • Auxiliary Modules: Tools for scanning and information gathering.

  • Post Modules: Actions taken on a compromised system.

  • Encoder Modules: Obfuscate payloads to evade detection.

  • Nop Generator Modules: Create NOP sleds for buffer overflows.

  • Listener Modules: Set up a listener for incoming connections.

Meterpeter

System information

Get system info

Get current user

Network

port fowarding

add route to the routing table

more useful commands

File System

commands with l prefix operate on the local system.

meterpeter allows extra file system commands like download or upload files from the local system to the target.

Channels

Meterpeter Post Exploitation

How long the system is in idle which indicates if it's in use.

Elevate to system using Token impersonation methods automatically.

migrating meterpeter process to other process.

MSFVenom

Payloads

Search payloads for target platform

Create executable payloads

Generating shell code

Generating obfuscated shell code with bad words:

Multi Handler

oneliner for multi handler

References

Last updated