Created
June 12, 2012 20:27
-
-
Save postmodern/2919927 to your computer and use it in GitHub Desktop.
Example of Ronin::Network::UDP::Proxy
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 'ronin/network/udp/proxy' | |
require 'hexdump' | |
Ronin::Network::UDP::Proxy.start(:port => 1337, :server => ['4.2.2.1', 53]) do |proxy| | |
hex = Hexdump::Dumper.new | |
proxy.on_client_data do |(client,(host,port)),server,data| | |
puts "#{host}:#{port} -> #{proxy}" | |
hex.dump(data) | |
end | |
proxy.on_server_data do |(client,(host,port)),server,data| | |
proxy.close! if data =~ /QUIT/ | |
puts "#{host}:#{port} <- #{proxy}" | |
hex.dump(data) | |
end | |
end |
Author
postmodern
commented
Jun 12, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment