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.
4 5 6 |
# File 'lib/snackhack2/tomcat.rb', line 4 def initialize(site) @site = site end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/snackhack2/tomcat.rb', line 8 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 |