-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
code: fix variables merge order #4623
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tarunKoyalwar
changed the title
fix variables merge order
code: fix variables merge order
Jan 11, 2024
example templateid: code-template
info:
name: example code template
author: pdteam
severity: info
variables:
OAST: "{{BaseURL}}"
code:
- engine:
- sh
- bash
source: |
echo "$OAST\nextracted" | base64
http:
- raw:
- |
GET /{{code_response}} HTTP/1.1
Host: {{Hostname}}
matchers:
- type: status
status:
- 200
extractors:
- type: dsl
dsl:
- base64_decode(code_response)
# digest: 4a0a00473045022100b07735c7ab49a35adb85026190594d285fd3a4567db180b34fca8a7b91f3957f022048a4005633759ba3a0db2bbb04be563900827ef49436ed744f539501c566cb31:73812c4e0e52692225979bd2d5f05a3c $ ./nuclei -t a.yaml -code -v -u https://scanme.sh
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.1.5
projectdiscovery.io
[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.1.5 (latest)
[INF] Current nuclei-templates version: v9.7.2 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 61
[INF] Templates loaded for current scan: 1
[INF] Executing 1 signed templates from tarun
[INF] Targets loaded for current scan: 1
[VER] [code-template] Executed code on local machine https://scanme.sh
[VER] [code-template] Sent HTTP request to https://scanme.sh/aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg==
[code-template] [http] [info] https://scanme.sh/aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg== ["https://scanme.sh\nextracted"]
|
New Changes
$ ./nuclei -t a.yaml -code -v -u https://scanme.sh -debug
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.1.5
projectdiscovery.io
[INF] Current nuclei version: v3.1.5 (latest)
[INF] Current nuclei-templates version: v9.7.2 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 61
[INF] Templates loaded for current scan: 1
[INF] Executing 1 signed templates from tarun
[INF] Targets loaded for current scan: 1
[DBG] [code-template] Dumped Executed Source Code for https://scanme.sh
echo "'https://scanme.sh'\nextracted" | base64
[DBG] [code-template] Dumped Code Execution for https://scanme.sh
aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg==
[INF] [code-template] Dumped HTTP request for https://scanme.sh/aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg==
GET /aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg== HTTP/1.1
Host: scanme.sh
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1866.237 Safari/537.36
Connection: close
Accept-Encoding: gzip
[DBG] [code-template] Dumped HTTP response https://scanme.sh/aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg==
HTTP/1.1 200 OK
Connection: close
Content-Length: 2
Content-Type: text/plain; charset=utf-8
Date: Thu, 11 Jan 2024 20:35:56 GMT
ok
[code-template:status-1] [http] [info] https://scanme.sh/aHR0cHM6Ly9zY2FubWUuc2gKZXh0cmFjdGVkCg== ["https://scanme.sh\nextracted"]
|
ehsandeep
approved these changes
Jan 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
raw variables
overevaluated variables
i.e why after{{BaseURL}}
was converted tohttps://scanme.sh
(or any url) it was replaced by{{BaseURL}}
again .