Windows Installation Guide For Suricata IDS/IPS/NSM
Windows Installation Guide For Suricata IDS/IPS/NSM
Windows Installation Guide For Suricata IDS/IPS/NSM
Suricata IDS/IPS/NSM
1 | Page
INSTALLATION............................................................................... 4
START CYGWIN............................................................................ 24
COMPILE SURICATA.....................................................................26
Download rules................................................................................................ 33
RUN SURICATA............................................................................38
2 | Page
INFO AND DOCUMENTATION.........................................................40
3 | Page
This is a guide of how to compile and come up with your own executable/binary of
Suricata IDS/IPS on Windows. If you do not want to do that – there is a auto
installation (MSI) windows native package here:
http://suricata-ids.org/download/
just run it and it will install and set up Suricata for you on your Windows system.
Installation
After the installation is done you would need to add the packages below to your
Cygwin installation - needed for Suricata to run:
Extra and useful libraries/packages for enabling extra features during compile/make
time or for compiling from git (latest devel version of Suricata):
4 | Page
The above packages will allow us to enable during compile and build time the
following extra features of Suricata –
➢ GeoIP
➢ MD5
5 | Page
Cygwin – download and install
About 500 -600MB of space needed in total with all the necessary prerequisites
installed.
Go ahead and install it with the default options (basically just click next and ok)
6 | Page
7 | Page
8 | Page
9 | Page
Here , select any mirror you want:
10 | P a g e
Click next to continue:
11 | P a g e
Next again to proceed with installation of the base packages:
12 | P a g e
Then you are going to see a progress bar:
13 | P a g e
14 | P a g e
Install Suricata specific dependencies
After the installation is finished – we need to install the Suricata specific build
dependencies (as described just before this section)
Click next and ok until you are presented with the following screen:
15 | P a g e
Here is where we search select and queue for installation the additional packages
needed.
In the picture below , in the search box type in the name of the package- the search
will return automatically , results , select the necessary package. Erase the
contentment of the search box and type in the name of the next package, select …
and so on.
Do the same for all the needed packages, DO NOT hit next until you have selected
all the packages.
16 | P a g e
libmpfr4, libmpfr-devel, mpfr, mingw-pthreads, gcc-core ,make, automake,
automake1.9, zlib, zlib-devel, zlib0, autoconf, autoconf2.5, libtool , libglib2.0-devel,
libglib2.0_0 ,pkg-config, libyaml-devel, libyaml0_2, libpcre1, libpcre-devel, file-
devel, gcc-g++, wget
After you are done selecting the packages – make sure the “search” box is cleared,
click the “view” button until the text on the right of the button displays “pending”.
Check and make sure all the needed packages are selected! If something is missing,
go back and select it!
17 | P a g e
Click Next:
After that click next (make sure the option “select required packages
(RECOMMENDED)” is selected!) :
18 | P a g e
The extra packages that you have selected will start to download and install:
19 | P a g e
This could also take 5 min or so. Then click finish:
20 | P a g e
System variables - add paths
Add path to system variables (Win 7, Win 8, 2008, 2012 Server - Control
Panel\System and Security\System\Advanced system settings\Environment
Variables) :
C:\cygwin\bin;C:\cygwin\lib\pkgconfig;
Add the above to environment system variables in your windows system!! See the
picture below
21 | P a g e
Edit the system path variable:
22 | P a g e
Add “ C:\cygwin\bin;C:\cygwin\lib\pkgconfig; “ without the quotes to the end of the ”
Variable value path “ :
23 | P a g e
Get libpcap – for windows
Go to http://www.winpcap.org/install/default.htm and download the WinPcap
installer for windows (at the time of this writing the current version was 4.1.3 )
Install the WinPcap (double click, and just use the default options, basically click
next and ok until finished.)
This is IMPORTANT , this is the development pack, we need that for Suricata to be
able to run on Windows.
Start Cygwin
Open CYGWIN. Double click your CYGWIN icon on your desktop. A Linux/bash like
command prompt will open:
24 | P a g e
JSON log output – eve.json
wget http://www.digip.org/jansson/releases/jansson-2.7.tar.gz
25 | P a g e
./configure --prefix=/usr && make clean && make && make install
That will enable JSON and eve.json availability for log output with Suricata on
Windows.
Compile Suricata
Suricata from git – latest version
(next section describes compilation for stable,beta,RC)
Type in
cd oisf
26 | P a g e
Then we execute the following command(type and hit enter):
The part -
27 | P a g e
will enable DM5s functionality for Suricata.
Like so:
28 | P a g e
Let it run…..this could take a few minutes or so
29 | P a g e
This section uses Suricata 3.0RC3 as an example.
If you want to install Suricata stable you can find it here - http://suricata-
ids.org/download/
1) wget http://www.openinfosecfoundation.org/download/suricata-3.0RC3.tar.gz
2) tar –zxf suricata-3.0RC3.tar.gz
3) cd suricata-3.0RC3
4) libtoolize -c && autoreconf -fv --install && ./configure --enable-luajit --enable-
pie --enable-geoip --disable-gccmarch-native --with-libnss-libraries=/usr/lib
--with-libnss-includes=/usr/include/nss/ --with-libnspr-libraries=/usr/lib --with-
libnspr-includes=/usr/include/nspr && make clean && make
The part -
NOTE: Please not the difference in the compilation line (4 above) for
stable/beta/RC and for git.
30 | P a g e
Next steps.
For the instructions below if you want to use stable or RC3 (as opposed to latest git
Suricata) – just substitute the oisf directory with the appropriate name – suricata-
3.0RC3 for example.
31 | P a g e
Set up and copy needed config and dll files
Create the following directories:
NOTE: It is not a must to place Suricata in C:\Program Files (x86)\Suricata you can
place it anywhere you would like.
1. cyggcc_s-1.dll
2. cygGeoIP-1.dll
3. cygluajit-5.1-2.dll
4. cygmagic-1.dll
5. cygnspr4.dll
6. cygnss3.dll
7. cygnssutil3.dll
8. cygpcre-1.dll
9. cygplc4.dll
10.cygplds4.dll
11.cygwin1.dll
12.cygz.dll
32 | P a g e
to your C:\Program Files (x86)\Suricata directory
Download rules
Go to http://rules.emergingthreats.net/open/suricata/
http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz
Then go to C:\cygwin\tmp\oisf
Copy
Open suricata.yaml with an editor – Notepad, Notepad++, whichever you like and
change the following lines:
33 | P a g e
# The default logging directory. Any log or output file will be
# placed here if its not specified with a full path name. This can be
….
….
#magic-file: /usr/share/file/magic
outputs:
- console:
enabled: yes
# type: json
- file:
enabled: yes
# type: json
# Set the default rule path here to search for the files.
34 | P a g e
default-rule-path: C:\\Program Files (x86)\\Suricata\\rules\\
rule-files:
...
vars:
address-groups:
EXTERNAL_NET: "!$HOME_NET"
HTTP_SERVERS: "$HOME_NET"
SMTP_SERVERS: "$HOME_NET"
35 | P a g e
suricata.exe –build-info
36 | P a g e
37 | P a g e
Run Suricata
like shown on the picture below (in this case – 10.0.2.15 is the IP/interface I want
Suricata to listen to, i.e. the IP that my network card has been configured with):
And you have yourself Suricata running (the start time could depend the PC/Server
CPU/MEM availability and of course how many rules and what options you have
enabled in suricata.yaml ):
38 | P a g e
Run Suricata on an un-ip'd interfaces
39 | P a g e
If you need to run Suricata on an un-ip'd interfaces(thanks to Rich Rumble for
pointing that out):
You can get the NIC UUID in a variety of ways, the simplest is using a single
command for WMIC:(from cmd prompt paste in the following)
If you know your NIC's IP you can filter the results with findstr:
Make sure the double slashes are used, and a backslash is placed before the curly
braces!
That’s it.
From here on it is up to you to configure Suricata the way it suits you best!
You can find much more info about setting up and tuning Suricata here:
40 | P a g e
https://redmine.openinfosecfoundation.org/projects/suricata/wiki
41 | P a g e