Skip to content

Added stdin pipeline support, live verbose mode, and robust error tracking - #2

Merged
R0X4R merged 3 commits into
mainfrom
dev
Jun 13, 2026
Merged

R0X4R merged 3 commits into
mainfrom
dev

Conversation

@R0X4R

@R0X4R R0X4R commented Jun 13, 2026 •

Copy link
Copy Markdown
Owner
  • Implemented dynamic pipeline scanning by reading targets directly from standard input (os.Stdin)
  • Added a safety check for scanner.Err() to catch standard input stream corruption gracefully
  • Introduced -v/-verbose flag to stream active network requests and status codes live to the terminal
  • Refactored logActivity to catch transport drops and track them as explicit [UNABLE TO CONNECT] events
  • Updated lib phase parameters to match the new explicit, structured logging format
  • Refreshed documentation layout in README.md to show stdin chaining examples

Summary by CodeRabbit

Release Notes

  • New Features

    • Added -v/--verbose CLI flag to stream live connection updates and status codes during execution
  • Documentation

    • Expanded "Operational Examples" section with guidance for piping output from other tools (subfinder, httpx, katana, gf ssrf) into ressrf
    • Added example usage of the new verbose flag
    • Clarified interaction between output suppression and verbose modes

…cking

- Implemented dynamic pipeline scanning by reading targets directly from standard input (`os.Stdin`)
- Added a safety check for `scanner.Err()` to catch standard input stream corruption gracefully
- Introduced `-v`/`-verbose` flag to stream active network requests and status codes live to the terminal
- Refactored `logActivity` to catch transport drops and track them as explicit `[UNABLE TO CONNECT]` events
- Updated `lib` phase parameters to match the new explicit, structured logging format
- Refreshed documentation layout in README.md to show stdin chaining examples
@R0X4R R0X4R added this to the Add new features milestone Jun 13, 2026
@R0X4R R0X4R self-assigned this Jun 13, 2026
@R0X4R R0X4R added the enhancement New feature or request label Jun 13, 2026
@coderabbitai

coderabbitai Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@R0X4R, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae3b606a-47be-4aa8-a633-6e06ae07be55

📥 Commits

Reviewing files that changed from the base of the PR and between 1d044fc and 2689f60.

📒 Files selected for processing (5)
  • lib/header.go
  • lib/parameter.go
  • lib/protocol.go
  • main.go
  • pkg/config.go
📝 Walkthrough

Walkthrough

This PR adds a -v/--verbose CLI flag to gate live logging output, refactors logging from variadic to structured callbacks across all executor phases, and enables reading target URLs from stdin when piped, making the tool more composable in command pipelines.

Changes

Verbose Logging and Stdin Support

Layer / File(s) Summary
Verbose option and configuration
pkg/config.go
Options struct gains Verbose bool field; package-level Verbose *bool pointer is added; -v/--verbose CLI flag is registered in ParseOptions; input file validation becomes conditional on whether InputFile is provided, allowing stdin as an alternative; EnsurePayloadsConfig logging is cleaned up.
Structured logging callback contract
lib/header.go, lib/parameter.go, lib/protocol.go
ExecuteHeaderPhase, ExecuteParameterPhase, and ExecuteProtocolPhase function signatures update logActivity parameter from variadic func(string, ...interface{}) to fixed-arity func(string, string, int, string) accepting event level, target URL, status code, and message details.
Executor phase logging call sites
lib/header.go, lib/parameter.go, lib/protocol.go
All logActivity invocations in executor phases are updated to the new structured signature. Error paths emit "ERROR" level with status 0 and error message. Success paths emit "SENT" level with response status and phase vector label. Vulnerability detection logging uses the structured format with descriptive message.
Main entry point: structured logger and stdin support
main.go
New logActivity function formats messages based on event type, colors status output for non-error events, conditionally prints to console when *pkg.Verbose is enabled, and always appends to activity.log. New hasStdinData() helper detects piped stdin. main() now reads target URLs from stdin when available (trimmed, non-empty lines), otherwise requires input file. Interrupt signal handler and OOB interaction display output are updated to use new logger and respect verbose flag.
Documentation: verbose flag and usage examples
README.md
Adds -v / --verbose flag to Reference Flags table describing live connection updates and status codes. Extends Operational Examples with pipeline composition guidance and verbose example command; includes note that -s suppresses output so should not be combined with -v in the same pipeline.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A verbose bunny hops through stdin streams,
Logging each deed in structured dreams,
From header, parameter, protocol's flight,
The pipes now sing with verbose light! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: stdin support, verbose mode, and error tracking across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #3

Docstrings generation was requested by @R0X4R.

* #2 (comment)

The following files were modified:

* `lib/header.go`
* `lib/parameter.go`
* `lib/protocol.go`
* `main.go`
* `pkg/config.go`
@coderabbitai coderabbitai Bot mentioned this pull request Jun 13, 2026

@R0X4R R0X4R left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@R0X4R R0X4R linked an issue Jun 13, 2026 that may be closed by this pull request
@R0X4R
R0X4R merged commit d34b558 into main Jun 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add verbose mode and Timeout error handling

1 participant