Close this search box.
Close this search box.

Testing Snort: Simulating Intrusions, Part 3

Welcome to the third installment of our exploration into deploying and mastering Snort. Previously, we embarked on this journey using Kali Linux for our foundational steps, covering installation and basic setup. However, as we transition into more practical exercise we’ve shifted our focus to Ubuntu.
This change reflects a more realistic scenario, as Ubuntu’s stability and widespread use make it a prime candidate for hosting network security tools like Snort. In essence, while Kali Linux serves as an exceptional platform for penetration testing and security assessments, Ubuntu provides a more suitable environment for running a production-level Intrusion Detection System (IDS).

Elevating to Root and Verifying Installation

Our first step involves elevating privileges to the root user, ensuring we have the necessary access to configure and test Snort comprehensively. Achieve this by opening your terminal and entering: su root

Then, to verify whether Snort is already on your system, execute: snort -V

If Snort isn’t installed, the terminal will suggest apt install snort commnad, which you should follow to proceed with the installation.

Configuring Snort’s Network Awareness

To determine your machine’s IP address, use the ifconfig command in a new terminal window. With your IP identified, continue setup.

A critical aspect of Snort’s setup involves specifying the network range it should monitor. This range is pivotal for Snort to effectively identify and protect the machines within your subnet from potential intrusions. During the installation, you’ll be prompted to input this range; accuracy here is key to ensuring Snort’s efficacy in monitoring network activities.

Accessing Snort’s Configuration Files

Upon installation, navigating to Snort’s configuration files is essential for tuning its settings to your environment’s specifics. Given the sensitivity and significance of these files, accessing them requires root privileges. Utilize a root-enabled file manager or command-line operations to edit these configurations securely.

Editing and Testing Snort’s Configuration

When configuring Snort, access its configuration file at /etc/snort/snort.conf to adjust key settings. It’s crucial to set the HOME_NET variable to your network’s IP range, previously identified using ifconfig. This ensures Snort is tailored to monitor your specific network effectively.

Post-configuration, validate your changes using Snort’s built-in configuration test:
snort -T -c /etc/snort/snort.conf

Now you can activate snort using commnad: sudo snort -A console -q -c /etc/snort/snort.conf -i enp0s3

You should see a blinking cursor, indicating that Snort is active and monitoring.

Simulating Intrusions and Monitoring Alerts

With Snort configured, the next step involves testing its detection capabilities. Simulate network scans or intrusions from another machine within your network, such as a Kali Linux system running alongside Ubuntu. Run ifconfig to find what ip address is assigned to Kali machine.

Tools like nmap can mimic malicious network activities, offering a real-world test for Snort’s alerting mechanisms.

Monitor Snort’s output as it detects these activities, ensuring it correctly identifies and logs potential threats. This live testing is crucial for verifying that Snort is alert and responsive to intrusion attempts.

As you can see above, Snort detected a suspicious request and found the IP address from which it originated.

Customizing Snort’s Rulesets

Beyond the default rulesets, Snort’s power lies in its flexibility to adopt custom rules tailored to specific threats or network behaviors. Navigate to Snort’s rules directory to edit or append custom rules, enhancing its detection scope. Utilize tools like Snorpy for generating these rules if you’re unfamiliar with the syntax.

Remember, effective rule management involves testing for conflicts or errors, ensuring your custom rules harmonize with Snort’s existing detection logic.


Through careful setup, network specification, and ruleset customization, you equip Snort with the necessary insights to guard your network effectively. Stay tuned for further exploration into Snort’s advanced configurations and operational strategies to fortify your cybersecurity defenses.

Thank you for following along, and ensure your network’s vigilance against attacks with Snort.

Leave a Reply

Your email address will not be published. Required fields are marked *