Dolibarr CRM Command Injection

Written by khalil on . Posted in Vulnerabilities

# Exploit Title: Dolibarr CRM < 3.9.1 - Command Injection Vulnerability
# Exploit Author: David Silveiro
# Exploit Author Github: github.com/davidsilveiro
# Exploit Author Twitter: # Exploit Title: Dolibarr CRM < 3.9.1 - Command Injection Vulnerability
# Exploit Author: David Silveiro
# Exploit Author Github: github.com/davidsilveiro
# Exploit Author Twitter: twitter.com/david_silveiro
# Vendor Homepage: https://www.dolibarr.org
# Software Link: https://sourceforge.net/projects/dolibarr/files/
# Date: Zero Day

Dolibarr ERP is a modern CRM to manage your company.It's opensource software,
designed for small and medium companies, foundations and freelancers.

It seems Dolibarr is open to Command Injection via the backup tool available
to administrative users. While the intention of the developers wasn't to allow
shell access, they've happened to do just that. It could be argued that the
assumption that's been made is simply; "But he who has Admin on the CRM,
has Admin on the Server".

As we know, that's not always the case. Especially if the Server Administrator
is unaware.

Vulnerable files:

GET: Dolibar_export.php
POST: export.php

POC:

Navigate to;

1) System Tools
2) Backup

You'll now notice 'Full Path to MysqlDump Command' on the right hand side.

Enter;

whoami;ifconfig;

Then select;

1) Compression 'None'
2) Generate backup

Continue by downloading the generated file on the upper right handside,
where the output of our commands will be.

Print