Просмотр файла index.php

Размер файла: 3.44Kb
<?php
error_reporting(0);
$server=rawurldecode(trim($_GET['server'])); $login=rawurldecode(trim($_GET['login']));
$pass=rawurldecode(trim($_GET['pass'])); $d=rawurldecode(trim($_GET['d']));
include_once("cnfg.php");

if (($server==NULL)||($login==NULL)) {
if ($server==NULL) {$server="ftp.";}
header("Content-Type: text/vnd.wap.wml; charset=Utf-8");
echo ("<?xml version=\"1.0\" encoding=\"Utf-8\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\"><wml>
<head><meta forua=\"true\" http-equiv=\"Cache-Control\" content=\"no-cache,no-store,must-revalidate\"/></head><card title=\"Punk77-FTP\">
<p align=\"left\"><small>
Перед использованием данного сервиса внимательно читайте FAQ!!<br/>
<a href=\"faq.php\">-=FAQ=-</a><br/>
- - -<br/>
Сервер:</small>
<input name=\"sr\" value=\"$server\" type=\"text\" maxlength=\"250\"/><br/>
<small>Логин:</small>
<input name=\"lg\" value=\"$login\" type=\"text\" maxlength=\"250\"/><br/>
<small>Пароль:</small>
<input name=\"ps\" value=\"$pass\" type=\"password\" maxlength=\"250\"/><br/>
<small>Перейти в папку:</small>
<input name=\"d\" value=\"/\" type=\"text\" maxlength=\"250\"/><br/>
<select name=\"bs\" multiple=\"true\" value=\"0\"><option value=\"1\">Размер файлов</option></select>
<select name=\"bi\" multiple=\"true\" value=\"0\"><option value=\"1\">Иконки</option></select><br/><small>
<anchor>-=Войти=-<go href=\"$dftp/index.php?i=$(bi)&amp;s=$(bs)\" method=\"get\">
<postfield name=\"server\" value=\"$(sr)\"/>
<postfield name=\"login\" value=\"$(lg)\"/>
<postfield name=\"pass\" value=\"$(ps)\"/>
<postfield name=\"d\" value=\"$(d)\"/>
</go></anchor>
<br/>- - -<br/>
<u>Автор:</u> <a href=\"http://wap.mysiem.net\">Punk77</a><br/>
<u>Помогали в создании:</u> <a href=\"http://shefon.kmx.ru\">Shefon</a>, <a href=\"http://loyz.ru\">&#171; LoyZ &#187;</a>
</small></p>
</card></wml>");
} else {
 $arr=array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F",
 "G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y",
 "Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r",
 "s","t","u","v","w","x","y","z");
 $key=$arr[rand(0,61)].$arr[rand(0,61)].$arr[rand(0,61)].$arr[rand(0,61)].$arr[rand(0,61)].$arr[rand(0,61)].$arr[rand(0,61)];
 $repl=array("^"=>""); $time=time(); $server=strtolower(trim(strtr($server,$repl)));
 $login=trim(strtr($login,$repl)); $pass=trim(strtr($pass,$repl));
 $v=trim($_GET['v']); if ($v==NULL) {$v=20;} elseif (($v<10)||($v>100)) {$v=20;}
 $s=trim($_GET['s']); if ($s==1) {$sz=1;} else {$sz=0;}
 $i=trim($_GET['i']); if ($i==1) {$ib=1;} else {$ib=0;}
 $str=$key."^$server^$login^$pass^$v^$time^$sz^$ib\r\n"; $fl=@file("userkeys.dat");
 if ($fl<>NULL) {
  for ($i=0;$i<count($fl);$i++) {
   list($p1,$p2,$p3,$p4,$p5,$p6,$p7,$p8)=split('\^',trim($fl[$i]));
   if ($p1==$key) {
    header("Location: $dftp/index.php?server=$server&login=$login&pass=$pass"); exit;
   }
   if (($time-$p6<2700)&&($p2<>$server)&&($p3<>$login)) {$str.=$fl[$i];}
   else {
    include_once("freedata.php"); freedata($p1);
   }
  }
 }
 $f=@fopen("userkeys.dat","w"); @fwrite($f,$str); @fclose($f);
 $dir=""; if (($d<>NULL)&&($d<>"/")) {$dir="&d=".rawurlencode($d);}
 $dir=str_replace(".htaccess",".|htaccess",$dir);
 header("Location: $dftp/ftp.php?k=$key$dir"); exit;
}
?>