The Essential Role of SIEMs in Modern Cybersecurity

COVER_PAGE

Security Information and Event Management (SIEM) systems have become essential for effective cybersecurity, providing crucial capabilities for monitoring, detecting, and responding to threats. They emerged from the need for compliance and more sophisticated security measures.

Introduction

Security Information and Event Management (SIEM) is considered the cornerstone of blue teaming in cybersecurity. Below is a summary of SIEMs (with a larger focus on QRadar by IBM, as a large number of the references spoke about it) divided into various organised sub-topics. The references to the main resources are given at the end. NOTE: This blog is not sponsored, and in no way should it be considered a promotion for any product.

Why did SIEMs come into existence?

Security Information and Event Management (SIEM) systems are essential for overseeing the security landscape. Historically, networks and internet security were not given sufficient attention, with applications primarily logging activities for debugging and basic monitoring. Routers played a key role in managing data flows, overseeing packet communication by tracking details such as destination (DST), source (SRC), IP, port, and data. The necessity for SIEMs emerged from governmental compliance requirements, with their core function being the analysis of logs and flows to detect alerts, cases, or offences.

Originally, logs were in a human-readable format, prompting the development of parsers to convert them into machine-readable formats, often utilising techniques like REGEX. Nowadays, logs are commonly available in machine-readable formats such as XML, JSON, and LEEF, among others. SIEMs like IBM QRadar feature various auto-parsers, some powered by AI, to streamline the process of making the logs ingestable by the platform.

Log Collection in Windows

Most of the systems run an appropriate version of Windows. To view the basic logs and events on a Windows system, one can search for Windows Administrative Tools and go to Event Viewer. If Event Viewer is not available on a Windows Server machine, you can install it using Server Manager or Admin Centre.

Event Viewer

Windows logs are categorised into five main types:
Application: Logs created by applications running on the system.
Security: Logs of sensitive actions such as logins and privilege escalations.
Setup: Logs related to system installations and upgrades.
System: Logs of system messages.
Forwarded: Logs from communication with other computers, usually found on server machines.

The Event Viewer application allows you to export, view detailed logs, and summarise event logs. Additionally, logs can be collected from various other applications, either pre-installed or downloadable on your Windows system. Some of these applications include:
DNS Manager: Monitors your DNS server.
Failover Cluster Manager: Manages server backups.
IIS Access: Monitors communication over network protocols like Ethernet and WiFi.
Task Scheduler: Finds tasks scheduled to run at specific times.

All these details can also be accessed using Windows PowerShell with the Get-WinEvent command. Some examples of its syntax are:

Get-WinEvent [[-LogName] <String[]>] [-MaxEvents <Int64>]
Get-WinEvent -FilterHashtable @{ Logname=' '; Id=' '; StartTime=(Get-Date).AddHours(-1)}

The latter example retrieves events from the past hour. Other time filters available include AddTicks, AddMilliseconds, AddSeconds, AddMinutes, AddDays, AddMonths, and AddYears.

Functioning of a SIEM

SIEMs primarily function via rules but also leverage machine learning and behavioural analytics to analyse security events and identify potential threats. Rules are some types of logic applied to categories and properties of events, logs, or flows. Depending on the weight of the rules, the SIEM classifies the threats by severity. This often leads to the calculation of a risk score, which helps in the segregation of more important events.

Threat Intelligence and IoCs

Threat intelligence helps organisations identify potential threats by utilising Indicators of Compromise (IoCs) like URLs, IP addresses, and malware hashes. SIEMs like QRadar can store IoCs in reference sets for efficient searching and analysis using data filters. These IoCs are often shared in STIX or TAXII formats. QRadar provides pre-made sets of IoCs on its online collection database, allowing exporting and installation of the same. It also has the option to run them directly on logs and live data. For enhanced threat classification, SIEMs might integrate with frameworks like MITRE ATT&CK. This also helps in providing a view of the monitoring software rules against various stages of the framework. Additionally, QRadar provides connections to its Security Orchestration, Automation, and Response (SOAR) to automatically collect data from the SIEM and automate threat response actions post-processing of the same.

Smart Data Analysis

Typically, one must go through the tedious process of taking events, such as downloaded viruses, and uploading their hashes to VirusTotal to find crucial information like threat actors and associated IPs. While QRadar can integrate with VirusTotal, it also leverages Watson AI to automate the creation of relationship graphs. This facilitates the auto-detection of Indicators of Compromise (IoCs), highlights similar IoCs with blue lines in the graph, and identifies the threat actors and IPs responsible for malicious activities. Additionally, QRadar can use vulnerability scan reports to provide a better understanding of events.

Analyzing data without a SIEM

A popular script called PowerSIEM (https://github.com/IppSec/PowerSiem) uses a PowerShell script for basic and fast analysis of system events, enabling better detection of Indicators of Compromise (IoCs) compared to the general event viewer due to its formatting. The script relies on SYSMON (https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon), a basic software tool for monitoring Windows event logs. It is important to note that support for this tool is provided by a single author, making it less suitable as the sole SIEM solution in a professional environment.

To install PowerSIEM, you must first install SYSMON in the System32 folder (installing it there prevents a DLL hijacking attack). SYSMON must be configured using the configuration file provided by Neo23x0 (https://github.com/Neo23x0/sysmon-config) and kept with the executable. To install, use the command:

Sysmon64.exe -i <config file> -acceptEula

Interesting Note: Accepting the EULA may create a registry key, which can often be used to determine if a user has run the software before.

To run the PowerSIEM script, open PowerShell and navigate to the script location. The Write-Alert function writes data to the console. The script continuously checks if the last index of the event list has changed. If it has, it fetches the last five events and displays them after processing. SYSMON assigns different event IDs for various types of events, helping differentiate between them. You can use the command $evt | select * to find all the information available about an event. Note that not all events are logged.

Interesting Note: Alternate Data Streams (ADS) create events. ADS are used for file transfers, downloading files from the internet, copying files, etc.

When running the PsExec tool, Windows Defender blocks PsExec from a Linux system but allows it from a remote Windows system. Additionally, Linux defaults to system/admin user permissions, whereas Windows defaults to basic user permissions. This highlights some fundamental differences between how the tool operates on different operating systems.

IoC Development using PowerSIEM

If you run a Cobalt Strike Beacon from another machine to do a drive-by-download attack targeted at the machine running the PowerShell script (PowerSIEM), you will see various connection requests to the command-and-control centre.

An interesting log is generated when we run the whoami command from the command-and-control center. The Process Create log generated has a /C at the end of the ParentCommandLine attribute. When running a normal whoami command via the CMD, this does not happen.

This happens because the command-and-control centre creates a sacrificial process (a process sacrificed by injecting malicious code into it for stealth, privilege escalation, etc.) and runs GPUpdate (a non-malicious process). GPUpdate uses the sacrificial process to change the pipe (information flow) to get access to the command line. The pipe is named postex_random characters. Mimikatz (a post-exploitation software) can be used to gain information from lsass.exe (a process that manages and stores credentials, policies, etc.) and later transfer it through these pipes.

Exciting features of IBM QRadar

Below are some key features in IBM QRadar mentioned by Jose Bravo. Various other vendors such as Splunk may or may not have these features.

Cloud Adoption and Live Processing

QRadar has massive support for telemetry (clues) from various sources. It has direct support for on-premise logs and allows various log source types. As various logs now come from cloud services, QRadar has plugins allowing you to directly send your logs.

QRadar also allows you to view network flows in real time with various filters. QRadar facilitates automatic discovery by generating logs for previously unseen devices and classifying them based on various attributes, such as communication details. QRadar also enables automated normalisation and indexing. This means logs from various sources are put in the same format if they are from the same category. This ensures accurate classification and easier analysis, regardless of the alert source. Login failure being normalised in logs for both Windows and Linux is a prime example.

Distributed Architecture

QRadar operates on a distributed architecture. In this setup, an event processor collects information from various event collectors to process. After processing, the data can be stored in a dedicated storage area called the data store. These components can be deployed on different systems distributed across networks and cloud services, enabling flexible log storage and efficient processing. For network devices, flow processors can be integrated into the network to capture and store more detailed information.

Additionally, you can use a custom console (GUI-based, using Pulse) at a central location to display desired graphs and statistics. This all-in-one console can also control components distributed across the network. The GUI allows for the separation of various servers at different levels, such as servers, companies, etc.

Powerful Queries and Filters

Pulse: The GUI for QRadar also supports powerful filters for various data store attributes. If a person prefers CLI, QRadar also has a query language called AQL (Ariel Query Language), which is like SQL. QRadar also has an automated query builder in which a person can construct the AQL statement by using the GUI.

API and AI/ML

QRadar allows every piece of information to be viewed and modified via APIs. This helps in creating more user-friendly and dynamic applications.

Other than using Watson AI for relationship graphs, QRadar integrates AI and ML into its functioning. A simple example of this is the use of machine learning and user behaviour-based thresholds. This helps in successfully detecting malicious actions by taking into account human behaviour.

Conclusion

Security Information and Event Management (SIEM) systems have become essential for effective cybersecurity, providing crucial capabilities for monitoring, detecting, and responding to threats. They emerged from the need for compliance and more sophisticated security measures.

IBM QRadar stands out for its advanced features like real-time log processing, integration with threat intelligence frameworks, and use of AI and ML technologies. It supports cloud environments, offers powerful querying, and provides detailed analytics, making it highly effective in detecting and responding to security incidents.

On the other hand, tools like PowerSIEM offer basic and fast analysis of system events, especially useful for detecting Indicators of Compromise (IoCs) in Windows environments. Windows itself provides extensive logging capabilities through tools like Event Viewer and PowerShell commands, enabling detailed monitoring and analysis of system activities.

Together, these tools highlight the critical role of SIEMs and related technologies in enhancing an organisation's cybersecurity posture, ensuring compliance, and safeguarding IT infrastructure. As SIEM technologies evolve, they continue to be a cornerstone of robust cybersecurity strategies.

References

Share:

Personal Data and External Resources - How risky can a cloud-hosted style sheet be?

COVER_PAGE

A website usually consists of a front-end and back-end. The front-end usually consists of the look and feel as well as the sending of data to the back-end. The look and feel for the front-end are usually done by HTML and CSS. The HTML defines the page skeleton whereas the CSS is concerned with the style of the page. A lot of times, people use CSS style-sheets available on the internet. These are usually hosted on a CDN (Content Delivery Network). A CDN consists of various servers on different locations on Earth which contain the same data. The data required is served to you by the functional server closest to your location. This helps reduce load on the website back-end as well as make the website loading time less (usually).

Personal Data and External Resources - How risky can a cloud-hosted style sheet be?

Introduction

Website Basics and CDN
A website usually consists of a front-end and back-end. The front-end usually consists of the look and feel as well as the sending of data to the back-end. The look and feel for the front-end are usually done by HTML and CSS. The HTML defines the page skeleton whereas the CSS is concerned with the style of the page. A lot of times, people use CSS style-sheets available on the internet. These are usually hosted on a CDN (Content Delivery Network). A CDN consists of various servers on different locations on Earth which contain the same data. The data required is served to you by the functional server closest to your location. This helps reduce load on the website back-end as well as make the website loading time less (usually).

Requests and IP addresses
When one connects to the Internet, they are given an IP address by their Internet Provider. The IP address they receive is unique in the internet but may be shared by the devices in the same house/area. When the website requires a style-sheet or any resource from a CDN, it sends a request to the CDN via your browser with a referrer header containing the website link. The request sent contains a lot of your data such as your IP address.

Setting up the lab - The Basic

To find out what all data can be received by the CDN, we can conduct a small experiment.

<!DOCTYPE  html>
<html  lang="en">
<head>
	<meta  charset="UTF-8">
	<meta  http-equiv="X-UA-Compatible"  content="IE=edge">
	<meta  name="viewport"  content="width=device-width, initial-scale=1.0">
	<title>Lab</title>
</head>
<body>
	<h1>Hello World</h1>
</body>
</html>

Saving the above code as index.html will lead to a simple webpage with a Hello World displayed on the page. Next we proceed to add a CDN. For this lab, I would be using the Bootstrap CDN.

<link  href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"  rel="stylesheet">

Upon adding the <link> tag with the Bootstrap CSS link, if the CSS is loaded correctly, upon refresh the Hello World will look different.


index.html

<!DOCTYPE  html>
<html  lang="en">
<head>
	<meta  charset="UTF-8">
	<meta  http-equiv="X-UA-Compatible"  content="IE=edge">
	<meta  name="viewport"  content="width=device-width, initial-scale=1.0">
	<link  href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"  rel="stylesheet">
	<title>Lab</title>
</head>
<body>
	<h1>Hello World</h1>
</body>
</html>

Setting up the lab - IP Grabbing

The next step is to shorten the link and replace it with an IP and Data Grabbing link. This step is not necessary if you own the CDN server as you could put the IP and Data Grabbing Code directly on the server.
To create the link, I will be using IP Logger.

enter image description here

After pasting the link and getting the IP Logger Code, a page as such opens:

I have hidden a few links for privacy purposes.

enter image description here

The link in green has to be used now instead of the original bootstrap link. After the changes, the code looks as such:

<!DOCTYPE  html>
<html  lang="en">
<head>
	<meta  charset="UTF-8">
	<meta  http-equiv="X-UA-Compatible"  content="IE=edge">
	<meta  name="viewport"  content="width=device-width, initial-scale=1.0">
	<link  href="https://iplogger.org/2hUNj6"  rel="stylesheet">
	<title>Lab</title>
</head>
<body>
	<h1>Hello World</h1>
</body>
</html>

Running the experiment

Upon opening the HTML page now, the look of the page remains the same. But, upon clicking on the Logged IP tab on IP Logger, we see our IP address as well as Device Data there:

enter image description here

Data such as Date and time, IP address, Estimated Location as well as device and browser data is sent to the server. If we host our page on the internet, the referring pages data would have the website URL.
To try the same, the HTML code can be hosted on your device via a tool named XAMPP and can become publicly accessible by using ngrok.

Tutorial for XAMPP
Tutorial for ngrok

After accessing the ngrok link, we see the following in our Logged IP tab

enter image description here
By this we can draw a conclusion that a CDN may collect your personal data as well as referrer data if it wants to. But now comes the main question. How can it identify each and every device properly and what type of data can it collect?

Data Collection and Privacy

Data Collection
Data such as pages visited can easily be collected. CDN owners may use cookies to identify your device and collect more information about your browsing habits.

Data Analysis
Data such as which topics interest you the most can be found out by analyzing your web traffic filtered out by cookies. This data can also help determine website ranking and gain insights on user interaction.

Privacy
Various countries such as UK and USA have laws such as GDPR and CCPA to help promote transparency as well as how the data may be collected and used.

Conclusion

As a website/CDN owner, make sure all the external resources are compliant with various laws and make sure to add a Privacy Policy regarding the same on your website as well

As a general user, make sure to check out the Privacy Policy of a website and to avoid sites which do not have one

Share:

The Cryptocurrency Scam - A misuse of Social Engineering so sleek, it feels real

COVER_PAGE

With the increase in the adoption of crytocurrencies, a lot of scammers come out with newer methods to use technologies unknown to the masses to steal money and run various scams. Even though cryptocurrencies boast to be transparent and secure, it has little capabilities to avoid and revert scams. It instead makes them easier due to anonymity and technologies unknown to the masses. A newer technology also helps in hackers try new methods of social engineering to manipulate and scam people.

The Crytocurrency Scam - A misuse of Social Engineering so sleek, it feels real

Introduction

With the increase in the adoption of crytocurrencies, a lot of scammers come out with newer methods to use technologies unknown to the masses to steal money and run various scams. Below are a few terms you need to know about before moving forward with the case study.

Wallet: A place where one can store various cryptocurrencies. Helps serve as an identity in the world of blockchain

Exchange: A place where one can buy, sell, trade and convert cryptocurrencies. A lot more features may be available depending upon the exchange.

The Beginning

The victim is approached with a link by either of the 2 methods:

  • Referral System: Used mainly by an affiliate marketer, a referral link looks mainly harmless, leading to a lot of people falling a victim to the scam.
  • Message Spam via Whatsapp: The victim receives the link via a spam message sent by the scammer. It is perfectly crafted to look as if it is genuine.

The link received is that of a Whatsapp Group. The message contains an offer to work as a registered advisor for the company after you’ve been trained to be one. After this the company the group is run by, will come and sign a contract with you, giving you a fixed income along side commission. The message also highlights that no monetary deposit will be required.

The message is made to seem completely normal as if a company is hiring and got your number from a database sold to them. Due to the no deposit highlight, a lot of people join the group, in hopes to earn and become rich.

The Whatsapp Group

The victim then joins the group, and finds themself among a few more members. They also see more people joining the group via an invite link, making them feel a false sense of security, as there are others in the group too who would be able to warn the others if anything goes wrong. The victim is then greeted by a person named Anthony (for the sake of this case study) on the group who then proceeds to send the message similar to the one given below:

Hello everyone, I am your old friend Anthony. Today’s course content: 1 (eight trading rules of moving average)

The victim is then greeted back by messages as such sent on the group (These are mostly other numbers the scammer(s) use(s)) :

Thank you Mr. Anthony for coming back

If I could learn from Teacher Anthony early, I would not lose $1,000 in the transaction

The group also receives messages regarding the doubts of the contents he is teaching via sending images and texts. Some of these are:

Teacher, is this technology suitable for all markets?

Why does the teacher operate small currencies and why not buy mainstream currencies?

The answers to the same are then given by Anthony and he proceeds forward with the course.

Scam Execution

The teacher Anthony then proceeds forward by saying they’re a part of a VIP group and that they can earn more and can also earn steadily only after using the exchange he told them to use to trade. For security purposes, we will name this exchange ‘TechCrypt Exchange’. He also gives them various offers after suggesting the same:

Recharge 10,000 US dollars, and Mr. Anthony personally guides the transaction. And join the VIP group. Trading signals 4 times a day.

Recharge 2000-6000 USD. I will privately provide trading signals 3 times a day. 🔮

Top up 500 US dollars to become an agent. The agent can invite other friends to enter TechCrypt for trading. For example, if you invite a friend who trades BTC to generate a handling fee of 1,000 USD, you can get a reward of 700 USD, which will be rewarded by TechCrypt to the agent. Your own trading account will also reduce the transaction fee by 70%, which will be returned to your account after 1 month. Trading signals once a day. 💎

For every 5 valid friends invited (a recharge of more than US$100 is regarded as a valid friend), they will be upgraded to a valid agent and a cooperation contract will be signed with the platform. According to the performance, monthly salary of 100-500 US dollars + subordinate member transaction fee 25% in return, Mr. Anthony sends out 1 transaction signal every day in the agent group, officially becomes an agent, and has the opportunity to join the VIP group.

On being asked as to why his students can not use more reputed exchanges such as Binance, his other account responds with:
Binance accounts do not support small currencies such as CBT. Only TechCrypt can buy it

Although an offer at first, his alternate account then starts removing people after a few calls stating that only those who transfer funds to their own TechCrypt wallet will be allowed to stay in the group. Along with this a lot of people (supposed alternate accounts of the scammer(s)) start saying they transferred the money and they are now earning and to thus not remove them. The victim, then acting on his fear of missing out transfer 700 USD worth Bitcoin(BTC) to his TechCrypt account in hopes to continue receiving tips and earn money. He then sends his confirmation on the group after which he is still removed and blocked by most of the numbers on the group. Angry, the victim checks the website of TechCrypt, only to find, there is no button now on the website, allowing him to withdraw or transfer his funds. The realization of him being scammed slowly sinks in.

The Research

Cryptocurrencies are known to keep their transactions transparent. Upon using the Wallet ID to find out more about the transactions, it was found that the money was transferred to another anonymous wallet and then various other wallets from there. This made the back tracing extremely difficult and the money is impossible to recover.
On researching about the site, the domain was registered less than 6 months back and had an extremely low trust score.

Conclusion

  • Do not ever transfer funds to any exchange or wallet before checking out the reviews.
  • Do also make sure it is used by various people, is in the market since long and is trusted by various known traders.
    Social Engineering is improving and scams are increasing and you may never know how you lost your money or data if you’re not careful.
    Even though cryptocurrencies boast to be transparent and secure, it has little capabilities to avoid and revert scams. It instead makes them easier due to anonymity and technologies unknown to the masses.
Share:

Public Key Infrastructure (PKI)

COVER_PAGE

One of the most important concepts of security is encryption. Encryption is the method used to convert meaningful messages into a ciphertext (meaningless message) such that it can only be understood by the person having the necessary information to convert it back to the original message. A concept used within encryption is that of keys. Keys are used to encrypt and/or decrypt messages. Depending upon the usage of the keys, the encryption can be either symmetric or asymmetric

Public Key Infrastructure (PKI)

Introduction

One of the most important concepts of security is encryption. Encryption is the method used to convert meaningful messages into a ciphertext (meaningless message) such that it can only be understood by the person having the necessary information to convert it back to the original message.
A concept used within encryption is that of keys. Keys are used to encrypt and/or decrypt messages.

Public Key Infrastructure is a way to securely share keys for encryption and decryption.

Asymmetric Encryption

Let us assume that John wants to send an important parcel to Ted. To make sure that the actual contents of the parcel cannot be viewed by anyone, Ted sends him a special lock and key (Public key). Once the parcel is locked by that key, it can only be opened by a key (Private key) Ted has kept with him. Anyone having the key given to John would NOT be able to open it. This makes the parcel quite secured.

Certification Authority

Now, let us assume that a thief tampers with the package and changes the key and lock. This way Ted gets impersonated and there is no way to verify if the contents are by Ted. To make sure that this does not happen, there is an authority known as the certification authority that verifies the integrity of the key sent. A certificate will be issued, containing the necessary details of Ted and his public key. Let us imagine this to be a public billboard. The certificate on the bill-board will have the public key along with the lock diagram. This certificate will be signed by the necessary Post office head.

Putting this in technical terms, let us assume two machines A and B. A sends its public and private key to the Certification Authority along with the necessary details such as name, domain etc. The authority then creates a message. This message along with the message hash is bundled into a certificate. It is also to be noted that the message hash is now signed. Once a hash has been signed, it can be verified by any person having access to the public key and message. This certificate is the encrypted via the public key of B and then sent.

The Final Block

Machine B decrypts the package using its private key to find a certificate. To test that the certificate is not tampered, it generates the message hash and compares it with the signed hash using the public key.

enter image description here

Conclusion

The above method can be used as a secure way to pass keys and is also used by browsers and servers to provide SSL encryption (HTTPS)

Share:

OWASP Top 10 - Application Security (2017)

COVER_PAGE

The Open Web Application Security Project (OWASP) is a non-profit community helps organizations to develop secured applications. The OWASP Top 10 Web Application Security Risks was updated in 2017 to provide guidance to developers and security professionals on the most critical vulnerabilities that are commonly found in web applications, which are mostly found in web application.The list is usually refreshed in every 3-4 years.They come up with standards, freeware tools and conferences that help organizations as well as researchers.

OWASP Top 10 - Application Security (2017)

Introduction

The Open Web Application Security Project (OWASP) is a non-profit community helps organizations to develop secured applications. The OWASP Top 10 Web Application Security Risks was updated in 2017 to provide guidance to developers and security professionals on the most critical vulnerabilities that are commonly found in web applications, which are mostly found in web application.The list is usually refreshed in every 3-4 years.They come up with standards, freeware tools and conferences that help organizations as well as researchers.

The following are a brief overview about the OWASP Top 10 Web Application Security vulnerabilities:

  1. Injection
  2. Broken Authentication
  3. Sensitive Data Exposure
  4. XML External Entity
  5. Broken Access Control
  6. Security Misconfiguration
  7. Cross-Site Scripting
  8. Insecure Deserialization
  9. Using Components With Known Vulnerabilities
  10. Insufficient Logging and Monitoring

Injection

Injection attacks occur when the user is able to input untrusted data tricking the application to execute unintended commands without proper authorization. Injections flaws can be - SQL injection, PHP injection, LDAP injection, Code injection and OS injection.

With a successful attack, an attacker can gain:

  1. Unauthorized access to an application: An attacker can successfully bypass an application’s authentication mechanism to have illegitimate access to it.
  2. Information disclosure: An attack could lead to a complete data leakage from the database server.
  3. Loss of data availability: An attacker can delete records from the database server.
  4. Compromised data integrity: As SQL statements are also used to modify or add the record, an attacker can use SQL injection to modify or add data stored in a database. This would lead to compromised data integrity.

Mitigation:

  1. Validating data i.e rejecting suspicious-looking data.
  2. Sanitizing user-submitted data, refers to cleaning up the suspicious parts of the data.
  3. Prepared statements with parameterized queries.
  4. Stored procedures.
  5. Principle of least privilege. This is a standard security control that helps minimize the potential damage of a successful attack.For example, accounts that only require read access are only granted read access to the table they need to access.
  6. A database admin can set controls to minimize the amount of information an injection attack can expose.

Broken Authentication

Vulnerabilities in Broken authentication occurs when the application is incorrectly configured or mismanages session related information such that the users identity gets compromised. The information can be in the form of session cookies, passwords, secret keys etc.

For example, an attacker can take a list containing thousands of known username/password combinations obtained during a data breach and use a script to try all those combinations on a login system to see if there are any that work.

With a successful attack, an attacker can gain:

  1. Unauthorized access to an application: An attacker can successfully bypass an application’s authentication mechanism to have illegitimate access to it.
  2. Information disclosure: An attack could lead to a complete data leakage from the database server if admin authentication is breached.
  3. Compromised data integrity: CRUD operations may take place by an admin account under the control of an attacker.

Mitigation:

  1. Usage of multifactor authentication.
  2. Using a SSL Certificate (HTTPS) on your application.
  3. Implementing an idle session timeout.
  4. Using cookies generated using secure algorithms and implementing HTTPS only read.
  5. Rate-limiting repeated login attempts.
  6. Forcing the usage of strong passwords.
  7. Forced login/logout after a password change.
  8. Invalidate tokens and cookies after logout.

Sensitive Data Exposure

Attackers can sniff or modify the sensitive data in web applications and APIs if not properly protected. Attack can lead to leak of financial data, usernames and passwords, or health information that could enable attackers to access such information to commit fraud or steal identities. One popular method for stealing sensitive information is using a man-in-the-middle(MITM) attack.

With a successful attack, an attacker can gain:

  1. Information disclosure: An attack could lead to a complete data leakage from the database server or may lead to sensitive data stored somewhere in the server.

Mitigation:

  1. Use strong encryption keys.
  2. Encrypt all data in transit and at rest.
  3. Use secure protocols and algorithms.
  4. Disable caching of responses with sensitive data.
  5. Using a SSL Certificate (HTTPS) on your application.

XML External Entity

This is an attack against a web application that parses XML input. Poorly configured XML processors evaluate external entity references within XML documents. Attackers can use external entities for attacks including remote code execution, and to disclose internal files and SMB file shares.

With a successful attack, an attacker can gain:

  1. Execute remote code: An attack could lead to a complete or partial takeover of the server.

Mitigation:
3. Accept a less complex type of data such as JSON.
4. Disable the use of external entities in an XML application.
5. Avoiding serialization of sensitive data.
6. Using Web Application Firewalls to detect and block attacks.
7. Having code reviews often.
8. Whitelisting code at server side to prevent malicious XML upload.

Broken Access Control

Improperly configured application allows attackers to access unauthorized resource or other users accounts, viewing sensitive documents, modifying data and access rights. Applications have different types of account depending on the users such as admins, operators, reporting groups and many more. Common problem is that the developers restrict the privileges just on the UI side and not on the server side. If exploited, each user can have admin rights.

Do not confuse Broken Access Control with Broken Authentication!
Broken Authentication refers to an attacker gaining access over the account of another person
Broken Access Control refers to an attacker doing changes to a system which they should not be allowed to do

With a successful attack, an attacker can gain:

  1. Information disclosure: An attack could lead to sensitive data leakage.
  2. Compromised data integrity: CRUD operations may take place by an unauthorized account under the control of an attacker.

Mitigation:

  1. Use secured authorization tokens.
  2. Restrict access of all resources based on various roles.
  3. Implement server side resource restriction.

Security Misconfiguration

This risk refers to improper implementation of controls such as misconfiguration of security headers, error messages containing sensitive information (information leakage), and not patching or upgrading systems, frameworks, and components.
This is the most common vulnerability on the list, and is often the result of using default configurations. Examples of these security misconfigurations are weak passwords, default passwords, default scripts stored on the servers, default directories, default error messages etc.

With a successful attack, an attacker can gain:

  1. Information disclosure: An attack could lead to a complete data leakage from the database server or may lead to sensitive data stored somewhere in the server.
  2. Complete Takeover: An attack could lead to the whole server being taken over by the attacker.

Mitigation:

  1. Review the security of the configurations.
  2. Install only the required features from a framework.
  3. Do ensure that defaults are changed.
  4. Ensuring that error messages are more general.

Cross-Site Scripting

Cross-site scripting (XSS) vulnerabilities occur when web applications allow attacker to insert malicious code or untrusted script into a url path or onto the web application. XSS is of 3 type i.e Reflected, Stored and DOM based XSS. These types refer to the way the attack is stored and executed.

With a successful attack, an attacker can gain:

  1. Information disclosure: An attack could lead to a complete data leakage from the database server.
  2. Account takeover: An attack could lead to an account being taken over by the attacker.
  3. Website defacement: An attack could deface the website.
  4. Unintended actions: An attack could lead to an attacker forcing the user(s) to make unintended actions.

Mitigation:

  1. Enabling Content-Security-policy(CSP).
  2. Escaping untrusted characters.
  3. Validating data i.e rejecting suspicious-looking data.
  4. Sanitizing user-submitted data, refers to cleaning up the suspicious parts of the data.

Insecure Deserialization

Serialization means taking objects from the application code and converting them into a format that can be used for another purpose, such as storing the data to disk or streaming it. Deserialization is just the opposite: converting serialized data back into objects the application can use.
An insecure deserialization exploit is the result of deserializing data from untrusted sources.

With a successful attack, an attacker can gain:

  1. DDoS attack: An attack could lead to the server being unavailable to users.
  2. Execute remote code: An attack could lead to a complete or partial takeover of the server.

Mitigation:

  1. Encryption of serialized data.
  2. Deserializers to run with least privileges.

Using Components With Known Vulnerabilities

Web developers use components such as libraries and frameworks in their web applications and these component are piece of software that helps developers to avoid redundant work. So attacker look for vulnerability in these components and this can lead to hundreds of thousands of components vulnerable to attacks. Examples are use of vulnerable PHP version, Unpatched windows, out-dated kernel version and many more. Attackers can exploit an insecure component to take over the server or steal sensitive data.

With a successful attack, an attacker can gain:

  1. Information disclosure: An attack could lead to a complete data leakage from the database server or may lead to sensitive data stored somewhere in the server.
  2. Complete Takeover: An attack could lead to the whole server being taken over by the attacker.

Mitigation:

  1. Frequently patch the process.
  2. Remove unused components from their application.
  3. Ensuring components are up to date.
  4. Ensure components are received from a trusted source.

Insufficient Logging and Monitoring

To ensure the malicious intent of the attackers gets noticed, it is essential to log all the activity and monitor it for any suspicious behavior.For example, Junk traffic, too many login attempts from a particular source etc.The average discovery time for a breach is around 200 days after it has happened. Insufficient logging and ineffective integration with security incident response systems allow attackers to pivot to other systems and maintain persistent threats.

Mitigation:

  1. 24x7 monitoring of application traffic.
  2. Log analysis.
  3. Implement incident response plans.

Conclusion

The above vulnerabilities are one of the most common and are to be kept in mind as a priority while developing or testing web applications

Share:

Sensitive data exposure

Attackers can sniff or modify the sensitive data in web applications and APIs if not properly protected. Attack can lead to leak of financial data, usernames and passwords, or health information that could enable attackers to access such information to commit fraud or steal identities. One popular method for stealing sensitive information is using a man-in-the-middle (MITM) attack.

Sensitive Data Exposure

Introduction

Attackers can sniff or modify the sensitive data in web applications and APIs if not properly protected. Attack can lead to leak of financial data, usernames and passwords, or health information that could enable attackers to access such information to commit fraud or steal identities. One popular method for stealing sensitive information is using a man-in-the-middle (MITM) attack.

Responsibility

The responsibility of sensitive data exposure can be the fault of a user (if they were a victim of a phishing attack) or the fault of the company (if they underwent a data breach). There are a lot of gray areas as well in which both the parties can be held mutually responsible.

Few attack scenarios in which the provider (company) can be held liable

  • Sensitive data such as username password is stored unencrypted
  • Broken authentication or access control
  • Attacks in which almost no user interaction is required

Few attack scenarios in which the consumer (user) can be held liable

  • Phishing attack from a fake domain
  • Using an insecure network
  • Using an unsafe device

Prevention

It is important for both the user as well as the provider to protect themselves from sensitive data exposures. Below are a few preventive measures that can be taken

Provider side protection

  • Encrypt with high level encryptions only
    One of the mistakes many of the developers do is they encrypt with weak algorithms like ROT13 etc.
    DO NOT ENCRYPT WITH SUCH WEAK ALGORITHMS

  • Encrypt all pages
    Most of the times the pages are interlinked,and an attacker might use the ‘unsecured’ webpage to gain access to sensitive data.

  • Encrypt all databases
    Encrypt the database as a whole or a column storing sensitive information.

    Username Password
    John MyPassword
    Annie AnNie123
    Jack PatriotismIsLife

    Example of an unencrypted databse

    Username Password
    John dc1e7c03e162397b355b6f1c895d…
    Annie 662dcb2ddf1cd7f7d002e97b7301…
    Jack 3c23e1b4cd65a4f19be3041889d8…

    Encrypting the password field

  • See which data is sensitive
    Do not waste your time heavily encrypting databases whose information is not sensitive/important.
    eg. You need not heavily encrypt a database having only the date the user joined the platform

  • Use HTTPS
    HTTPS encrypts the packets being sent between the server and user. This helps in preventing sniffing attacks.

  • Do not store all data forever
    Keep a notice on your website “Accounts that are not active for __ days minimum will be deleted”
    This helps remove unnecessary data of inactive users which will minimize the damage of any attack that happens.

  • Do not ask for unnecessary information
    The less data you have, the less you can lose. If you have made a website where people can chat, there may be no need to store their physical address while creating an account.

Consumer side protection

  • Keep complex passwords
    Make sure to set complex passwords which can not be guessed.
  • Phishing
    Make sure to double check the domain before typing in any information.
  • Secure devices and network
    Make sure the devices you use to access the resources are secure and the network you are using to connect is known and trusted with a proper encryption protocol in place.

Conclusion

The above vulnerabilities are one of the most common and are complex to detect and solve even though a few measures are scenarios are elaborated above, various other types of bugs may effect the code leading to the above vulnerability. One must always be alert and mindful while programming or using applications.

Share:

Broken Authentication

What is broken authentication?


Broken authentication is when one gains access to specific parts of a web application without proper login/permissions.

Example:-

I have a web page named example.com/login.html
Once a person logs in with a proper username and password,he will be redirected to example.com/admin.html

What will broken authentication allow one to do?
Instead of going to the login page,one will directly type the address example.com/admin.html on their URL bar.

Example 2:-

I have a web page named example.com/login.html
Once a person logs in with a proper username and password,the sensitive data will be appeared there and then.

What will broken authentication allow one to do?
It will allow one to attack the web page using methods like:-
  • Credential stuffing (Dictionary attack)
  • Automated attack (Brute force attack)

How do I fix it?

  • Ask for multiple authentications
  • Keep complex password requirements
  • Download a big list of passwords,and if a users password is in that list notify them
  • Limit login attempts
  • Keep your website HTTPS
  • One may use Cookie editors,so make keep complex cookies to prevent Cookie Stealing

Hope you enjoyed,
4YU3H41
Share: