greydgl--pentestgpt
abe3be01b4
Major rewrite of PentestGPT to use an agentic pipeline architecture: Core Changes: - New event-driven architecture with EventBus for TUI-agent decoupling - Implemented AgentController with 5-state lifecycle (IDLE->RUNNING->PAUSED->COMPLETED->ERROR) - Added AgentBackend interface with ClaudeCodeBackend implementation - Session management with file-based persistence for resumable pentests - Langfuse integration for observability and tracing Interface: - New Textual-based TUI with real-time activity feed - Keyboard shortcuts: F1 help, Ctrl+P pause, Ctrl+Q quit - Enhanced CLI with --target, --instruction, --non-interactive, --debug flags Project Structure: - Moved legacy multi-LLM version (v0.15) to legacy/ directory - New pentestgpt/core/ for agent, controller, events, session modules - New pentestgpt/interface/ for TUI and CLI components - New pentestgpt/benchmark/ for xbow benchmark integration - Comprehensive test suite in tests/ with unit and integration tests DevOps: - Docker support with Ubuntu 24.04 container - GitHub Actions CI/CD pipeline - Makefile with dev commands (test, lint, format, typecheck) - Added xbow-validation-benchmarks as submodule
21 行
578 B
Python
21 行
578 B
Python
# just a trial script to test the os module
|
|
import subprocess
|
|
|
|
# use sqlmap in the terminal
|
|
|
|
cmd = 'sqlmap -u "http://testphp.vulnweb.com/listproducts.php?cat=1" --batch --level=5 --risk=3'
|
|
|
|
# execute the command
|
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None, shell=True)
|
|
output_str = ""
|
|
while True:
|
|
output = p.stdout.readline()
|
|
if output:
|
|
print(output.decode("utf-8"), end="")
|
|
output_str += output.decode("utf-8")
|
|
if output == b"" and p.poll() is not None:
|
|
print("------end of output------")
|
|
break
|
|
|
|
print(output_str)
|