Tag: Network Traffic Analysis

Step-by-Step Guide: How to Install and Configure Suricata IDS on Kali Purple

Protect your network with Suricata! Learn how to install and configure this powerful Intrusion Detection System (IDS) on Kali Purple with our easy-to-follow guide. Whether you’re a cybersecurity enthusiast or a seasoned professional, this guide will help you secure your network in no time.

πŸ“‹ Table of Contents

  1. Introduction
  2. Step 1: Update Your System πŸ”„
  3. Step 2: Install Suricata πŸ“¦
  4. Step 3: Verify the Installation βœ…
  5. Step 4: Configure Suricata βš™οΈ
  6. Step 5: Download and Update Suricata Rules πŸ“„
  7. Step 6: Start Suricata πŸš€
  8. Step 7: Test the Installation πŸ§ͺ
  9. Step 8: Automate Suricata Startup πŸ”§
  10. Conclusion πŸŽ‰

Introduction

Suricata is an open-source network threat detection engine that can function as an IDS, IPS, and Network Security Monitoring (NSM) tool. With Kali Purple, you have a powerful platform at your fingertips for enhancing your network security. In this guide, we’ll walk you through the steps to install and configure Suricata, complete with examples to make the process easy and intuitive.


Step 1: Update Your System πŸ”„

Before we dive into installing Suricata, let’s ensure your Kali Purple system is up to date. Running updates regularly helps you avoid potential compatibility issues.

sudo apt update && sudo apt upgrade -y

Step 2: Install Suricata πŸ“¦

Suricata is available directly from the Kali Linux repositories, making installation a breeze.

sudo apt install suricata -y

Step 3: Verify the Installation βœ…

Let’s confirm that Suricata has been installed correctly. This step will give you peace of mind knowing everything is in place.

suricata --build-info

This command provides detailed information about your Suricata installation, including the version and compile-time options.

Step 4: Configure Suricata βš™οΈ

Now, it’s time to configure Suricata to fit your network environment.

Set the Network Interface 🌐

Suricata needs to know which network interface to monitor. Open the configuration file and make the necessary adjustments.

sudo nano /etc/suricata/suricata.yaml

Inside the file, locate the af-packet section and set your network interface.

af-packet:
- interface: eth0
threads: auto
defrag: yes
cluster-type: cluster_flow
cluster-id: 99
copy-mode: ips
checksum-checks: auto

Configure Logging πŸ“

Proper logging ensures you have the data needed for analysis. Here’s an example configuration:

default-log-dir: /var/log/suricata/

outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
types:
- alert:
- http:
- dns:
- tls:
- ssh:
- flow:

Step 5: Download and Update Suricata Rules πŸ“„

Suricata uses rules to detect potential threats. Keeping these rules up to date is crucial.

Install suricata-update:

sudo apt install python3-pip 
sudo pip3 install --pre --upgrade suricata-update

Update Rules:Download the latest rule sets.

sudo suricata-update

Verify the Rule Configuration:Ensure the rules are configured correctly.

sudo suricata -T -c /etc/suricata/suricata.yaml

Step 6: Start Suricata πŸš€

Now that Suricata is configured, it’s time to start it up!

IDS Mode (monitoring only):

sudo suricata -c /etc/suricata/suricata.yaml -i eth0
  • IPS Mode (monitoring and blocking):
sudo suricata -c /etc/suricata/suricata.yaml --af-packet=eth0

Step 7: Test the Installation πŸ§ͺ

Test Suricata by generating some network traffic. Use nmap or another tool to initiate traffic that should trigger alerts.

nmap -sS -Pn -p 80,443 <target-ip>

Check the logs:

tail -f /var/log/suricata/eve.json

You should see alerts matching the traffic.

Step 8: Automate Suricata Startup πŸ”§

To ensure Suricata starts automatically when your system boots, enable it as a service.

sudo systemctl enable suricata
sudo systemctl start suricata

Conclusion πŸŽ‰

Congratulations! You’ve successfully installed and configured Suricata IDS on Kali Purple. Your network is now better protected against potential threats. Regularly update your rules and monitor your logs to maintain robust security.

Feel free to share your experiences or ask questions in the comments below! 😊

what is arkime (moloch)?

Arkime, formerly known as Moloch, is a powerful tool for full packet capture and analysis. It offers a wide range of features that make it a must-have tool for network security professionals. Some of the main features of Arkime include:

  1. Packet capture: Arkime can capture all network traffic passing through a particular network interface, allowing security analysts to analyze the traffic and identify potential threats.
  2. Indexing and search: Arkime uses Elasticsearch to store and index captured packets, which makes it easy for analysts to search for specific packets or packets containing specific patterns or keywords.
  3. Web-based user interface: Arkime includes a powerful web-based user interface that allows analysts to search and analyze captured traffic, as well as visualize network traffic data in real-time. The user interface is highly customizable, and analysts can create custom dashboards and visualizations to meet their specific needs.
  4. Advanced analysis capabilities: Arkime can perform advanced network traffic analysis, including protocol decoding, session reassembly, and file carving. This makes it possible for analysts to detect and investigate a wide range of security threats, including malware, phishing attacks, and data exfiltration.
  5. Support for multiple file formats: Arkime can capture and analyze a wide range of network protocols, including TCP, UDP, HTTP, and SSL. It also supports a variety of file formats, including PCAP, JSON, and ASCII.
  6. Scalability: Arkime is designed to be highly scalable, and it can be deployed in large-scale environments. It can handle large amounts of network traffic data, making it suitable for use in high-bandwidth environments.

Overall, Arkime is a comprehensive tool that offers a wide range of features for full packet capture and analysis. Its advanced analysis capabilities, support for multiple file formats, and scalability make it a must-have tool for any organization that needs to monitor and secure its network.

Learn how to identify and prevent malware attacks with Suricata intrusion detection system rules

How To Detect Malware With Suricata Rules.

Suricata is a highly efficient, open-source, and multi-platform network security engine that incorporates advanced Intrusion Detection System (IDS), Intrusion Prevention System (IPS), and Network Security Monitoring (NSM) technologies. Developed and maintained by the Open Information Security Foundation (OISF) community since 2009, Suricata offers a comprehensive solution for detecting and preventing network security threats.

As we already explained in this article, an IDS is a passive system that is responsible for monitoring the behavior of a network to detect and report on possible unauthorized intrusions, while an IPS is an active system that works as an extension of the IDS and that , in addition to sending alerts on detections, it can also block malicious activity within the network – such as brute force attacks, DDoS, or attacks that seek to exploit vulnerabilities – and create a log with the intrusion. All this from the traffic, the file signatures, and the heuristic analysis of the flow. Additionally, IPS allows adding policies and restricting access to users and / or even applications.

That said, the most common uses for Suricata are related to scanning network traffic and analyzing traffic logs within a sandbox or sandbox environment (such as running malware). However, we can also use this tool for creating rules in order to classify malware.

Testing Meerkat

Next, we are going to see a simple example of how to use Suricata for malware classification.

Suppose we have a machine destined to perform dynamic analysis of malware samples, we could add different Suricata rules to be able to classify the type of malware that is running according to the traffic.

In this case, while a sample of the Trickbot banking Trojan is running on the network , a .pcap file is generated with information on the behavior of the traffic.

Through the network flow generated by the malware and knowing its behavior, we could create some rules in Suricata in the /etc/suricata/

rules folder :

In this Image you can see the list of some rules that come by default when installing Suricata.

Before proceeding with the generation of the rule to detect Trickbot, we will see a short description of the basic fields to generate rules in Suricata:

Action HeaderRule Options
  • Action: corresponds to the action (drop, alert, etc.) that Suricata will perform when the rule is identified in the network flow.
  • Header: this section corresponds to the specific network flow to be analyzed. From origin to destination. With the word β€œany” we can tell Meerkat that all ports will be analyzed.
  • Rule: rule to implement to detect malware in our case. Within this field there are keywords that help us create our rule:
    • Msg: alert message that Suricata will issue.
    • flow: network flow.
    • Content: contains the character string to be searched within the traffic.
    • Reference: contains references, in this case we put a verification MD5 hash of a Trickbot sample.
    • Sid: ID of the identified rule.
    • Rev: version of the rule.
    • Classtype: provides information on the classification of rules and alerts.

Taking as an example the rule for Trickbot malware, let’s proceed to add the Suricata rule in the / etc / suricata / rules directory for its detection: We save our rule for Trickbot taken from the aforementioned repository

Now we go on to analyze the traffic with Suricata by executing the command:
sudo suricata -c /etc/suricata/suricata.yaml -r [file.pcap]:

The previous statement generates four files:

The eve.json file is the file that interests us the most at the moment, since it is the output file that provides information about alerts, anomalies, metadata, and even information about specific files and logs:

If we search for the name of the message β€œ Trickbot β€œ with the command:

grep β€œTrickbot” eve.json

We will see that our rule was able to detect the malicious file as Trickbot.

To close this proof of concept it is important to mention that Suricata is a very useful tool to perform Threat Hunting . It is capable of identifying network protocols (TPC, UDP, HTTP, ICMP, etc.) enabling real-time control of the traffic generated on our network and controlling the presence of possible malicious codes. The latter can be done through MD5 checks, as we saw in the Trickbot rule.

On the other hand, we also recommend reviewing the Suricata Open Source repository of Emerging Threats rules , where you can find rules that detect new threats.
install-Suricata-in-Linux

How to install Suricata in Linux.

Suricata is an open-source network intrusion detection and prevention system (IDS/IPS) that can be used to detect and prevent cyber attacks on a computer network. It uses a variety of techniques, including signature-based detection and protocol analysis, to identify and block malicious traffic.

Installing Suricata on a Linux operating system is a multi-step process that involves the following steps:

1. Verify that your Linux system meets the minimum requirements for running Suricata. This includes checking that you have a supported version of Linux and that you have the necessary dependencies installed.

A supported version of Linux: Suricata is compatible with various Linux distributions such as Ubuntu, Debian, Fedora, and CentOS. You can check your Linux version by running the command.
  • GCC compiler: Suricata requires a C compiler to build the source code. You can check if GCC is installed on your system by running the command
"gcc --version"
  • Libpcap library: Suricata uses the libpcap library to capture network traffic. You can check if libpcap is installed on your system by running the command
"ldconfig -p | grep libpcap"
  • libyaml library: Suricata uses the libyaml library for parsing YAML files. You can check if libyaml is installed on your system by running the command
"ldconfig -p | grep libyaml"
  • libjansson library: Suricata uses the libjansson library for JSON data handling. You can check if libjansson is installed on your system by running the command
"ldconfig -p | grep libjansson"
  • libmagic library: Suricata uses the libmagic library to detect file types. You can check if libmagic is installed on your system by running the command
"ldconfig -p | grep libmagic"

Please note that these commands are for checking the dependencies in Ubuntu and Debian based distributions. In other distributions, the package manager commands may be different, for example, in Red Hat-based systems, you should use yum instead of apt-get.

2. Download the latest version of Suricata from the official website (https://suricata-ids.org/download/)

3.Extract the downloaded package using the command

tar -xvzf suricata-version.tar.gz

4. Change directory to the extracted package by running

cd suricata-version

5. Run the command

"./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var"

to configure the installation.

6. Run the command to build the source code.

"make"

7. Run the command to install Suricata.

sudo make install-full

8. Configure Suricata by editing the configuration file located at /etc/suricata/suricata.yaml.

9. Start Suricata by running the command

(assuming that the interface you want to listen on is eth0)

"suricata -c /etc/suricata/suricata.yaml -i eth0" 

10. Verify that Suricata is running correctly by checking the output of the command

sudo suricata -i eth0 --list-runmode-helpers

It’s always recommended to check the official documentation of Suricata for the specific version that you are installing and to be aware of the dependencies that your system needs to have installed before proceeding with the installation. It’s always recommended to consult the official documentation of Suricata for the specific version that you are installing and to be aware of the dependencies that your system needs to have installed.

Powered by WordPress & Theme by Anders Norén