Contributing to Docker Images
The Docker images are the heart of the Exegol project. They contain a carefully curated selection of tools, configurations, aliases, history commands, and various customizations prepared in multiple images adapted for different uses: web hacking, Active Directory, OSINT (Open Source INTelligence), etc.
Getting started
- Fork the Exegol-images repository
- Follow the Installation Guide to set up your development environment
- Checkout the
devbranch - (optional) create a new branch in your fork, if you plan on working on different topics
- Create your content using this guide
- Make sure your changes work locally
- Stage, Commit, and Push your changes
- Submit a Pull Request (https://github.com/ThePorgs/Exegol-images/compare)
Tools
When adding a new tool to an image (or modifying a tool install function), follow these steps:
Identify which package your tool installation function should go into in the packages directory.
Create an installation function following this structure:
function install_yourtool() {
colorecho "Installing yourtool"
# tool install commands [...]
add-aliases yourtool
add-history yourtool
add-test-command "yourtool.py --help"
add-to-list "yourtool,https://link.to/the/tool,description"
}Required Components
Your installation function should include:
colorecho "Installing yourtool"- For progress loggingcatch_and_retry <command>- For commands that might fail due to network issues. Note: Most standard Internet-involved commands (git, wget, curl, go, etc.) are already transparently wrapped withcatch_and_retry. You probably won't need that.add-aliases yourtool- If your tool needs aliases. You will need to create the aliases file in/sources/assets/shells/aliases.d/named after your tool. Example:bashalias tool.py='python3 /opt/tools/yourtool/tool.py'add-history yourtool- For command examples. Create a history file in/sources/assets/shells/history.d/named after your tool. Example:bashyourtool.py --user "$USER" --password "$PASSWORD" --target "$TARGET" yourtool.py --mode enum --user "$USER" --target "$TARGET" yourtool.py --mode unauthenticatedadd-test-command "testcommand"- For CI/CD unit tests. The command must return 0 if successful. If--helpdoesn't work, try using grep:yourtool.py --help|& grep 'Usage:'add-to-list "yourtool,https://link.to/the/tool,description"- For tools list export. Format is CSV with 3 columns: name, link, description. No comma allowed in description.
Code Check Whitelisting
If your tool doesn't need aliases or history commands, add a whitelist comment at the beginning of the function:
# CODE-CHECK-WHITELIST=add-aliases
# CODE-CHECK-WHITELIST=add-aliases,add-historyInstallation Standards
Follow these standards when installing tools:
- Use virtual environments for Python tools with access to system site-packages with
--system-site-packages - Install tools in
/opt/tools/or place binaries in/opt/tools/bin/ - Use
--depth 1with git clone to save space - Use
asdffor managing tool versions (currently only for Go)
Installation Methods
# From GitHub
pipx install --system-site-packages git+https://github.com/AUTHOR/REPO
# From local sources
git -C /opt/tools/ clone --depth 1 https://github.com/AUTHOR/REPO
pipx install --system-site-packages /opt/tools/yourtool/Temporary Fixes (tempfix)
Sometimes tools have issues that need temporary fixes. Here are two approaches:
function install_TOOL() {
[...]
# git -C /opt/tools/ clone --depth 1 https://github.com/REPO/TOOL.git
local temp_fix_limit="YYYY-MM-DD"
if check_temp_fix_expiry "$temp_fix_limit"; then
git -C /opt/tools/ clone https://github.com/REPO/TOOL.git
git -C /opt/tools/TOOL checkout 774f1c33efaaccf633ede6e704800345eb313878
fi
[...]
}Multi-architecture Support
Exegol images are built for both AMD64 and ARM64 systems. When possible, ensure your tool installation works on both architectures:
if [[ $(uname -m) = 'x86_64' ]]
then
# command for AMD64
elif [[ $(uname -m) = 'aarch64' ]]
then
# command for ARM64
else
criticalecho-noexit "This installation function doesn't support architecture $(uname -m)" && return
fiTesting Your Changes
Before submitting a pull request, test your installation locally:
# Build the local image
exegol install "testimage" "full" --build-log "/tmp/testimage.log"
# Create and start a container for the tests
exegol start "testcontainer" "testimage"
# Run the tests (from the container)
cat /.exegol/build_pipeline_tests/all_commands.txt | grep -vE "^\s*$" | sort -u > /.exegol/build_pipeline_tests/all_commands.sorted.txt
python3 /.exegol/build_pipeline_tests/run_tests.py
cat /.exegol/build_pipeline_tests/failed_commands.logMy-resources
The my-resources feature allows users to customize their Exegol environment with personal configurations, tools, and scripts. When contributing to my-resources, follow these guidelines:
Documentation
Any new feature or service added to my-resources must be documented in the following places:
- Add a description in the my-resources documentation
- Include examples and usage instructions
- Document any dependencies or prerequisites
- Add any relevant configuration options
Code
The my-resources functionality is primarily managed through the load_supported_setup.sh script. When contributing code:
Follow the existing logging pattern:
bashwrapper_verbose "Your message" # For user-visible messages logger_verbose "Your message" # For log file onlyUse the appropriate logging levels:
wrapper_info/logger_info- General informationwrapper_verbose/logger_verbose- Detailed informationwrapper_warning/logger_warning- Warning messageswrapper_error/logger_error- Error messageswrapper_success/logger_success- Success messages
Structure your code following these patterns:
bashfunction deploy_your_feature() { wrapper_verbose "Deploying your feature" # Check if feature directory exists if [[ -d "$MY_SETUP_PATH/your_feature" ]]; then # Handle existing setup logger_verbose "Processing existing setup" # Your code here else # Create new setup logger_verbose "Creating new setup" mkdir -p "$MY_SETUP_PATH/your_feature" # Your code here fi }Use the standard paths:
$MY_ROOT_PATH- Root my-resources directory (/opt/my-resources)$MY_SETUP_PATH- Setup directory for user customization (/opt/my-resources/setup)
Handle errors gracefully:
bashif ! your_command; then wrapper_error "Failed to execute your_command" return 1 fiAdd your new function to the main execution flow in
load_supported_setup.sh
Additional Resources
- Credentials - For tools requiring credentials
- Ports & Services - For tools that open ports or run services