installing application prerequisites
I am a newbie to Linux environment. I am trying to install snort on my Ubuntu machine, while I am installing it, it often gets stuck in middle and says: libnet, zlib, daq are not found
. So I tried to download these packages. Then I started installing snort again and this time is saying that pcre is not found
. In windows if I install some software it will ask these package are needed to install and it will download that to perform the installation. Likewise is there any commands or something else to know what files are needed before the installation starts.
command-line
add a comment |
I am a newbie to Linux environment. I am trying to install snort on my Ubuntu machine, while I am installing it, it often gets stuck in middle and says: libnet, zlib, daq are not found
. So I tried to download these packages. Then I started installing snort again and this time is saying that pcre is not found
. In windows if I install some software it will ask these package are needed to install and it will download that to perform the installation. Likewise is there any commands or something else to know what files are needed before the installation starts.
command-line
Welcome to Ask Ubuntu! Please edit your question to specify how you are trying to install it, i.e. using which commands or applications.
– Melebius
Mar 14 at 9:25
1
What was wrong withsudo apt install snort
(since snort is packaged)?
– N0rbert
Mar 14 at 20:13
add a comment |
I am a newbie to Linux environment. I am trying to install snort on my Ubuntu machine, while I am installing it, it often gets stuck in middle and says: libnet, zlib, daq are not found
. So I tried to download these packages. Then I started installing snort again and this time is saying that pcre is not found
. In windows if I install some software it will ask these package are needed to install and it will download that to perform the installation. Likewise is there any commands or something else to know what files are needed before the installation starts.
command-line
I am a newbie to Linux environment. I am trying to install snort on my Ubuntu machine, while I am installing it, it often gets stuck in middle and says: libnet, zlib, daq are not found
. So I tried to download these packages. Then I started installing snort again and this time is saying that pcre is not found
. In windows if I install some software it will ask these package are needed to install and it will download that to perform the installation. Likewise is there any commands or something else to know what files are needed before the installation starts.
command-line
command-line
edited Mar 14 at 10:37
Prajwal Dhatwalia
518211
518211
asked Mar 14 at 5:12
user934244user934244
31
31
Welcome to Ask Ubuntu! Please edit your question to specify how you are trying to install it, i.e. using which commands or applications.
– Melebius
Mar 14 at 9:25
1
What was wrong withsudo apt install snort
(since snort is packaged)?
– N0rbert
Mar 14 at 20:13
add a comment |
Welcome to Ask Ubuntu! Please edit your question to specify how you are trying to install it, i.e. using which commands or applications.
– Melebius
Mar 14 at 9:25
1
What was wrong withsudo apt install snort
(since snort is packaged)?
– N0rbert
Mar 14 at 20:13
Welcome to Ask Ubuntu! Please edit your question to specify how you are trying to install it, i.e. using which commands or applications.
– Melebius
Mar 14 at 9:25
Welcome to Ask Ubuntu! Please edit your question to specify how you are trying to install it, i.e. using which commands or applications.
– Melebius
Mar 14 at 9:25
1
1
What was wrong with
sudo apt install snort
(since snort is packaged)?– N0rbert
Mar 14 at 20:13
What was wrong with
sudo apt install snort
(since snort is packaged)?– N0rbert
Mar 14 at 20:13
add a comment |
1 Answer
1
active
oldest
votes
Snort is a signature based intrusion detection system, it either drops or accepts the packets coming on a certain interface depending on the rules you have used. Follow the below steps to install it properly:
Section - I: Preparing your System
Before actually installing Snort, run these commands to install all the required pre-requisites:
sudo apt-get update
sudo apt-get dist-upgrade
Reboot your system after running the above commands
Open the command-line interface again and run these commands:
sudo apt-get install build-essential
sudo apt-get install -y libpcap-dev libpcre3-dev libdumbnet-dev
sudo apt-get install -y zlib1g-dev liblzma-dev openssl libssl-dev
sudo apt-get bison flex
Now your system is ready to install Snort
Section - II: Installing Daq
Snort requires "Daq" to run. You can create a separate folder for all your downloads mkdir ~/snort
. It will keep all your downloads in one place. Download and Extract "Daq" using the commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
tar -xvzf daq-2.0.6.tar.gz
cd daq-2.0.6
./configure
make
sudo make install
- Above commands will download the "daq" source code and then install it properly.
Section - III: Installing Snort
You are now ready to download the Snort source code. Run the following commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/snort-2.9.8.3.tar.gz
tar -xvzf snort-2.9.8.3.tar.gz
cd snort-2.9.8.3
./configure
make
sudo make install
sudo ldconfig
sudo ln -s /usr/local/bin/snort /usr/sbin/snort
Snort is now installed on your system, but you will still have to configure it properly to use it. Run the snort -V
command to ensure Snort is properly installed on your system.
Section - IV: Creating some required Directories
"Snort" need some folder and files to place its logs, errors and rules files. If you are good with bash script, create it, or else run these commands at once or you can just execute them one by one:
sudo groupadd snort
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
sudo mkdir /etc/snort
sudo mkdir /etc/snort/rules
sudo mkdir /etc/snort/rules/iplists
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo mkdir /etc/snort/so_rules
sudo touch /etc/snort/rules/iplists/black_list.rules
sudo touch /etc/snort/rules/iplists/white_list.rules
sudo touch /etc/snort/rules/local.rules
sudo touch /etc/snort/sid-msg.map
sudo mkdir /var/log/snort
sudo mkdir /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort
sudo chmod -R 5775 /var/log/snort
sudo chmod -R 5775 /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort/so_rules
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules
sudo chown -R snort:snort /etc/snort
sudo chown -R snort:snort /var/log/snort
sudo chown -R snort:snort /usr/local/lib/snort_dynamicrules
cd ~/snort/snort-2.9.8.3/etc/
sudo cp *.conf* /etc/snort
sudo cp *.map /etc/snort
sudo cp *.dtd /etc/snort
cd ~/snort/snort-2.9.8.3/src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/
sudo cp * /usr/local/lib/snort_dynamicpreprocessor/
CAUTION: Please do not ignore these commands.
Section - VI: Editing Snort configuration files
We also need to modify some configuration files to run Snort in network intrusion detection mode. For this, we would need to comment out all the rules in snort configuration file. Here's the command:
sudo sed -i "s/include $RULE_PATH/#include $RULE_PATH/" /etc/snort/snort.conf
Once you have commented out all the rules, it is time to test Run the Snort.
Section - VII: Testing Snort
To make sure that Snort is running in network intrusion detection mode, we need to insert a rule in our Rules file. So, open it and run the following rule:
alert ip any any -> any any (msg:"ATTACK RESPONSES id check returned root"; content: "uid=0(root)"; classtype:bad-unknown;
sid:498; rev:3;)
- Now run Snort using:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i ens3
Note: It will start listening on interface ens3, so, make sure you replace it with your interface name. After running Snort, open another SSH Connection to the server and run this command: ping -b 255.255.255.255 -p "7569643d3028726f6f74290a" -c3
You should now be able to see alerts on SSH where you have started Snort.
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commandsmkdir
,touch
,chmod
,chown
,cp
, it’s not necessary to duplicate these lines.
– Melebius
Mar 14 at 9:39
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1125501%2finstalling-application-prerequisites%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Snort is a signature based intrusion detection system, it either drops or accepts the packets coming on a certain interface depending on the rules you have used. Follow the below steps to install it properly:
Section - I: Preparing your System
Before actually installing Snort, run these commands to install all the required pre-requisites:
sudo apt-get update
sudo apt-get dist-upgrade
Reboot your system after running the above commands
Open the command-line interface again and run these commands:
sudo apt-get install build-essential
sudo apt-get install -y libpcap-dev libpcre3-dev libdumbnet-dev
sudo apt-get install -y zlib1g-dev liblzma-dev openssl libssl-dev
sudo apt-get bison flex
Now your system is ready to install Snort
Section - II: Installing Daq
Snort requires "Daq" to run. You can create a separate folder for all your downloads mkdir ~/snort
. It will keep all your downloads in one place. Download and Extract "Daq" using the commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
tar -xvzf daq-2.0.6.tar.gz
cd daq-2.0.6
./configure
make
sudo make install
- Above commands will download the "daq" source code and then install it properly.
Section - III: Installing Snort
You are now ready to download the Snort source code. Run the following commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/snort-2.9.8.3.tar.gz
tar -xvzf snort-2.9.8.3.tar.gz
cd snort-2.9.8.3
./configure
make
sudo make install
sudo ldconfig
sudo ln -s /usr/local/bin/snort /usr/sbin/snort
Snort is now installed on your system, but you will still have to configure it properly to use it. Run the snort -V
command to ensure Snort is properly installed on your system.
Section - IV: Creating some required Directories
"Snort" need some folder and files to place its logs, errors and rules files. If you are good with bash script, create it, or else run these commands at once or you can just execute them one by one:
sudo groupadd snort
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
sudo mkdir /etc/snort
sudo mkdir /etc/snort/rules
sudo mkdir /etc/snort/rules/iplists
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo mkdir /etc/snort/so_rules
sudo touch /etc/snort/rules/iplists/black_list.rules
sudo touch /etc/snort/rules/iplists/white_list.rules
sudo touch /etc/snort/rules/local.rules
sudo touch /etc/snort/sid-msg.map
sudo mkdir /var/log/snort
sudo mkdir /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort
sudo chmod -R 5775 /var/log/snort
sudo chmod -R 5775 /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort/so_rules
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules
sudo chown -R snort:snort /etc/snort
sudo chown -R snort:snort /var/log/snort
sudo chown -R snort:snort /usr/local/lib/snort_dynamicrules
cd ~/snort/snort-2.9.8.3/etc/
sudo cp *.conf* /etc/snort
sudo cp *.map /etc/snort
sudo cp *.dtd /etc/snort
cd ~/snort/snort-2.9.8.3/src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/
sudo cp * /usr/local/lib/snort_dynamicpreprocessor/
CAUTION: Please do not ignore these commands.
Section - VI: Editing Snort configuration files
We also need to modify some configuration files to run Snort in network intrusion detection mode. For this, we would need to comment out all the rules in snort configuration file. Here's the command:
sudo sed -i "s/include $RULE_PATH/#include $RULE_PATH/" /etc/snort/snort.conf
Once you have commented out all the rules, it is time to test Run the Snort.
Section - VII: Testing Snort
To make sure that Snort is running in network intrusion detection mode, we need to insert a rule in our Rules file. So, open it and run the following rule:
alert ip any any -> any any (msg:"ATTACK RESPONSES id check returned root"; content: "uid=0(root)"; classtype:bad-unknown;
sid:498; rev:3;)
- Now run Snort using:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i ens3
Note: It will start listening on interface ens3, so, make sure you replace it with your interface name. After running Snort, open another SSH Connection to the server and run this command: ping -b 255.255.255.255 -p "7569643d3028726f6f74290a" -c3
You should now be able to see alerts on SSH where you have started Snort.
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commandsmkdir
,touch
,chmod
,chown
,cp
, it’s not necessary to duplicate these lines.
– Melebius
Mar 14 at 9:39
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
add a comment |
Snort is a signature based intrusion detection system, it either drops or accepts the packets coming on a certain interface depending on the rules you have used. Follow the below steps to install it properly:
Section - I: Preparing your System
Before actually installing Snort, run these commands to install all the required pre-requisites:
sudo apt-get update
sudo apt-get dist-upgrade
Reboot your system after running the above commands
Open the command-line interface again and run these commands:
sudo apt-get install build-essential
sudo apt-get install -y libpcap-dev libpcre3-dev libdumbnet-dev
sudo apt-get install -y zlib1g-dev liblzma-dev openssl libssl-dev
sudo apt-get bison flex
Now your system is ready to install Snort
Section - II: Installing Daq
Snort requires "Daq" to run. You can create a separate folder for all your downloads mkdir ~/snort
. It will keep all your downloads in one place. Download and Extract "Daq" using the commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
tar -xvzf daq-2.0.6.tar.gz
cd daq-2.0.6
./configure
make
sudo make install
- Above commands will download the "daq" source code and then install it properly.
Section - III: Installing Snort
You are now ready to download the Snort source code. Run the following commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/snort-2.9.8.3.tar.gz
tar -xvzf snort-2.9.8.3.tar.gz
cd snort-2.9.8.3
./configure
make
sudo make install
sudo ldconfig
sudo ln -s /usr/local/bin/snort /usr/sbin/snort
Snort is now installed on your system, but you will still have to configure it properly to use it. Run the snort -V
command to ensure Snort is properly installed on your system.
Section - IV: Creating some required Directories
"Snort" need some folder and files to place its logs, errors and rules files. If you are good with bash script, create it, or else run these commands at once or you can just execute them one by one:
sudo groupadd snort
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
sudo mkdir /etc/snort
sudo mkdir /etc/snort/rules
sudo mkdir /etc/snort/rules/iplists
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo mkdir /etc/snort/so_rules
sudo touch /etc/snort/rules/iplists/black_list.rules
sudo touch /etc/snort/rules/iplists/white_list.rules
sudo touch /etc/snort/rules/local.rules
sudo touch /etc/snort/sid-msg.map
sudo mkdir /var/log/snort
sudo mkdir /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort
sudo chmod -R 5775 /var/log/snort
sudo chmod -R 5775 /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort/so_rules
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules
sudo chown -R snort:snort /etc/snort
sudo chown -R snort:snort /var/log/snort
sudo chown -R snort:snort /usr/local/lib/snort_dynamicrules
cd ~/snort/snort-2.9.8.3/etc/
sudo cp *.conf* /etc/snort
sudo cp *.map /etc/snort
sudo cp *.dtd /etc/snort
cd ~/snort/snort-2.9.8.3/src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/
sudo cp * /usr/local/lib/snort_dynamicpreprocessor/
CAUTION: Please do not ignore these commands.
Section - VI: Editing Snort configuration files
We also need to modify some configuration files to run Snort in network intrusion detection mode. For this, we would need to comment out all the rules in snort configuration file. Here's the command:
sudo sed -i "s/include $RULE_PATH/#include $RULE_PATH/" /etc/snort/snort.conf
Once you have commented out all the rules, it is time to test Run the Snort.
Section - VII: Testing Snort
To make sure that Snort is running in network intrusion detection mode, we need to insert a rule in our Rules file. So, open it and run the following rule:
alert ip any any -> any any (msg:"ATTACK RESPONSES id check returned root"; content: "uid=0(root)"; classtype:bad-unknown;
sid:498; rev:3;)
- Now run Snort using:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i ens3
Note: It will start listening on interface ens3, so, make sure you replace it with your interface name. After running Snort, open another SSH Connection to the server and run this command: ping -b 255.255.255.255 -p "7569643d3028726f6f74290a" -c3
You should now be able to see alerts on SSH where you have started Snort.
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commandsmkdir
,touch
,chmod
,chown
,cp
, it’s not necessary to duplicate these lines.
– Melebius
Mar 14 at 9:39
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
add a comment |
Snort is a signature based intrusion detection system, it either drops or accepts the packets coming on a certain interface depending on the rules you have used. Follow the below steps to install it properly:
Section - I: Preparing your System
Before actually installing Snort, run these commands to install all the required pre-requisites:
sudo apt-get update
sudo apt-get dist-upgrade
Reboot your system after running the above commands
Open the command-line interface again and run these commands:
sudo apt-get install build-essential
sudo apt-get install -y libpcap-dev libpcre3-dev libdumbnet-dev
sudo apt-get install -y zlib1g-dev liblzma-dev openssl libssl-dev
sudo apt-get bison flex
Now your system is ready to install Snort
Section - II: Installing Daq
Snort requires "Daq" to run. You can create a separate folder for all your downloads mkdir ~/snort
. It will keep all your downloads in one place. Download and Extract "Daq" using the commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
tar -xvzf daq-2.0.6.tar.gz
cd daq-2.0.6
./configure
make
sudo make install
- Above commands will download the "daq" source code and then install it properly.
Section - III: Installing Snort
You are now ready to download the Snort source code. Run the following commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/snort-2.9.8.3.tar.gz
tar -xvzf snort-2.9.8.3.tar.gz
cd snort-2.9.8.3
./configure
make
sudo make install
sudo ldconfig
sudo ln -s /usr/local/bin/snort /usr/sbin/snort
Snort is now installed on your system, but you will still have to configure it properly to use it. Run the snort -V
command to ensure Snort is properly installed on your system.
Section - IV: Creating some required Directories
"Snort" need some folder and files to place its logs, errors and rules files. If you are good with bash script, create it, or else run these commands at once or you can just execute them one by one:
sudo groupadd snort
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
sudo mkdir /etc/snort
sudo mkdir /etc/snort/rules
sudo mkdir /etc/snort/rules/iplists
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo mkdir /etc/snort/so_rules
sudo touch /etc/snort/rules/iplists/black_list.rules
sudo touch /etc/snort/rules/iplists/white_list.rules
sudo touch /etc/snort/rules/local.rules
sudo touch /etc/snort/sid-msg.map
sudo mkdir /var/log/snort
sudo mkdir /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort
sudo chmod -R 5775 /var/log/snort
sudo chmod -R 5775 /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort/so_rules
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules
sudo chown -R snort:snort /etc/snort
sudo chown -R snort:snort /var/log/snort
sudo chown -R snort:snort /usr/local/lib/snort_dynamicrules
cd ~/snort/snort-2.9.8.3/etc/
sudo cp *.conf* /etc/snort
sudo cp *.map /etc/snort
sudo cp *.dtd /etc/snort
cd ~/snort/snort-2.9.8.3/src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/
sudo cp * /usr/local/lib/snort_dynamicpreprocessor/
CAUTION: Please do not ignore these commands.
Section - VI: Editing Snort configuration files
We also need to modify some configuration files to run Snort in network intrusion detection mode. For this, we would need to comment out all the rules in snort configuration file. Here's the command:
sudo sed -i "s/include $RULE_PATH/#include $RULE_PATH/" /etc/snort/snort.conf
Once you have commented out all the rules, it is time to test Run the Snort.
Section - VII: Testing Snort
To make sure that Snort is running in network intrusion detection mode, we need to insert a rule in our Rules file. So, open it and run the following rule:
alert ip any any -> any any (msg:"ATTACK RESPONSES id check returned root"; content: "uid=0(root)"; classtype:bad-unknown;
sid:498; rev:3;)
- Now run Snort using:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i ens3
Note: It will start listening on interface ens3, so, make sure you replace it with your interface name. After running Snort, open another SSH Connection to the server and run this command: ping -b 255.255.255.255 -p "7569643d3028726f6f74290a" -c3
You should now be able to see alerts on SSH where you have started Snort.
Snort is a signature based intrusion detection system, it either drops or accepts the packets coming on a certain interface depending on the rules you have used. Follow the below steps to install it properly:
Section - I: Preparing your System
Before actually installing Snort, run these commands to install all the required pre-requisites:
sudo apt-get update
sudo apt-get dist-upgrade
Reboot your system after running the above commands
Open the command-line interface again and run these commands:
sudo apt-get install build-essential
sudo apt-get install -y libpcap-dev libpcre3-dev libdumbnet-dev
sudo apt-get install -y zlib1g-dev liblzma-dev openssl libssl-dev
sudo apt-get bison flex
Now your system is ready to install Snort
Section - II: Installing Daq
Snort requires "Daq" to run. You can create a separate folder for all your downloads mkdir ~/snort
. It will keep all your downloads in one place. Download and Extract "Daq" using the commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
tar -xvzf daq-2.0.6.tar.gz
cd daq-2.0.6
./configure
make
sudo make install
- Above commands will download the "daq" source code and then install it properly.
Section - III: Installing Snort
You are now ready to download the Snort source code. Run the following commands:
cd ~/snort
wget https://www.snort.org/downloads/snort/snort-2.9.8.3.tar.gz
tar -xvzf snort-2.9.8.3.tar.gz
cd snort-2.9.8.3
./configure
make
sudo make install
sudo ldconfig
sudo ln -s /usr/local/bin/snort /usr/sbin/snort
Snort is now installed on your system, but you will still have to configure it properly to use it. Run the snort -V
command to ensure Snort is properly installed on your system.
Section - IV: Creating some required Directories
"Snort" need some folder and files to place its logs, errors and rules files. If you are good with bash script, create it, or else run these commands at once or you can just execute them one by one:
sudo groupadd snort
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
sudo mkdir /etc/snort
sudo mkdir /etc/snort/rules
sudo mkdir /etc/snort/rules/iplists
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo mkdir /etc/snort/so_rules
sudo touch /etc/snort/rules/iplists/black_list.rules
sudo touch /etc/snort/rules/iplists/white_list.rules
sudo touch /etc/snort/rules/local.rules
sudo touch /etc/snort/sid-msg.map
sudo mkdir /var/log/snort
sudo mkdir /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort
sudo chmod -R 5775 /var/log/snort
sudo chmod -R 5775 /var/log/snort/archived_logs
sudo chmod -R 5775 /etc/snort/so_rules
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules
sudo chown -R snort:snort /etc/snort
sudo chown -R snort:snort /var/log/snort
sudo chown -R snort:snort /usr/local/lib/snort_dynamicrules
cd ~/snort/snort-2.9.8.3/etc/
sudo cp *.conf* /etc/snort
sudo cp *.map /etc/snort
sudo cp *.dtd /etc/snort
cd ~/snort/snort-2.9.8.3/src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/
sudo cp * /usr/local/lib/snort_dynamicpreprocessor/
CAUTION: Please do not ignore these commands.
Section - VI: Editing Snort configuration files
We also need to modify some configuration files to run Snort in network intrusion detection mode. For this, we would need to comment out all the rules in snort configuration file. Here's the command:
sudo sed -i "s/include $RULE_PATH/#include $RULE_PATH/" /etc/snort/snort.conf
Once you have commented out all the rules, it is time to test Run the Snort.
Section - VII: Testing Snort
To make sure that Snort is running in network intrusion detection mode, we need to insert a rule in our Rules file. So, open it and run the following rule:
alert ip any any -> any any (msg:"ATTACK RESPONSES id check returned root"; content: "uid=0(root)"; classtype:bad-unknown;
sid:498; rev:3;)
- Now run Snort using:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i ens3
Note: It will start listening on interface ens3, so, make sure you replace it with your interface name. After running Snort, open another SSH Connection to the server and run this command: ping -b 255.255.255.255 -p "7569643d3028726f6f74290a" -c3
You should now be able to see alerts on SSH where you have started Snort.
edited Mar 14 at 9:35
Melebius
5,05752040
5,05752040
answered Mar 14 at 5:49
Manu MathurManu Mathur
54129
54129
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commandsmkdir
,touch
,chmod
,chown
,cp
, it’s not necessary to duplicate these lines.
– Melebius
Mar 14 at 9:39
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
add a comment |
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commandsmkdir
,touch
,chmod
,chown
,cp
, it’s not necessary to duplicate these lines.
– Melebius
Mar 14 at 9:39
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commands
mkdir
, touch
, chmod
, chown
, cp
, it’s not necessary to duplicate these lines.– Melebius
Mar 14 at 9:39
Please use block code formatting when posting multiple commands, I’ve edited it this time. Also note that you can specify multiple files for all of the commands
mkdir
, touch
, chmod
, chown
, cp
, it’s not necessary to duplicate these lines.– Melebius
Mar 14 at 9:39
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
Thank you, sir. I couldn't edit my response due to power failure. Will ensure it isn't repeated.
– Manu Mathur
Mar 14 at 9:40
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1125501%2finstalling-application-prerequisites%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Welcome to Ask Ubuntu! Please edit your question to specify how you are trying to install it, i.e. using which commands or applications.
– Melebius
Mar 14 at 9:25
1
What was wrong with
sudo apt install snort
(since snort is packaged)?– N0rbert
Mar 14 at 20:13