LoginSignup
28
30

More than 5 years have passed since last update.

LinuxサーバでDOSられた時にさくっと確認する方法

Last updated at Posted at 2014-12-09

WEB(TCP:80番)の場合
これで、80番にDOS食らってる時は、どこから来てるかの判断ができるはず( ー`дー´)キリッ
あとは、ファイアウォールで止めるなりなんなり・・・よしなに。

netstat -nat | grep 80 | awk '{ print $5}' | cut -d ":" -f 1 | sort | uniq -c | sort -r

解説

1(netstat -nat)

接続されているTCPコネクションの一覧を取得

2(grep 80)

ポート80番のみとする

3(awk '{ print $5}')

5行目を抜き出す

4(cut -d ":" -f 1)

IPとポートを「:」にて切り分けます。

5(sort )

sortで並び替えます

6(uniq -c)

unic -cでユニークIPの件数を数えます

7(sort -r)

件数の多い順に並び替え

28
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
30