NTOPNG
사이트: http://www.ntop.org/products/traffic-analysis/ntop/
Github: https://github.com/ntop
웹기반으로 트래픽을 분석하고 흐름을 수집해주는 도구로, ntop의 차세대 버전이다.
자세한 기능과 설명은 사이트를 참조한다.
사용자 가이드
https://github.com/ntop/ntopng/blob/dev/doc/UserGuide.pdf
설치
우분투 16에서 ntopng는 apt 리스트에 이미 있다.
설치
sudo apt-get install ntopng
redis-server도 같이 설치되는 것으로 보임. 확인해 볼 것.
설정
sudo vi /etc/ntopng.conf
다음 소스를 참조하여 수정한다.
http://idroot.net/linux/install-ntopng-ubuntu-16-04/
# /etc/ntopng/ntopng.conf
#
# The configuration file is similar to the command line, with the exception that an equal
# sign '=' must be used between key and value. Example: -i=p1p2 or --interface=p1p2 For
# options with no value (e.g. -v) the equal is also necessary. Example: "-v=" must be used.
#
#
# -G|--pid-path
# Specifies the path where the PID (process ID) is saved.
#
-G=/var/tmp/ntopng.pid
#
# -e|--daemon
# This parameter causes ntop to become a daemon, i.e. a task which runs in the background
# without connection to a specific terminal. To use ntop other than as a casual monitoring
# tool, you probably will want to use this option.
#
-e=
#
# -i|--interface
# Specifies the network interface or collector endpoint to be used by ntopng for network
# monitoring. On Unix you can specify both the interface name (e.g. lo) or the numeric
# interface id as shown by ntopng -h. On Windows you must use the interface number instead.
# Note that you can specify -i multiple times in order to instruct ntopng to create multi‐
# ple interfaces.
#
-i=1
#
# -w|--http-port
# Sets the HTTP port of the embedded web server.
#
-w=3000
#
# -m|--local-networks
# ntopng determines the ip addresses and netmasks for each active interface. Any traffic on
# those networks is considered local. This parameter allows the user to define additional
# networks and subnetworks whose traffic is also considered local in ntopng reports. All
# other hosts are considered remote. If not specified the default is set to 192.168.1.0/24.
#
# Commas separate multiple network values. Both netmask and CIDR notation may be used,
# even mixed together, for instance "131.114.21.0/24,10.0.0.0/255.0.0.0".
#
-m=192.168.1.0/24
#
# -n|--dns-mode
# Sets the DNS address resolution mode: 0 - Decode DNS responses and resolve only local
# (-m) numeric IPs 1 - Decode DNS responses and resolve all numeric IPs 2 - Decode DNS
# responses and don't resolve numeric IPs 3 - Don't decode DNS responses and don't resolve
#
-n=1
#
# -S|--sticky-hosts
# ntopng periodically purges idle hosts. With this option you can modify this behaviour by
# telling ntopng not to purge the hosts specified by -S. This parameter requires an argu‐
# ment that can be "all" (Keep all hosts in memory), "local" (Keep only local hosts),
# "remote" (Keep only remote hosts), "none" (Flush hosts when idle).
#
-S=
#
# -d|--data-dir
# Specifies the data directory (it must be writable). Default directory is ./data
#
-d=/var/tmp/ntopng
#
# -q|--disable-autologout
# Disable web interface logout for inactivity.
#
-q=
실행
sudo service ntopng restart
실행이 잘 되고 있는지 확인
netstat -tulpn | grep :3000
주의) ntopng는 기본으로 3000번 포트를 사용하므로, 서버 보안 정책의 inbound에 3000번 포트를 열어주어야 한다.
테스트
웹브라우져에 다음과 같은 주소를 입력하고, 관리자 ID와 비밀번호를 입력한다.
Ntopng와 연결된 패키지인 pf-ring, Ndpi 등은 같이 설치해 봤으나 ntopng가 안열리는 문제가 있었음.
그외 연동 가능 한 것: Fritz!Box routers(
http://www.ntop.org/ntopng/how-to-use-ntopng-for-realtime-traffic-analysis-on-fritzbox-routers/\
)
ntopng의 옵션 보기
sudo ntopng -h
관리자 비밀번호 변경
ntopng 관리 사이트에 들어가서 관리자로 로그인하면 "사용자 관리"에서 변경할 수 있다.
ntopng의 정식 매뉴얼: https://github.com/ntop/ntopng/blob/dev/doc/README.compilation
admin 비밀번호 재설정
아래와 같이 하면 된다는데 안됨.
sudo redis-cli SET user.admin.password <MD5>
일반 문자열을 md5로 바꿀려면 다음과 같이 한다.
echo -n "admin" | md5sum
다음과 같은 방법으로 reset한다.
특정 사용자의 비밀번호를 다음과 같이 삭제하면 기본 비밀번호인 admin/admin 으로 로그인할 수 있다.
sudo service ntopng stop
sudo redis-cli del ntopng.user.admin.password
sudo service ntopng start
이제 admin 비밀번호가 "admin"으로 reset 되었다.
---------------- 아래서 부터는 검토안됨 ---------------------
준비를 위한 설치
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential git bison flex libxml2-dev libpcap-dev libtool libtool-bin rrdtool librrd-dev autoconf automake autogen redis-server wget libsqlite3-dev libhiredis-dev libgeoip-dev libcurl4-openssl-dev libpango1.0-dev libcairo2-dev libnetfilter-queue-dev zlib1g-dev libssl-dev
sudo apt-get install libpng12-dev libmysqlclient-dev libzmq3-dev
sudo apt-get install debhelper dpkg-sig dkms
ntopng 설치
sudo cd <compilation directory>
sudo git clone https://github.com/ntop/nDPI.git
cd nDPI; sudo ./autogen.sh; sudo ./configure; sudo make; cd ..
sudo git clone https://github.com/ntop/ntopng.git
cd ntopng
sudo ./autogen.sh
sudo ./configure
sudo make
https://github.com/ntop/ntopng/blob/dev/doc/README.md
-> redis 서버의 필요성에 대해 나온다.
주의 참고)
https://github.com/ntop/ntopng/tree/dev/doc
여기에 있는 것들중 필요한 것은 꼭 읽어보자
특히 README.compilation, README.redis , README.mysql 등
개인 작성 매뉴얼.
https://sdn-lab.com/2017/04/28/visualizing-sflow-data-with-ntop-and-nprobe-on-ubuntu-16-04/
https://blog.webernetz.net/2016/02/09/ntopng-installation/
http://idroot.net/linux/install-ntopng-ubuntu-16-04/
http://devinegrace.tistory.com/4
http://www.pcquest.com/installing-ntopng-a-web-based-network-traffic-analysis-tool/
-> redis 서버에 관해 조금 나온다. 필요한가?
Restart ntop service
Type the following command, enter:# /etc/init.d/ntop restart
Verify ntop is working, enter:# netstat -tulpn | grep :3000