feat: added initial live DAST server implementation
Proposed changes
Added initial DAST live server implementation (experimental)
Checklist
- [x] Pull request is created against the dev branch
- [ ] All checks passed (lint, unit/integration/regression tests etc.) with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
Summary by CodeRabbit
-
New Features
- Introduced Dynamic Application Security Testing (DAST) capabilities, including server mode and reporting options.
- Added deduplication functionality for HTTP requests.
- Enhanced fuzzing options with in-scope and out-of-scope URL regex patterns.
- Added a new HTML template for displaying DAST scan reports.
- Implemented a statistics tracking module for fuzzing events.
-
Bug Fixes
- Improved error handling and validation for various configuration options.
-
Documentation
- Updated documentation to reflect new features and enhancements.
-
Tests
- Expanded test coverage for timing dependency detection and other features.
-
Chores
- Updated dependencies and cleaned up unused code.
Walkthrough
This pull request introduces significant enhancements to the Nuclei framework, focusing on Dynamic Application Security Testing (DAST) capabilities. The changes span multiple packages and introduce new features for fuzzing, server-side operations, and statistics tracking. Key additions include a DAST server mode, improved fuzzing scope management, enhanced statistics tracking, and more flexible input handling across various formats. The modifications aim to provide more granular control over security testing processes and improve the overall extensibility of the Nuclei tool.
Changes
| File/Group | Change Summary |
|---|---|
cmd/nuclei/main.go |
Added DAST server and fuzzing-related flags, integrated name generator |
go.mod |
Updated dependencies, added new packages for DAST and name generation |
internal/runner/* |
Enhanced configuration handling, added DAST option validation |
internal/server/* |
Introduced DAST server components, request handling, and scope management |
pkg/fuzz/* |
Improved fuzzing statistics tracking, analyzers, and component handling |
pkg/input/formats/* |
Modified input parsing to support io.Reader for more flexible input |
pkg/protocols/* |
Added fuzzing statistics tracking, updated HTTP client configurations |
pkg/types/types.go |
Added new options for DAST server and fuzzing scope |
Sequence Diagram
sequenceDiagram
participant User
participant NucleiCLI
participant DASTServer
participant ScopeManager
participant FuzzStatistics
participant HTTPExecutor
User->>NucleiCLI: Start with DAST server options
NucleiCLI->>DASTServer: Initialize server
DASTServer->>ScopeManager: Create scope rules
User->>DASTServer: Submit HTTP requests
DASTServer->>ScopeManager: Validate request scope
alt Request in scope
DASTServer->>HTTPExecutor: Execute request
HTTPExecutor->>FuzzStatistics: Record component events
HTTPExecutor->>FuzzStatistics: Record result events
else Request out of scope
DASTServer->>User: Skip request
end
DASTServer->>User: Provide scan results
Possibly related PRs
- projectdiscovery/nuclei#6028: The changes in the main PR, which enhance DAST features and introduce new flags for configuration, are related to the retrieved PR that adds HTTP statistics tracking, including a new flag for enabling HTTP status capturing, as both involve modifications to the command-line options and functionality of the
cmd/nuclei/main.gofile.
Suggested reviewers
- dogancanbakir
Poem
🐰 Fuzzy Rabbit's DAST Delight
In Nuclei's realm, a new light shines bright,
DAST server dancing with scopes so tight,
Payloads hopping, statistics take flight,
Testing web paths with algorithmic might,
Security leaping to a whole new height! 🕵️♀️🔍
📜 Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between d7156dcaa26db8890c31db287d639b9cdf3b8cdc and a62fd8d2b2478cb0d35e3a0c5eb3ae53d885fd81.
📒 Files selected for processing (1)
-
pkg/output/stats/waf/waf.go(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/output/stats/waf/waf.go
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Tests (macOS-latest)
- GitHub Check: Tests (windows-latest)
- GitHub Check: Tests (ubuntu-latest)
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. (Beta) -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Lint failed.
@coderabbitai resolve
:white_check_mark: Actions performed
Comments resolved.