From 174ed4ec978fde5eebc46629cd991d339de8474d Mon Sep 17 00:00:00 2001 From: h4x-x0r <152236528+h4x-x0r@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:29:04 +0100 Subject: [PATCH] minor improvements minor improvements --- .../gather/solarwinds_webhelpdesk_backdoor.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/auxiliary/gather/solarwinds_webhelpdesk_backdoor.rb b/modules/auxiliary/gather/solarwinds_webhelpdesk_backdoor.rb index fbcbb3f20dc9..4483e83ff8ac 100644 --- a/modules/auxiliary/gather/solarwinds_webhelpdesk_backdoor.rb +++ b/modules/auxiliary/gather/solarwinds_webhelpdesk_backdoor.rb @@ -53,11 +53,15 @@ def run } ) - fail_with(Failure::UnexpectedReply, 'Unexpected Reply') unless res&.code == 200 + fail_with(Failure::UnexpectedReply, 'Unexpected Reply: ' + res.to_s) unless res&.code == 200 - json = res.get_json_document - if json.to_s.include?('shortSubject') - print_good('Successfully authenticated and tickets retrieved:' + json.to_s) + body = res.body + if body.include?('shortSubject') + jbody = JSON.parse(body) + print_good('Successfully authenticated and tickets retrieved:') + print_good(JSON.pretty_generate(jbody)) + file = store_loot('solarwinds_webhelpdesk.json', 'text/json', datastore['USER'], jbody) + print_good("Saved tickets to #{file}") end end end