Skip to content

Commit

Permalink
Merge pull request #62 from codingo/timk-sni-monkey-patch
Browse files Browse the repository at this point in the history
Allow Server Name Identification to be set
  • Loading branch information
codingo authored Oct 8, 2017
2 parents 9c4006c + 6bf9bfe commit b2ec938
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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,
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

0 comments on commit b2ec938

Please sign in to comment.