This repository contains a Bash script designed to streamline the setup and deployment of a Ligolo-based Command and Control (C2) environment, along with various offensive security and reconnaissance tools. It is intended for use during adversary simulation tests, penetration tests, and red team exercises.
The provided script automates the installation and configuration of a wide range of tools commonly used in cybersecurity operations. It detects whether you are running on Ubuntu or Debian, updates the system, installs system packages, sets up Python virtual environments, fetches repositories, and configures services for offensive operations.
Key features include:
- Automated installation of system packages via APT and SNAP.
- Installation of Python packages into a dedicated virtual environment.
- Cloning and setting up offensive security tools from Git repositories.
- Configuring a persistent
/tmpdirectory. - Setting up and configuring Docker images and containers for certain tools.
- Installing Go and related tools (such as
garble). - Preparing a TUN interface for Ligolo C2 tunneling.
- Providing a unified environment ready for adversary emulation exercises.
- Ubuntu: Verified on Ubuntu variants. Specific handling for Ubuntu 24.04 and earlier versions regarding the
mlocateandplocatepackages. - Debian: Basic support with installation of
snapdand other Debian-compatible packages.
Note: Other distributions are not currently supported by this script and may fail.
Below is a categorized list of all tools and packages the script installs.
For Ubuntu:
build-essentiallibsasl2-devpython3-devlibldap2-devlibssl-devnet-toolslibreadline-devzlib1g-devgnupg2python3-venvnmapapache2docker.iohashcathydra-gtkgobusterdirbhping3johncewlsmbmapwhatwebsendemailsocatwine64
For Debian (includes the above and adds):
gitsnapdplocate(for Debian or Ubuntu 24.04) /mlocate(for other Ubuntu versions)
The script automatically determines whether to install plocate or mlocate based on the OS version.
sqlmapenum4linux
All Python packages are installed into a Python virtual environment (~/env):
wheelpyOpenSSL==24.0.0lxml==4.9.3setuptoolscertipy-adkerbrutebloodhoundimpacket
Additional Python dependencies for the cloned Git repositories are installed later.
All repositories are cloned into ~/Git:
- NetExec: Built locally with
docker build -t netexec:latest .inside theNetExecdirectory. - Nikto: Built locally from the
niktodirectory (docker build -t sullo/nikto .). - Manspider: Pulled from BlackLanternSecurity/manspider.
- Gowitness: Pulled from leonjza/gowitness.
- Go: Installed from
go1.23.2.linux-amd64.tar.gz(official Go release). - Garble: Installed using
go install mvdan.cc/garble@master.
- SecLists: Cloned into
/usr/share/wordlists/SecLists. - Ligolo-NG Proxy: Compiled from the
ligolo-ngrepository and linked to/usr/bin/lg-proxy. - DNSChef, ADIDNSDump, ADenum, ROADtools: Required Python dependencies installed after cloning.
-
Creates a
ligoloTUN adapter for Ligolo-based tunneling:sudo ip tuntap add user "$USER" mode tun ligolo sudo ip link set ligolo up
Note: After the script finishes, you will need to manually add routes and modify
/etc/hostsas necessary to map target domain controllers or other hosts to the TUN interface.
- Downloads a
routesconfiguration script (configure_routes.shandipparser.py) into~/Tools/routes/.
- Updates the system database using
updatedbfor easy file location vialocate.
- Root or Sudo Access: The script must be run with privileges that allow system changes (e.g.,
sudo). - Internet Connection: A stable internet connection is required to download packages, clone repositories, and pull Docker images.
- Compatible OS: Ubuntu (various versions) or Debian are currently supported.
-
Clone this repository:
wget https://raw.githubusercontent.com/VitoBonetti/c2-setup/refs/heads/main/multiplatform.sh
-
Make the script executable:
chmod +x multiplatform.sh
-
Run the script:
./multiplatform.sh
The script will:
- Detect your OS (Ubuntu or Debian).
- Update and upgrade system packages.
- Install the specified APT, SNAP, and PIP packages.
- Set up a Python virtual environment.
- Clone various Git repositories containing offensive security tools.
- Install Docker images for certain tools (NetExec, Nikto, Manspider, Gowitness).
- Install Go and the
garbleobfuscation tool. - Configure the Ligolo TUN adapter.
- Clone and set permissions for SecLists.
- Update the system’s
locatedatabase.
-
Post-Installation Steps:
- Check the
ligoloTUN adapter:ifconfig ligolo. - Add necessary routes and hosts to
/etc/hostsas your testing scenario requires. - Activate the Python virtual environment as needed:
and deactivate with:
source ~/env/bin/activate
deactivate
- Tools installed via Docker can be run with
sudo docker run ....
- Check the
- Missing Dependencies: If the script fails due to missing dependencies, ensure
sudoprivileges and a stable network connection. - Unsupported Distribution: The script may fail if run on unsupported distributions or significantly different OS versions.
- Manual Adjustments: Some packages or tools may require manual configuration post-installation. Check the official documentation for each tool if you encounter issues.
Contributions are welcome! If you have suggestions, improvements, or encounter issues:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request describing your modifications.