How marven11/fenjing works
Main Components
• Command-Line Interface (CLI): Modules like fenjing/cli.py and the __main__.py serve as the entry point for command-line usage (e.g., “scan”, “crack”, “crack-request”, etc.).
• Web UI Component: The fenjing/webui.py module along with its associated templates (in fenjing/templates) handles the web interface, allowing users to interactively launch scans and view results.
• Payload Generation Engine: This is the core of the project and includes modules such as fenjing/payload_gen.py and fenjing/full_payload_gen.py. It leverages a defined set of bypass “rules” (located under fenjing/rules) that encapsulate how to generate and adjust payloads to bypass the WAF.
• Cracker/Attack Module: Modules like fenjing/cracker.py and fenjing/shell_payload.py take the generated payloads and execute the attack logic (for instance, “crack”, “crack-path”, or “crack-request” operations).
• Network/Request Handler: Components such as fenjing/requester.py and fenjing/submitter.py manage HTTP interactions (sending payloads via GET/POST, handling responses, etc.).
• Utility and Configuration Modules: Files such as fenjing/config_payload.py, fenjing/options.py, fenjing/context_vars.py, and the “const” module consolidate configuration, context, and shared constants across the system.
• Testing and Example Components: The “tests” directory and example files (example.py, examples.md) indicate a well-tested design and provide usage demonstrations.
Relationship and Interaction Flow
◦ The user begins by invoking a command (via CLI or Web UI).
◦ The CLI/Web UI layer captures user inputs such as target URLs, method of attack, and options (e.g., scan, crack, etc.).
◦ This input is then directed to the Payload Generation Engine, which:
• Consults the rules engine (fenjing/rules) to generate payloads using various bypass techniques (handling key characters, natural numbers, and complex string assembly).
• May also work with the config (via config_payload) to adjust payload settings, ensuring shorter expressions or proper variable substitutions.
◦ Once payloads are generated, the Cracker/Attack module takes over to craft and dispatch HTTP requests to the target. This frequently works with the Network/Request Handler to send the payloads through GET, POST, or even by reading from a prepared request file.
◦ Responses may be processed and fed back to the user interface (CLI output or Web UI rendering), possibly with additional interactive components for further intervention (see the “interactive-panel” template).
Architectural Patterns and Principles
• Modularity: The project is divided into clear modules for CLI, Web UI, payload generation, and network interactions.
• Separation of Concerns: Each module (from rule-based payload generation to actual request sending) is clearly isolated, aiding testing and extensibility.
• Extensibility: The “rules” folder and many configuration/utility modules demonstrate a design that allows new payload generation techniques to be incorporated seamlessly.
• Automation: The end-to-end flow—from scanning a target, generating payloads automatically (using predefined rules), to executing an attack—is a key design goal.