Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Instructions NIDS are the most popular tools for monitoring network traffic. There is clearly a fine line between raising alerts for every single packet or flow and raising alerts for highly...

1 answer below »


Instructions


NIDS are the most popular tools for monitoring network traffic. There is clearly a fine line between raising alerts for every single packet or flow and raising alerts for highly specific traffic. This assignment wants to make you become acquainted withSuricata IDS. Perform the following:



  • The first one is easy. Many viruses have specific signatures that can be seen either when they are being downloaded (e.g., http download exe file) or once they are installed they have specific communication patterns (specific payloads). While executables can be detected based on their hex or hash values, network patterns need specific hex signatures. Since most viruses already have a signatures which can be found online (not ideal for an assignment), your first task is to instead develop a policy signatures that detects HTTP png downloads. Your signatures msg (very important) should be: POLICY HTTP Portable network graphics downloaded. IMPORTANT: do NOT use filemagic (that would be too easy).

  • Alright, let's look for something more realistic. Encoded binary files in HTTP downloads using Base64 encoding. In ex2.pcap there is a good example of this where the binary (encoded in Base64) is meant to be executed through PowerShell. Build a policy that alerts us whenever we see Base64 in HTTP inbound traffic. Signature msg should be: POLICY HTTP Base64 encoding detected. You will need perl compatible regular expressions for this one. Use an online regex test service while building your pattern.

  • Create a Suricata alert that can detect an inbound port scan on port addresses below 1024. Use a suricata alert to detect a potential slow port scan (hint: you will need to use threshold: type threshold, track by_src...). Use the nmap.pcap to help you test (or the actual command from the terminal. The signature msg should be:SCAN nmap -sS.

  • Alright, time for some Lua scripting. Remember those weird domain name requests in ex1.pcap that are the likely result of DGA. One way to detect such traffic (which would be wise) is through the use of

    Shannon's Entropy








Links to an external site.


on the domain's alphanumeric and - (minus) characters. You need to omit . (periods). Look for what a string's max entropy could be and it will make sense why. Lua scripts attach to suricata's rule and their output is either return 0 and return 1 (guess which means raise an alert). Look for the Lua Scripting reference on Suricata's online manual. For simplicity, let us forget that multiple DNS queries could be stacked in one DNS payload. Raise an alert if a domain name's entropy is more than 3 and is at least 85% of the max possible entropy for that string length. For capturing domain names you will need to use

patterns in lua






Links to an external site.


to find domain names in the payload (
there is an option for accessing this through Lua








  • Links to an external site.

    ). Signature msg should be: POLICY DNS Domain name request with entropy > 3 and at least 85% of max entropy. TIP: use print in lua to output different results as you are testing your patterns.



What to use for the assignment


You can utilize VirtualBox (or some other VM) to build your testing machines. Lab computers may be more appropriate if you load demanding machines. Useful distros include:



  • SELKS:
    https://www.stamus-networks.com/open-source/#selks









  • Links to an external site.



  • SecurityOnion:
    https://securityonion.net/








  • Links to an external site.



  • Kali:
    https://www.kali.org/









    • Links to an external site.




    SO is by far the most demanding requiring a min of 8GB if ELK stack is utilized. With SELKS, you can get away with 3GB. Kali is useful for pentests but many of these you can initiate from your host computer. If you do not have sudo access in the host machine check this guide if you need to build several tools from source:Installing with no sudo access



    What to submit





    • In your repository include the following files only:suricata.yaml, local.rules,processdns.lua,









    Download nmap.pcap

    ,






    Download ex1.pcap

    ,
    ex2.pcap













  • Download ex2.pcap

    .


  • Your code will be tested using the following commands: suricata -c suricata.yaml -r badpcap.pcap. This means that all your configuration and files need to be self-contained in the same directory and pointed to using suricata.yaml


  • suricata.yamlwill be a downsized version of the configuration file. It will need to point to local.rules.


  • local.ruleswill contain4 rules that detect the different scenarios. One of the rules will also be pointing to your
    processdns.lua
    script for the domain entropy calculations.

  • Answered 2 days After Feb 15, 2023

    Solution

    Syed answered on Feb 18 2023
    36 Votes
    SOLUTION.PDF

    Answer To This Question Is Available To Download

    Related Questions & Answers

    More Questions »

    Submit New Assignment

    Copy and Paste Your Assignment Here