2,修改cls_mysql.php文件的ErrorMsg函數,註釋掉那些錯誤提示,或者把錯誤寫入文件。
3,給所有$_COOKIE,$_POST,$_GET,$_REQUEST變量加sql關鍵字過濾。
4,修改後台地址,不要使用默認的admin
5,如有可能去掉後台的模板管理-》庫項目管理功能
1.修改cls_templage.php文件,添加函數:
function delete_php_code($content) { if(!empty($content)) { $pattern='/\<\?(.|\r\n|\s)*\?\>/U'; return preg_replace($pattern,'',$content); } }
2.第165行$out = $this->_eval($this->fetch_str(file_get_contents($filename)));修改為:
$out = $this->_eval($this->fetch_str($this->delete_php_code(file_get_contents($filename))));
3.第260行$source = $this->fetch_str(file_get_contents($filename));修改為:
$source = $this->fetch_str($this->delete_php_code(file_get_contents($filename)));
它的特色在於 "非常簡單",懂一點點 unix 就可以用了。
它的功能只是檢查與通知,主要是讓管理者知道一小時內有哪些檔案做了更動,若發現有不是自己去更動的檔案時,可以盡速檢查系統的弱點。 若系統已經有漏洞被入侵了,光是做檔案覆蓋是沒有用的,因此這個範例不包含檔案回覆的功能。
- 建立一個 /chk_file.csh,內容如下:
cd /tmp
find /var/www/htdocs -type f -mmin -60 -print >! xx.$$
set lines = `wc -l xx.$$`
if ( $lines[1] < 1 ) then
\rm xx.$$
else
mail -s file_changed me@xxx.com < xx.$$
\rm xx.$$
endif
** 註:
1. /var/www/htdocs 換成要監控的路徑
2. me@xxx.com 換成自己的 email
- 在 crontab 加入: 0 * * * * /bin/csh /chk_file.csh >/dev/null 2>&1
若要監控多個路徑,只要更動一行,範例:
find /var/www/htdocs /var/www/web2 -type f -mmin -60 -print >! xx.$$
- $file = 'image.jpg';
- // FILE TIME
- $filetime = filemtime($file); // displays in Seconds since the Unix Epoch
- echo date("M j, Y", $filetime); // would display the file creation/modified date as Feb 3, 2007
- // FILE SIZES
- $filesize = filesize($file); // displays in bytes
- $file_kb = round(($filesize / 1024), 2); // bytes to KB
- $file_mb = round(($filesize / 1048576), 2); // bytes to MB
- $file_gb = round(($filesize / 1073741824), 2); // bytes to GB
- // PHP does funny thing for files larger than 2GB
Fckeditor 漏洞
http://hi.baidu.com/cjdos/blog/item/2207e3ecd5f83629269791c4.html
沒有留言:
張貼留言