-
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
Support to use "ip" DSL in the requests #2025
Comments
@brenocss Unfortunately, the IP information is available only after performing at least one connection to the target. A temporary workaround could be a template like the following one: id: basic-raw-example
info:
name: Test RAW Template
author: pdteam
severity: info
requests:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
- |
GET / HTTP/1.1
Host: {{Hostname}}
Origin: {{extractedip}}
extractors:
- type: dsl
internal: true
name: extractedip
dsl:
- ip Is there any specific use case you encountered that requires the IP information to be available before the connection? |
Use case nuclei -t internetdb.yaml -u google.com
nuclei -t internetdb.yaml -u https://google.com It is important that this template can be executed even for entries that are not URLs requests:
- raw:
- |
@Host: https://internetdb.shodan.io/
GET /{{ip}} HTTP/1.1
Host: internetdb.shodan.io An example of a workaround that would be possible when the cross-protocol data sharing function is working id: teste
info:
name: debug
author: brenocss
severity: info
description: Ip
reference:
- https://google.com
classification:
cwe-id: CWE-200
tags: dns,A
dns:
- name: "{{FQDN}}"
type: A
matchers:
- type: word
words:
- "IN\tA"
extractors:
- type: regex
name: extractedip
group: 1
# internal: true
regex:
- "IN\tA\t(\\S+)"
requests:
- raw:
- |
@Host: https://internetdb.shodan.io/
GET /{{extractedip}} HTTP/1.1
Host: internetdb.shodan.io But that won't work for this, that's why dsl would be a better way to do it echo hackerone.com | nuclei -t internetdb -u 8.8.8.8 Another problem is to keep redoing unnecessary dns/http requests |
Unfortunately, knowing the actual server's IP is impossible before performing at least one connection to the DNS hostname. |
@Mzack9999 indeed, it will not only solve this, but also helpful for new helpers at #2341 |
Don't we need to preprocess all domains before using for all templates? it is worth mentioning that when the input is an ip the variable {{ip}} is also not valid echo https://127.0.0.1 | nuclei -t teste.yaml -duc -debug |
@brenocss, the pre-processing phase only lexicographically (fqdn)/range (ip + cidr) deduplicates input items. The DNS resolution, if a domain name is provided, happens within fastdialer at connection time. On Hold - We need to clarify if the helper function with heuristic assumptions can cover the particular use case |
|
@Mzack9999 don't scan based in ip type ( such as ipv6 or ipv4 ) pre process domains and resolve before running? |
@brenocss, that is an excellent point. Still, this happens only in the case of |
This works:
But not this:
should be exposed to use in all supported protocols.
The text was updated successfully, but these errors were encountered: