check for ssl related errors. Fix #993

This commit is contained in:
Christian Mehlmauer
2016-09-05 22:58:56 +02:00
parent 88d3c26113
commit 91151fc53b
5 changed files with 40 additions and 6 deletions

View File

@@ -21,6 +21,29 @@ class WebSite
@uri.to_s
end
# Checks if the remote website has ssl errors
def ssl_error?
return false unless @uri.scheme == 'https'
c = get_root_path_return_code
# http://www.rubydoc.info/github/typhoeus/ethon/Ethon/Easy:return_code
return (
c == :ssl_connect_error ||
c == :peer_failed_verification ||
c == :ssl_certproblem ||
c == :ssl_cipher ||
c == :ssl_cacert ||
c == :ssl_cacert_badfile ||
c == :ssl_issuer_error ||
c == :ssl_crl_badfile ||
c == :ssl_engine_setfailed ||
c == :ssl_engine_notfound
)
end
def get_root_path_return_code
Browser.get(@uri.to_s).return_code
end
# Checks if the remote website is up.
def online?
Browser.get(@uri.to_s).code != 0

View File

@@ -46,7 +46,8 @@ class WpscanOptions
:throttle,
:disable_accept_header,
:disable_referer,
:cache_dir
:cache_dir,
:disable_tls_checks
]
attr_accessor *ACCESSOR_OPTIONS
@@ -290,7 +291,8 @@ class WpscanOptions
['--throttle', GetoptLong::REQUIRED_ARGUMENT],
['--disable-accept-header', GetoptLong::NO_ARGUMENT],
['--disable-referer', GetoptLong::NO_ARGUMENT],
['--cache-dir', GetoptLong::REQUIRED_ARGUMENT]
['--cache-dir', GetoptLong::REQUIRED_ARGUMENT],
['--disable-tls-checks', GetoptLong::NO_ARGUMENT],
)
end