Imported Upstream version 2.7
[ossec-hids.git] / doc / nmap.txt
1 OSSEC
2 Copyright (C) 2009 Trend Micro Inc.
3
4
5 ** Nmap correlation **
6
7 Ossec can read nmap grepable output files to use as a
8 correlation tool and also to alert based on host information
9 changes. Follow the step by step below on how to configure
10 ossec:
11
12
13 1- Add the nmap output file on ossec.conf (generally 
14    at /var/ossec/etc/ossec.conf):
15
16 <ossec_config>
17   <localfile>
18     <log_format>nmapg</log_format>
19     <location>/var/log/nmap-out.log</location>
20   </localfile>
21 </ossec_config>
22
23
24 2- If the file does not exist, touch it:
25
26 ossec-test# touch /var/log/nmap-out.log
27
28
29 3- Restart ossec:
30
31 ossec-test# /var/ossec/bin/ossec-control restart
32
33
34 4- Run your nmap scans (example scanning 192.168.2.0/24 network):
35
36 ossec-test# nmap --append_output -sU -sT -oG /var/log/nmap-out.log 192.168.2.0-255
37
38
39
40 *** Example of alert when a new host is found:
41
42 ** Alert 1152058913.238: mail
43 2006 Jul 04 20:21:53 /var/log/nmap-out.log
44 Rule: 15 (level 8) -> 'New host information added.'
45 Src IP: (none)
46 User: (none)
47 Host: 192.168.2.10, open ports: 21(tcp) 22(tcp) 80(tcp) 113(tcp) 514(udp) 1514(udp) 4500(udp)
48
49
50 *** Example of alert when a new a host information is changed:
51
52 ** Alert 1152058983.487: mail
53 2006 Jul 04 20:23:03 /var/log/nmap-out.log
54 Rule: 15 (level 8) -> 'Host information changed.'
55 Src IP: (none)
56 User: (none)
57 Host: 192.168.2.1, open ports: 54(udp) 8080(tcp) 161(udp) 520(udp) 1025(udp) 1900(udp)
58 Previously open ports: 53(udp) 80(tcp) 161(udp) 520(udp) 1025(udp) 1900(udp)
59