toolbelt/config.py
rpriven fd0659d70c
Toolbelt v2.0 - Complete refactor with interactive menus and profiles
Major rewrite from single-file script to modular architecture with comprehensive features:

## New Features
- Interactive 3-level menu system (Main → Categories → Tools)
- Pre-built profiles: Bug Bounty, CTF, Web App, Network, Full Pentest
- Distro detection with appropriate tool sets (Kali, Debian, Ubuntu)
- NO root requirement - runs as user, uses sudo selectively
- Comprehensive logging (console + ~/toolbelt-install.log)
- Fresh CLI tool integration and detection
- Smart tool detection (skips already-installed tools)

## Architecture Changes
- Modular design: utils.py, config.py, installer.py, toolbelt.py
- utils.py: Distro detection, logging setup, helper functions
- config.py: Tool definitions, profiles, category metadata
- installer.py: Installation logic for all tool categories
- toolbelt.py: Interactive menu system and main flow

## Improvements
- Fixed $HOME path resolution bug (no more /root issues)
- Added comprehensive error handling and reporting
- Category-based tool organization (APT, Go, /opt, Python, Docker, Scripts)
- Parallel Go tool installation with ThreadPoolExecutor
- Shell alias setup for Docker tools

## Documentation
- Complete README rewrite with usage examples
- Architecture diagrams and file structure
- Integration guide for fresh ecosystem
- Version history and changelog

## Archived Files
- toolbelt.sh → toolbelt.sh.old (legacy bash version)
- toolbelt.py → toolbelt_old.py (original Python v1.0)

Part of the Djedi security tooling ecosystem integration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 23:17:41 -06:00

315 lines
9.5 KiB
Python

#!/usr/bin/env python3
"""
Djedi Toolbelt - Configuration and Tool Definitions
Defines all tools, categories, and profiles
"""
from typing import Dict, List
# ============================================================================
# Tool Categories
# ============================================================================
# APT Tools - Available via package manager
APT_TOOLS_KALI = [
"nmap",
"masscan",
"naabu",
"nuclei",
"burpsuite",
"feroxbuster",
"nikto",
"gobuster",
"seclists",
"sqlmap",
"git",
"docker.io",
"docker-compose",
"golang-go",
"wireshark",
]
APT_TOOLS_DEBIAN = [
"nmap",
"masscan",
"nikto",
"sqlmap",
"git",
"docker.io",
"docker-compose",
"golang-go",
"wireshark",
"burpsuite", # Community edition available in some repos
]
# /opt Tools - Cloned to /opt directory
OPT_TOOLS = {
"pimpmykali": {
"url": "https://github.com/Dewalt-arch/pimpmykali",
"post_install": [
"cd /opt/pimpmykali && sudo ./pimpmykali.sh --go",
"cd /opt/pimpmykali && sudo ./pimpmykali.sh --impacket",
"cd /opt/pimpmykali && sudo ./pimpmykali.sh --upgrade"
],
"kali_only": True
},
"xnLinkFinder": {
"url": "https://github.com/xnl-h4ck3r/xnLinkFinder.git",
"post_install": ["cd /opt/xnLinkFinder && sudo python setup.py install"],
"kali_only": False
},
"knock": {
"url": "https://github.com/guelfoweb/knock.git",
"post_install": ["cd /opt/knock && pip3 install -r requirements.txt"],
"kali_only": False
},
"Sublist3r": {
"url": "https://github.com/aboul3la/Sublist3r.git",
"post_install": ["cd /opt/Sublist3r && pip install -r requirements.txt"],
"kali_only": False
},
"Striker": {
"url": "https://github.com/s0md3v/Striker.git",
"post_install": ["cd /opt/Striker && pip install -r requirements.txt"],
"kali_only": False
},
"wafw00f": {
"url": "https://github.com/EnableSecurity/wafw00f.git",
"post_install": [
"cd /opt/wafw00f && pip3 install -r requirements.txt",
"cd /opt/wafw00f && sudo python setup.py install"
],
"kali_only": False
},
"waymore": {
"url": "https://github.com/xnl-h4ck3r/waymore.git",
"post_install": [
"cd /opt/waymore && pip3 install -r requirements.txt",
"cd /opt/waymore && sudo python setup.py install"
],
"kali_only": False
},
"XSStrike": {
"url": "https://github.com/s0md3v/XSStrike.git",
"post_install": ["cd /opt/XSStrike && pip3 install -r requirements.txt"],
"kali_only": False
},
}
# Python Tools - Installed via pip3
PYTHON_TOOLS = [
"wfuzz",
"arjun",
"scrapy",
"tld",
"requests",
"fuzzywuzzy",
]
# Go Tools - Installed via go install
GO_TOOLS = {
"naabu": "github.com/projectdiscovery/naabu/v2/cmd/naabu@latest",
"nuclei": "github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest",
"katana": "github.com/projectdiscovery/katana/cmd/katana@latest",
"httpx": "github.com/projectdiscovery/httpx/cmd/httpx@latest",
"subfinder": "github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest",
"amass": "github.com/OWASP/Amass/v3/...@master",
"assetfinder": "github.com/tomnomnom/assetfinder@latest",
"httprobe": "github.com/tomnomnom/httprobe@latest",
"gowitness": "github.com/sensepost/gowitness@latest",
"subjack": "github.com/haccer/subjack@latest",
"hakrawler": "github.com/hakluke/hakrawler@latest",
"webanalyze": "github.com/rverton/webanalyze/cmd/webanalyze@latest",
}
# Docker Tools
DOCKER_TOOLS = {
"rustscan": {
"image": "rustscan/rustscan:2.0.1",
"alias": "alias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:2.0.1'"
},
}
# Useful Scripts - Downloaded to ~/scripts
USEFUL_SCRIPTS = {
"linpeas.sh": "https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh",
"jaws-enum.ps1": "https://github.com/411Hall/JAWS/raw/master/jaws-enum.ps1",
"LinEnum.sh": "https://github.com/rebootuser/LinEnum/raw/master/LinEnum.sh",
"winPEASany_ofs.exe": "https://github.com/carlospolop/PEASS-ng/releases/download/20230122/winPEASany_ofs.exe",
"php-reverse-shell.php": "https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php",
"linux-exploit-suggester.sh": "https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh",
"PowerView.ps1": "https://github.com/PowerShellMafia/PowerSploit/raw/master/Recon/PowerView.ps1",
}
# ============================================================================
# Installation Profiles
# ============================================================================
PROFILES = {
"bug-bounty": {
"name": "Bug Bounty Hunter",
"description": "Tools for bug bounty hunting and web application testing",
"categories": {
"apt": ["nmap", "masscan", "nikto", "sqlmap", "burpsuite", "git"],
"go": ["nuclei", "httpx", "subfinder", "katana", "amass", "assetfinder", "httprobe"],
"opt": ["Sublist3r", "wafw00f", "XSStrike"],
"python": ["wfuzz", "arjun", "requests"],
"scripts": True, # Install all scripts
}
},
"ctf": {
"name": "CTF Player",
"description": "Tools for Capture The Flag competitions",
"categories": {
"apt": ["nmap", "burpsuite", "sqlmap", "git", "wireshark"],
"python": ["wfuzz", "scrapy", "requests"],
"scripts": True,
}
},
"web-app": {
"name": "Web Application Testing",
"description": "Focused on web application security testing",
"categories": {
"apt": ["nmap", "nikto", "sqlmap", "burpsuite"],
"go": ["nuclei", "httpx", "katana"],
"opt": ["wafw00f", "XSStrike", "Striker"],
"python": ["wfuzz", "arjun", "scrapy"],
}
},
"network": {
"name": "Network Pentesting",
"description": "Network reconnaissance and scanning tools",
"categories": {
"apt": ["nmap", "masscan", "wireshark"],
"go": ["naabu", "amass", "assetfinder", "httprobe"],
"docker": ["rustscan"],
}
},
"full-pentest": {
"name": "Full Pentesting Arsenal",
"description": "Complete toolset for comprehensive penetration testing",
"categories": {
"apt": "all",
"go": "all",
"opt": "all",
"python": "all",
"docker": "all",
"scripts": True,
}
},
}
# ============================================================================
# Category Metadata
# ============================================================================
CATEGORIES = {
"apt": {
"name": "APT Tools",
"description": "Tools installed via apt package manager",
"icon": "📦",
"requires_sudo": True,
},
"go": {
"name": "Go Tools",
"description": "Security tools written in Go",
"icon": "🔷",
"requires_sudo": False,
},
"opt": {
"name": "/opt Tools",
"description": "Tools cloned to /opt directory",
"icon": "🔧",
"requires_sudo": True,
},
"python": {
"name": "Python Tools",
"description": "Tools installed via pip3",
"icon": "🐍",
"requires_sudo": False,
},
"docker": {
"name": "Docker Tools",
"description": "Containerized security tools",
"icon": "🐳",
"requires_sudo": False,
},
"scripts": {
"name": "Useful Scripts",
"description": "PEAS, PowerView, and other scripts",
"icon": "📜",
"requires_sudo": False,
},
}
# ============================================================================
# Helper Functions
# ============================================================================
def get_apt_tools_for_distro(distro_type: str) -> List[str]:
"""
Get appropriate APT tools list for distro
Args:
distro_type: One of 'kali', 'debian', 'ubuntu', 'unknown'
Returns:
List of APT package names
"""
if distro_type == 'kali':
return APT_TOOLS_KALI
elif distro_type in ['debian', 'ubuntu']:
return APT_TOOLS_DEBIAN
else:
# Conservative list for unknown distros
return [
"nmap",
"nikto",
"sqlmap",
"git",
"docker.io",
]
def get_opt_tools_for_distro(distro_type: str) -> Dict:
"""
Get appropriate /opt tools for distro
Args:
distro_type: One of 'kali', 'debian', 'ubuntu', 'unknown'
Returns:
Dictionary of /opt tools
"""
if distro_type == 'kali':
return OPT_TOOLS
# Filter out Kali-only tools for other distros
return {
name: config
for name, config in OPT_TOOLS.items()
if not config.get('kali_only', False)
}
def get_profile(profile_name: str) -> Dict:
"""
Get profile configuration by name
Args:
profile_name: Profile identifier
Returns:
Profile configuration dictionary or None
"""
return PROFILES.get(profile_name)
def list_profiles() -> List[str]:
"""
Get list of available profile names
Returns:
List of profile names
"""
return list(PROFILES.keys())