Exploitationpenetration-testingreconnaissancediscoveryexploitationautomationnetwork

Legion

Semi-automated network penetration testing tool that aids in discovery, reconnaissance and exploitation of information systems. Legion is a fork of SECFORCE’s Sparta.

Description

Legion is an open source, easy-to-use, super-extensible and semi-automated network penetration testing tool. It assists security professionals and penetration testers in the discovery, reconnaissance, and exploitation phases of assessing information systems.

The tool integrates numerous dependencies including Nmap, Metasploit, Nikto, SQLMap, and others to provide a comprehensive testing environment. It supports both GUI and headless operation modes for flexibility in different testing scenarios.

As a fork of Sparta, Legion maintains a familiar interface while adding new features like staged scanning and AI integration capabilities.

How It Works

Legion orchestrates multiple scanning and exploitation tools through a semi-automated workflow. It performs host discovery, service enumeration, vulnerability scanning, and exploitation using integrated tools like Nmap for discovery, Metasploit for exploitation, Nikto and SQLMap for web vulnerabilities, and Hydra/Medusa for brute-forcing. The tool supports staged scanning approaches and can operate in both GUI and CLI/headless modes with extensible action modules.

Installation

bash
sudo apt install legion

Flags

-h, --helpshow this help message and exit
--mcp-serverStart MCP server for AI integration
--headlessRun Legion in headless (CLI) mode
--input-file INPUT_FILEText file with targets (hostnames, subnets, IPs, etc.)
--discoveryEnable host discovery (default: enabled)
--staged-scanEnable staged scan
--output-file OUTPUT_FILESpecify output file
--run-actionsRun predefined actions

Examples

Display help message and usage information
legion -h
Start Legion in headless (CLI) mode
legion --headless
Start MCP server for AI integration
legion --mcp-server
Run Legion with targets from input text file
legion --input-file targets.txt
Enable host discovery (default behavior)
legion --discovery
Enable staged scanning approach
legion --staged-scan
Save scan results to specified output file
legion --output-file results.json
Execute predefined actions/workflows
legion --run-actions
Updated 2026-04-16kali.org ↗