Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use maxsize #4814

Merged
merged 3 commits into from Feb 28, 2024
Merged

use maxsize #4814

merged 3 commits into from Feb 28, 2024

Conversation

dogancanbakir
Copy link
Member

Proposed changes

Closes #4722

$ go run . -duc  -nh -retries 0 -rl 100 -bs 200 -target http://0.0.0.0:2379/debug_mode_nuclei_dump -t test.yaml -v

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.2.0-dev

                projectdiscovery.io

[VER] Started metrics server at localhost:9092
[WRN] Found 1 templates loaded with deprecated protocol syntax, update before v3 for continued support.
[INF] Current nuclei version: v3.2.0-dev (development)
[INF] Current nuclei-templates version: v9.7.6 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 49
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
[VER] [200-code] Sent HTTP request to http://0.0.0.0:2379/debug_mode_nuclei_dump
[200-code] [http] [info] http://0.0.0.0:2379/debug_mode_nuclei_dump
$ python3 test.py
Server started http://0.0.0.0:2379
GET request, Path: 1e20baa1-dbc5-4d97-aa47-8e29bffc1b36 /debug_mode_nuclei_dump
127.0.0.1 - - [28/Feb/2024 00:12:23] "GET /debug_mode_nuclei_dump HTTP/1.1" 200 -
GET request, number: Path: 1e20baa1-dbc5-4d97-aa47-8e29bffc1b36 /debug_mode_nuclei_dump finished

Checklist

  • 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)

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

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

we also have a max read size option from cli input . so we can use this code which exists on line 810-815 and move it before this logic

	// define max body read limit
	maxBodylimit := -1 // stick to default 4MB
	if request.MaxSize > 0 {
		maxBodylimit = request.MaxSize
	} else if request.options.Options.ResponseReadSize != 0 {
		maxBodylimit = request.options.Options.ResponseReadSize
	}

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

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

lgtm !

minor update - just recalled that we added this implementation in utils/http which also accepts maxBodyRead size . updated it and removed residual code

@ehsandeep ehsandeep merged commit 6abff96 into dev Feb 28, 2024
12 checks passed
@ehsandeep ehsandeep deleted the use_maxsize branch February 28, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

connection reset for response more than 4 MB (introduced in nuclei v3.1.6)
3 participants