Skip to content

Instantly share code, notes, and snippets.

@evilsocket
Created January 22, 2017 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evilsocket/7fbbfc9b12826e7de7a1c97a921b7ce8 to your computer and use it in GitHub Desktop.
Save evilsocket/7fbbfc9b12826e7de7a1c97a921b7ce8 to your computer and use it in GitHub Desktop.
BetterCAP example UDP Proxy Module
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