Legion is 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, 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. Legion is developed and maintained by GoVanguard. More information about Legion, including the roadmap, can be found on it's project page at https://GoVanguard.com/legion. If you are interested in contributing to Legion, join our Legion Keybase Team.
It is preferable to use the docker image over a traditional installation. This is because of all the dependancy 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!
RunIt supports Ubuntu 18, Fedora 30, Parrot and Kali at this time. 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.
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's musical chairs with regards to platform updates changing and breaking dependencies.
Linux with Local X11:
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 setup. - Replace X.X.X.X with the IP 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. - Assumes Docker Desktop is installed in Windows, Docker Desktop is running in Linux containers mode and Docker Desktop is connected to WSL. - See detailed instructions here - Replace X.X.X.X with the IP 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: - Not yet in runIt.sh script. - Possible to setup using socat. See instructions here: https://kartoza.com/en/blog/how-to-run-a-linux-gui-application-on-osx-using-docker/
sudo apt-get update sudo apt-get install -y docker.io python-pip -y sudo groupadd docker pip install --user docker-compose
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 - Download from https://hub.docker.com/editions/community/docker-ce-desktop-windows (Free account required) - 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 - Download https://sourceforge.net/projects/xming/files/Xming/22.214.171.124/Xming-6-9-0-31-setup.exe/download - 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 setup 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:
git clone https://github.com/GoVanguard/legion.git cd legion sudo chmod +x startLegion.sh sudo ./startLegion.sh
To run all test cases, execute the following in root directory:
python -m unittest
Legion is licensed under the GNU General Public License v3.0. Take a look at the LICENSE for more information.