Created
January 22, 2017 14:56
-
-
Save evilsocket/7fbbfc9b12826e7de7a1c97a921b7ce8 to your computer and use it in GitHub Desktop.
BetterCAP example UDP Proxy Module
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
class Example < BetterCap::Proxy::UDP::Module | |
meta( | |
'Name' => 'Example', | |
'Description' => 'Example UDP proxy module.', | |
'Version' => '1.0.0', | |
'Author' => "Simone 'evilsocket' Margaritelli", | |
'License' => 'GPL3' | |
) | |
# Received when the victim is sending data to the upstream server. | |
def on_data( event ) | |
# You can access the request data being sent using the event object: | |
# | |
# event.data.gsub!( 'SOMETHING', 'ELSE' ) | |
# | |
BetterCap::Logger.raw "\n#{BetterCap::StreamLogger.hexdump( event.data )}\n" | |
end | |
# Received when the upstream server is sending a response to the victim. | |
def on_response( event ) | |
# You can access the response data being received using the event object: | |
# | |
# event.data.gsub!( 'SOMETHING', 'ELSE' ) | |
# | |
BetterCap::Logger.raw "\n#{BetterCap::StreamLogger.hexdump( event.data )}\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment