
17.07.2008, 00:56
|
|
Members of Antichat - Level 5
Регистрация: 24.10.2007
Сообщений: 256
Провел на форуме: 6905523
Репутация:
1174
|
|
SinChat 1.0 beta1
Type: [XSS]
Product: SinChat
Author: ZAMUT
Passive XSS:
Код:
/chat/reg.php?error={XSS}&mail=&site
/chat/showinfo.php?nick={XSS}
Active XSS:
Vuln code:
/reg.php
PHP код:
}else{
$nick=$_POST['nick'];
$pass=$_POST['pass'];
$pass2=$_POST['pass2'];
$mail=$_POST['mail'];
$site=$_POST['site'];
$sexe=$_POST['sexe'];
$all="mail=$mail&site=$site";
$error=0;
...
if ($error==null){
$PrintData="$nick::$pass::user::$mail::$site::$sexe\n";
$fp=fopen("data/users.dat", "a+");
if(fwrite($fp,$PrintData)){
$html="Пользователь зарегистрирован";
}else {
$html="Ошибка при регистрации";
}
fclose($fp);
}
Как видим, при регистрации не фильтруются входящие данные. Информация пишется в файл users.dat, наш код сработает в любом месте, где можем смотреть данные профиля. к примеру:
Код:
/chat/showinfo.php?nick=lol
Art-Soft Mini Chat!
Type: [XSS]
Product: Art-Soft Mini Chat!
Author: ZAMUT
Active XSS:
Vuln code:
/write_msg.php
PHP код:
include "option.php";
$fl = file($msg_file);
$count_fl = count($fl);
$msg = stripslashes(trim($_POST['msg']));
$person = trim($_POST['person']);
if (($msg != "") && ($person != ""))
{
if ($count_fl >= $msg_count)
{
$fw = fopen($msg_file, "w");
for($i=1;$i<$msg_count;$i++) fwrite($fw, trim($fl[$i])."\r\n");
}
$time = strftime("%H:%M:%S", time());
$fp = fopen($msg_file, "a+");
$fw = fwrite($fp, $person."¤".$time."¤".$msg."\r\n");
fclose($fp); ?>
Уязвимые поля: "Имя", "Сообщение". Чат не требует регистрации.
__________________
в строю
|
|
|