[Day 2] 1. Overview of SNORT
Introduction to Intrusion Detection System (IDS)
- An Intrusion Detection System (IDS) monitors network traffic and allows only authorized packets into the system.
- The definition of intrusion varies across organizations and is determined by their respective policies.
- Authorized and unauthorized traffic is also defined by the organization's specific rules.
What is SNORT?
- SNORT is an Open Source Intrusion Detection System.
- It can operate in multiple modes:
- Packet Capturing or Sniffing Mode: Used to verify SNORT's installation and functionality.
- NIDS (Network Intrusion Detection System) Mode: For detecting intrusions and analyzing network traffic.
- Packet Logging Mode: Logs network packets to a disk for later analysis.
Installation Steps
-
Install Winpcap
- Download and install Winpcap, a library required for SNORT to capture network packets.
-
Verify Winpcap Installation
- Open the Add or Remove Programs section in Windows to ensure Winpcap is installed successfully.
-
Install SNORT
- Download and install SNORT in the folder (recommended for easier setup).
C:\
- Download and install SNORT in the
-
Add SNORT to Defender Exclusion List
- Add the SNORT folder () to the Windows Defender exclusion list to prevent interference.
C:\Snort
- Add the SNORT folder (
-
Ensure 7-Zip is Installed
- Install 7-Zip, which will be used to extract rule files.
-
Extract Rule Files
- Navigate to the folder containing .
snortrules-snapshot-2923.tar.gz- Right-click and choose .
7-Zip > Extract Here - If the option isn’t visible, select More Options after right-clicking.
7-Zip
- Right-click and choose
- After extraction, right-click the file and choose
.tar.7-Zip > Extract Files- Set as the destination folder.
C:\Snort - In the options, select Overwrite without prompt and uncheck any checkboxes.
- Set
- Navigate to the folder containing
-
Open Command Prompt and Configure SNORT
- Open Command Prompt as an administrator and navigate to :
C:\Snort\bin
shellcd C:\Snort\bin - Open Command Prompt as an administrator and navigate to
-
Verify SNORT Installation
- Run the following command to list available network interfaces, confirming SNORT is installed correctly.
shellsnort -W
Address any errors shown during the setup and apply the extra changes suggested in the error logs. The steps to resolve those errors are given below.
Key Commands and Usage
Running SNORT
-
Always run SNORT as an administrator. (Run
as administrator and navigate to thecmd) then start using theC:\Snort\bincommands:snort -
Default SNORT executable path:
plaintextC:\Snort\bin\snort.exe
List Network Interfaces
-
Use the following command to list interfaces supported by SNORT:
shellsnort -W -
Use this along with:
shellgetmac /fo csv /vThis retrieves MAC addresses of network adapters, helping identify the correct interface.
Capture Packets
-
To select a specific interface (e.g., interface 4):
shellsnort -i 4 -
Stop packet capturing:
- Press .
CTRL + C
- Press
Additional Flags
-
To see application layer data:
shellsnort -i 4 -d -
To see data link layer data:
shellsnort -i 4 -e -
For verbose output:
shellsnort -i 4 -v
Rules in SNORT
- SNORT uses rules to detect known threats, similar to how antivirus software uses signature files.
- Initially, the rules folder is empty.
- You can:
- Download pre-defined rule files from SNORT developers.
- Create custom rule files tailored to specific needs.
Important Note
- Add SNORT rule files to the Windows Defender exclusion list to avoid interference.
browser-ie.rules
File
browser-ie.rules- This file contains rules related to Internet Explorer vulnerabilities. This file is automatically deleted if you do not add the folder to the exclusion list of Windows Defender.
Snort
Read Next
[Day 2] 2. SNORT Setup
### **Basic Command Syntax** ```shell snort -i 4 -c C:\Snort\etc\snort.conf -l C:\Snort\log -A console ``` #### **Explanation of Parameters**...
[Day 2] 3. SNORT Rules
### **Writing a SNORT Rule** - To create a rule, start with an empty text file and write the rule in it. - Each rule is separated by a space. - T...