-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CVE-2023-3519 Citrix RCE #18240
Add CVE-2023-3519 Citrix RCE #18240
Conversation
Hi @zeroSteiner, first of all, thanks for your work on this.
A. you're currently targeting one precisely and this PoC would crash all other vulnerable instances regardless of the version of the instance ?1 For reference, the official advisory mentions this :
Footnotes
|
|
buffer = rand_text_alphanumeric(target['return_offset']).bytes.map { |b| (b < 0xa0) ? '%%%02x' % b : b.chr }.join | ||
buffer << [target['return']].pack('Q').bytes.map { |b| (b == 25) ? '%%%02x' % b : b.chr }.join | ||
buffer << shellcode.bytes.map { |b| (b < 0xa0) ? '%%%02x' % b : b.chr }.join |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment explaining that this block is about encoding away bad chars?
929a997
to
5d0b6e1
Compare
documentation/modules/exploit/freebsd/http/citrix_formssso_target_rce.md
Outdated
Show resolved
Hide resolved
ret | ||
SHELLCODE | ||
|
||
buffer = rand_text_alphanumeric(target['return_offset']).bytes.map { |b| (b < 0xa0) ? '%%%02x' % b : b.chr }.join |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe rand_text_alphanumeric
always returns alphanumeric characters that are < 0xa0
. Do we need to handle characters >= 0xa0
? Unless I'm missing something, this could be:
buffer = rand_text_alphanumeric(target['return_offset']).bytes.map { |b| (b < 0xa0) ? '%%%02x' % b : b.chr }.join | |
buffer = rand_text_alphanumeric(target['return_offset']).bytes.map { |b| '%%%02x' % b }.join |
SHELLCODE | ||
|
||
buffer = rand_text_alphanumeric(target['return_offset']).bytes.map { |b| (b < 0xa0) ? '%%%02x' % b : b.chr }.join | ||
buffer << [target['return']].pack('Q').bytes.map { |b| (b == 25) ? '%%%02x' % b : b.chr }.join |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly, the character that this wants to encode is %
. This character has an ascii value of 0x25
and not 25
, which will result in this character inserted in the buffer unencoded:
[43] pry(main)> [0x12432566].pack('Q').bytes.map { |b| (b == 25) ? '%%%02x' % b : b.chr }.join
=> "f%C\x12\x00\x00\x00\x00"
[44] pry(main)> [0x12432566].pack('Q').bytes.map { |b| (b == 0x25) ? '%%%02x' % b : b.chr }.join
=> "f%25C\x12\x00\x00\x00\x00"
buffer << [target['return']].pack('Q').bytes.map { |b| (b == 25) ? '%%%02x' % b : b.chr }.join | |
buffer << [target['return']].pack('Q').bytes.map { |b| (b == 0x25) ? '%%%02x' % b : b.chr }.join |
Thanks @zeroSteiner ! The last changes fixed the crash I had on my environment. However, I'm still not able to make it work. Now the server just resets the connection. Citrix ADC 13.0-91.12
Citrix ADC 13.1-37.38
Note that for Citrix ADC 13.0-91.12, I needed to set |
@cdelafuente-r7 does this now work with stability ? |
@AkechiShiro , yes! We just had a long debugging session with @zeroSteiner and found the issue. I was able to reliably execute the exploit against Citrix ADC versions 13.1-37.38 and 13.0-91.12 (targets 0 and 2). Thanks @zeroSteiner for fixing this live! I landed quickly before the release cut for this week. Example outputCitrix ADC versions 13.1-37.38
Citrix ADC versions 13.0-91.12
|
Release NotesThis adds an exploit for CVE-2023-3519 which is an unauthenticated RCE in Citrix ADC. By making a specially crafted HTTP GET request, an attacker can trigger a stack buffer overflow within the |
@zeroSteiner awesome! Any plans for also adding support for version 12.1 (the EOL one)? |
Nicely done, y'all! |
Hi, |
It was released in version 6.3.28. If you're running an older version then yes you can manually copy the files. Some distros like Kali take a week or two to pull in the latest version of Metasploit. |
Thank you for the information! I'll wait for a bit to see if it pulls in Kali! |
The exploit works on 13.1-48.47 but I still need to write the docs and look into a check method. I tested both the
cmd/unix/reverse_bash
andcmd/unix/python/meterpreter/reverse_tcp
payloads. Thensppe
process does not crash so the target can be exploited repeatedly. It's highly unlikely that the addresses and offsets will work on other Citrix targets. I'll need to review those and add them as necessary.Verification
RHOST
,PAYLOAD
and payload-related datastore optionsExample