Class: Snackhack2::SSRF

Inherits:
Object
  • Object
show all
Defined in:
lib/snackhack2/ssrf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSSRF

Returns a new instance of SSRF.



8
9
10
# File 'lib/snackhack2/ssrf.rb', line 8

def initialize
  @site = site
end

Instance Attribute Details

#siteObject

Returns the value of attribute site.



7
8
9
# File 'lib/snackhack2/ssrf.rb', line 7

def site
  @site
end

Instance Method Details

#ssrfObject



11
12
13
14
15
16
17
18
# File 'lib/snackhack2/ssrf.rb', line 11

def ssrf
  url = @site.gsub("SSRF", "http://google.com")
  ht = HTTParty.get(url)
  if ht.body.include?("Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.")
    puts "Boom Shaka. It's vulnerable to SSRF..."
  end

end