-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Why doesn't msfvenom have an option like SNI? #19680
Comments
I think in most cases we don't validate the SSL certificate that's used for the HTTPS connection. The underlying Meterpreter protocol uses it's own encryption and we offer peer validation through other means. Typically when I see SNI being configured, it's server side anyways. Is there something that isn't working that you think should be working and if so can you please provide steps that we can use to replicate it? |
Nowadays, network architectures are changing a lot. Cloudflare usually uses shared traffic devices. If the https traffic they receive from the client does not carry SNI, it will not know which domain name in their shared pool this request corresponds to, because they use the same device for many domain names. When they identify https traffic, they need to forward it to the user's backend server based on SNI. Reproduction steps: Step 1: use exploit/multi/handler set payload linux/x64/meterpreter_reverse_https set lhost 0.0.0.0 set lport 443 run Step 2:
Step 3: Step 4: Step 5: Step 6: Step 7: |
Oh okay, that makes a lot more sense. Thanks your detailed response. |
If the template is source code written in C language, I can help you modify it. However, I'm sorry, I don't know how to modify it. I can only hope that you can find time to do it. |
Well in the case of the We may not have time to look into this for at least a few weeks but if you wanted to take a shot, I'd start looking at these files more closely:
You should be able to test things by building mettle and run it with an HTTPS transport using the |
Ok, thanks, I'll take a look and try to fix it |
Sorry, I tried but couldn't solve it. Testing with build/linux.x86_64/bin/mettle still doesn't carry SNI. I don't know why. |
My last commit was to add SNI in the TLS handshake packet. Although the data packet showed that SNI was carried in it, it lacked the options required for encryption suite and key exchange, which still made it impossible to complete the TLS handshake. Now I have fixed this problem and can complete the TLS handshake and transmit the attack payload. PR is here: |
The domain name hosted by cloudflare requires SNI, but the backdoor program for https reverse connection generated by msfvenom on the Linux platform does not carry SNI, only the Windows platform has it.
The text was updated successfully, but these errors were encountered: