-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Log4Shell HTTP Scanner #15958
Log4Shell HTTP Scanner #15958
Conversation
49c05a1
to
95e7859
Compare
Not getting expected return on known vulnerable servers. Will keep testing and validating as updates are made. |
What service are you testing it against? Did you set the TARGETURI option? Is the service exploitable via HTTP headers or is it some other field? If it's via headers, is the header in the included word list? |
Testing against a vulnerable manage engine product. Did not set the TARGETURI option |
Can you provide an example HTTP request that triggers it on Manage Engine? I'll be able to figure out how to add it from there. |
7d3f298
to
7899a96
Compare
7899a96
to
ddc9407
Compare
ddc9407
to
dd5e1a1
Compare
dd5e1a1
to
5dc8fa3
Compare
Does it need some kind of delay before closing the ldap service? Otherwise it might race itself on the last request |
05bd746
to
4cde008
Compare
Seeing some odd behavior.
If I set
I was wondering if it was just sending repeated headers, but I am just |
Yup; I'm now seeing after a bunch of attempts to connect to the IP, it moves to the next set. Seems like we should catch that first timeout and stop yelling at the IP. Edit: Could we alter the |
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
Got this working on my PR with all the native bits, most an exploit in there too - need a hand with the serialized payload method. |
end | ||
end | ||
|
||
token = rand_text_alpha_lower_numeric(8..32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker: Looks like there's a small possibility of creating a duplicate token here, presumably more likely when two threads create a token of length 8 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a Rex::Text
method for this, why an internal impl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure there's a Rex::Text method for this? I didn't see one that uses this character set. I wanted it lower and numeric to ensure that it was case insensitive.
Release NotesThis module performs a generic scan of a given target for the Log4Shell vulnerability by injecting it into a series of Header fields as well as the URI path. |
This module will scan an HTTP end point for the Log4Shell vulnerability by injecting a format message that will | ||
trigger an LDAP connection to Metasploit. This module is a generic scanner and is only capable of identifying | ||
instances that are vulnerable via one of the pre-determined HTTP request injection points. These points include | ||
HTTP headers and the HTTP request path. Additinally URI paths for common, known-vulnerable applications are included |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTP headers and the HTTP request path. Additinally URI paths for common, known-vulnerable applications are included | |
HTTP headers and the HTTP request path. Additionally URI paths for common, known-vulnerable applications are included |
I'm having issues using this module from one AWS system to another. Since both the source and target are behind NAT, and I can't seem to set the SRVHOST to the external IP, I can't get the callback. Looking through this thread, I see a few test snippits, and all look like they're using internal to internal hosts. Has anyone tried this with two external hosts (e.g. one AWS host targeting one Digital Ocean host, or some similar setup)? I get the following errors depending on the SRVHOST setting: SRVHOST = 0.0.0.0 SRVHOST = External IP SRVHOST = eth0/internal (RFC 1918) IP I'm not sure if I'm doing something wrong, or if this is just a scenario that hasn't been tested or accounted for. |
@BeanBagKing yeah right now the SRVHOST needs to be an address that the local MSF system can bind to and the remote can route too. We should be able to separate the bind address from the connection address pretty easily but I haven't done so yet. If you want to raise a ticket requesting the feature I can work on it. In the mean time, there won't be a workaround without editing the module. |
I'll add that to the update PR this evening |
Thanks a lot @sempervictus. There should be an existing advanced option convention like |
@zeroSteiner - is it a convention or a method-chain? LPORT and such will fail to bind if they cant find the address in the switchboard. Happy to change it i you'd like (#15972) |
This module isn't perfect, but it'll perform a generic scan of a given target for the Log4Shell vulnerability by injecting it into a series of Header fields as well as the URI path. In the future, additional checks should be added. Right now it works out of the box on Spring Boot and Struts2 (steps included in the module docs). Additional ideas on generic injection points would be greatly appreciated.
Metasploit will receive and process the LDAP query, making me pretty confident that there shouldn't be false positives. In addition to that the Java information including the vendor and version will be returned in the details.
Example
Testing
To Do