ad_728x90

參觀我的【 伊生活小舖】

2014年9月5日 星期五

Linux上使用netstat命令查證DDOS攻擊

你可以知道在受到攻擊之後如何在終端中使用netstat命令檢查你的服務器。

  一些例子和解釋

netstat -na顯示所有連接到服務器的活躍的網絡連接netstat -an | grep :80 | sort只顯示連

接到80段口的活躍的網絡連接,80是http端口,這對於web服務器非常有用,並且對結果排序.對

於你從許多的連接中找出​​單個發動洪水攻擊IP非常有用netstat -n -p|grep SYN_REC | wc -l

這個命令對於在服務器上找出活躍的SYNC_REC非常有用,數量應該很低,最好少於5.在dos攻

擊和郵件炸彈,這個數字可能非常高.然而值通常依賴於系統,所以高的值可能平分給另外的服

務器.netstat -n -p | grep SYN_REC | sort -u列出所有包含的IP地址而不僅僅是計數.netstat -

n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'列出所有不同的IP地址節點發送

SYN_REC的連接狀態netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n使

用netstat命令來計算每個IP地址對服務器的連接數量netstat -anp |grep 'tcp |udp' | awk

'{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n列出使用tcp和udp連接到服務器的數目

netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr檢查

ESTABLISHED連接而不是所有連接,這可以每個ip的連接數netstat -plan|grep :80|awk

{'print $5' }|cut -d: -f 1|sort|uniq -c|sort -nk 1顯示並且列出連接到80端口IP地址和連接

數.80被用來作為HTTP

  如何緩解DDoS攻擊

當你發現攻擊你服務器的IP你可以使用下面的命令來關閉他們的連接:

iptables -A INPUT 1 -s $IPADRESS -j DROP/REJECT

請注意你必須用你使用netstat命令找到的IP數替換$IPADRESS

在完成以上的命令,使用下面的命令殺掉所有httpd連接,清除你的系統,然後重啟httpd服務。

killall -KILL httpd service httpd start #For Red Hat systems /etc/init/d/apache2 restart

如何檢查他們的網站是否已經淪陷,變成StealRat殭屍網路/傀儡網路 Botnet的一部分


在本篇文章裡,我們會討論網站管理員可以如何檢查他們的網站是否已經淪陷,變成StealRat殭屍網路/傀儡網路 Botnet的一部分。
第一步是檢查是否有垃圾郵件發送腳本的存在,通常會用sm13e.phpsm14e.php的名稱。不過要注意的是,這些腳本可能會改變檔案名稱,所以最好還是要檢查是否有任何陌生的PHP檔案存在。

DDOS 攻擊實例.<圖示>...



說明:本人已移除此資料夾,所以是 File does not exist.

2014年9月4日 星期四

netstat指令參數


-a / --all : 顯示所有連接中的 Socket。 
-c / --continuous : 持續列出網路狀態。 
-C / --cache : 顯示路由配置的快取資訊。 
-F / --fib : 顯示 Forward Information Base。 
-g / --groups : 顯示 Multicast 的群組名單。 
-i / --interfaces : 顯示網路介面資訊表單。 
-l / --listening : 顯示監控中的伺服器的 Socket。 
-n / -numeric : 直接使用 IP Address,而不使用名稱伺服器。 
-o / --timers : 顯示計時器。 

-p / --programs : 顯示正在使用 Socket 的程式識別碼和程式名稱。 
-r / --route : 顯示 Routing Table。 
-s / -- statistics : 顯示網路工作資訊統計表。 
-t / --tcp : 顯示 TCP 的連線狀況。 
-u / --ucp : 顯示 UCP 的連線狀況。 
-w / -raw : 顯示 RAW 的連線狀況。 
-x / --unix / -A unix : 列出 Unix 傳輸協定連線中的相關位址。 
ip / inet / -A inet : 列出 DARPA 傳輸協定 ( Internet ) 連線中的相關位址。 
DARPA:Defense Advanced Research Projects Agency。 


哪些主機會承受(Slowloris)攻擊....Which web-server's are affected by slowloris attack?

  1. Apache (1.x & 2.x)
  2. dhttpd
  3. Goahead web server
Web server's that work on an event based architecture like nginx are not affected by a slowloris attack.
It seems that IIS is also is not affected by a slowloris attack(although not tested by us).

防護Apache受攻擊(Slowloris)..._Protect Apache Against Slowloris Attack ! 

Slowloris allows a single machine to take down another machine’s web server with minimal bandwidth and side effects on unrelated services and ports. The tools used to launch Slowloris attack can be downloaded at http://ha.ckers.org/slowloris/
Slowloris tries to keep many connections to the target web server open and hold them open as long as possible. It accomplishes this by opening connections to the target web server and sending a partial request. Periodically, it will send subsequent HTTP headers, adding to—but never completing—the request. Affected servers will keep these connections open, filling their maximum concurrent connection pool, eventually denying additional connection attempts from clients.
Following web server has been tested and NOT affected by this kind of attack:
  • IIS6.0
  • IIS7.0
  • lighttpd
  • Squid
  • nginx
  • Cherokee
  • Netscaler
  • Cisco CSS

Install and Configure wget on OS X Mavericks 10.9 and fix SSL GNUTLS error

Get Xcode

To add and install wget to your system you need to download the source files, compile the code and make an install. 
Next you need to install the Xcode command line tools, easiest way to do so by running in the Terminal:
xcode-select --install

COMMENTS HAVE BEEN DISABLED FOR THIS POST [文章的評論已被禁用]

Ratings and Recommendations by outbrain