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

fix curl command #4014

Merged
merged 1 commit into from
Aug 1, 2023
Merged

fix curl command #4014

merged 1 commit into from
Aug 1, 2023

Conversation

dogancanbakir
Copy link
Member

Proposed changes

This PR resolves the wrong URL issue in the curl-command field. Closes #3908.

Before:

$ go run main.go -t  ~/nuclei-templates/http/cves/2019/CVE-2019-6802.yaml -u https://test.com -jsonl -fhr

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.9.10

                projectdiscovery.io

[INF] Current nuclei version: v2.9.10 (latest)
[INF] Current nuclei-templates version: v9.6.0 (latest)
[INF] New templates added in latest release: 33
[INF] Templates loaded for current scan: 1
[INF] Targets loaded for current scan: 1

curl-command:

curl -X 'GET' -d '' -H 'Accept: */*' -H 'Accept-Language: en' -H 'Referer: https://test.com/%0d%0aSet-Cookie:crlfinjection=1;' -H 'User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36' 'https://test.com/simple/'

After:

$ go run main.go -t  ~/nuclei-templates/http/cves/2019/CVE-2019-6802.yaml -u https://test.com -jsonl -fhr

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.9.10

                projectdiscovery.io

[INF] Current nuclei version: v2.9.10 (latest)
[INF] Current nuclei-templates version: v9.6.0 (latest)
[INF] New templates added in latest release: 33
[INF] Templates loaded for current scan: 1
[INF] Targets loaded for current scan: 1

curl-command:

curl -X 'GET' -H 'Accept: */*' -H 'Accept-Language: en' -H 'User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36' 'https://test.com/%0d%0aSet-Cookie:crlfinjection=1;'

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)

@dogancanbakir dogancanbakir self-assigned this Aug 1, 2023
@tarunKoyalwar tarunKoyalwar linked an issue Aug 1, 2023 that may be closed by this pull request
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 !

$  ./nuclei -u https://test.target/ -id "CVE-2019-6802" -jsonl -fhr -silent | jq -r '. | ."curl-command"'
curl -X 'GET' -H 'Accept: */*' -H 'Accept-Language: en' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36' 'https://test.target/1/%0d%0aSet-Cookie:crlfinjection=1;'

@tarunKoyalwar tarunKoyalwar requested a review from ehsandeep August 1, 2023 16:05
@ehsandeep ehsandeep merged commit 0776b2e into dev Aug 1, 2023
@ehsandeep ehsandeep deleted the fix_curl_command branch August 1, 2023 19:17
@ehsandeep ehsandeep removed the request for review from Mzack9999 August 1, 2023 19:17
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.

issue with generated curl-command as poc
3 participants