Skip to content

Allow Server Name Identification to be set #62

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

Merged
merged 4 commits into from
Oct 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/core/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# |V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk
# +-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan

__version__ = '1.5.3'

__version__ = '1.5.4'
13 changes: 13 additions & 0 deletions lib/core/virtual_host_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@
import pandas as pd
import time
from lib.core.discovered_host import *
from urllib3.util import ssl_

DEFAULT_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'

_target_host = None
_ssl_wrap_socket = ssl_.ssl_wrap_socket
def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move this into the class. Going to merge for now since it's a bugfix but I think we should definitely do some refactoring on this file soon.

ca_certs=None, server_hostname=None,
ssl_version=None, ciphers=None, ssl_context=None,
ca_cert_dir=None):
ssl_wrap_socket_(sock, keyfile=keyfile, certfile=certfile, cert_reqs=cert_reqs,
ca_certs=ca_certs, server_hostname=_target_host,
ssl_version=ssl_version, ciphers=ciphers, ssl_context=ssl_context,
ca_cert_dir=ca_cert_dir)
ssl_.ssl_wrap_socket = _ssl_wrap_socket

class virtual_host_scanner(object):
"""Virtual host scanning class
Expand Down Expand Up @@ -85,6 +97,7 @@ def scan(self):
})

dest_url = '{}://{}:{}/'.format('https' if self.ssl else 'http', self.target, self.port)
_target_host = hostname

try:
res = requests.get(dest_url, headers=headers, verify=False)
Expand Down