
28.08.2009, 16:51
|
|
Постоянный
Регистрация: 02.03.2008
Сообщений: 893
С нами:
9574565
Репутация:
712
|
|
index.html
Код HTML:
<form action="reger.php" method="post">
Логин: <input type="text" name="login"><br>
Пароль: <input type = "text" name="password"><br>
E-mail: <input type ="text" name = "email"><br>
<input type ="submit" value="Регистрация">
</form>
reger.php
PHP код:
<?php
@set_time_limit(0);
//-----------------//
$accounts = 'accounts.txt'; // Файл для сохранения аккаунтов
$divider = ':'; // Раздеитель
//-----------------//
function post($url,$post,$refer)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox/3.0.4");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_REFERER, $refer);
curl_setopt($ch, CURLOPT_COOKIEJAR, "./cook1");
curl_setopt($ch, CURLOPT_COOKIEFILE, "./cook1");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
return $result;
}
if($_POST['captcha'])
{
$result = post('http://moemesto.ru/register/','from=button&captchaid='.$_POST['captchaid'].'&login='.$_POST['login'].'&email='.$_POST['email'].'&password='.$_POST['password'].'&captcha='.trim($_POST['captcha']).'&do_reg=%D0%97%D0%B0%D1%80%D0%B5%D0%B3%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C%D1%81%D1%8F','http://moemesto.ru/register/?from=button');
$result = iconv("UTF-8","Windows-1251",$result);
if(preg_match('#2>П(.*?)з#i',$result,$end))
{
$fh = fopen($accounts, "a+");
$success - fwrite($fh, $_POST['login'].$divider.$_POST['password']."\r\n");
fclose($fh);
Header('Location: reger.php');
}
else
{
echo '<script>alert(\'Не правильный код!\')</script>';
echo '<meta http-equiv="Refresh" content="0; url=reger.php">';
}
}
else
{
$result = post('http://moemesto.ru/register/',null,'http://moemesto.ru/');
preg_match('#id" value="(.*?)"#i',$result,$captchaid);
echo '<img src="http://moemesto.ru/captcha/'.$captchaid[1].'"><br>
<form name="captcha_form" action="reger.php" method="POST">
<input type="text" name="captcha" value="" /><br>
<input type="hidden" name="captchaid" value="'.$captchaid[1].'" />
<input type="hidden" name="login" value="'.$_POST['login'].'" />
<input type="hidden" name="password" value="'.$_POST['password'].'" />
<input type="hidden" name="email" value="'.$_POST['email'].'" />
<input type="submit" value="ok">
</form>';
}
/* geforse.name */
?>
|
|
|