A demo service showcasing Nuclei vulnerability scanning capabilities.
Find a file
2025-05-11 23:23:07 +03:30
cmd Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
docker Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
internal Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
scripts Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
.env.template Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
.gitignore init 2025-05-11 22:55:42 +03:30
build.sh Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
Dockerfile Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
go.mod Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
go.sum Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
LICENSE Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30
README.md Update README to reflect the service as a demo for Nuclei vulnerability scanning capabilities. 2025-05-11 23:23:07 +03:30
setup.bash Initial commit of the Nuclei Service project, including server configuration, Docker setup, PostgreSQL database schema, and core application logic for managing vulnerability scans. Added essential files such as README, environment configuration, and build scripts. 2025-05-11 23:04:41 +03:30

Nuclei Service

A demo service showcasing Nuclei vulnerability scanning capabilities.

Overview

This service provides a robust API for managing Nuclei vulnerability scans, template management, and result storage. It's designed to handle high-volume scanning operations while maintaining performance and reliability. The service includes a background worker for processing scans asynchronously and storing results in PostgreSQL.

Key Features

  • REST API for scans and templates
  • PostgreSQL storage
  • Docker deployment
  • Zap logging
  • Demo vulnerable routes
  • Configurable scans
  • Async processing
  • Status tracking
  • Build automation

Requirements

  • Go 1.21+
  • PostgreSQL 12+
  • Docker & Docker Compose
  • Nuclei (for local dev)

Quick Start

  1. Clone and setup:
git clone https://github.com/danial2026/nuclei-service-demo.git
cd nuclei-service-demo
./setup.bash
  1. Configure your environment:
# Edit .env with your settings
vim .env
  1. Launch with Docker:
docker-compose up --build

Project Structure

.
├── cmd/                    # Application entry points
├── internal/              # Private application code
│   ├── model/            # Data models
│   ├── repository/       # Database operations
│   ├── service/          # Business logic
│   └── server/           # HTTP server and handlers
├── docker/               # Docker-related files
├── scripts/              # Utility scripts
├── build.sh             # Build script
├── setup.bash           # Setup script
├── Dockerfile           # Main service Dockerfile
└── docker-compose.yml   # Docker Compose configuration

API Reference

Templates

List Templates

GET /api/v1/templates

Query Parameters:

  • tags: Filter by template tags
  • author: Filter by template author
  • severity: Filter by severity level
  • type: Filter by template type

Response:

[
  {
    "id": "string",
    "name": "string",
    "author": "string",
    "tags": ["string"],
    "severity": "string",
    "type": "string",
    "description": "string",
    "created_at": "string",
    "updated_at": "string"
  }
]

Get Template Details

GET /api/v1/templates/{id}

Refresh Template Cache

POST /api/v1/templates/refresh

Scans

List Scans

GET /api/v1/scans

Query Parameters:

  • status: Filter by scan status
  • target: Filter by target URL
  • template_id: Filter by template ID

Start New Scan

POST /api/v1/scans

Request:

{
  "target": "string",
  "template_ids": ["string"],
  "tags": ["string"],
  "options": {
    "concurrency": 10,
    "rate_limit": 100,
    "timeout": 30,
    "retries": 3,
    "headless": false
  }
}

Get Scan Results

GET /api/v1/scans/{id}/results

Demo Server

The service includes a demo server that exposes intentionally vulnerable endpoints for testing purposes. These endpoints simulate common security vulnerabilities and can be used to test the Nuclei scanner.

Vulnerable Endpoints

  1. Open Redirect
GET /vuln/openredirect?redirect=<url>

Vulnerable to open redirect attacks.

  1. Oracle Fatwire LFI
GET /vuln/lfi-fatwire?fn=<file_path>

Vulnerable to Local File Inclusion attacks.

  1. HiBoss RCE
GET /vuln/hiboss-rce?ip=<ip_address>

Vulnerable to Remote Command Execution via ping command.

  1. ThinkPHP Arbitrary File Write
GET /vuln/thinkphp-write?content=<content>

Vulnerable to arbitrary file write operations.

  1. Zyxel Unauthenticated LFI
GET /vuln/zyxel-lfi?path=<file_path>

Vulnerable to Local File Inclusion attacks.

  1. Nuxt.js XSS
GET /vuln/nuxt-xss?stack=<payload>

Vulnerable to Cross-Site Scripting (XSS) attacks.

  1. Sick-Beard XSS
GET /vuln/sickbeard-xss?pattern=<payload>

Vulnerable to Cross-Site Scripting (XSS) attacks.

  1. Fastjson Deserialization RCE
POST /vuln/fastjson-rce

Vulnerable to Remote Code Execution via JSON deserialization.

  1. BeyondTrust XSS
GET /vuln/beyondtrust-xss?input=<payload>

Vulnerable to Cross-Site Scripting (XSS) attacks.

  1. WordPress Brandfolder Open Redirect
GET /vuln/brandfolder-redirect?url=<redirect_url>

Vulnerable to open redirect attacks.

Warning

: These endpoints are intentionally vulnerable and should only be used in controlled testing environments. Do not expose the demo server to production or untrusted networks.

Development

  1. Setup:
./setup.bash
  1. Run tests:
go test ./...
  1. Build the service:
./build.sh
  1. Start service:
go run cmd/server/main.go

Deployment

The service is containerized for easy deployment. The stack includes:

  • API service
  • PostgreSQL database
  • Nuclei scanner service
  • Background worker for scan processing

Deploy with:

docker-compose up -d

Contributing

Found a bug? Have a feature request? Contributions are welcome!

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

Contact

License

MIT License - see LICENSE for details.


Built with ❤️ by Danial | May 2025