Last active
September 1, 2020 19:46
-
-
Save evilsocket/36da77e34766dc600218 to your computer and use it in GitHub Desktop.
BetterCAP example TCP 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::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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
unable to compile the code !