Created
September 5, 2012 01:09
-
-
Save rickmzp/3628767 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'socket' | |
| socket = TCPSocket.new "192.168.201.133", 1337 | |
| socket.puts "GET /8\n\n" | |
| results = {} | |
| total_lines = 0 | |
| begin | |
| puts "Scanning..." | |
| while line = socket.gets | |
| next if line =~ /HTTP|:/ || line.strip.empty? | |
| string = line.strip | |
| results[string] ||= 0 | |
| results[string] += 1 | |
| total_lines += 1 | |
| end | |
| rescue Interrupt | |
| puts "\nstopped scanning\n\n\n" | |
| results.each_with_index do |(data, count), index| | |
| chance = count.to_f / total_lines.to_f | |
| printf("%1s: %s%%\n", data, chance.round(5).to_s) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment