ANTICHAT.XYZ    VIDEO.ANTICHAT.XYZ    НОВЫЕ СООБЩЕНИЯ    ФОРУМ  
Баннер 1   Баннер 2
Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей. Здесь обсуждаются безопасность, программирование, технологии и многое другое. Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
Вернуться   Форум АНТИЧАТ > Программирование > PHP, PERL, MySQL, JavaScript
   
 
 
Опции темы Поиск в этой теме Опции просмотра

PHP socks proxyhunter by nerezus
  #1  
Старый 26.04.2005, 19:20
Аватар для nerezus
nerezus
Pagan Heart
Регистрация: 12.08.2004
Сообщений: 3,791
Провел на форуме:
6490435

Репутация: 2290


Отправить сообщение для nerezus с помощью ICQ
Talking PHP socks proxyhunter by nerezus

Ищем ошибки, потом исправлю:
Код:
<?

//PHP socks proxyhunter by nerezus(ICQ 547097), 2005, GPL v.2

$from =$_GET['from'];
$to =$_GET['to'];
$pfrom =$_GET['pfrom'];
$pto =$_GET['pto'];
$outfile =$_GET['outfile'];
$timeout =$_GET['timeout'];
if ($outfile=='') $outfile='out.txt';
if ($timeout=='') $timeout=3;


function hex2bin($dump){
$dump=str_replace(' ', '', $dump);
$res='';
$dumplen=strlen($dump);
for ($i=0; $i<$dumplen; $i+=2){
$bt=$dump[$i].$dump[$i+1];
$res=$res.chr(hexdec($bt));}
return $res; }

function hexlen($s) {
$s=str_replace(' ', '', $s);
if (strlen($s)/2 <16) $v='0';
if (strlen($s)/2 <256) $v.='0';
if (strlen($s)/2 <4096) $v.='0';
$v.=dechex(strlen($s)/2);
return $v; }

function sockcheck( $sockip, $sockport, $timeout=10) {
$sres=0;
$f=fsockopen($sockip, $sockport, $ern, $ers, $timeout);
if (!$f) {
return 0;
} else {
$s=hex2bin('05 02 00 02');
fputs ($f, $s);
$g=fgets ($f,2);
$list= bin2hex($g);
if (($g[0]==hex2bin('04')) or ($g[0]==hex2bin('05'))) $sres=1;
fclose($f); 
return $sres; }
}


$form = "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"get\">
<center>
<b>PHP socks proxyhunter by nerezus(ICQ 547097),<br> 2005, GPL v.2</b><br>
IP range:<br>
<input type=\"text\" name=\"from\" size=\"15\" maxlength=\"15\">
<input type=\"text\" name=\"to\" size=\"15\" maxlength=\"15\"><br>
Port range:<br>
<input type=\"text\" name=\"pfrom\" size=\"5\" maxlength=\"5\">
<input type=\"text\" name=\"pto\" size=\"5\" maxlength=\"5\"><br>
Timeout: <input type=\"text\" name=\"timeout\" size=\"2\" maxlength=\"2\"><br>
Outfile: <br>
<input type=\"text\" name=\"outfile\" size=\"16\" maxlength=\"255\"><br>
<input type=\"submit\" value=\".: GO! :.\">
</form></center>";
if ($from == '' or $to == '' or $pfrom=='' or $pto=='')  echo $form;  else {
$flist=explode('.', $from);
$tlist=explode('.', $to);
$fip=$flist[0]*256*256*256+$flist[1]*256*256+$flist[2]*256+$flist[3];
$tip=$tlist[0]*256*256*256+$tlist[1]*256*256+$tlist[2]*256+$tlist[3];
for ($i=$fip; $i<=$tip; $i++) {
	$tmp=$i;
	$d1=floor($tmp / (256*256*256)); $tmp=$tmp-$d1*(256*256*256);
	$d2=floor($tmp / (256*256)); $tmp=$tmp-$d2*(256*256);
	$d3=floor($tmp / 256); $tmp=$tmp-$d3*256;
	$d4=$tmp;
	$ip="$d1.$d2.$d3.$d4";
	if (($d4!=0) && ($d4!=255)){ 
		for ($prt=$pfrom; $prt<=$pto; $prt++) {
			if (sockcheck($ip, $prt, $timeout)) { 
				$file = fopen ($outfile, "a");
				echo "$ip:$prt<br>\n";
				fputs ($file, "$ip:$prt\n");
				fclose($file);
				flush();
				}
			}
		
} } }?>
 
Ответить с цитированием
 





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


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




ANTICHAT.XYZ