Skip to content

Instantly share code, notes, and snippets.

Created Sep 4, 2012
What would you like to do?
heroku tcp information leak demonstration
require 'ipaddr'
def draw(s)
ip, port = s.split(':')
ip = ip.scan(/(..)/).reverse.join('')
ip = ip.to_i(16)
ip =, Socket::AF_INET).to_s
port = port.to_i(16)
end'/proc/net/tcp').each_line do |l|
toks = l.split
next if toks[0] == "sl"
src = toks[1]
dst = toks[2]
puts "#{draw(src)} -> #{draw(dst)}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment