Open pwnhxl opened 3 months ago
Both ssrf-1.yaml and ssrf-2.yaml send url=http://{{interactsh-url}} but ssrf-1.yaml fails to detect because ssrf-1.yaml uses a payload.
@tarunKoyalwar
Confirmed.
I am also experiencing the same issue. I will leave the logs below, and I hope they might be helpful.
v3.3.1
vuln.php
<?php
# vuln.php
$command = (!isset($_GET['command']) || $_GET['command'] === '')
? 'ls'
: $_GET['command'];
exec($command);
?>
start vuln.php
php -S 0.0.0.0:8888 ./vuln.php
detect.yaml
# detect.yaml
id: detect
info:
name: OOB OS Command injection
author: k1rnt
severity: High
description: A template for detecting OS command injection using Out-of-Band (OOB) techniques.
http:
- raw:
- |
GET /?command=nslookup${IFS}{{interactsh-url}} HTTP/1.1
matchers:
- name: A DNS request was sent to an external URL.
type: word
part: interactsh_protocol
words:
- "dns"
Execution command
nuclei -t ./detect.yaml -u "http://localhost:8888" -p "http://localhost:8080" --debug
Execution result
nuclei -t ./detect.yaml -u "http://localhost:8888" -p "http://localhost:8080" --debug
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.3.1
projectdiscovery.io
[INF] Current nuclei version: v3.3.1 (latest)
[INF] Current nuclei-templates version: v9.9.3 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 56
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[INF] Using Interactsh Server: oast.live
[INF] [detect] Dumped HTTP request for http://localhost:8888/?command=nslookup${IFS}cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live
GET /?command=nslookup${IFS}cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 12) AppleWebKit/618.6 (KHTML, like Gecko) Version/17.2 Safari/618.6
Connection: close
Accept-Encoding: gzip
[DBG] [detect] Dumped HTTP response http://localhost:8888/?command=nslookup${IFS}cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live
HTTP/1.1 200 OK
Connection: close
Content-Type: text/html; charset=UTF-8
Date: Mon, 26 Aug 2024 08:07:24 GMT
Host: localhost:8888
X-Powered-By: PHP/8.3.10
[cr63feqhc8a54hnmtj306rb8uy4cqkiw7] Received DNS interaction from 163.139.8.231 at 2024-08-26 08:07:28
------------
DNS Request
------------
;; opcode: QUERY, status: NOERROR, id: 16796
;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version 0; flags:; udp: 1232
;; QUESTION SECTION:
;cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live. IN A
------------
DNS Response
------------
;; opcode: QUERY, status: NOERROR, id: 16796
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live. IN A
;; ANSWER SECTION:
cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live. 3600 IN A 178.128.210.172
;; AUTHORITY SECTION:
cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live. 3600 IN NS ns1.oast.live.
cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live. 3600 IN NS ns2.oast.live.
;; ADDITIONAL SECTION:
ns1.oast.live. 3600 IN A 178.128.210.172
ns2.oast.live. 3600 IN A 178.128.210.172
[detect:A DNS request was sent to an external URL.] [http] [high] http://localhost:8888/?command=nslookup${IFS}cr63feqhc8a54hnmtj306rb8uy4cqkiw7.oast.live
burp screenshot
no_detect.yaml
# no detect.yaml
id: no_detect
info:
name: OOB OS Command injection
author: k1rnt
severity: High
description: A template for detecting OS command injection using Out-of-Band (OOB) techniques.
http:
- raw:
- |
GET /?command=§pattern§ HTTP/1.1
payloads:
pattern:
- "nslookup${IFS}.{{interactsh-url}}"
matchers:
- name: A DNS request was sent to an external URL.
type: word
part: interactsh_protocol
words:
- "dns"
Execution command
nuclei -t ./no_detect.yaml -u "http://localhost:8888" -p "http://localhost:8080" --debug
Execution result
nuclei -t ./no_detect.yaml -u "http://localhost:8888" -p "http://localhost:8080" --debug
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.3.1
projectdiscovery.io
[INF] Current nuclei version: v3.3.1 (latest)
[INF] Current nuclei-templates version: v9.9.3 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 56
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[INF] Using Interactsh Server: oast.site
[INF] [no_detect] Dumped HTTP request for http://localhost:8888/?command=nslookup${IFS}.cr63gfihc8a56pe5fkr039xjexhqa7jgb.oast.site
GET /?command=nslookup${IFS}.cr63gfihc8a56pe5fkr039xjexhqa7jgb.oast.site HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Knoppix; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Accept-Encoding: gzip
[DBG] [no_detect] Dumped HTTP response http://localhost:8888/?command=nslookup${IFS}.cr63gfihc8a56pe5fkr039xjexhqa7jgb.oast.site
HTTP/1.1 200 OK
Connection: close
Content-Type: text/html; charset=UTF-8
Date: Mon, 26 Aug 2024 08:09:35 GMT
Host: localhost:8888
X-Powered-By: PHP/8.3.10
[INF] No results found. Better luck next time!
burp screenshot
Nuclei version:
last
--
When I use payloads together with oast, it results in a miss. Here's an example of the test command I used, along with a yaml template, and a php test.
Nuclei command: