How groshi215/cve-2024-48887-exploit works
Project type and purpose
• This is an open‑source exploitation tool (a CLI script) targeting CVE‑2024‑48887 in Fortinet FortiSwitch GUI.
• Its purpose is to automate the remote, unauthenticated password‑change exploit by:
• Checking target version
• Extracting required nonces
• Logging in or bypassing authentication
• Uploading a shell or changing the admin password
• Managing sessions, errors, and real‑time feedback
File structure
• Only README.md is present; no deeper code structure is provided.
• We infer a simple, modular script (likely Python or similar) with components for HTTP requests, parsing, session management, version checking, exploitation, error handling, and user interaction.
README for additional insights
• Core features: automated exploitation, version check, error handling, session handling, real‑time feedback.
• External dependencies implied (e.g., HTTP client library, CLI parser).
Main components
a. CLI Interface
• Accepts target IP/URL and optional flags
• Displays progress and output
b. Version Checker Module
• Sends initial request to detect firmware version
• Decides whether to proceed
c. Nonce Extractor & Parser
• Parses HTML/JSON responses to pull dynamic tokens (nonces)
d. Session Manager
• Maintains persistent cookies/headers across requests
e. Exploit Module
• Crafts the special HTTP request to change password/upload shell
f. Error Handler
• Catches HTTP or parsing failures and triggers retry or abort
g. Output/Feedback Renderer
• Formats and prints step‑by‑step status, errors, success messages
h. External Target (FortiSwitch GUI)
• Receives exploit HTTP requests and responds
Relationships and interactions
• CLI → Version Checker → (if vulnerable) → Nonce Extractor
• Nonce Extractor ↔ Session Manager maintains tokens
• Session Manager + Exploit Module → HTTP requests to Target
• Target → HTTP responses → Parser → Error Handler/Feedback
• Error Handler decides to retry or exit
• Feedback Renderer updates CLI
Architectural patterns and principles
• Modular design (each responsibility in its own module)
• Separation of concerns: parsing, session, exploitation, I/O
• Robust error handling and retry logic
• Real‑time feedback loop to the user
Detail
• Modules with technologies (e.g., “requests” library, “argparse,” shell upload endpoint).
• Use notes or call‑outs to describe retry logic, version gating, and session persistence.