How shisones/ptconsole works
Project type and purpose
• This is an open-source CLI pentesting toolkit (“PTConsole”) written in Python.
• It provides a core console/engine that dynamically loads and runs a variety of “check” and “scan” modules against target hosts.
File structure
• Top-level scripts:
• console.py – Entry point for an interactive shell or command-line interface.
• main.py – Likely the script that parses arguments and dispatches commands.
• pentest.py – Core engine that implements module discovery, loading, and result aggregation.
• modules/ directory:
• Each “*-check.py” or “*-scan.py” file is a plugin module implementing a specific test (FTP, HTTP, RDP, SMB, SNMP, etc.).
• No database or web frontend; the system communicates directly with network targets.
Core architectural components
A. CLI Frontend
• console.py – Interactive shell environment
• main.py – Command parser (argparse, subcommands)
B. Core Engine
• pentest.py –
• Plugin manager (scans modules/ directory)
• Task scheduler/dispatcher
• Result collector and reporter
C. Plugin Layer
• modules/*.py – Individual test modules conforming to a common interface (e.g., run(target, options) → result)
D. Network/Subsystem
• Target Host(s) – External systems on which checks are performed
• Protocol libraries (e.g., socket, ftplib, paramiko)
E. Reporting/Output
• STDOUT/Log files – Where results are displayed or persisted
Relationships and interactions
• Core Engine ↔ Plugin Layer: dynamically load and invoke module logic
• Plugin Layer → Network/Subsystem: open connections and perform scans
• Plugin Layer → Core Engine: return results
• Core Engine → Reporting/Output: format and present findings
Architectural patterns and principles
• Plugin architecture: decouples new checks from core logic
• Dependency injection via a common module interface
• Single responsibility: each module handles one protocol/service
• Core orchestrator (engine) manages control flow
Technologies, frameworks, libraries
• Python 3.x
• Standard libs: argparse, importlib, socket, logging
• Third-party libs (if any): paramiko (SSH), pymssql, pysnmp, nikto wrapper