Skip to content

Commit fabced5

Browse files
heyderjheysel-r7
andauthored
Apply suggestions from code review
Co-authored-by: jheysel-r7 <[email protected]>
1 parent c1c74a0 commit fabced5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

documentation/modules/exploit/multi/http/wso2_api_manager_file_upload_rce.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ services:
1717
```bash
1818
docker-compose up
1919
```
20-
21-
22-
2320
## Verification Steps
2421

2522
1. Install the application

modules/exploits/multi/http/wso2_api_manager_file_upload_rce.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class MetasploitModule < Msf::Exploit::Remote
77
Rank = ExcellentRanking
88

99
include Msf::Exploit::Remote::HttpClient
10+
include Msf::Exploit::FileDropper
1011
prepend Msf::Exploit::Remote::AutoCheck
1112

1213
attr_accessor :bearer
@@ -87,7 +88,12 @@ def initialize(info = {})
8788
def check
8889
vprint_status('Checking target...')
8990

90-
authenticate
91+
begin
92+
authenticate
93+
rescue Msf::Exploit::Failed => e
94+
vprint_error(e.message)
95+
return Exploit::CheckCode::Unknown
96+
end
9197
res = send_request_cgi(
9298
'uri' => normalize_uri(target_uri.path, 'services', 'Version'),
9399
'method' => 'GET',
@@ -368,6 +374,7 @@ def upload_payload(api_id, doc_id)
368374
fail_with(Failure::UnexpectedReply, 'Payload upload attempt failed') unless res&.code == 201
369375

370376
print_good('Payload uploaded successfully')
377+
register_file_for_cleanup(jsp_filename)
371378
return res
372379
end
373380

0 commit comments

Comments
 (0)