Class: Snackhack2::TomCat
- Inherits:
-
Object
- Object
- Snackhack2::TomCat
- Defined in:
- lib/snackhack2/tomcat.rb
Instance Method Summary collapse
-
#initialize(site) ⇒ TomCat
constructor
A new instance of TomCat.
- #run ⇒ Object
Constructor Details
#initialize(site) ⇒ TomCat
Returns a new instance of TomCat.
6 7 8 |
# File 'lib/snackhack2/tomcat.rb', line 6 def initialize(site) @site = site end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/snackhack2/tomcat.rb', line 10 def run tc = Snackhack2.get(File.join(@site, '/docs/')) if tc.code == 404 if tc.body.include?('Tomcat') doc = Nokogiri::HTML(tc.body) version = doc.at('h3').text puts "[+] Looks like the site is Tomcat, running #{version}." end else puts "[+] Status code: #{tc.code}" end end |