Last active
February 24, 2021 03:47
-
-
Save bluesku/ab0e6e761997cb3a3dc9113313b6228d to your computer and use it in GitHub Desktop.
Snort-v3-install-32-64bits.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
#Shell Varibles' | |
RED='\033[0;31m' | |
BIGreen='\033[1;92m' | |
NC='\033[0m' | |
Bred='\033[1;31m' | |
mkdir ~/snort3-Plus | |
cd ~/snort3-Plus | |
echo ${BIGreen} '# made by Henrique Silva : scriptxone.blogspot.com' ${NC} | |
echo ${BIGreen} '# Ive made some ajustments to include some rules ::' ${NC} | |
# script reference: https://gist.github.com/cstayyab/f17911194e998a8c7ad18eeb58bddef2 | |
# requirements | |
apt install -y git libtool autoconf | |
apt install -y build-essential autotools-dev libdumbnet-dev libluajit-5.1-dev libpcap-dev zlib1g-dev pkg-config libhwloc-dev cmake | |
apt install -y liblzma-dev openssl libssl-dev cpputest libsqlite3-dev uuid-dev | |
# Installing Snort DAQ Prerequisites | |
apt install install -y bison flex | |
# Installing libraries for Snort inline mode using NFQ | |
apt install -y libnetfilter-queue-dev libmnl-dev | |
# Downloading and installing safec | |
cd ~/snort3-Plus | |
wget https://github.com/rurban/safeclib/releases/download/v04062019/libsafec-04062019.0-ga99a05.tar.gz | |
tar -xzvf libsafec-04062019.0-ga99a05.tar.gz | |
cd libsafec-04062019.0-ga99a05/ | |
./configure | |
make && make install | |
# Installing latest PRCE | |
cd ~/snort3-Plus/ | |
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz | |
tar -xzvf pcre-8.43.tar.gz | |
cd pcre-8.43 | |
./configure | |
make && make install | |
# Download and install gpertools 2.7 | |
cd ~/snort3-Plus | |
wget https://github.com/gperftools/gperftools/releases/download/gperftools-2.7/gperftools-2.7.tar.gz | |
tar xzvf gperftools-2.7.tar.gz | |
cd gperftools-2.7 | |
./configure | |
make && make install | |
#Installing Regal and Boost headers for HyperScan | |
cd ~/snort3-Plus | |
wget http://www.colm.net/files/ragel/ragel-6.10.tar.gz | |
tar -xzvf ragel-6.10.tar.gz | |
cd ragel-6.10 | |
./configure | |
make && make install | |
# Installing Boost | |
cd ~/snort3-Plus | |
wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz | |
tar -xvzf boost_1_71_0.tar.gz | |
# Install Hyperscan 5.2 from source | |
cd ~/snort3-Plus | |
wget https://github.com/intel/hyperscan/archive/v5.2.0.tar.gz | |
tar -xvzf v5.2.0.tar.gz | |
mkdir ~/snort3-Plus/hyperscan-5.2.0-build | |
cd hyperscan-5.2.0-build/ | |
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBOOST_ROOT=~/snort3-Plus/boost_1_71_0/ ../hyperscan-5.2.0 | |
make && make install | |
cd ~/snort3-Plus/hyperscan-5.2.0-build/ | |
./bin/unit-hyperscan | |
# Installing (Optional) Flatbuffers Library | |
cd ~/snort3-Plus | |
wget https://github.com/google/flatbuffers/archive/v1.11.0.tar.gz -O flatbuffers-v1.11.0.tar.gz | |
tar -xzvf flatbuffers-v1.11.0.tar.gz | |
mkdir flatbuffers-build | |
cd flatbuffers-build | |
cmake ../flatbuffers-1.11.0 | |
make && make install | |
# Download and install DAQ from Snort Website | |
cd ~/snort3-Plus | |
git clone https://github.com/snort3/libdaq.git | |
cd libdaq | |
./bootstrap | |
./configure | |
make && make install | |
# Downloading and Installing Snort 3 | |
cd ~/snort3-Plus | |
git clone git://github.com/snortadmin/snort3.git | |
cd snort3 | |
./configure_cmake.sh --prefix=/usr/local --enable-tcmalloc | |
cd build | |
make && make install | |
echo ${BIGreen} 'Starting SNORT in '${NC} ; ldconfig | |
snort -V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment