Replies: 3 comments 4 replies
-
@mzpqnxow this is a very good idea. We were also thinking of providing some way of doing tampers on request to do things like waf-bypass etc. We can use this issue for discussing and formulating the idea. Some idea of the way we were thinking of doing this - rule:
- On: User Agent
mutators: uppercase | base64encode
- On: Payloads
mutators: hex
- On: request
mutators: x-forward-headers
- On: QueryString
mutator: basic-xss cc @Mzack9999 |
Beta Was this translation helpful? Give feedback.
-
Are you thinking of providing a way for the user to do fully arbitrary transforms? Or are you just thinking of expanding the various built-in functionality? I realize probably 95% of users will be happy to defer to the nuclei dev team/community on how to encode stuff, though there are always a few that will need to do something somewhat specific (and/or are unable to contribute whatever they're using back to the project, for whatever reason) Basically I'm asking for this specific example (log4j) would it be: - On: QueryString
mutator: log4j Or: - On: QueryString
mutator: custom_user_thingie (where Or maybe this is part of what's open for discussion? |
Beta Was this translation helpful? Give feedback.
-
Any planning on this, or is it still just a long-term /nebulous thing? Just checking or for the sake of keeping the issue open and not completely stale (or closing it would be fine too) |
Beta Was this translation helpful? Give feedback.
-
Please describe your feature request:
First, I am relatively new to Nuclei so please forgive me if there is some way to do this, aside from patching the source. I searched a bit to see if I could find a way but didn't see one
Currently
nucleii
supports expressions likebase64
,rand_text_alpha
, etc. to dynamically modify payloads. What I am looking for is the ability to perform a custom expression, ideally in the language of my choice.Describe the use case of this feature:
In my case, I am testing with a payload that includes an interact.sh domain for a custom interact.sh server. Because interact.sh domains themselves are very easy to fingerprint and therefore block, before I started testing
nucleii
as a tool, I was using my own tool to generate, send and correlate any responses- and in that tool, I was performing the dynamic obfuscation/encoding on the actual interact.sh domain before sending the request- this works fine but I would like to leverage all of the features ofnucleei
instead of using my own tool- since my tool has some clunk and cruft, and there are some really effective templates available fornucleei
Specific Use-Case: log4j encoding
The most recent and relevant example is the log4j issue. Consider the following template value for the
Contact
header:In this case, the obfuscation/encoding is hard-coded into the template- which is no problem because the un-obfuscated text is static. This provides some basic obfuscation on the
${jndi:rmi://}
string, but the interact.sh domain still goes through "as-is". There's no way to encode it as far as I can tell, because it is dynamically generated by the template/request engine. The interact.sh domain is very easy to fingerprint with a WAF, which is why this is an issue. This is true even when using a custom interact.sh domainAssume the
{{interactsh-url}}
value is4d3js1nguo28r8164020c8dwn8eyyyquo.custom.domain
. I would prefer to run this value through my own encoder (specific to log4j expression evaluation) and send something like the following instead of that interact.sh domain literal:Is there some way I'm missing to do manipulation with this level of complexity on a dynamic varable/expression in the template?
Workarounds
nucleii
codebase (e.g.log4j_encode()
) and then rebuildnucleii
and reference it from the template in the same way one would usebase64()
. It seems that this may be a bit heavy-handed as this sort of encoding is relatively unique to log4j and would therefore have minimal value to thenucleii
project as a whole. If I do this I'd be happy to send a PR upstream, but I'm not sure it's worth the effortImplementation Suggestions
The way sqlmap does this is via
--tamper
. When--tamper
is set to a Python module implementing a simple interface, the final payload for each dynamically created request is first sent to that module (and then retrieved back from it) before transmission.There are some drawbacks to that, specifically when it comes to performance, though depending on the details performance impact could be minimized. For example, the "tamper" module could be a long-running program in C, golang, rust, Python- whatever- with a tight select loop on a TCP port or some IPC mechanism (e.g. named pipe) where requests and responses could be rapidly passed back and forth without much overhead. Any performance issues would be the responsibility of the user that developed the "tamper" application/daemon
If performance isn't a concern, then it could of course operate in a mode where a new process is created, the payload is sent via stdin to the new process, modified, and then returned via stdout. This would be simplest for most users since they wouldn't need to worry about i/o multiplexing, sockets, etc. They could just use stdin/stdout
Maybe there is some way to do this, or a more clever workaround?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions