TP2 Partie2 Houssem - Mathlouthi
TP2 Partie2 Houssem - Mathlouthi
TP2 Partie2 Houssem - Mathlouthi
CII3-SSIR-B
1. The interaction between iptables and Suricata will be configured in the section “nfq” of the file.
4. To send all the incoming and outgoing traffic from iptables to Suricata
II. Preventing against ICMP echo requests
nano /var/lib/suricata/rules/custom.rules
There should be no response to ping command, while DNS and HTTP connection should be
possible. We check the log file fast.log and verify that suricata has successfully blocked the icmp
traffic, logged the event and generated the alert.
III. Filtering clear HTTP traffic
we stop suricata and start it again as an IPS with the NFQ mode
Access again to portquiz website through the two TCP ports 80 and 445 using the browser
Firefox. Now, the website is completely unreachable.
http://portquiz.net
http://portquiz.net:445
11. Check the log file fast.log, and verify that suricata has successfully blocked the two HTTP
connections
IV.TLS analysis
13. Connect to the website https://badssl.com/ and click on “expired” to access to the subdomain
https://expired.badssl.com/ that uses an expired certificate. You should click on accept the risk and
continue if your browser asks for confirmation. Check that the validity period of the certificate has
ended.
14. In the rule file custom.rules add the following entry to drop access to sites with expired certificates
15. start it again as an IPS with the NFQ mode
16. Test that access to https://expired.badssl.com/ is dropped and that the alert is generated.
17. In the rule file custom.rules add a new entry to drop access to facebook website using TLS,
matching the content of facebook 509 certificate.
drop tls $HOME_NET any -> $EXTERNAL_NET any (msg:"Blocked Facebook TLS Traffic"; tls_sni;
content:"facebook.com"; nocase; priority:1; sid:1000006; rev:1;)
V.Downloaded files collection
25. In /var/lib/suricata/rules/custom.rules add the following rule to store all files to disk.
28. Go to the folder Review the folders /var/log/suricata/filestore/ and execute the following commands.
You
# cd /var/log/suricata/filestore/
# file */*
29. Open the stored file using the command display (you should install ImageMagic using yum if it is
not already available in your system) and check the obtained image.
30. Suricata can output alerts, http events, dns events, tls events and file info through EVE json
format. The
JSON format allows a nice handling of data in external tool like Elasticsearch or Splunk. Open the
Suricata configuration file /etc/suricata/suricata.yaml in your editor and scroll down to the "output"