Linux

Apache / Ubuntu 9.04:如何應對威脅並提高伺服器環境的安全性?

  • October 18, 2012

我們的伺服器託管了一千多個站點,其中一些站點似乎已被惡意腳本劫持。這些腳本執行通常由合法使用者集體執行的操作,在我們的伺服器上造成嚴重的壓力,並且經常需要我們重新啟動以清除負載。我們沒有辦法找出它們是什麼。最近,這些攻擊已經開始影響我們的日常運營。我們的錯誤日誌文件大小為 70mb,其中包含類似於以下內容的消息:

[timstamp] [error] [client xx.xxx.xx.xxx] File does not exist: /path/favicon.ico (File exists. This is the majority of all log entries)
[timstamp] [error] [client xxx.xxx.xx.xxx] client denied by server configuration: /path/to/cron.php (This is my TOP concern)
[timstamp] [error] [client xxx.xx.xx.xx] Directory index forbidden by Options directive: /another/path
[timstamp] [error] [client xx.xx.xxx.xxx]  ALERT - canary mismatch on efree() - heap overflow detected (attacker 'xxx.xx.xxx.xxx', file '/path/to/index.php')
[timstamp] [error] [client xx.xx.xxx.xx]  Directory index forbidden by Options directive: /path/to/another/file_or_folder/
[timstamp] [error] [client xxx.xx.x.xx] Invalid URI in request GET /../../ HTTP/1.1
[timstamp] [error] [client xx.xxx.xx.xx] client denied by server configuration: /path/to/another/web/file/
Invalid URI in request GET mydomain.com HTTP/1.0

我們的數據庫日誌文件大小超過 5GB。

我的問題是,我們能做些什麼來應對這些威脅?有沒有辦法根據某些行為禁止 IP?我們仍在篩選我們的日誌並試圖確定行動方案。任何可以提供的指南、參考資料或教程將不勝感激。

  1. 升級你的系統。 Ubuntu 9.04 已經兩年沒有獲得安全更新了。
  2. client denied by server configuration: /path/to/cron.php- 別擔心這個。該請求被 Apache 的配置阻止,攻擊者得到了403 Forbidden響應。
  3. ALERT - canary mismatch on efree() - heap overflow detected (attacker 'xxx.xx.xxx.xxx', file '/path/to/index.php')- 這可能是一個主要問題 - 緩衝區溢出漏洞可以讓攻擊者完全控制您的系統。另一方面,可能只是攻擊者試圖接管您的系統只是觸發了 PHP 中的錯誤。

系統可能已經受到威脅;如有疑問,請從備份中恢復。然後,將此系統升級到受支持的目前版本的作業系統,這也將更新您的應用程序包。查看您是否仍有問題,如果是,請通過徹底驗證客戶端輸入數據來消除緩衝區溢出。

引用自:https://serverfault.com/questions/439586