forked from evilsocket/bettercap-proxy-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spinimages.rb
40 lines (34 loc) · 903 Bytes
/
spinimages.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
=begin
BETTERCAP
Author : Simone 'evilsocket' Margaritelli
Email : evilsocket@gmail.com
Blog : http://www.evilsocket.net/
This project is released under the GPL 3 license.
=end
class Spinimages < BetterCap::Proxy::Module
def on_request( request, response )
# is it a html page?
if response.content_type =~ /^text\/html.*/
BetterCap::Logger.info "Hacking http://#{request.host}#{request.url}"
# make sure to use sub! or gsub! to update the instance
response.body.sub!( '</head>', '<<style>
@-moz-keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
/*
Spin all images
*/
img {
-webkit-animation: spin 1s linear infinite;
animation: spin 1s linear infinite;*/
}
</style>
</head>' )
end
end
end