Knowledgebase
  • Welcome!
  • Threats
    • Software
      • Malware
      • Ransomware
      • Macros
    • Hardware
      • Flipper Zero
        • Firmware
          • 🐬flipperzero
            • Getting Started
          • 🐬flipper-xtreme
            • Wiki
              • Key Combos
              • Generic Guides
              • iButton key file format
              • SubGhz
              • How to add new SubGHz frequencies
              • Sub-GHz Remote
              • LF RFID key file format
              • NFC Flipper File Formats
              • Infrared Flipper File Formats
              • BadKB
              • Asset Packs
              • Unit tests
              • OTA Updates
              • How To Build
              • Hardware Targets
              • Flipper Build Tool
              • FAP (Flipper Application Package)
              • Flipper Application Manifests (.fam)
          • 🐬roguemaster
          • 🐬unleashed
    • Human
      • Advanced Persistent Threats (APTs)
      • Social engineering
      • Phishing
      • Typosquatting
    • Disinformation
      • Black Propaganda
      • White Propaganda
      • Grey Propaganda
      • Info Warfare
      • Political Warfare
      • Astroturfing
      • Greenwashing
      • Bluewashing
      • Whisper Campaigns
      • Push Polling
      • "Joe Jobs"
      • False Flags
      • Deep Fakes
  • About
    • Ports
      • 20
      • 21
      • 22
      • 23
      • 25
      • 587
      • 2323
      • 53
      • 80
      • 194
  • Tools
    • Radio Frequency & SubGHZ
      • gnuradio
      • hackrf
    • Digital Forensics
      • afflib
    • Reverse Engineering
      • binwalk
      • radare2
    • Hardware & Virtualization
      • qemu
      • freerdp2
      • util-linux
      • lvm2
    • VPN Providers
      • ProtonVPN
      • NordVPN
      • ExpressVPN
      • Surfshark
      • CyberGhost
      • Private Internet Access
    • Database, Cloud, & Firewalls
      • sqlmap
      • cewl
      • gobuster
      • fwbuilder
      • clamav
    • Enumeration & Lists
      • crunch
      • aflplusplus
      • ffuf
      • maltego
        • maltego-teeth
      • getallurls
    • Penetration Testing
      • beef-xss
      • wifite
      • burpsuite
      • metasploit-framework
    • Passwords & Auth
      • john
      • hashcat
      • hydra
      • cryptsetup
    • Surface Intelligence
      • theharvester
      • subfinder
      • dsniff
      • dnsrecon
      • dirb
      • nikto
      • legion
      • spiderfoot
    • Networks & Wireless
      • nmap
      • impacket-scripts
      • tcpdump
      • traceroute
      • wireshark
      • responder
      • aircrack-ng
      • netcat
      • kismet
      • ubertooth
      • routersploit
      • apache2
      • ettercap
      • bettercap
      • bettercap-ui
      • freeradius
      • bind9
      • samba
      • net-snmp
      • tcpreplay
    • Social Media
      • sherlock
    • Miscellaneous
      • git
      • libnfc
      • llvm-defaults
  • Operating Systems
    • Ubuntu
      • Installation
        • Switching
          • From Windows
          • From macOS
          • From a different Linux
        • Applications
        • Ubuntu PreInstalled
    • Linux Mint
      • Installation Guide
        • Verify your ISO image
        • Choose the right edition
        • Boot Linux Mint
        • Create the bootable media
        • Install Linux Mint
        • Hardware drivers
        • Language support
        • EFI
        • Multimedia codecs
        • System snapshots
        • Pre-installing Linux Mint (OEM Installation)
        • Where to find help
        • Boot options
        • Partitioning
        • Multi-boot
      • User Guide
        • Grub Boot Menu
        • Snap Store
        • Chromium
        • Bluetooth
        • Windows ISOs and multiboot USB
        • How to upgrade to Linux Mint 20
        • Edge ISO Images
        • Lost Password
        • Upgrades
        • Printers and Scanners
        • How to upgrade to Linux Mint 21
      • Troubleshooting Guide
        • Expectation
        • Responsibility
        • Change
        • Reproducibility
        • Observation
        • Environment
        • What
        • When
        • Why
        • Errors
        • Where
        • How
      • Translation Guide
        • Using Launchpad
        • Verify your translations
        • Localization
      • Developer Guide
        • Getting Started
          • Setup
          • Technology
        • Mint Tools
        • Cinnamon
        • XApps
        • Development
          • Daily Builds
          • Coding Guidelines
          • Optimizing JS with Cinnamon
          • Building
    • Kali Linux
      • Installation
        • Installing Kali Linux
        • Bare-bones Kali
        • Installing Kali on Mac Hardware
        • Dual Booting Kali with Linux
        • Making a Kali Bootable USB Drive
        • Dual Booting Kali with macOS/OS X
        • Dual Booting Kali with Windows
        • BTRFS Install (Kali Unkaputtbar)
        • Deploying Kali over Network PXE/iPXE Install
      • Virtualization
        • Running Kali Linux as a Virtual Machine in Windows
        • Installing VMware on Apple Silicon (M1/M2) Macs (Host)
        • Customizing a Kali Vagrant Vagrantfile
        • Kali inside Proxmox (Guest VM)
        • Installing VMware on Kali (Host)
        • Installing VirtualBox on Kali (Host)
        • Import Pre-Made Kali VMware VM
        • Kali inside Parallels (Guest VM)
        • Kali inside Vagrant (Guest VM)
        • Kali inside VMware (Guest VM)
        • Kali inside VirtualBox (Guest VM)
        • Import Pre-Made Kali VirtualBox VM
        • Kali inside Hyper-V (Guest VM)
        • Kali inside UTM (Guest VM)
        • Kali inside QEMU/LibVirt with virt-manager (Guest VM)
        • Improving Virtual Machine Performance for VMware
        • Installing VMware Tools (Guest Tools)
        • Installing VirtualBox Guest Addition (Guest Tools)
        • Installing Hyper-V Enhanced Session Mode (Guest Tools)
        • Converting VMX to an OVA
      • USB
        • Making a Kali Bootable USB Drive (Linux)
        • Making a Kali Bootable USB Drive (macOS/OS X)
        • Updating Kali Linux on USB
        • Making a Kali Bootable USB Drive on Windows
        • Standalone Kali Linux 2021.4 Installation on a USB Drive, Fully Encrypted
        • Adding Persistence to a Kali Linux Live USB Drive
        • Adding Encrypted Persistence to a Kali Linux Live USB Drive
        • USB Boot in VirtualBox
        • USB Boot in VMware
      • Kali On ARM
        • BeagleBone Black
        • Acer Tegra Chromebook 13" (Nyan)
        • ASUS Chromebook Flip (Veyron)
        • Banana Pro
        • Banana Pi
        • CubieBoard2
        • CuBox-i4Pro
        • CubieTruck (CubieBoard3)
        • Gateworks Newport
        • CuBox
        • Gateworks Ventana
        • NanoPi NEO Plus2
        • NanoPi2
        • Mini-X
        • NanoPC-T3
        • ODROID-C0/C1/C1+
        • ODROID-XU3
        • ODROID-U2/U3
        • ODROID-C2
        • Pinebook
      • Containers
        • Kali Linux LXC/LXD Images
        • Official Kali Linux Docker Images
        • Installing Docker on Kali Linux
        • Using Kali Linux Docker Images
        • Using Kali Linux Podman Images
      • WSL
        • Win-KeX SL
        • Win-KeX ESM
        • Preparing a system for WSL
        • Win-KeX
        • Win-KeX Win
      • Cloud
        • Digital Ocean
        • AWS
        • Azure
        • Linode
      • Kali NetHunter
        • Installing NetHunter On the OnePlus 7
        • Installing NetHunter On the Gemini PDA
        • Installing NetHunter
        • Installing NetHunter On the TicWatch Pro 3
        • Installing NetHunter On the TicWatch Pro
        • NetHunter Application - Terminal
        • NetHunter BadUSB Attack
        • NetHunter Bluetooth-Arsenal
        • NetHunter Chroot Manager
        • NetHunter Components
        • NetHunter Custom Commands
        • NetHunter Home Screen
        • NetHunter DuckHunter Attacks
        • NetHunter HID Keyboard Attacks
        • NetHunter Exploit Database SearchSploit
        • NetHunter Kali Services
        • NetHunter MAC Changer
        • NetHunter MANA Evil Access Point
        • NetHunter Man In The Middle Framework
        • NetHunter KeX Manager
      • Tools
        • Installing Tor Browser on Kali Linux
        • Kali Tools
        • Installing snapd on Kali Linux
        • Metasploit Framework
        • Installing Flatpak on Kali Linux
        • Submitting tools to Kali
        • Removed Tools From Kali
      • Troubleshooting
        • Discovering Problems With Download Speed
        • Common Cloud Based Setup Information
        • The Basics of Troubleshooting
        • Troubleshooting Installations Failures
        • Troubleshooting Wireless Drivers
        • Minimum Install Setup Information
      • Kali Development
        • Contributing run-time tests with autopkgtest
        • Custom CuBox Image
        • Custom Beaglebone Black Image
        • Custom EfikaMX Image
        • Custom Chromebook Image
        • Custom MK/SS808 Image
        • Custom Raspberry Pi Image
        • Custom ODROID X2 U2 Image
        • Setting up a system for packaging
        • Intermediate packaging step-by-step example
        • Introduction to packaging step-by-step example
        • Getting the best out of the Kali Bot
        • Advanced Packaging Step-By-Step Example (FinalRecon & Python-icmplib)
        • Generate an Updated Kali ISO
        • Creating A Custom Kali ISO
        • Building Custom Kali ISOs
        • Rebuilding a Source Package
        • Recompiling the Kali Linux Kernel
        • ARM Build Scripts
        • Preparing a Kali Linux ARM chroot
    • Arch Linux
      • Installation Guide
      • Frequently Asked Questions
      • General Recommendations
      • Applications
        • Office & Docs
        • Internet
        • Multimedia
        • Science
        • Security
        • Utilities
        • Others
      • Arch compared to other distributions
    • NetBSD
      • Calls and Errors
      • Libraries
      • Lua Modules
      • Devices and Drivers
  • Law, Policy, and Ethics
    • Fair Use
    • DMCA
      • 🗄️Notable Cases
        • MGM Studios Inc. v. Grokster, Ltd.
        • Viacom International, Inc v YouTube, Inc
        • Capitol Records, Inc. v. Thomas-Rasset
        • Perfect 10, Inc. v. Amazon.com
        • Recording Industry Association of America (RIAA) v. Diamond Multimedia Systems, Inc.
        • A&M Records, Inc. v. Napster, Inc.
        • BMG Music v. Gonzalez
        • Sony Computer Entertainment America (SCEA) v. Connectix Corp.
        • Columbia Pictures Industries, Inc. v. Fung
        • Warner Bros. Entertainment Inc. v. RDR Books
        • BMG Music v. John Doe
        • Universal Music Group v. Veoh Networks, Inc.
        • Universal Music Group v. MySpace, Inc.
        • UMG Recordings, Inc. v. MP3.com, Inc.
        • Cartoon Network LP v. CSC Holdings, Inc.
        • Metro-Goldwyn-Mayer Studios Inc. v. Grokster, Ltd.
        • Viacom International Inc. v. Google Inc.
        • Tiffany (NJ) Inc. v. eBay Inc.
        • Perfect 10, Inc. v. Visa International Service Association
        • Universal City Studios Productions LLLP v. Reimerdes
        • Recording Industry Association of America (RIAA) v. Lime Group LLC
        • Sony BMG Music Entertainment v. Tenenbaum
        • Viacom International Inc. v. Time Warner Cable Inc.
        • UMG Recordings, Inc. v. Shelter Capital Partners LLC
        • Sony Computer Entertainment America Inc. v. Bleem LLC
        • Universal City Studios, Inc. v. Corley
        • Ticketmaster Corp. v. Tickets.com, Inc.
        • Authors Guild, Inc. v. Google, Inc.
        • Perfect 10, Inc. v. Cybernet Ventures, Inc.
        • Tiffany (NJ) Inc. v. Ningbo Beyond Home Textile Co., Ltd.
        • Google Inc. v. American Blind & Wallpaper Factory, Inc.
        • Columbia Pictures Industries, Inc. v. Redd Horne, Inc.
Powered by GitBook
On this page
  • Fix NMAP 7.92 Sefgaults under Kali
  • 🍿 Features
  • 🌉 Supported Distributions
  • 💻 Installation
  • 🏗 Development
  • ⚖️ License
  • ⭐️ Attribution
  • Packages and Binaries:

Was this helpful?

Edit on GitHub
  1. Tools
  2. Surface Intelligence

legion

Legion is an open-source, customizable network penetration testing framework by GoVanguard, based on Sparta, aiding in discovery and exploitation of information systems.

PreviousniktoNextspiderfoot

Last updated 4 months ago

Was this helpful?

Legion, a fork of SECFORCE's Sparta, is an open source, easy-to-use, super-extensible, and semi-automated network penetration testing framework that aids in discovery, reconnaissance, and exploitation of information systems. is developed and maintained by . More information about Legion, including the , can be found on its project page at .

If you are interested in contributing to Legion, join our .

Fix NMAP 7.92 Sefgaults under Kali

Install NMAP 7.93 using the following:

sudo apt install snapd -y
sudo systemctl enable --now snapd.apparmor
sudo systemctl start snapd
sudo snap install nmap
sudo mv /usr/bin/nmap /usr/bin/nmap-7.92
sudo ln -s /snap/bin/nmap /usr/bin/nmap

Then verify the version is 7.93 with: nmap -v

Update the apparmor profile: vi /var/lib/snapd/apparmor/profiles/snap.nmap.nmap

Goto line 300, create new line and add in:

owner @{HOME}/.local/share/legion/tmp/** rw,
/etc/ssl/kali.cnf r,

Reboot

🍿 Features

  • Automatic recon and scanning with NMAP, whataweb, nikto, Vulners, Hydra, SMBenum, dirbuster, sslyzer, webslayer and more (with almost 100 auto-scheduled scripts).

  • Easy to use graphical interface with rich context menus and panels that allow pentesters to quickly find and exploit attack vectors on hosts.

  • Modular functionality allows users to easily customize Legion and automatically call their own scripts/tools.

  • Multiple custom scan configurations ideal for testing different environments of various size and complexity.

  • Highly customizable stage scanning for ninja-like IPS evasion.

  • Automatic detection of CPEs (Common Platform Enumeration) and CVEs (Common Vulnerabilities and Exposures).

  • Ties CVEs to Exploits as detailed in Exploit-Database.

  • Realtime auto-saving of project results and tasks.

Notable changes from Sparta

  • Refactored from Python 2.7 to Python 3.6 and the elimination of deprecated and unmaintained libraries.

  • Upgraded to PyQT5, increased responsiveness, less buggy, more intuitive GUI that includes features like:

    • Task completion estimates

    • 1-Click scan lists of ips, hostnames and CIDR subnets

    • Ability to purge results, rescan hosts and delete hosts

    • Granular NMAP scanning options

  • Support for hostname resolution and scanning of vhosts/sni hosts.

  • Revise process queuing and execution routines for increased app reliability and performance.

  • Simplification of installation with dependency resolution and installation routines.

  • Realtime project auto-saving so in the event some goes wrong, you will not lose any progress!

  • Docker container deployment option.

  • Supported by a highly active development team.

Demo (GIF)

🌉 Supported Distributions

Docker runIt script support

RunIt script (docker/runIt.sh) supports:

  • Ubuntu 18

  • Fedora 30

  • ParrotOS

  • Kali Linux

It is possible to run the docker image on any Linux distribution, however, different distributions have different hoops to jump through to get a docker app to be able to connect to the X server. Everyone is welcome to try to figure those hoops out and create a PR for runIt.

Traditional installation support

We can only promise correct operation on Ubuntu 18 using the traditional installation at this time. While it should work on ParrotOS, Kali, and others, until we have Legion packaged and placed into the repos for each of these distros, it is musical chairs in regard to platform updates changing and breaking dependencies.

💻 Installation

Two installation methods available:

It is preferable to use the Docker method over a traditional installation. This is because of all the dependency requirements and the complications that occur in environments which differ from a clean, non-default installation.

NOTE: Docker versions of Legion are unlikely to work when run as root or under a root X!

Docker method

Docker method includes support for various environments, choose the one that works for you.

Linux with local X11

Assumes Docker and X11 are installed and set up (including running Docker commands as a non-root user).

It is critical to follow all the instructions for running as a non-root user. Skipping any of them will result in complications getting Docker to communicate with the X server.

Within Terminal:

git clone https://github.com/GoVanguard/legion.git
cd legion/docker
chmod +x runIt.sh
./runIt.sh

Linux with remote X11

Assumes Docker and X11 are installed and set up.

Replace X.X.X.X with the IP address of the remote running X11.

Within Terminal:

git clone https://github.com/GoVanguard/legion.git
cd legion/docker
chmod +x runIt.sh
./runIt.sh X.X.X.X

Windows under WSL using Xming and Docker Desktop

Assumes:

  • Xming is installed in Windows.

  • Docker Desktop is installed in Windows

  • Docker Desktop is running in Linux containers mode

  • Docker Desktop is connected to WSL.

Replace X.X.X.X with the IP address with which Xming has registered itself. Right click Xming in system tray -> View log and see IP next to "XdmcpRegisterConnection: newAddress"

Within Terminal:

git clone https://github.com/GoVanguard/legion.git
cd legion/docker
sudo chmod +x runIt.sh
sudo ./runIt.sh X.X.X.X

Windows using Xming and Docker Desktop without WSL

Why? Don't do this. :)

OSX using XQuartz

Configuring Docker

Setting up Docker on Linux

To install Docker components typically needed and add set up the environment for Docker, under a term, run:

sudo apt-get update
sudo apt-get install -y docker.io python3-pip -y
sudo groupadd docker
pip install --user docker-compose

Setup Docker to allow non-root users

To enable non-root users to run Docker commands, under a term, run:

sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock
sudo xhost +local:docker

Setup Hyper-V, Docker Desktop, Xming and WSL

The order is important for port reservation reasons. If you have WSL, HyperV, or Docker Desktop installed then please uninstall those features before proceeding.

  • Cortana / Search -> cmd -> Right click -> Run as Administrator

  • To reserve the Docker port, under CMD, run:

    netsh int ipv4 add excludedportrange protocol=tcp startport=2375 numberofports=1
    • This will likely fail if you have Hyper-V already enabled or Docker Desktop installed

  • To install Hyper-V, under CMD, run:

    dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
  • Reboot

  • Cortana / Search -> cmd -> Right click -> Run as Administrator

  • To install WSL, under CMD, run:

    dism.exe /Online /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux
  • Reboot

  • Run installer

  • Optionally input your Docker Hub login

  • Right click Docker Desktop in system tray -> Switch to Linux containers

    • If it says Switch to Windows containers then skip this step, it's already using Linux containers

  • Right click Docker Desktop in system tray -> Settings

  • General -> Expose on localhost without TLS

  • Run installer and select multi window mode

  • Open Microsoft Store

  • Install Kali, Ubuntu or one of the other WSL Linux Distributions

  • Open the distribution, let it bootstrap and fill in the user creation details

  • To install Docker components typically needed and add set up the environment for Docker redirection, under the WSL window, run:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install -y docker-ce python-pip -y
    sudo apt autoremove
    sudo usermod -aG docker $USER
    pip install --user docker-compose
    echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc
  • Test Docker is reachable with:

    docker images

Traditional installation method

Please use the Docker image where possible! It's becoming very difficult to support all the various platforms and their own quirks.

Assumes Ubuntu, Kali or Parrot Linux is being used with Python 3.6 installed.

Within Terminal:

git clone https://github.com/GoVanguard/legion.git
cd legion
sudo chmod +x startLegion.sh
sudo ./startLegion.sh

🏗 Development

Executing test cases

To run all test cases, execute the following in root directory:

python -m unittest

Modifying Configuration

The configuration of selected ports and associated terminal actions can be easily modified by editing the legion.conf file.

[StagedNmapSettings] defines what ports will be scanned in sequential order as well as any NSE scripts that will be called.

[SchedulerSettings] defines what actions will occur automatically based upon port scan results.

sudoedit /root/.local/share/legion/legion.conf

⚖️ License

⭐️ Attribution

  • The initial Sparta Python 2.7 codebase and application design is credited SECFORCE.

  • Several additional PortActions, PortTerminalActions and SchedulerSettings are credited to batmancrew.

  • The nmap XML output parsing engine was largely based on code by yunshu, modified by ketchup and modified SECFORCE.

  • ms08-067_check script used by smbenum.sh is credited to Bernardo Damele A.G.

  • Legion relies heavily on nmap, hydra, python, PyQt, SQLAlchemy and many other tools and technologies, so we would like to thank all of the people involved in the creation of those.

  • Special thanks to Dmitriy Dubson for his continued contributions to the project!

Packages and Binaries:

legion

This package contains an open source, easy-to-use, super-extensible and semi-automated network penetration testing tool that aids in discovery, reconnaissance and exploitation of information systems.

Legion is a fork of SECFORCE’s Sparta.

Installed size: 3.12 MB How to install: sudo apt install legion

Dependencies:
  • cutycapt

  • figlet

  • finger

  • hping3

  • hydra

  • ldap-utils

  • medusa

  • nbtscan

  • nfs-common

  • nikto

  • nmap

  • python3

  • python3-aiohttp

  • python3-aioredis

  • python3-apscheduler

  • python3-colorama

  • python3-impacket

  • python3-pandas

  • python3-pyexploitdb

  • python3-pyfiglet

  • python3-pyqt5

  • python3-pyshodan

  • python3-quamash

  • python3-service-identity

  • python3-six

  • python3-sqlalchemy

  • python3-termcolor

  • rpcbind

  • rwho

  • smbclient

  • sparta-scripts

  • sqlmap

  • sslscan

  • wapiti

  • whatweb

  • x11-apps

  • xauth

  • xsltproc

  • xvfb

legion

:~# legion -h
 _     _____ ____ ___ ___  _   _ 
| |   | ____/ ___|_ _/ _ \| \ | |
| |   |  _|| |  _ | | | | |  \| |
| |___| |__| |_| || | |_| | |\  |
|_____|_____\____|___\___/|_| \_|
                                 

Updated on: 2022-Nov-16


See detailed instructions to set up Docker and enable running containers as non-root users and granting Docker group SSH rights .

See detailed Docker instructions

Not yet in runIt.sh script. Possible to set up using socat. See

Download from (Free account required)

Download

Legion is licensed under the GNU General Public License v3.0. Take a look at the for more information.

Refactored Python 3.6+ codebase, added feature set and ongoing development of Legion is credited to

Legion
GoVanguard
roadmap
https://GoVanguard.com/legion
Legion Keybase Team
Docker method
Traditional installation method
Linux with local X11
Linux with remote X11
Windows under WSL
⚠️ Windows without WSL
⚠️ OSX using XQuartz
here
here
here
instructions here
https://hub.docker.com/editions/community/docker-ce-desktop-windows
https://sourceforge.net/projects/xming/files/Xming/6.9.0.31/Xming-6-9-0-31-setup.exe/download
LICENSE
GoVanguard