Path: blob/master/tools/bettercap/modules/hack_title.rb
527 views
=begin12BETTERCAP34Author : Simone 'evilsocket' Margaritelli5Email : [email protected]6Blog : http://www.evilsocket.net/78This project is released under the GPL 3 license.910=end11class HackTitle < BetterCap::Proxy::HTTP::Module12meta(13'Name' => 'HackTitle',14'Description' => 'Adds a "!!! HACKED !!!" string to every webpage title.',15'Version' => '1.0.0',16'Author' => "Simone 'evilsocket' Margaritelli",17'License' => 'GPL3'18)1920def on_request( request, response )21# is it a html page?22if response.content_type =~ /^text\/html.*/23BetterCap::Logger.info "Hacking http://#{request.host}#{request.path}"24# make sure to use sub! or gsub! to update the instance25response.body.sub!( '<title>', '<title> !!! HACKED !!! ' )26end27end28end293031