trafshowを使ってみた

VPSの運営からおたくからUDP-Floodしてるぞ
と怒られたので、調査してみた。

結局は、複数人で管理しているので
その内の一人が自宅へiperfとかもろもろやってたのが
原因でした。

入れるのは簡単!!

で入ります。
CentOSなら

yum install trafshow

Ubuntuなら

# apt-cache search netdiag
netdiag - Net-Diagnostics (trafshow,netwatch,statnet,tcpspray,tcpblast)
# apt-get install netdiag



とりあえず

# trafshow -h
Usage:
 trafshow [-vpnb] [-a len] [-c conf] [-i ifname] [-s str] [-u port] [-R refresh] [-P purge] [-F file | expr]
Where:
 -v         Print version number, compile-time definitions, and exit
 -p         Don't put the interface(s) into promiscuous mode
 -n         Don't convert numeric values to names
 -b         To place a backflow near to the main stream
 -a len     To aggregate IP addresses using the prefix length
 -c conf    Color config file instead of default /etc/trafshow
 -i ifname  Network interface name; all by default
 -s str     To search & follow for string in the list show
 -u port    UDP port number to listen for Cisco Netflow; default 9995
 -R refresh Set the refresh-period of data show to seconds; default 2 sec
 -P purge   Set the expired data purge-period to seconds; default 10 sec
 -F file    Use file as input for the filter expression
 expr       Filter expression; see tcpdump(1) for syntax

どうやら、
/etc/trafshow」が設定ファイルがあるらしい。

覗いてみる

# cat /etc/trafshow

#
# default fcolor:bcolor
#       - Set the default screen background color-pair
#
# port[/proto] fcolor:bcolor
#       - Set color pattern by service port
#
# [proto] source[/mask][,port] destination[/mask][,port] fcolor:bcolor
#       - Set color pattern by pair of from-to addresses
#
# Reserved tokens `*', `any', `all' matchs ANY in the pattern.
#
# The colors are:
#       black  red  green  yellow  blue  magenta  cyan  white
#
# The upper-case Fcolor mean bright *on* and Bcolor blink *on*.
#

#default white:blue

# following color settings looks nice under black-on-gray xterm (xterm-color)

# Private IP Addresses will be alarmed by Red foreground.
# Source        Destination     Color

10.0.0.0/8      any             Red
any             10.0.0.0/8      Red
127.0.0.1/8     any             Red
any             127.0.0.1/8     Red
172.16.0.0/16   any             Red
any             172.16.0.0/16   Red
192.168.0.0/16  any             Red
any             192.168.0.0/16  Red

# Network Services.
# Service       Color   Comments

135             Red     # netbios
137             red     # netbios
138             red     # netbios
139             red     # netbios

snmp            white
smux            white
162             White   # snmp-trap
67              white   # bootp/dhcp-server
68              white   # bootp/dhcp-client
546             white   # dhcpv6-client
547             white   # dhcpv6-server
timed           white
who             white

domain          cyan
389             cyan    # ldap
636             cyan    # ldaps
*/icmp          Cyan

http            blue
https           blue
3128            Blue    # http-proxy
8080            Blue    # http-proxy

smtp            Green
nntp            Green
pop3            green
995             green   # pop3s
143             green   # imap2,4
220             green   # imap3

ftp             yellow
20              Yellow  # ftp-data
tftp            Yellow
nfs             Yellow
6000            Yellow  # X11

ssh             magenta
telnet          Magenta
sunrpc          Magenta
513/tcp         Magenta # rsh
514/tcp         Magenta # rcmd

いろいろと色を変えたりできるみたい

起動画面はアレなので省略しますw

使うオプションは
そのままだとホスト名が表示されるので「-n」でIP表示にしたり
-s str」で絞り込んだりなどでしょうか。

ここで、トラフィックや通信相手が分かるので
あとは、netstatなどでプロセスも絞り込めるかと思います。

何はともあれ不正使用されてなくてよかった・・・
[tegaki]とらしゅ勉強したいなぁ[/tegaki]

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Enter code * Time limit is exhausted. Please reload CAPTCHA.

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください