lib/scanner/generic.rb in yawast-0.6.0.beta2 vs lib/scanner/generic.rb in yawast-0.6.0.beta3

- old
+ new

@@ -44,14 +44,15 @@ end end puts '' if server != '' - Yawast::Scanner::Apache.check_banner(server) + Yawast::Scanner::Plugins::Servers::Apache.check_banner(server) Yawast::Scanner::Php.check_banner(server) - Yawast::Scanner::Iis.check_banner(server) - Yawast::Scanner::Nginx.check_banner(server) + Yawast::Scanner::Plugins::Servers::Iis.check_banner(server) + Yawast::Scanner::Plugins::Servers::Nginx.check_banner(server) + Yawast::Scanner::Plugins::Servers::Python.check_banner(server) if server == 'cloudflare-nginx' Yawast::Utilities.puts_info 'NOTE: Server appears to be Cloudflare; WAF may be in place.' puts end @@ -163,10 +164,15 @@ if res['Public'] != nil Yawast::Utilities.puts_info "Public HTTP Verbs (OPTIONS): #{res['Public']}" puts '' end + if res['Allow'] != nil + Yawast::Utilities.puts_info "Allow HTTP Verbs (OPTIONS): #{res['Allow']}" + + puts '' + end end end def self.check_trace(uri) begin @@ -195,9 +201,34 @@ Yawast::Utilities.puts_warn 'Possible Info Disclosure: PROPFIND Enabled' puts "\t\t\"curl -X PROPFIND #{uri}\"" puts '' end + end + end + + def self.ssl_connection_info(uri) + begin + # we only care if this is https + if uri.scheme == 'https' + # setup the connection + socket = TCPSocket.new(uri.host, uri.port) + + ctx = OpenSSL::SSL::SSLContext.new + ctx.ciphers = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers] + + ssl = OpenSSL::SSL::SSLSocket.new(socket, ctx) + ssl.hostname = uri.host + ssl.connect + + # this provides a bunch of useful info, that's already formatted + # instead of building this manually, we'll let OpenSSL do the work + puts ssl.session.to_text + + puts + end + rescue => e + Yawast::Utilities.puts_error "SSL Information: Error Getting Details: #{e.message}" end end end #Custom class to allow using the PROPFIND verb