{"id":209,"date":"2025-06-22T23:42:07","date_gmt":"2025-06-22T23:42:07","guid":{"rendered":"https:\/\/epbrtcybersecurityportfolio.xyz\/?p=209"},"modified":"2025-06-22T23:42:07","modified_gmt":"2025-06-22T23:42:07","slug":"running-snort","status":"publish","type":"post","link":"https:\/\/epbrtcybersecurityportfolio.xyz\/?p=209","title":{"rendered":"Running Snort"},"content":{"rendered":"\n<p><strong>Purpose<\/strong><br>This lab is an introduction to Snort and its output. It focuses on helping a new user get comfortable with the tool.<\/p>\n\n\n\n<p><strong>Exercise 1<\/strong><\/p>\n\n\n\n<p>1)Start by exploring Snort\u2019s available command-line options. Run the following command to view help information and understand what parameters are available:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"572\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-76.png\" alt=\"\" class=\"wp-image-210\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-76.png 935w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-76-300x184.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-76-768x470.png 768w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\" \/><\/figure>\n\n\n\n<p>2)Which command-line option should you use to specify a        particular configuration file when running Snort?<\/p>\n\n\n\n<p>Going through the above list of available parameters, we find the below option<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"410\" height=\"26\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-77.png\" alt=\"\" class=\"wp-image-212\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-77.png 410w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-77-300x19.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/figure>\n\n\n\n<p><strong>Exercise 2<\/strong><\/p>\n\n\n\n<p>1)Which Snort command-line option can be used to check the current configuration and generate a report?<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"25\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-78.png\" alt=\"\" class=\"wp-image-215\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-78.png 546w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-78-300x14.png 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p>2)Launch Snort using the correct option to validate the configuration and generate a report, pointing to the <code>snort.lua<\/code> configuration file located in <code>\/sec503\/Exercises\/Day3\/snort\/<\/code>.<\/p>\n\n\n\n<p>Using the 2 questions above, we can easily answer this question:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"785\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-79.png\" alt=\"\" class=\"wp-image-216\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-79.png 657w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-79-251x300.png 251w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure>\n\n\n\n<p>3) After running Snort, you\u2019ll see a stream of initialization messages. Does the <code>snort.lua<\/code> configuration file pass validation?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"52\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-80.png\" alt=\"\" class=\"wp-image-218\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-80.png 641w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-80-300x24.png 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/figure>\n\n\n\n<p>4) How many rules did Snort confirm it loaded?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"455\" height=\"44\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-81.png\" alt=\"\" class=\"wp-image-219\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-81.png 455w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-81-300x29.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/figure>\n\n\n\n<p>5) Run Snort again with the <code>-T<\/code> option to test the configuration, but this time use <code>snort-broken.lua<\/code> as the config file. Add the <code>-q<\/code> option to reduce clutter by hiding the usual startup messages\u2014this will make the error message easier to spot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"711\" height=\"101\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-82.png\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-82.png 711w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-82-300x43.png 300w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/figure>\n\n\n\n<p>6) In which file is the error located? What is the specific error message?<\/p>\n\n\n\n<p>The error is located in file called local.rules. Two variables are undefined in this file. <\/p>\n\n\n\n<p>7) Use the <code>diff<\/code> command to compare the contents of <code>snort.lua<\/code> and <code>snort-broken.lua<\/code>. What differences do you observe?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"179\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-83.png\" alt=\"\" class=\"wp-image-223\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-83.png 730w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-83-300x74.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n\n\n\n<p>The main difference is that <code>snort.lua<\/code> defines two variables that are commented out in <code>snort-broken.lua<\/code>. Specifically, <code>HOME_NET<\/code> is set to the 10.121.0.0\/16 network, while <code>EXTERNAL_NET<\/code> is defined as any network not included in <code>HOME_NET<\/code> (using the exclamation mark <code>!<\/code> for negation). These variables help Snort distinguish between IP addresses inside the monitored network and those outside of it. In <code>snort-broken.lua<\/code>, these variable definitions are disabled using comment markers (<code>--<\/code>), so they aren\u2019t loaded. Snort 3 requires that both <code>HOME_NET<\/code> and <code>EXTERNAL_NET<\/code> be properly set.<\/p>\n\n\n\n<p><strong>Exercise 3<\/strong><\/p>\n\n\n\n<p>This task is about running Snort in IDS mode. You\u2019ll be using a configuration file and analyzing traffic from a packet capture file instead of live network data. For this, use the file named <code>sample.pcap<\/code>, located in the <code>\/sec503\/Exercises\/Day3<\/code> folder. <\/p>\n\n\n\n<p>1) The goal is to run Snort using the <code>snort.lua<\/code> configuration file and see alerts on your console. To make this work, you\u2019ll need to use a few options that haven\u2019t been covered yet.<\/p>\n\n\n\n<p>To accomplish this task, I ran snort with the below options:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"58\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-84-1024x58.png\" alt=\"\" class=\"wp-image-226\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-84-1024x58.png 1024w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-84-300x17.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-84-768x43.png 768w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-84.png 1101w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>2) Looking at the alert output, you\u2019ll notice that after the GID, SID, and revision number, there\u2019s a message, followed by a priority level. After that, it shows the protocol, the source IP address and port, and then the destination IP address and port (shown with the arrow symbol &#8220;->&#8221;). What are the values for the protocol, source IP and port, and destination IP and port?<\/p>\n\n\n\n<p>The protocol is TCP. The source IP address is 10.121.70.151. The source port is 21 (FTP). The destination IP address is 10.234.125.254 and the destination port is 2217.<\/p>\n\n\n\n<p><strong>Exercise 4<\/strong><br><strong>Task:<\/strong> Run Snort in IDS mode and make sure logging is enabled.<\/p>\n\n\n\n<p>1) In the previous exercise, you saw that Snort does not show alerts by default unless it&#8217;s specifically told to. Figure out how to configure Snort so it logs fast alerts to a file. The alerts should be saved in the <code>logs<\/code> directory, located in the current folder or at <code>\/sec503\/Exercises\/Day3\/snort\/logs<\/code>.<\/p>\n\n\n\n<p>Wed can use the -l option to log a given file to a desired directory:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"21\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-85-1024x21.png\" alt=\"\" class=\"wp-image-230\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-85-1024x21.png 1024w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-85-300x6.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-85-768x16.png 768w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-85.png 1322w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p>The file was correctly saved  in the chosen directory:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"537\" height=\"120\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-86.png\" alt=\"\" class=\"wp-image-232\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-86.png 537w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-86-300x67.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/figure>\n\n\n\n<p>2) Look at the content of this file<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"40\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-87-1024x40.png\" alt=\"\" class=\"wp-image-234\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-87-1024x40.png 1024w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-87-300x12.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-87-768x30.png 768w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-87.png 1159w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This is the same content as what we saw in the console output above. <\/p>\n\n\n\n<p>3) Review the available logger plugins again and identify one that supports both event and packet logging.<\/p>\n\n\n\n<p>The <code>--help-plugins<\/code> option provides detailed information about the different plugins that are available. Looking at the list, the unified2 plugin appears to be a good choice. This plugin can be run with the -A option:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"160\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-88.png\" alt=\"\" class=\"wp-image-237\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-88.png 975w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-88-300x49.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-88-768x126.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\"><\/ol>\n\n\n\n<p>After the unified2 log file has been created, it can be read using tools such as <code>u2spewfoo<\/code> and <code>u2boat<\/code>. Running <code>u2spewfoo<\/code> on the file will display the alert and a packet dump showing what triggered it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PurposeThis lab is an introduction to Snort and its output. It focuses on helping a new user get comfortable with the tool. Exercise 1 1)Start by exploring Snort\u2019s available command-line options. Run the following command to view help information and understand what parameters are available: 2)Which command-line option should you use to specify a particular [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209"}],"version-history":[{"count":5,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":239,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions\/239"}],"wp:attachment":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}