Skip to content
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

Incorrect SSL info in scan #638

Closed
archergod opened this issue Nov 21, 2019 · 17 comments
Closed

Incorrect SSL info in scan #638

archergod opened this issue Nov 21, 2019 · 17 comments

Comments

@archergod
Copy link

I run nikto -h https://www.example.com it shows SSL info for some other site on server [which is apparently the first Virtual host on server]. But it is not showing the SSL info of URL I shared. We are using Let's encrypt SSL for all sites. If I change order in my Virtual Host file and make scan site as first it shows correct. But why Nikto is scanning SSL separately probably based on IP address. Is there any option we can mark for shared hosting?

@digininja
Copy link
Contributor

digininja commented Nov 21, 2019 via email

@archergod
Copy link
Author

archergod commented Nov 21, 2019

No, we create Virtual Host in Apache, and then when we run Certbot it ask to choose site and whenever we put new site we get new SSL, which has different dates for that Domain (or it's alias) so each virtual host get its own certificate.

When we run site on browsers they all shows different certificate [different issue date etc]

@drwetter
Copy link
Contributor

Reminds me on #573

@digininja
Copy link
Contributor

digininja commented Nov 21, 2019 via email

@archergod
Copy link
Author

@digininja your images didn't come through. I am no expert and didn't exactly know how to run Wireshark. I am running WSL Kali with nikto form my win 10 machine to scan site. We have to provide security report to our customer and hence we are scanning site on live server. I cannot share server details to let anyone scan it. The CN We are getting in nikto output is for different domain, [first in list]

@archergod
Copy link
Author

I just see -vhost option probably this is design for issues like mine, but apparently it is not working for my case.

@digininja
Copy link
Contributor

Here are the images.

image

image

Fire up Wireshark, get it sniffing on the main network interface

Filter it to just show the IP that you are scanning with a filter of

ip.addr == 1.2.3.4

Start the scan and then stop it as soon as the SSL info is shown.

Scroll up to the top of the capture and look for a Client Hello message.

Expand that out and you should see something like the first screenshot.

Look down a few packets and you should then see a Certificate packet. Expand that out and you'll see the second screenshot.

The two packets marked in black in this screenshot are the two you want to look for.

image

@archergod
Copy link
Author

Okay, I got wireshark running and capture for Client Hello and it doesn't have "extension: server_name" line in there for Client Hello. I am using default Kali Linux's Nikto 2.1.6 as stated there. if that make difference.

@digininja
Copy link
Contributor

That will be the problem then. Without an SNI field, the web server doesn't know which site the connection is for so will return the default vhost.

Make sure the Kali box is fully up to date and pull the latest Nikto from Github and try that.

My guess is an old version of OpenSSL, or some other library which doesn't support SNI, is being used somewhere.

@tautology0
Copy link
Collaborator

I put in a couple of SNI patches to libwhisker about a year ago. Bearing in mind how poor Kali's patching is, I strongly suspect that they haven't been rolled upstream.

I seriously don't recommend using Kali's packaged tools.

@archergod
Copy link
Author

Thanks for information, the problem is understood and I need to prepare other machine to test it out, so it might be a while for me to test. Thanks for information.

@digininja
Copy link
Contributor

Just try with the latest version from here, the changes @tautology0 put in place may be the ones you need.

@archergod
Copy link
Author

First, I was able to run with correct SSL info been displayed.

Now, few things I notice (probably other thread should be created but anyways:)

  1. I try to install using Docker instruction on my windows machine that has docker install, I get powershell to download git and build using docker command, but then docker run --rm sullo/nikto gives error that ' : no such file or directory just that.

  2. I try to use "release" package but it doesn't work for some Plugin error

  3. I use the GIT clone on ubuntu then and have to install Perl SSL and then it works just fine. but on kali machine it still give same old certificate and I am not sure how to change Open SSL anyother lib there, but at least I have one workable solution.

Thanks for @digininja for your encouragement and clear guidance.

@digininja
Copy link
Contributor

digininja commented Nov 21, 2019 via email

@sullo
Copy link
Owner

sullo commented Nov 21, 2019 via email

@sullo
Copy link
Owner

sullo commented Nov 21, 2019 via email

@archergod
Copy link
Author

@sullo I already tried vhost option and it doesn't work, and your reply on close thread does means a lot as you been the author. I can now trust more on Nikto :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants