Skip to content

Instantly share code, notes, and snippets.

@evilsocket
Last active September 1, 2020 19:46
Show Gist options
  • Save evilsocket/36da77e34766dc600218 to your computer and use it in GitHub Desktop.
Save evilsocket/36da77e34766dc600218 to your computer and use it in GitHub Desktop.
BetterCAP example TCP Proxy Module
class Example < BetterCap::Proxy::TCP::Module
meta(
'Name' => 'Example',
'Description' => 'Example TCP 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
@lcmsms
Copy link

lcmsms commented Sep 1, 2020

unable to compile the code !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment