HackBot v1.2.4
🚀 Shell-Free Pipeline Support (Piped Commands)
- Pipeline Execution: Implemented safe, shell-free pipeline execution (
execute()andexecute_async()) using chained subprocesses. Piped commands (e.g.nmap ... | grep open) are split and run without invoking a shell (shell=False), preventing command injection while enabling advanced filtering. - Allowed Utilities: Added common text-processing utilities (
grep,egrep,head,tail,sort,uniq,wc,awk,sed,cut,tr,cat,tee,find,xargs) to the default allowed tools list so they can be safely used as pipeline targets.
🛡️ Improved Allowlist & Script Handling
- Remediation Scripts: Added
bash,sh, andchmodto the default allowed tools list. Implemented auto-detection inrunner.pyto automatically allow execution of HackBot-generated remediation/exploit scripts saved in thereports/scriptsdirectory. - Python Compatibility: Added
pythonto the allowed list alongsidepython3to prevent commands using thepythonalias from being blocked.
🐛 Bug Fixes
- Process Group Terminate Bug: Fixed a critical bug in the process termination logic (
_kill_process) where subprocess timeouts would terminate the entire parent process group (killing pytest or HackBot itself). It now safely detects the process group ID and terminates the child process group without affecting the parent runner. - Accidental Slash Commands: Added normalization rules to automatically strip accidental trailing chat slash commands (like
/cve,/osint,/topology) when appended to tool execution commands by the AI. - Dirb Syntax Auto-Correction: Added normalization rules to auto-correct invalid
dirbsyntax (specifically stripping misplaced-aflags immediately preceding a URL). - Amass Syntax Auto-Correction: Added auto-correction for invalid
amasssubcommand/flag syntax and URL-format targets, automatically translating them into correctamass inteloramass enumcommands.
🛠️ Wfuzz Python 3.12+ Dependency Fix
- setuptools Dependency: Installed
setuptoolsin the Dockerfile to supply thepkg_resourcesmodule which was removed in Python 3.12+, resolving the wfuzz startup crash. - Pre-Install Hooks: Added support for
pre_installcommands inToolInstaller(allowingpip install setuptoolsto run automatically beforewfuzz). - Runtime Auto-Repair: Added
ToolInstaller.check_and_fix_wfuzz()to verify and dynamically fix thepkg_resourcesimport at runtime.
Files Changed
| File | Description |
|---|---|
hackbot/core/runner.py |
Added pipeline execution, script validation, process group fix, and dirb/amass/slash command auto-correction |
hackbot/config.py |
Updated default allowed tools list and added wfuzz installation recipe with pre_install hook |
hackbot/core/installer.py |
Added pre_install hook support and check_and_fix_wfuzz() runtime auto-repair |
Dockerfile |
Installed setuptools to fix wfuzz dependency issues |
tests/test_runner.py |
Updated and added unit tests for pipeline execution, Amass/Dirb auto-correction, and slash command stripping |
Full Changelog: v1.2.3...v1.2.4