How eastsword/xuanyuansword_ainuclei works
Project type and purpose
• This is a developer tool (CLI pipeline) for collecting, generating, and running security proofs‐of‐concept (POCs) via GitHub and Deepseek, then scanning targets with Nuclei.
• Four Python scripts serve as sequential stages:
1. Download_POCs.py – fetches repositories/POC files from GitHub
2. POCGenerator.py – processes raw downloads into standardized POC definitions
3. Update_nuclei.py – injects or updates those POC definitions into your local Nuclei templates
4. Scan.py – launches Nuclei (external binary) against targets using the updated templates
File structure
• Top‐level Python scripts correspond to discrete pipeline stages.
• config.json holds API keys (Deepseek API, GitHub token) and pipeline parameters.
• nuclei_darwin_arm64 is the Nuclei binary (platform‑specific).
• nuclei_templates/ contains YAML template files (existing & newly generated).
• repo.csv is likely used to track downloaded repositories or metadata.
• No separate “src” or “lib” directories—each script is standalone but they share the same working directory and config.json.
Key insights from README
• User must swap out nuclei_darwin_arm64 for the correct binary for their OS.
• config.json must be populated with valid credentials.
• Step order is critical; step 4 (Download_POCs.py) can be optimized to avoid repeated full downloads.
Main components
a. CLI Orchestrator (could be a simple shell script or manual invocation)
b. Pipeline stages (four Python script components)
c. External Services
• GitHub API
• Deepseek API (for deep‑searching repositories/POCs)
d. External Binary
• Nuclei (nuclei_darwin_*)
e. Local Storage
• config.json (configuration data)
• repo.csv (downloaded repo metadata)
• nuclei_templates/ (YAML POC templates)
• Working directory (generated POC files)
Relationships and data flows
• The orchestrator triggers Download_POCs.py → calls GitHub API & Deepseek → writes raw POCs & metadata to repo.csv.
• POCGenerator.py reads repo.csv (and raw files), invokes logic to output standardized YAML POCs into nuclei_templates.
• Update_nuclei.py merges or copies new YAMLs from nuclei_templates into the main Nuclei template set.
• Scan.py calls the nuclei binary (nuclei_darwin_*) with the updated template directory against target URLs/hosts; outputs scan results.
• config.json is read by each script to access tokens and pipeline settings.
Architectural patterns & design principles
• Pipeline / batch‑processing pattern: clear, linear stages.
• Separation of concerns: each script does only one job.
• Externalize configuration: use config.json for secrets and thresholds.
• File‑based integration: scripts communicate by reading/writing files in a common directory.
Detail
• Component names, data stores, external service endpoints, and the scripts’ invocation order.
• Configuration dependencies and platform‑specific binary as separate nodes.