How to Detect Security Incidents Targeting Web Applications

Photo by Shamin Haky on Unsplash

The two most popular incident response frameworks come from NIST and SANS. While they differ in how they group and name the phases of incident response, both follow the same basic process. Based on this, here are six steps for incident handling in web application security: Prepare, Detect, Contain, Address, Recover, and Learn.

Step 1: Prepare

Preparation is by far the most essential stage of incident response. To secure your web assets, you first need to know what assets you have – and surprisingly, many organizations don’t even know that. Similarly, to ensure data security, you need to know your data, where it resides, who should have access to it, and how critical it is to your business.

Next, you need some kind of risk assessment process so you know what security events and impacts you are preparing for. Depending on your policies and requirements, this could involve formal threat modeling or a more informal approach to threat intelligence and identifying the most likely attack vectors.

In the preparation stage, you will likely identify weaknesses or blind spots you must address. For example, if you use a tool like Netsparker to run asset discovery followed by a vulnerability scan, you may find forgotten or unmaintained websites vulnerable to attack. These issues must be addressed to reduce your attack surface and close all the gaps, so you might call this Step 0: Prevent.

Whatever you put in your incident response plan, you need someone to implement it when things go wrong. Your incident response (IR) team will often simply be your IT security team, though large organizations may have a dedicated computer security incident response team (CSIRT). In either case, you must have specific team members on call and ready to follow established procedures.

Step 2: Detect

Web application attacks and data breaches are often only detected after many days or even months – or not detected at all, especially if they have no direct impact on operations. Careful logging and monitoring at the application level can help detect suspicious activity, such as repeated access attempts or unexpected user accounts being created. You can use a security information and event management (SIEM) solution to coordinate these monitoring efforts. Regular security testing using an accurate and up-to-date web vulnerability scanner is also vital to prevent attacks and find new vulnerabilities that attackers could already have exploited.

Step 3: Contain

After a web security incident is detected, your IR team needs to triage it and decide on the best action to minimize short-term impact and prevent minor issues from escalating into full-blown incidents. For example, suppose you detect a critical vulnerability in one of your business applications being actively exploited. In that case, the containment phase might involve setting up your web application firewall (WAF) to block this attack and prevent further damage. Advanced vulnerability scanners like Netsparker can even integrate with popular WAF platforms automatically.

Step 4: Address

Once the immediate threat is under control, you must fix or permanently address the issue. Continuing the example of your critical vulnerability, your security team would take the vulnerability report and create a fixed ticket for developers after deploying a WAF rule to block attacks in the containment phase. In the case of Netsparker, this process can also be automated to streamline communication and minimize the response time.

Recent global cyberattacks have served as a reminder that plugging security holes is often the easiest part. Advanced threat actors don’t do hit-and-run attacks but rather infiltrate target systems to maintain a stealthy and persistent presence. Eliminating the entry point starts a long and arduous process where your IT security and administrators check all potentially affected systems for malicious code, such as web shells, and then clean or rebuild them.

If you’ve had a data breach, you may also have legal obligations to take care of, such as GDPR-mandated notifications. Depending on the type of data and your jurisdiction and industry, you might need to report the incident to law enforcement or the relevant regulatory bodies and update this notification as more information becomes available.

Step 5: Recover

While most web application security incidents won’t require a full disaster recovery process, you need to have incident recovery procedures in place for every eventuality and every level of the application stack. In IT security, everything is connected, so a web application breach could be just one part of a broader attack that affects other systems or threatens business continuity. Regardless of the incident, the overriding goal of your recovery process should be to restore regular service while minimizing damage and disruption to business operations.

Step 6: Learn

Once the fire is out, you can move to post-incident activities such as a post-mortem or root cause analysis. This phase is probably the most important for improving long-term security since many web attacks are performed by reusing and adapting existing techniques. For example, fixing only a specific injection vulnerability without making the relevant part of the application code more secure may allow attackers to modify the attack payload slightly and breach the application again. By analyzing each incident and drawing the right lessons, you can return to step 1 – and be better prepared for the next attack.

What is a Seedbox?

Photo by Taylor Vick on Unsplash

A seedbox is a dedicated, high-speed server for downloading and uploading files. Most people rent seedboxes to achieve very fast torrent or Usenet transfers. Typically, you will see speeds from 100Mbps (8 MB/s) to 10Gbps (1250 MB/s) on a seedbox.

A seedbox also allows you to avoid ISP throttling and bypass eavesdroppers like the RIAA or MPAA.

Today, there are many seedbox providers — most are run by individuals or small companies. These seedboxes have some of the best feedback from customers:

How To Use A Seedbox

Generally, seedboxes are set up so that you can install Usenet and torrent applications quite easily.

Once the files are downloaded to the seedbox, they can then be downloaded to your computer via HTTP, FTP, SFTP, or rsync protocols. You can also directly stream the media from the seedbox with an application like Plex.

Some seedboxes may provide VNC connection or remote desktop protocol on some Windows-based machines. This allows many popular clients to be run remotely.

Seedbox Providers

These are my recommended seedbox providers:

  • RapidSeedbox offers root access and many apps available as “one click installs” including Plex and OpenVPN. Accepts bitcoin, 14 day refund policy. €15 euro ($18 USD) month-to-month.
  • DediSeedbox also offers OpenVPN and Plex as a “one click” install. Root access to your own VPS. Good disk space allowances (1TB with the $15 per month plan).

What Is a Man-in-the-Middle Attack

Photo by Stephen Phillips – Hostreviews.co.uk on Unsplash

A man-in-the-middle attack, often abbreviated as an MITM attack, is a type of cyber assault in which an unauthorized individual interposes themselves in the communication flow between two parties who assume they are engaging in direct communication. In this scenario, the attacker gains the ability to intercept, eavesdrop on, and potentially manipulate the content of the communication taking place. Man-in-the-middle attacks pose a significant threat as they allow for clandestine surveillance and potential tampering with communications across various contexts, such as interactions between individuals, clients, and servers, and even secure connections like HTTPS and other SSL/TLS protocols, as well as Wi-Fi network connections, among others.

Here is how a Man-in-the-middle attack works.

Picture a scenario where you and a colleague are engaged in a conversation through a secure messaging platform. In this situation, an adversary with malicious intent aims to intercept your exchange, clandestinely monitor it, and insert fabricated messages into the conversation, making it appear that these false messages are coming from you to your colleague. This form of cyber attack illustrates the peril of a man-in-the-middle assault, where the attacker attempts to undermine the integrity and confidentiality of your communication.

Initially, you request your colleague’s public key to establish secure communication. If your colleague sends her public key, but an attacker manages to intercept it, a man-in-the-middle attack becomes possible. The attacker sends you a fabricated message skillfully designed to mimic your colleague’s communication. However, this message contains the attacker’s public key instead of your colleague’s legitimate one. Thinking you are using your colleague’s public key, you encrypt your message and unknowingly employ the attacker’s key to secure it. Subsequently, you send this encrypted message back to what you believe is your “colleague.”The attacker, once again, intercepts the message, decrypts it using their private key, manipulates the content, and then re-encrypts it using the public key they initially intercepted from your colleague, who had intended to send it to you. As your colleague receives and examines the encrypted message, she is under the impression that it originated from you, unaware of the attacker’s meddling.

Bypassing Firewalls Using Nmap

Photo by Sigmund on Unsplash

Nowadays, almost every system is protected by firewalls or Intrusion Detection Systems (IDS). Nmap provides various ways to bypass these firewalls or IDS to perform port scans on a system.

TCP ACK Scan

nmap -sA x.x.x.x

How it works…The filtered and unfiltered port scan results depend on whether the firewall is stateful or stateless. A stateful firewall checks whether an incoming ACK packet is part of an existing connection. It blocks it if the packets are not part of any requested connection. Hence, the port will show up as filtered during a scan. Whereas, in the case of a stateless firewall, it will not block the ACK packets,

TCP Window Scan

nmap -sW x.x.x.x

Idle scan

Idle scanning is an advanced technique where no packets sent to the target can be traced back to the attacker’s machine. It requires a zombie host to be specified.

nmap -sI zombiehost.com domain.com

Idle scan works based on a predictable IPID or an IP fragmentation ID of the zombie host. First, the IPID of the zombie host is checked, and then a connection request is spoofed from that host to the target host. If the port is open, an acknowledgment is sent back to the zombie host, which resets (RST) the connection as it has no history of opening such a connection. Next, the attacker checks the IPID on the zombie again; if it has changed by one step, it implies an RST was received from the target. But if the IPID has changed by two steps, it means a packet was received by the zombie host from the target host, and there was an RST on the zombie host, which implies that the port is open.

Directory Traveral

Photo by Gabriel Heinzer on Unsplash

Also called directory climbing, dot-dot-slash, and backtracking attack, the directory traversal method leverages the way in which an application gets data from the webserver. Generally, Access Control Lists (ACLs) limit user access to specific files within a root directory.

Consider a set of nested folders that follow this order:

  • Root directory: My Very Sensitive Data (MVSD)
  • Inside MVSD folder: Protecting from H@x0rs (PfH) folder
  • Inside PfH folder: My Password is Bad (MPiB) folder
  • Inside MPiB folder: H@x0rs Stole My Info file

Now, you might have an additional set of folders outside that root folder including Pictures, Videos, and Downloads. Unless you have access to each of these other root folders, you can’t access the information they contain.

Web applications organize information the same way, even if you don’t see it. In a directory traversal attack, malicious actors figure out the URL structure that the application uses to request files. Using the hypothetical above, that URL might be:

www.myinsecurewebapp.com/MyPas… “.asp?item=” indicates that this URL pulled the file “H@x0rsStoleMyInfo” from the “My Password is Bad” folder. Now, they know the structure of folders and how to start getting different files.

Using this structure, they add “../” at the end. The “../” indicates moving from one folder to one just above it in the hierarchy. The new request might look like this:

www.myinsecurewebapp.com/MyH@cking.asp?item=../

They keep adding the ../ until they gain access to another file. If they know the name of the file, such as an operating system file name, they might do this:

www.mywebsiteinfo.com/MyPasswordisBad.asp?item=../genericoperatingsystemfile

At this point, they just keep adding more “../” after the equal sign until they get to the folder level and file they want.

Top 7 SaaS Security Risks

Photo by Lewis Kang’ethe Ngugi on Unsplash

Contemporary enterprises increasingly embrace cloud technology to harness the operational advantages of delegating essential business functions. A study conducted in 2021 discovered that 90% of the organizations surveyed have integrated cloud computing into their operations, including utilizing services like software-as-a-service (SaaS).

SaaS solutions are pivotal in enabling organizations to attain critical objectives like cost reduction and accelerated time-to-market. Nevertheless, akin to other digital transformation tools, they also introduce cybersecurity vulnerabilities.

When organizations become customers of third-party vendors, they ultimately place their sensitive data in their hands, relying on a foundation of trust. However, even with this trust in place, if a data breach occurs due to inadequate data security practices by the SaaS provider, the responsibility for such a breach still falls squarely upon the client organization.

This article delineates the seven foremost cybersecurity risks introduced by SaaS solutions and provides insights into how organizations can proactively mitigate these risks to prevent potential data breaches.

Top 3 SaaS Security Risk

Below is a list of the three primary cybersecurity risks your organization should consider when utilizing SaaS services.

  1. Cloud Misconfiguration

Since SaaS environments operate within the public cloud, organizations must remain vigilant regarding the distinct cyber threats associated with cloud applications. One prevalent concern is cloud misconfigurations, which transpire when the SaaS provider or the SaaS customer neglects to properly secure the cloud environment. These lapses in security management leave organizations vulnerable to a multitude of cyber threats, including:

Cloud Leaks, Ransomware, Malware, Phishing, External Hackers, Insider threats

A prevalent misconfiguration in cloud computing involves the granting of overly generous permissions. This misstep transpires when an administrator bestows excessive access rights upon an end-user, leading to a permissions imbalance. Excessive licenses constitute a substantial security risk, frequently allowing cloud leaks, data breaches, and insider threats to manifest.

An illustrious instance of a misconfiguration by a cloud service provider is Amazon Web Services (AWS) default public access settings for S3 buckets. Beyond addressing misconfigurations from the cloud provider, your organization must introspect and enhance its security protocols. Gartner’s prediction that 99% of cloud security failures will be attributable to the customer’s actions by 2025 underscores the critical importance of internal security vigilance.

Another noteworthy example of a significant software misconfiguration is the Microsoft Power Apps Data Leak. Secuirty Researchers identified misconfigured OData APIs within Microsoft’s Power Apps portals. This oversight led to the inadvertent exposure of a staggering 38 million records spread across 47 different organizations.

2. Zero Day Vulnerabilities

A zero-day vulnerability is an unpatched software vulnerability that remains unknown to developers. Cybercriminals can exploit these vulnerabilities through attacks, often causing data breaches and loss across affected organizations.

Zero-day vulnerabilities are particularly damaging when identified in popular SaaS platforms – many organizations could be affected, causing a mass shutdown of operations. For example, Accellion’s file-sharing system, FTA, was compromised in 2020 by web shell attacks and zero-day exploits to exploit an unpatched software vulnerability. The incident was part of a broader supply chain attack that breached the sensitive data of over 100 Accellion customers, resulting in widespread operational disruptions.

Organizations must be able to rapidly identify existing vulnerabilities in their SaaS apps to prevent further security issues from occurring through delayed remediation. 

3. Third Party Risk

SaaS services generate third-party risk – the risk deriving from any third party in an organization’s supply chain. Third parties can pose different levels of risk to an organization’s information security. For example, an organization will likely consider a contracted office janitor a low-level security threat, whereas a SaaS vendor is likely high-risk. 

Most SaaS apps will access or store an organization’s sensitive data, including publicly identifiable information (PII) and other privileged information. Your organization may have strict security measures to mitigate cyber threats, but your protection is only as strong as the weakest link in the supply chain.

Organizations must implement effective third-party risk management programs to consistently monitor and manage the unique cyber risks their SaaS vendors contribute to the attack surface.

Open Source Security Testing Tools You Can Start Using Today

Photo by Andrew on Unsplash

In today’s interconnected world, ensuring your digital assets’ security is paramount. As cyber threats continue to evolve, it’s crucial to have effective security testing tools at your disposal. Fortunately, the open-source community offers a wealth of powerful security testing tools to help identify vulnerabilities and strengthen defenses. In this blog post, we’ll explore some of the top open-source security testing tools you can use today.

  1. OWASP ZAP (Zed Attack Proxy): OWASP ZAP is a popular open-source web application security scanner. It provides a comprehensive set of features for finding vulnerabilities in web applications, including automated scanning, manual testing, and security analysis. ZAP is highly extensible, allowing you to customize and enhance its capabilities according to your specific requirements. It’s an invaluable tool for identifying common web application vulnerabilities like cross-site scripting (XSS), SQL injection, etc.
  2. Nmap (Network Mapper): Nmap is a versatile and powerful open-source network scanning tool for security auditing and network exploration. With its extensive scanning techniques, Nmap can map out hosts, identify open ports, and detect potential vulnerabilities. It supports a scripting engine that enables you to automate tasks and create custom scripts for targeted scanning. Nmap is an essential tool for assessing network security and identifying potential entry points for attackers.
  3. Wireshark: Wireshark is a widely used open-source packet analyzer for network troubleshooting and security analysis. It allows you to capture and examine network traffic at a granular level. Wireshark provides detailed insights into network protocols, allowing you to detect anomalies, analyze network behavior, and identify security threats. Its robust filtering capabilities and extensive protocol support make it an indispensable tool for network security professionals.
  4. Metasploit Framework: The Metasploit Framework is a powerful open-source penetration testing platform that enables you to assess and exploit vulnerabilities in systems and applications. With a vast collection of exploits, payloads, and auxiliary modules, Metasploit simplifies the process of penetration testing and helps security professionals validate the effectiveness of their defenses. It also offers a collaborative community and a wide range of resources for sharing knowledge and expertise.
  5. Nikto is an open-source vulnerability scanner to identify security flaws in web servers and applications. It performs comprehensive tests, including server misconfigurations, outdated software versions, and potentially dangerous files or scripts. Nikto provides detailed scan reports, making prioritizing and remediating identified vulnerabilities easier. Its simple command-line interface and extensive plugin support make it a valuable tool for security testing.

Securing your digital assets requires a proactive and comprehensive approach. By leveraging open-source security testing tools, you can enhance your security posture and protect against potential threats. The tools mentioned in this blog post, including OWASP ZAP, Nmap, Wireshark, Metasploit Framework, and Nikto, offer powerful capabilities to identify vulnerabilities, assess network security, and perform penetration testing. Start exploring these open-source tools today and take a proactive stance in securing your systems and applications. Remember to stay updated with the latest releases and actively participate in the open-source community to maximize the benefits of these valuable resources.

Is AES secure?

Photo by FLY:D on Unsplash

In 2000, after a very thorough and open selection process, NIST announced that AES (formally known as Rijndael, after one of its creators) would replace DES as its recommended “unclassified, publicly disclosed encryption algorithm capable of protecting sensitive government information well into the next century.”

Based on NIST’s recommendation, the US government uses AES to secure its classified information:

“The design and strength of all key lengths of the AES algorithm (i.e., 128, 192 and 256) are sufficient to protect classified information up to the SECRET level. TOP SECRET information will require the use of either the 192 or 256 key lengths.”Brute force attacks

The most basic form of attack possible on any encryption cipher is a brute force attack, which involves trying every possible key combination until the correct one is found.

As we discuss in Privacy Decrypted #3: Can encryption be broken? Fugaku is currently the most powerful (known) supercomputer in the world. If it dedicated its entire output to the task, it would take Fugaku 12 trillion years to exhaust all possible combinations for AES-128.

AES-256 is 340 billion-billion-billion-billion times harder to brute force than AES-128. To put this into perspective, the universe is 14 billion years old. It is, therefore, safe to say that even at its lower bit sizes, AES is highly resistant to brute force attacks from conventional computers.

It is often theorized that when quantum computing becomes available, modern encryption algorithms will be rendered all but useless. There is truth in this when it comes to asymmetric-key ciphers, but symmetric-key ciphers are relatively quantum-resistant, although quantum computers still reduce the security of AES by half. This means AES-256 remains secure, but AES-128 is less so.

Brute force attacks, however, are not the only way to compromise an encryption algorithm.

Key attacks

Over the years, a number of theoretical attacks on AES keys have been published by cryptographers, but all of these are either unworkable in practice, or are only effective on AES implementations that use a reduced number of rounds (see below).

The most successful attempt was a biclique attack published in 2011 that can reduce the time needed to brute force AES by a factor of four. However, it would still require billions of years to brute force AES on any current or foreseeable computer hardware.

No known key attack is practical against properly implemented AES-128 or higher.

Side channel attacks

A side-channel attack attempts to reduce the number of combinations required to make a successful brute force attack by looking for clues from the computer performing the encryption calculations. Clues can be gleaned by examining:

Timing – how long a computer takes to perform an operation

Electromagnetic leaks

Audio cues

Visual cues (picked up using a high-resolution camera).

Cache-timing attacks, in particular, have proven to be quite effective at successfully cracking AES. In the most notable example, researchers in 2016 were able to recover an AES-128 key using “only about 6 – 7 blocks of plaintext or ciphertext (theoretically even a single block would suffice)”.

However, there are a number of things that can be done to mitigate against the threat of side-channel attacks:

Properly implemented AES can prevent ways that data can be leaked. Hardware that integrates the AES instruction set further reduces the side-channel attack surface of AES. Randomization techniques can be used to disrupt the relationship between data protected by AES and any leaked data that could be collected using a side-channel attack.

It is also worth noting that, in many cases, side-channel attacks require the attacker to have close proximity or physical access to the device as it decrypts data (although remote attacks are possible if malicious software is installed on a device, particularly in the case of timing attacks).

The human factor

Security is only as strong as its weakest point. There is little point in encrypting your data with AES-256 if you then secure it using the password “12345”. Social engineering attacks and keylogger viruses are also a threat to AES-encrypted data.

Use of a good password manager, anti-virus software, and improved education about cybersecurity are the best forms of defence against these kinds of attacks. Note that this kind of attack is only a risk if you encrypt your own data with a password.

How to Improve MySQL Security: Top 5 Ways

Photo by Stephen Phillips – Hostreviews.co.uk on Unsplash

MySQL RDBMS is esteemed among open-source technologies, a prevalent choice for integrating popular software packages such as WordPress and server stacks like LAMP. As the foundational data platform for numerous websites and cloud services, it is imperative to fortify MySQL security to safeguard your valuable data effectively. To that end, here are 5 essential techniques to bolster your MySQL security posture:

5 Ways to Improve MySQL Security

1. Eliminate the Test Database

The default installation of the MySQL Server package includes a test database accessible to all users. This database represents a prime target for potential attackers. As part of the post-installation hardening process, it is crucial to remove the test database completely.

2. Eradicate Anonymous Accounts

Upon installation, MySQL creates anonymous user accounts that serve no practical purpose. However, these accounts pose a potential vulnerability, offering attackers an entry point into the database. Thus, it is vital to eliminate these anonymous accounts from the system.

3. Alter Default Port Mappings

By default, MySQL operates on port 3306. To enhance security, it is advisable to modify this default port setting. Doing so helps obscure critical services on specific ports, as attackers commonly exploit default configurations. Altering the default port mappings strengthens your defense against such attempts.

4. Disable Remote Logins

If the MySQL database is solely utilized by local applications, it is prudent to disable remote access to the server. This can be achieved by editing the /etc/my.cnf file and adding a “skip-networking” entry under the [mysqld] section. By configuring MySQL to cease listening on all TCP/IP ports, including 127.0.0.1, you confine database access solely to local MySQL socket-based communications.

5. Avoid Running MySQL with Root Level Privileges

MySQL should not be operated directly under the root user account to reinforce security measures. Instead, running MySQL under a dedicated user account specifically created for this purpose is recommended. You benefit from improved auditing and logging capabilities by employing a distinct user account with the appropriate permissions to run the service. Moreover, this practice prevents attackers from gaining unauthorized access by exploiting the root user account.

Implementing these five measures will significantly enhance the security of your MySQL database, reducing the risk of potential breaches and protecting your data with heightened efficiency.