Labels: sma, snmp, snmpd.conf net-snmp, solaris
Labels: RRAS RAS VPN Windows 2003
var AIM_SERVERS [64.12.24.0/23,64.12.28.0/23,64.12.161.0/24,64.12.163.0/24,64.12.200.0/24,205.188.3.0/24,205.188.5.0/24,205.188.7.0/24,205.188.9.0/24,205.188.153.0/24,205.188.179.0/24,205.188.248.0/24]
var HOME_NET 192.168.37.0/24
var RULE_PATH /etc/snort/rules
var PREPROC_RULE_PATH /etc/snort/preproc_rules
var TELNET_SERVERS $HOME_NET
var SQL_SERVERS $HOME_NET
var HTTP_SERVERS $HOME_NET
var SMTP_SERVERS $HOME_NET
var DNS_SERVERS $HOME_NET
var EXTERNAL_NET !$HOME_NET
var SNMP_SERVERS $HOME_NET
# Next variable automatic added by SnortCenter, used in some rule(s).
var HTTP_PORTS any
#
preprocessor stream5_global: max_tcp 8192, track_tcp yes, track_udp no
preprocessor stream5_tcp: policy first, use_static_footprint_sizes
#
output log_tcpdump: tcpdump.log
#
#
#
config reference: bugtraq http://www.securityfocus.com/bid/
config reference: cve http://cve.mitre.org/cgi-bin/cvename.cgi?name=
config reference: arachNIDS http://www.whitehats.com/info/IDS
config reference: McAfee http://vil.nai.com/vil/content/v_
config reference: nessus http://cgi.nessus.org/plugins/dump.php3?id=
config reference: url http://
#
#
#-------------------------------------------------------------------------------
# $Id: classification.config, Tuesday 05th 2010f January 2010 05:05:23 PM
#-------------------------------------------------------------------------------
config classification: not-suspicious,Not Suspicious Traffic,3
config classification: unknown,Unknown Traffic,3
config classification: bad-unknown,Potentially Bad Traffic, 2
config classification: attempted-recon,Attempted Information Leak,2
config classification: successful-recon-limited,Information Leak,2
config classification: successful-recon-largescale,Large Scale Information Leak,2
config classification: attempted-dos,Attempted Denial of Service,2
config classification: successful-dos,Denial of Service,2
config classification: attempted-user,Attempted User Privilege Gain,1
config classification: unsuccessful-user,Unsuccessful User Privilege Gain,1
config classification: successful-user,Successful User Privilege Gain,1
config classification: attempted-admin,Attempted Administrator Privilege Gain,1
config classification: successful-admin,Successful Administrator Privilege Gain,1
config classification: rpc-portmap-decode,Decode of an RPC Query,2
config classification: shellcode-detect,Executable code was detected,1
config classification: string-detect,A suspicious string was detected,3
config classification: suspicious-filename-detect,A suspicious filename was detected,2
config classification: suspicious-login,An attempted login using a suspicious username was detected,2
config classification: system-call-detect,A system call was detected,2
config classification: tcp-connection,A TCP connection was detected,4
config classification: trojan-activity,A Network Trojan was detected, 1
config classification: unusual-client-port-connection,A client was using an unusual port,2
config classification: network-scan,Detection of a Network Scan,3
config classification: denial-of-service,Detection of a Denial of Service Attack,2
config classification: non-standard-protocol,Detection of a non-standard protocol or event,2
config classification: protocol-command-decode,Generic Protocol Command Decode,3
config classification: web-application-activity,access to a potentially vulnerable web application,2
config classification: web-application-attack,Web Application Attack,1
config classification: misc-activity,Misc activity,3
config classification: misc-attack,Misc Attack,2
config classification: icmp-event,Generic ICMP event,3
config classification: kickass-porn,SCORE! Get the lotion!,1
config classification: policy-violation,Potential Corporate Privacy Violation,1
config classification: default-login-attempt,Attempt to login by a default username and password,2
#
#
#-------------------------------------------------------------------------------
# $Id: Unknown-Catagory.rules, Tuesday 05th 2010f January 2010 05:05:23 PM
#-------------------------------------------------------------------------------
alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any ( sid: 1837; rev: 2; msg: "PORN alt.binaries.pictures.tinygirls"; flow: to_client,established; content: "alt.binaries.pictures.tinygirls"; nocase; classtype: kickass-porn;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any ( sid: 1292; rev: 9; msg: "ATTACK-RESPONSES directory listing"; flow: established; content: "test"; classtype: bad-unknown;)
alert tcp any any -> any any ( sid: 10293; rev: 10; msg: "testkaka_is_coming"; content: "testkaka";)
cd ~* Bản mới hơn có thể tìm trên sf: http://sourceforge.net/projects/nsnam/files/allinone/
wget http://nchc.dl.sourceforge.net/project/nsnam/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz
sudo apt-get install -f build-essential libxt-dev libxt6 libsm-dev libsm6 libice-dev libice6 libxmu-dev-Giải nén và cài đặt ns-allinone:
tar -xzf ns-allinone-2.34.tar.gz* Chú ý: với bản Ubuntu 9.10 có thể gặp lỗi sau
cd ns-allinone-2.34
./install
Lỗi này là do file config của otcl sử dụng nhầm linker (ld thay vì gcc).otcl.o: In function `OTclDispatch': /home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to `__stack_chk_fail_local' otcl.o: In function `Otcl_Init': /home/ns/ns-allinone-2.34/otcl/otcl.c:2284: undefined reference to `__stack_chk_fail_local' ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined ld: final link failed: Nonrepresentable section on output make: *** [libotcl.so] Error 1
gedit otcl-1.13/configuresửa dòng 6304 từ
thànhSHLIB_LD="ld -shared"
-Thiết lập biến môi trường:SHLIB_LD="gcc -shared"
gedit ~/.bashrc
#LD_LIBRARY_PATHSau đó chạy lệnh:
OTCL_LIB=/home/username/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/username/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
# TCL_LIBRARY
TCL_LIB=/home/username/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
# PATH
XGRAPH=/home/username/ns-allinone-2.34/bin:/home/username/ns-allinone-2.34/tcl8.4.18/unix:/home/username/ns-allinone-2.34/tk8.4.18/unix
NS=/home/username/ns-allinone-2.34/ns-2.34/
NAM=/home/username/ns-allinone-2.34/nam-1.14/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
PATH=$PATH:$XGRAPH:$NS:$NAM
source ~/.bashrc
http://210.245.86.152/tantt/msk15/genPATH(mirror http://www.mediafire.com/file/kjgg5njmz2q/genPATH )
đặt vào thư mục ns-allinone-2.34/
bash genPATHSau đó chạy lệnh:
source ~/.bashrc-Kiểm tra:
nsNếu thấy xuất hiện dấu nhắc:
%là đã thành công. Nếu chưa được kiểm tra lại bước Thiết lập biến môi trường.
sudo apt-get install gnuplot xgraph
#!/bin/bash
PWD=`pwd`
ns2PATH="#LD_LIBRARY_PATH\n
OTCL_LIB=$PWD/`ls $PWD | grep tcl-`\n
NS2_LIB=`pwd`/lib\n
X11_LIB=/usr/X11R6/lib\n
USR_LOCAL_LIB=/usr/local/lib\n
# TCL_LIBRARY\n
TCL_LIB=$PWD/`ls $PWD | grep -e tcl[0-9].*`/library\n
USR_LIB=/usr/lib\n
# PATH\n
XGRAPH=`pwd`/bin:$PWD/`ls $PWD | grep -e 'tcl[0-9].*'`/unix:$PWD/`ls $PWD | grep -e 'tk[0-9].*'`/unix\n
NS=$PWD/`ls $PWD | grep -e 'ns-[0-9].*'`/\n
NAM=$PWD/`ls $PWD | grep -e 'nam-[0-9].*'`/"
echo -e $ns2PATH >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB'>>~/.bashrc
echo 'export TCL_LIBRARY=$TCL_LIB:$USR_LIB'>>~/.bashrc
echo 'PATH=$PATH:$XGRAPH:$NS:$NAM'>>~/.bashrc
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uv rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rm rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum update
yum install rrdtool perl-CGI-SpeedyCGI fping httpd perl-libwww-perl.noarch fontconfig freetype dejavu-lgc-fonts.noarch perl-rrdtool
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz
tar xvzf smokeping-2.4.2.tar.gz
mv smokeping-2.4.2 /usr/local/smokeping
chown -R root:root /usr/local/smokeping
cd /usr/local/smokeping/bin
for foo in *.dist; do cp $foo `basename $foo .dist`; done
cd /usr/local/smokeping/etc/
for foo in *.dist; do cp $foo `basename $foo .dist`; done
cd /usr/local/smokeping/htdocs
for foo in *.dist; do cp $foo `basename $foo .dist`; done
#Thay đổi đường dẫn của các lib cần thiết, chú ý nếu bạn dùng bản 32bit thì phải thay đổi đường dẫn tương ứng
· change > use lib qw(/usr/pack/rrdtool-1.3.0-rp/lib/perl);
to > use lib qw(/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/RRDs);
# với bản 32 bit> use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs);
· change > use lib qw(lib);
to > use lib qw(/usr/local/smokeping/lib);
· change > Smokeping::main(”etc/config.dist”);
to > Smokeping::main(”/usr/local/smokeping/etc/config”);
vi /usr/local/smokeping/htdocs/smokeping.cgi
· change > use lib qw(/usr/pack/rrdtool-1.3.0-rp/lib/perl);
to > use lib qw(/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/RRDs);
#với bản 32bit> use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs);
· change > use lib qw(/home/oetiker/checkouts/smokeping/trunk/software/lib);
to > use lib qw(/usr/local/smokeping/lib);
· change > Smokeping::cgi(”/home/oetiker/checkouts/smokeping/trunk/software/etc/config.dist”);
to > Smokeping::cgi(”/usr/local/smokeping/etc/config”);
cp /usr/local/smokeping/htdocs/smokeping.cgi /var/www/cgi-bin
cp -R /usr/local/smokeping/htdocs/* /var/www/html/smokeping
· change > owner | contact | mailhostTạo thư mục lưu img và thông tin cho smokeping
to > what they should be
· change > imgcache = /home/oetiker/public_html/smokeping-ms/cache
to > imgcache = /var/www/html/smokeping/img
· change > imgurl = cache
to > imgurl = http://yoursite.url/smokeping/img
#quan trọng nếu không sẽ không thấy graph
· change > datadir = /tmp/smokeping-ms/data
to > datadir = /usr/local/smokeping/var
· change > piddir = /tmp/smokeping-ms/var
to > piddir = /usr/local/smokeping/var
· change > cgiurl = http://some.url/smokeping.cgi
to > cgiurl = http://yoursite.url/cgi-bin/smokeping.cgi
· change > smokemail = /home/oetiker/checkouts/smokeping/trunk/software/etc/smokemail.dist
to > smokemail = /usr/local/smokeping/etc/smokemail
· change > tmail = /home/oetiker/checkouts/smokeping/trunk/software/etc/tmail.dist
to > tmail = /usr/local/smokeping/etc/tmail
· change > template = /home/oetiker/checkouts/smokeping/trunk/software/etc/basepage.html.dist
to > template = /usr/local/smokeping/etc/basepage.html
#có thể phải sửa đổi file này cho phù hợp với đường dẫn của các file js, img trong thư mục smokeping/cropper và smokeping/img
· change > binary = /usr/sbin/fping
to > binary = /usr/sbin/fping
#tìm đường dẫn của fping bằng lệnh “which fping”
· comment out (#) the “*** Slaves ***” section
· comment out or remove everything below “*** Targets ***” > remark (don’t remove probe, menu, title)
· You’ll need to add your targets before you can do anything useful with smokeping.
mkdir -p /var/www/html/smokeping/imgChạy:
chown -R apache:apache /var/www/html/smokeping/img
mkdir /usr/local/smokeping/var
/usr/local/smokeping/bin/smokeping &
*** Slaves ***Edit mục Targets
secrets=/usr/local/smokeping/etc/smokeping_secrets
#File secrets ở trên phải được chmod 600, chown apache:apache
#Nếu ko sẽ ko start đc smokeping hoặc gây lỗi:
# WARNING: Opening secrets file /usr/local/smokeping/etc/smokeping_secrets: Permission denied
#File secrets chứa các dòng, mỗi dòng gồm có hostname của slave và pass
#(secrets string) cho slave đó theo định dạng:
#slave1:abc123
#slave2:abc123
+slave1
#bắt buộc phải trùng với hostname của slave
display_name=erul22
location=India
color=ff0000
++override
Probes.FPing.binary = /usr/bin/fping
#phần override để áp dụng các cấu hình cho từng slave nếu nó khác với master. Ví dụ như trên là chỉ ra đường dẫn của fping trên slave
*** Targets ***Ở slave:
slaves = slave1 slave2
#Chứa tên tất cả các slave.
#Nếu thiếu sẽ gây lỗi: "WARNING: No targets found for slave 'tên slave'"
...
+dest1
slaves =
...
+dest2
slaves = slave1
host = IPcuaHost
title = TenHost
#Đặt menu cho đẹp, chứa các host và title ở đây.
...
+dest3
./smokeping --master-url=http://master.url/smokeping.cgi \
--cache-dir=/var/smokeping/ \
--shared-secret=/var/smokeping/secret.txt
Subscribe to
Posts [Atom]