Class: Yawast::Scanner::Core
- Inherits:
-
Object
- Object
- Yawast::Scanner::Core
- Defined in:
- lib/scanner/core.rb
Class Method Summary collapse
- .check_ssl(uri, options, head) ⇒ Object
- .get_cms(uri, options) ⇒ Object
- .print_header(uri) ⇒ Object
- .process(uri, options) ⇒ Object
- .setup(uri, options) ⇒ Object
Class Method Details
.check_ssl(uri, options, head) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/scanner/core.rb', line 76 def self.check_ssl(uri, , head) setup(uri, ) if uri.scheme == 'https' && !.nossl head = Yawast::Shared::Http.head(uri) if head == nil if .internalssl Yawast::Scanner::Ssl.info(uri, !.nociphers, .sweet32count) else Yawast::Scanner::SslLabs.info(uri, .sslsessioncount) end Yawast::Scanner::Ssl.check_hsts(head) elsif uri.scheme == 'http' puts 'Skipping TLS checks; URL is not HTTPS' end end |
.get_cms(uri, options) ⇒ Object
69 70 71 72 73 74 |
# File 'lib/scanner/core.rb', line 69 def self.get_cms(uri, ) setup(uri, ) body = Yawast::Shared::Http.get(uri) Yawast::Scanner::Cms.get_generator(body) end |
.print_header(uri) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/scanner/core.rb', line 4 def self.print_header(uri) Yawast.header puts "Scanning: #{uri.to_s}" puts end |
.process(uri, options) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/scanner/core.rb', line 22 def self.process(uri, ) setup(uri, ) begin #setup the proxy Yawast::Shared::Http.setup(.proxy, .) #cache the HEAD result, so that we can minimize hits head = Yawast::Shared::Http.head(uri) Yawast::Scanner::Generic.head_info(head) #perfom SSL checks check_ssl(uri, , head) #process the 'scan' stuff that goes beyond 'head' unless .head #server specific checks Yawast::Scanner::Apache.check_all(uri, head) Yawast::Scanner::Iis.check_all(uri, head) Yawast::Scanner::ObjectPresence.check_source_control(uri) Yawast::Scanner::ObjectPresence.check_sitemap(uri) Yawast::Scanner::ObjectPresence.check_cross_domain(uri) Yawast::Scanner::ObjectPresence.check_wsftp_log(uri) Yawast::Scanner::ObjectPresence.check_trace_axd(uri) Yawast::Scanner::ObjectPresence.check_elmah_axd(uri) Yawast::Scanner::ObjectPresence.check_readme_html(uri) Yawast::Scanner::ObjectPresence.check_release_notes_txt(uri) Yawast::Scanner::Generic.check_propfind(uri) Yawast::Scanner::Generic.(uri) Yawast::Scanner::Generic.check_trace(uri) #check for common directories if .dir Yawast::Scanner::Generic.directory_search(uri, .dirrecursive) end get_cms(uri, ) end puts 'Scan complete.' rescue => e Yawast::Utilities.puts_error "Fatal Error: Can not continue. (#{e.})" end end |
.setup(uri, options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/scanner/core.rb', line 11 def self.setup(uri, ) unless @setup print_header(uri) Yawast. Yawast::Scanner::Generic.server_info(uri, ) end @setup = true end |