Skip to content

Commit d2e758a

Browse files
committed
Better failure handling
1 parent d3f31fb commit d2e758a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

modules/auxiliary/gather/wp_all_in_one_migration_export.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ def initialize(info = {})
3737
], self.class)
3838
end
3939

40-
def exporter_url
41-
normalize_uri(plugin_url, 'modules', 'export', 'templates', 'export.php')
42-
end
43-
4440
def check
4541
check_plugin_version_from_readme('all-in-one-wp-migration', '2.0.5')
4642
end
@@ -63,7 +59,13 @@ def run
6359
fail_with(Failure::UnexpectedReply, "#{peer} - Server responded with status code #{res.code}")
6460
end
6561

66-
store_path = store_loot('wordpress.export', 'zip', datastore['RHOST'], res.body, 'wordpress_backup.zip', 'WordPress Database and Content Backup')
67-
print_good("#{peer} - Backup archive saved to #{store_path}")
62+
if res.body.blank?
63+
print_status("Unable to download anything.")
64+
print_status("Either the target isn't actually vulnerable, or")
65+
print_status("it does not allow WRITE permission to the all-in-one-wp-migration/storage directory.")
66+
else
67+
store_path = store_loot('wordpress.export', 'zip', datastore['RHOST'], res.body, 'wordpress_backup.zip', 'WordPress Database and Content Backup')
68+
print_good("#{peer} - Backup archive saved to #{store_path}")
69+
end
6870
end
6971
end

0 commit comments

Comments
 (0)