<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sahan Thilina on Medium]]></title>
        <description><![CDATA[Stories by Sahan Thilina on Medium]]></description>
        <link>https://medium.com/@Sahan0710?source=rss-05c601aeb34e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*570oO0kBuxFbqHKbLwKWOQ.jpeg</url>
            <title>Stories by Sahan Thilina on Medium</title>
            <link>https://medium.com/@Sahan0710?source=rss-05c601aeb34e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:16:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Sahan0710/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[VSFTPD — Backdoor Command Execution Vulnerability Exploitation]]></title>
            <link>https://medium.com/@Sahan0710/vsftpd-backdoor-command-execution-vulnerability-exploitation-471d02ad822a?source=rss-05c601aeb34e------2</link>
            <guid isPermaLink="false">https://medium.com/p/471d02ad822a</guid>
            <category><![CDATA[ftp]]></category>
            <category><![CDATA[backdoor]]></category>
            <category><![CDATA[vsftpd]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[cve-2011-02523]]></category>
            <dc:creator><![CDATA[Sahan Thilina]]></dc:creator>
            <pubDate>Sat, 12 Apr 2025 23:40:30 GMT</pubDate>
            <atom:updated>2025-04-12T23:57:27.189Z</atom:updated>
            <content:encoded><![CDATA[<h3>VSFTPD — Backdoor Command Execution Vulnerability Exploitation</h3><h3>Introduction</h3><p>Over the past few years, individuals and organizations have been rapidly embracing digital transformation. However, this shift has brought with it a critical issue that many remain unaware of or choose to ignore, security of their data and information.</p><p>While cybersecurity professionals work hard to make digital environments safer, it’s a constant challenge due to the fast-evolving nature of the IT industry. Every software deployment or update has the potential to introduce new vulnerabilities.</p><p>Today, we explore the backdoor vulnerability found in <strong>vsftpd version 2.3.4</strong> — a popular FTP service included by default in many UNIX and Linux-based systems. We will take a closer look at how this vulnerability operates and demonstrate an exploitation as a proof of concept.</p><h3>Setting up the virtual environment</h3><p>In order to setup the virtual environment, We will be usingVirtualBox application as a hypervisor as it is freely available and easy to use. The next step is to create the two virtual machines.</p><ul><li>Victim — Metasploitable 2 [Vulnerable Ubuntu distro made for exploitation practice]</li><li>Attacker — Kali Linux [A Linux distro developed for penetration testing]</li></ul><p>This step is quite straightforward, the two virtual machines were created by as per the resources available in the host machine (images attached) but there are two important points to be highlighted. Go to host settings on each of the created virtual machines by right clicking on the virtual machine and then clicking on settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*wI7JGZ6WAY2m0ojKLhdIYw.png" /><figcaption><strong>Host Settings</strong></figcaption></figure><ol><li>In the storage settings of each virtual machine, make sure that the downloaded virtual box image is attached in the Controller: SATA section</li></ol><h4><strong>Kali Linux Image Download</strong></h4><p><a href="https://www.kali.org/get-kali/#kali-virtual-machines">Get Kali | Kali Linux</a></p><h4><strong>Metasploitable 2 Image Download</strong></h4><p><a href="https://downloads.sourceforge.net/project/metasploitable/Metasploitable2/metasploitable-linux-2.0.0.zip">https://downloads.sourceforge.net/project/metasploitable/Metasploitable2/metasploitable-linux-2.0.0.zip</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*tQqc1lz0EzbMq081OKe67g.png" /><figcaption>Kali Linux Storage Settings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*ICyZLBp5AKY269TIU0nORA.png" /><figcaption>Metasploitable Storage Settings</figcaption></figure><p>2. In the network settings of each virtual machine, make sure that the attached to: section is set as Host-only Adaptor. This will create a private network with no access to internet isolating the virtual machines configured with this setting from external networks. The host machine will be able to communicate with VMs through this setting and each VM will receive an IP of this private network through DHCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*82CAai7K36ktSG83udx3eQ.png" /><figcaption>Network Settings (Both VMs)</figcaption></figure><h4><strong>Kali Linux VM Configuration</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*Tiot-lsDTqKJlno7tmZEzA.png" /><figcaption>Kali Linux VM Configuration</figcaption></figure><h4><strong>Metasploitable 2 VM Configuration</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*ZatM6ce0G8OHboBpXus_Og.png" /><figcaption>Metasploitable 2 VM Configuration</figcaption></figure><h3>Noteing the IP addresses of the Virtual Machines</h3><p>After logging into the configured machines, check for their IP addresses with the ifconfig command. As previously stated, the use of Host-only Adaptor option has allocated two IP addresses to each of the VMs within the same private network allowing them to communicate with each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*i47JPu31kLS8IbZ-lfChjQ.png" /><figcaption>IP Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*bXm-b7_2YPuwbCRmNBMuUQ.png" /><figcaption>IP of Kali Linux VM</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*84oirEM9OpQZzyJ3PNDCOg.png" /><figcaption>IP of Metasploitable VM</figcaption></figure><h3>Scanning for open ports</h3><h4><strong>Nmap</strong></h4><p>Nmap (Network Mapper) is a free and open source tool that is used for network discovery. This tool comes with an out of the box port scanning functionality which allows users to identify services running on a host. (nmap.org, 2017)</p><p>Execute a port scan on the Metasploitable 2 machine from the Kali Machine which comes with nmap pre-installed. While there are many open ports on the victim host (Metasploitable 2), We will be only looking into the FTP service hosted on port 21.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*AXZoooAb8OPTROpUUonphQ.jpeg" /><figcaption>Nmap Scan Results</figcaption></figure><p>Command executed: <strong>sudo nmap -sS -sV 192.168.56.103</strong></p><p>Breakdown of the command</p><ul><li>sudo — Execute this command as root user</li><li>nmap — Tool used for the port scan</li><li>sS — Set scan type as TCP SYN Scan</li><li>-sV — Detect versions of the services that are running</li><li>192.168.56.103 — IP address of victim host (Metasploitable 2)</li></ul><p>Before further explaining the scan type that was used, Let’s learn about TCP 3- Way Handshake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*ZrMaQz8lUfwD95y0uwa8Xw.png" /><figcaption>TCP 3-Way Handshake (geeksforgeeks.org, 2011)</figcaption></figure><ul><li>SYN — Synchronize</li><li>SYN/ACK — Synchronize/Acknowledge</li><li>ACK — Acknowledge</li><li>RST — Reset</li></ul><p>When devices initially connect over the TCP/IP protocol, they perform the above TCP 3- Way Handshake to establish the connection. The client host would send a SYN packet to a specific port on the server host as per the required service. If the port is closed, the server host will send a RST packet to the client host to terminate the handshake. If the port is open, the server host will send a SYN/ACK packet to state that the post is open and the client host will send an ACK packet to establish a successful TCP/IP connection.</p><h4><strong>TCP SYN Scan</strong></h4><p>A TCP SYN Scan otherwise known as a Stealth Scan or a Half-Open Scan, is when a TCP/IP connection is initiated by sending a SYN packet, receiving a SYN/ACK packet and then not completing the TCP 3-Way Handshake but terminating it by sending a RST packet to the server host. When attempting to perform the TCP 3-Way Handshake, the server host will display a service banner which is used to identify services and service versions running on that particular port. It is not necessarily required to complete the TCP 3-Way Handshake to get this information.</p><p>Now going back to the results of the port scan, as stated previously the we will be only looking into the FTP service hosted on port 21. Below is a port scan specifying the ports to scan using –p parameter as 21 and 6200. As of now, the only thing to note about port 6200 is the fact that it is in closed state. This will be later brought up when deep diving into the vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*rzaRfR3F28xIpZRtieLlSg.png" /><figcaption>Nmap Port Scan on Port 21 and 6200</figcaption></figure><h4><strong>FTP (File Transfer Protocol)</strong></h4><p>A FTP service is used to for file sharing, it allows to make files available to other authorized users within a network</p><h4><strong>VSFTPD (Very Secure File Transfer Protocol Daemon)</strong></h4><p>This is a FTP service that comes by default in most of the common UNIX based and Linux systems like Ubuntu, CentOS, and RHEL</p><h4><strong>Vulnerability</strong></h4><p>A vulnerability can simply be defined as a flaw in a computer system that can compromise the overall security of the host or network.</p><h3>Performing a vulnerability scan on port 21</h3><p>The nmap tool comes with a module called vuln that can be used to perform vulnerability scans on the services detected on open ports. We will be using the — script parameter to specify the nmap command to utilize the vulnerability detection scripts of the vuln module. (Julien Maury, 2022)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*oYOIC9Qt54iTVer2-ZOaqQ.png" /><figcaption>Nmap Vulnerability Scan Results</figcaption></figure><p>As per the above results, the CVE-2011–02523 backdoor vulnerability has been flagged on the vsftpd 2.3.4 service.</p><h3>CVE-2011–02523</h3><p>CVE is a registry of publicly known vulnerabilities operated by the MITRE Corporation. CVE-2011–02523 in particular is related to the vulnerability in vsftpd version 2.3.4 downloaded between 2011/06/30 and 2011/07/03 which had contained a backdoor which opens a shell with root privilege on TCP port 6200. It has been given a 9.8 CVSS base score due to its criticality. (NIST, 2019) In order to exploit this vulnerability, an attacker would only require to add a “:)” smiley emoticon at the end of the username with any password, this will open a backdoor on port 6200. This had not been a security flaw in the original vsftpd itself, an unknown attack had replaced the original vsftpd in the master site with a malicious vsftpd setup containing this backdoor.</p><p>Link to the vulnerable source code: <a href="https://github.com/nikdubois/vsftpd-2.3.4-infected">https://github.com/nikdubois/vsftpd-2.3.4-infected</a></p><h3>Vulnerability in the source code of VSFTPD 2.3.4</h3><p>Below is the malicious part of the vsftpd 2.3.4’s source code. In line 12 and below, the program is checking the p_buf[i] array against two hexadecimal values 0x3a and 0x29. These hex values make up the :) smiley face emoticon in the respective order when converted to ASCII. If the program finds the “:” and “)” characters in the respective order it will call the vsf_sysutil_extra() function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*mk9J3XVhWatYZh9Mjg9nxA.png" /><figcaption>Malicious Source Code 1 (Nguyen-Phuoc, 2019)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/206/1*-N7wqub2v9I1utNEKKJQzg.png" /><figcaption>Hex to ASCII</figcaption></figure><p>Below is the code related to the vsf_sysutil_extra() function which opens a TCP socket listening on port 6200 and spawns a root shell once connected to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*Lohy7WFJ3gcWjEscAM7dHQ.png" /><figcaption>Malicious Source Code 2 (Nguyen-Phuoc, 2019)</figcaption></figure><h4>Metasploit</h4><p>Metasploit is a widely used open source penetration testing framework. It comes with exploits for known vulnerabilities that can be used against many types of devices.</p><h4>MSFconsole</h4><p>This is the most popular interface to the Metasploit Framework. This provides an all-in-one centralized console with access to almost all the features provided by Metasploit Framework. (offsec.com, 2023)</p><h3>Exploiting the vulnerability with Metasploit</h3><p>The MSFconsole will be opened with the msfconsole command. It will open up as below with a randomly generated text art.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*iA0Bt3n1jxh0wHOuIyBprg.png" /><figcaption>MSFconsole</figcaption></figure><p>Next the vsftpd service will be searched using “search vsftpd” command on the MSFconsole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*YnqvT4CFOHPyrGGZ9thEhg.png" /><figcaption>Searching for VSFTPD in MSFconsole</figcaption></figure><p>Two results have reflected for this service and same version. The scope of this report only covers the backdoor vulnerability. Hence only the highlighted #1 vulnerability is important from above to be noted down. Then the required module can be selected with the use command along with the name [exploit/unix/ftp/vsftpd_234_backdoor] or else the module number [1].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*5JIpNrMTQI9CvfNkeCKt6g.png" /><figcaption>MSFconsole Selecting Module by Name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*iPNZ3ybYQ9EHQ8AYxWGF-A.png" /><figcaption>MSFconsole Selecting Module by Number</figcaption></figure><p>The info command provides more insight into the vulnerability while also showing the options available to use in the exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*znwAONZl-TOOlN0tDJiF0Q.png" /><figcaption>MSFconsole unix/ftp/vsftpd_234_backdoor info</figcaption></figure><p>The show options command is then used to display just the options of the selected module. In the current module [exploit/unix/ftp/vsftpd_234_backdoor] it requires an IP for the RHOSTS which will be the IP of the victim machine and the LPORT is already set to 21 port by default which is the default FTP port and also same port where the CVE-2011- 02523 vulnerability exists on the Metasploitable 2 VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*876FSi41-621ATjYenygMA.png" /><figcaption>MSFconsole unix/ftp/vsftpd_234_backdoor Show Options</figcaption></figure><p>The RHOSTS attribute will be set to the Metasploitable 2 VM’s IP using the set RHOST 192.168.56.103 command as below. Same can be validated using the show options command again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-mgLXjDwtC3wFq5_TZ7eQ.png" /><figcaption>MSFconsole unix/ftp/vsftpd_234_backdoor set LHOST</figcaption></figure><p>Finally, the run command be will be executed to run the exploit. This returns us with a shell. </p><ul><li>The hostname command can be executed to validate that the current shell is opened on the Metasploitable 2 virtual machine</li><li>The uname –a command shows the all the system information</li><li>The whoami command displays the user account of the shell in this case it is root</li><li>The init 6 command stops all the processes written in the init files in the reverse order they were started and then performs a reboot</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*TmhZWG8sC6Hc1ZVQ3DExLQ.png" /><figcaption>MSFconsole unix/ftp/vsftpd_234_backdoor Run</figcaption></figure><p>After executing init 6 on the shell belonging to Metasploitable VM which was received on the Kali Linux, the following output is displayed on the Metasploitable machine where the processes are getting stopped and finally the reboot been performed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*THxiCzB3BNFxK0GKBfwQ-Q.png" /><figcaption>Metasploitable init 6</figcaption></figure><h4>Netcat</h4><p>This is a utility that is used to read/write data over TCP/UDP networks connections. This is a feature rich tool having multiple use cases including port binding to accept incoming connections. (sectools.org, 2019)</p><h3>Exploiting the vulnerability manually</h3><p>In order to trigger the malicious source code, the username just needs to have a :) smiley emoticon at the end. We will be using netcat to connect to the FTP service on the 21 port on the Metasploitable virtual machine with the nc 192.168.56.103 21 command. Then “anyUsername:)” is given as the username and “anyPassword” is given as the password. Though it does not show any output afterwards this will trigger the malicious source code because of the :) smiley emoticon at the end of the username and open a root shell on port 6200. Enter “Ctrl + C” to break out of the netcat connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*ZbYqkfAecWUsdy2cShQVWA.png" /><figcaption>Connecting to FTP</figcaption></figure><p>In the previous scan, the port 6200 was closed. Another port scan will be initiated on port 6200 now. As per the below out, 6200 is now open with the backdoor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*wxTLGcC0b2JoweHv0WC07A.png" /><figcaption>Port Scan for port 6200</figcaption></figure><p>We will now connect to the 6200 port using netcat using “nc –v 192.168.56.103 6200” command. The “-v” parameter stands for verbose which’ll display some extra output relating to the execution of the command. The exploitation is complete and a root shell has spawned as expected, the same commands that were executed previously during the Metasploit exploitation are executed here as well for validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*Oa2BRzdXD-1kNNj_QlnovQ.png" /><figcaption>Connecting to the backdoor over port 6200</figcaption></figure><h3>Vulnerability remediation</h3><p>Once the vulnerability is identified, it’s important to take remediating actions to address them. Proposed is a solid fix in below method 1 and a temporary workaround fix in the method 2 to address this vulnerability.</p><h4>Method 1: Updating vsftpd application to a newer version</h4><p>In order remediate this vulnerability, We would need to use a newer version of vsftpd and also to check the checksums and digital signatures of the binaries when performing installations of files downloaded through the internet.</p><h4>Method 2: Dropping all packets incoming to port 6200</h4><p>The malicious source code utilizes the 6200 port in order to open the root shell. So we will be using the iptables tool to drop any packets that are coming to the 6200 port. Create a new configuration file in order to make this rule persistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*ApaaxGhUsIeUwnhl32oNQQ.png" /><figcaption>nano ip-tables-rules</figcaption></figure><p>The nano command will create a file in the /etc/nework/if-prep-up.d/ directory called iptables-rules and prompt to enter the input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*bVQ1oRbfO7nsemLVfle1Mg.png" /><figcaption>nano taking input</figcaption></figure><p>The above shown input will be written into the iptables-rules file and “Ctrl + O” and “Enter” key will be used to write out and exit. Below is the breakdown of the commands.</p><ul><li>#!/bin/sh — Specify which interpreter to use for the execution of the script.</li><li>#/sbin/iptables — A tool used to configure packet filter rules for the Linux kernel firewall</li><li>-A INPUT — Append to the input chain handling incoming traffic</li><li>-p tcp — Defines the protocol as TCP</li><li>— dport 6200 — Defines the destination port as 6200</li><li>-j DROP — If the previous conditions are matched, defined to drop those packets</li></ul><p>Below command will be executed in order to make the file executable as it will be executed at each startup to implement the rule persistently across reboots.</p><p>Command: <strong>sudo chmod +x /etc/network/if-pre-up.d/iptables-rules</strong></p><p>Afterwards a networking service restart will be performed to implement the new rule with below command.</p><p>Command: <strong>sudo /etc/init.d/networking restart</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*mNvDpSSOF5QV8wysqBj-VQ.png" /><figcaption>Making iptables-rules executable and restarting networking services</figcaption></figure><p>The networking service will restart with below output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*C4IVB7aUpTNEfeILrdby6Q.png" /><figcaption>Networking restart</figcaption></figure><p>Afterwards we will re-attempt to execute the Metasploit exploit from the Kali Linux virtual machine which will be unsuccessful proving that the vulnerability has been successfully mitigated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*LDF7S6N5tYf6Jk8N6MIDSg.png" /><figcaption>Failed exploitation after remediation</figcaption></figure><h3>Conclusion</h3><p>We initially worked on setting up the virtual environment and then performed a port scan to identify potential openings for an attack, then we took this one step further by including a script to the port scan to automate the vulnerability detection. Once the FTP vulnerability was identified, then took a look at the source code to check how the vulnerability works and decided to try to exploit the vulnerability both through Metasploit and manually. After successfully doing both, we then proceeded to look into ways to patch this vulnerability and came up with two solutions, one being a solid fix and the other being a temporary workaround which can be implemented in environments where upgrading the vsftpd was not feasible.</p><h3>References</h3><p>geeksforgeeks.org, 2011. [Online] Available at: <a href="https://www.geeksforgeeks.org/tcp-3-way-handshake-process/">https://www.geeksforgeeks.org/tcp-3-way-handshake-process/</a></p><p>Julien Maury, C. K., 2022. [Online] Available at: <a href="https://www.esecurityplanet.com/networks/nmap-vulnerability-scanningmade-easy/">https://www.esecurityplanet.com/networks/nmap-vulnerability-scanningmade-easy/</a></p><p>Nguyen-Phuoc, G., 2019. [Online] Available at: <a href="https://westoahu.hawaii.edu/cyber/forensics-weekly-executivesummmaries/8424-2/">https://westoahu.hawaii.edu/cyber/forensics-weekly-executivesummmaries/8424-2/</a></p><p>NIST, 2019. [Online] Available at: <a href="https://nvd.nist.gov/vuln/detail/CVE-2011-2523">https://nvd.nist.gov/vuln/detail/CVE-2011-2523</a></p><p>nmap.org, 2017. [Online] Available at: <a href="https://nmap.org/">https://nmap.org/</a></p><p>offsec.com, 2023. [Online] Available at: <a href="https://www.offsec.com/metasploit-unleashed/msfconsole/">https://www.offsec.com/metasploit-unleashed/msfconsole/</a></p><p>sectools.org, 2019. [Online] Available at: <a href="https://sectools.org/tool/netcat/">https://sectools.org/tool/netcat/</a></p><p>  </p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=471d02ad822a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jigsaw Ransomware: A Blend of Malware and Psychological Manipulation]]></title>
            <link>https://medium.com/@Sahan0710/jigsaw-ransomware-a-blend-of-malware-and-psychological-manipulation-04beb1ec69dd?source=rss-05c601aeb34e------2</link>
            <guid isPermaLink="false">https://medium.com/p/04beb1ec69dd</guid>
            <category><![CDATA[ransomware]]></category>
            <category><![CDATA[jigsaw]]></category>
            <category><![CDATA[decryption]]></category>
            <dc:creator><![CDATA[Sahan Thilina]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 12:06:13 GMT</pubDate>
            <atom:updated>2026-05-28T09:01:06.759Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmNN8i6oj35e5tM74tKXnQ.png" /><figcaption>Jigsaw ransomware</figcaption></figure><p>Ransomware is a type of malicious software designed to block access to a computer system or encrypt its files until a ransom is paid. It typically spreads through phishing emails, malicious downloads, or software vulnerabilities. Among the many strains of ransomware, Jigsaw stands out as one of the most aggressive and psychologically manipulative.</p><h3>The Infamous Jigsaw Ransomware</h3><p>Jigsaw is a particularly notorious ransomware strain that encrypts a victim’s files and threatens to delete them gradually if the ransom isn’t paid. Unlike other ransomware that simply locks files and demands payment, Jigsaw <strong>actively deletes files over time</strong>, creating a psychological sense of urgency.</p><p>First discovered in early 2016, Jigsaw ransomware has since spawned several variants. Originally known as BitcoinBlackmailer, this strain exclusively targets Windows-based systems. It encrypts files using <strong>AES-256 encryption</strong> and appends extensions such as .FUN, .KKK, .GWS, or .BTC.</p><h3>The Psychological Manipulation Tactic</h3><p>What sets Jigsaw apart is its fear-inducing approach, drawing inspiration from the popular horror movie franchise <em>Saw</em>. The malware displays a ransom note featuring Billy the Puppet, the same puppet used by John “Jigsaw” Kramer in the movies to communicate with his victims. The ransomware uses countdown timers and threats of permanent file deletion to manipulate victims psychologically. The constant reminder of an impending loss creates immense stress, often pushing victims to act irrationally and pay the ransom out of desperation</p><p>Once Jigsaw infects a system:</p><ol><li>It encrypts files and displays a ransom message.</li><li>A countdown timer begins, warning the victim that files will start getting deleted.</li><li>Every hour, a set number of files is permanently erased.</li><li>If the victim attempts to restart their computer or terminate the malware, Jigsaw retaliates by deleting up to 1,000 files instantly.</li><li>If the ransom isn’t paid within 72 hours, all remaining files are erased.</li></ol><p>Although some variants of Jigsaw ransomware claim to delete 1,000 files if the ransomware process is stopped, analysis has shown that this threat is merely a bluff. The malware attempts to instill fear and pressure victims into complying with ransom demands, but in reality, the deletion process does not occur as mentioned.</p><p>Below are some of the file extension types that are particularly targeted by the Jigsaw ransomware.</p><pre>.jpg, .jpeg, .raw, .tif, .gif, .png, .bmp , .3dm, .max, .accdb, .db, .dbf, .mdb, .pdb, .sql, .dwg, .dxf, .c, .cpp, .cs, .h, .php, .asp, .rb, .java, .jar, .class, .py, .js, .aaf, .aep, .aepx, .plb, .prel, .prproj, .aet, .ppj, .psd, .indd, .indl, .indt, .indb, .inx, .idml, .pmd, .xqx, .xqx, .ai, .eps, .ps, .svg, .swf, .fla, .as3, .as, .txt, .doc, .dot, .docx, .docm, .dotx, .dotm, .docb, .rtf, .wpd, .wps, .msg, .pdf, .xls, .xlt, .xlm, .xlsx, .xlsm, .xltx, .xltm, .xlsb, .xla, .xlam, .xll, .xlw, .ppt, .pot, .pps, .pptx, .pptm, .potx, .potm, .ppam, .ppsx, .ppsm, .sldx, .sldm, .wav, .mp3, .aif, .iff, .m3u, .m4u, .mid, .mpa, .wma, .ra, .avi, .mov, .mp4, .3gp, .mpeg, .3g2, .asf, .asx, .flv, .mpg, .wmv, .vob, .m3u8, .dat, .csv, .efx, .sdf, .vcf, .xml, .ses, .Qbw, .QBB, .QBM, .QBI, .QBR  , .Cnt, .Des, .v30, .Qbo, .Ini, .Lgb, .Qwc, .Qbp, .Aif, .Qba, .Tlg, .Qbx, .Qby  , .1pa, .Qpd, .Txt, .Set, .Iif  , .Nd, .Rtp, .Tlg, .Wav, .Qsm, .Qss, .Qst, .Fx0, .Fx1, .Mx0, .FPx, .Fxr, .Fim, .ptb, .Ai, .Pfb, .Cgn, .Vsd, .Cdr, .Cmx, .Cpt, .Csl, .Cur, .Des, .Dsf, .Ds4, , .Drw, .Dwg.Eps, .Ps, .Prn, .Gif, .Pcd, .Pct, .Pcx, .Plt, .Rif, .Svg, .Swf, .Tga, .Tiff, .Psp, .Ttf, .Wpd, .Wpg, .Wi, .Raw, .Wmf, .Txt, .Cal, .Cpx, .Shw, .Clk, .Cdx, .Cdt, .Fpx, .Fmv, .Img, .Gem, .Xcf, .Pic, .Mac, .Met, .PP4, .Pp5, .Ppf, .Xls, .Xlsx, .Xlsm, .Ppt, .Nap, .Pat, .Ps, .Prn, .Sct, .Vsd, .wk3, .wk4, .XPM, .zip, .rar  </pre><p>Since its initial discovery, <strong>s</strong>everal variants of Jigsaw ransomware have emerged, differing mainly in ransom amounts, targeted file types, and extensions. Some versions increase the ransom amount over time, further pressuring victims into paying quickly.</p><h3>Infection and Execution</h3><p>Jigsaw typically infiltrates systems via spam emails, malicious attachments, or compromised downloads. Once executed:</p><p>The ransomware disguises itself as a <strong>Firefox or Dropbox process</strong>, using filenames like:</p><ul><li>firefox.exe</li><li>drpbx.exe</li></ul><p>It configures an auto-run process in the Windows startup list, ensuring it launches every time the system is rebooted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*ip0jZmkKHrz8me-zxGc2Ng.png" /><figcaption>Jigsaw ransomware disguised as Firefox, set to run at startup</figcaption></figure><h3>Identifying Artifacts</h3><p>Once infected, the malware will make copies of itself, typically in the below file paths.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*NWy971nGWNooLhromsiArQ.png" /><figcaption>%UserProfile%\AppData\Roaming\Frfx\firefox.exe</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*iEwdQsM9zT3PbomCTkGZbA.png" /><figcaption>%UserProfile%\AppData\Local\Drpbx\drpbx.exe</figcaption></figure><p>To maintain persistence, Jigsaw ransomware adds itself to the startup, ensuring it runs even after system reboots. It achieves this by modifying the Windows Registry, specifically targeting the following key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*kYr3ahVDuhxYMVs8O4dl8Q.png" /><figcaption>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run</figcaption></figure><p>Additionally, below files are also created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*JPx41wikNE0leTSlYz_vvA.png" /><figcaption>%UserProfile%\AppData\Roaming\System32Work</figcaption></figure><p>The “address.txt” file contains the attacker’s bitcoin wallet address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*2ubKdAQhSuJFGxeYLO7tVw.png" /><figcaption>Bitcoin Wallet Address</figcaption></figure><p>The “dr” file is likely used for the encryption process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/107/1*FandPyhD43-zFVESd6BipA.png" /><figcaption>“dr” File</figcaption></figure><p>The “EncryptedFileList.txt” lists all the files encrypted by the Jigsaw ransomware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*EjKU9k1L7VW5npGT0HKrog.png" /><figcaption>Encrypted File List</figcaption></figure><h3>Dissecting Jigsaw Ransomware</h3><p>Despite the sophisticated nature of Jigsaw ransomware, its creators made a crucial mistake by leaving the encryption key in plain sight within the ransomware itself. This oversight significantly weakened the effectiveness of their encryption mechanism. By reverse-engineering the ransomware, security researchers were able to uncover the key, allowing victims to recover their files without paying the ransom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*aWCYhRBQOhHBc3gZL51abQ.png" /><figcaption>“Firefox.exe” decompiled with JetBrains dotPeek</figcaption></figure><p>Its use of the .NET framework means it can be easily decompiled with tools like dotPeek, allowing cybersecurity researchers or even attackers to extract critical components of the malware, including the encryption key. By simply decompiling the binary, the encryption key and other valuable information are exposed. This vulnerability not only makes Jigsaw easier to bypass but also highlights how even well-designed ransomware can be compromised when basic reverse engineering tools are applied.</p><h3>Outsmarting Jigsaw and Decryption</h3><p>When infected with Jigsaw ransomware, immediate action is necessary to prevent further damage. First, open the Task Manager in Windows and terminate any processes related to Firefox (firefox.exe) and Dropbox (drpbx.exe), which the malware disguises itself as.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*bj0g28iF2WpGYa9hLityCw.png" /><figcaption>Identiyfing Jigsaw processes</figcaption></figure><p>Identify the “Firefox.exe” or “Drpbx.exe” process (or both) and select “Go to details”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*szH4O_mSeIx_v6Qx6zQfQg.png" /><figcaption>Ending Jigsaw process’ process tree</figcaption></figure><p>Right click on the identified process and select “End process tree”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*otFWgRwJG2gz1jqOI5rEpw.png" /></figure><p>Then, access the Registry Editor and delete the startup entry called “firefox.exe” located at</p><blockquote>“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run”</blockquote><p>This will stop the ransomware from re-launching on system reboot.</p><p>After disabling the ransomware’s processes, you can proceed to delete the ransomware artifacts and start decrypting your files.</p><pre>%UserProfile%\AppData\Local\Drpbx\<br>%UserProfile%\AppData\Roaming\Frfx\<br>%UserProfile%\AppData\Roaming\System32Work\</pre><p>Once your files are recovered, ensure your system is fully cleaned by running anti-virus or anti-malware software to remove any remaining traces of the Jigsaw malware. This multi-step approach will help you regain control of your system and safeguard against future infections.</p><p>You can use the below PowerShell script to automate the above disinfection steps as well as to decrypt infected files.</p><p><a href="https://github.com/Sahan0710/jigsawDecryptor">GitHub - Sahan0710/jigsawDecryptor: This PowerShell script is designed to decrypt files encrypted by the Jigsaw ransomware, automatically remove malicious directories, and clean up registry entries associated with the malware.</a></p><p>Never pay the ransom. Not only does paying encourage cybercriminals to continue their attacks, but there’s no guarantee that your files will be restored. The best course of action is to report the attack, seek professional help, and explore alternative recovery methods.</p><p>If you enjoyed this article, feel free to share it with others who might find it useful, leave a comment with your thoughts. Stay safe and stay informed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04beb1ec69dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Litter — Sherlocks — Hack The Box (dnscat Decoding, Wireshark, Data Exfiltration and Tunneling)]]></title>
            <link>https://medium.com/@Sahan0710/litter-sherlocks-hack-the-box-dnscat-decoding-wireshark-dns-data-exfiltration-and-dns-tunneling-ac372663c98b?source=rss-05c601aeb34e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac372663c98b</guid>
            <category><![CDATA[dnscat]]></category>
            <category><![CDATA[dns-exfiltration]]></category>
            <category><![CDATA[litter]]></category>
            <category><![CDATA[decode]]></category>
            <category><![CDATA[dns-tunneling]]></category>
            <dc:creator><![CDATA[Sahan Thilina]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 18:45:48 GMT</pubDate>
            <atom:updated>2024-03-03T18:45:48.624Z</atom:updated>
            <content:encoded><![CDATA[<h3>Litter — Sherlocks — Hack The Box (dnscat Decoding, Wireshark, DNS Data Exfiltration and DNS Tunneling) — HTB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*HsLLYNkPQwrVsFfUb634eQ.jpeg" /></figure><ol><li><strong>Export DNS query name where [protocol=DNS] AND [destination IP = 192.168.157.145] as pcapDNSDetails</strong></li></ol><pre>tshark -Y &quot;dns and ip.dst == 192.168.157.145&quot; -T fields -e &quot;dns.qry.name&quot; -r suspicious_traffic.pcap &gt; pcapDNSDetails</pre><p>■ tshark: command-line utility for Wireshark<br>■ -Y “dns and ip.dst == 192.168.157.145”: This is the display filter (-Y option) applied to the captured packets. In this case, it filters for DNS packets (dns) where the destination IP address (ip.dst) is equal to 192.168.157.145.<br>■ -T fields: This specifies the output format as fields. It means that instead of displaying the entire packet, only specific fields will be shown<br>■ -e “dns.qry.name”: This option specifies the field to be displayed. In this case, it’s the DNS query name (dns.qry.name). It extracts and displays the domain name being queried in the DNS packets<br>■ -r suspicious_traffic.pcap: This option specifies the input file (-r for read) from which tshark should analyze the network traffic. In this case, it’s reading from a file named suspicious_traffic.pcap, which is likely a packet capture file</p><p><strong>2. Removing the first 9 bytes from each line as they are not real data, they are related to the C&amp;C communication. (Sequences and control bytes)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*Qjby48NJVvsxngmuEOyfYg.png" /><figcaption>dnscat first 9 bytes in hex</figcaption></figure><pre>cat pcapDNSDetails | awk &#39;sub(/^.{18}/,&quot;&quot;)&#39; &gt; output.txt</pre><p>■1 byte is 8 bits. 9 bytes is 72 bits. 1 hex is represented in 4 bits. To get the 72 bit representation in hex, divide it by 4 which is 18. cat reads the pcapDNSDetails file and uses | to pipe the output to the awk command which will run the sub function on each line. The sub function gets the first 18 characters of each line and replace them with a blank. sub basically substitutes.<br>■^ means start of line.<br>■^.{18} means identify any 18 characters from the start of line<br>■”” means what to replace the identified text with, which is blank<br>■sub(/findThis/,replaceWithThis)</p><p><strong>3. Removing the “.microsofto365.com” domain name</strong></p><pre>sed -i &#39;s/.microsofto365.com//&#39; output.txt</pre><p>■sed is the steam editor command which is used to edit files<br>■-i: Edit the mentioned file itself, otherwise it’ll only show you the output<br>■’s/whatToLookFor/WhatToReplaceItWith/’ — In our case, it looks for “.microsofto365.com” and replaces it with blank</p><p><strong>4. Removing all the [.] fullstops</strong></p><pre>sed -i &quot;s/\.//&quot; output.txt</pre><p>■’s/whatToLookFor/WhatToReplaceItWith/’ — In our case, it looks for “\.” literal fullstop the backslash is given so that it will not take the regex value (. means any in regex) and replaces it with blank</p><p><strong>5. Convert output from HEX to ASCII (human-readable)<br></strong>■Convert the output.txt file in CyberChef with filter [<em>From Hex]</em><br><a href="https://gchq.github.io/CyberChef/#recipe=From_Hex(&#39;Auto&#39;)">https://gchq.github.io/CyberChef/#recipe=From_Hex(&#39;Auto&#39;)</a></p><p>OR</p><p>■Use below command to install xxd on debian</p><pre>sudo apt-get update;sudo apt-get -y install xxd;</pre><p>■xxd is a tool to convert ASCII to HEX, but in this case we give -r to do the reverse operation which is HEX to ASCII. -p means plaintext.</p><pre>cat output.txt | xxd -r -p &gt; hexDecodedOutput.txt</pre><p><strong><em>A bash script to perform all above at once</em></strong></p><pre>#!/bin/bash<br>#Asks for the pcap file name with extension<br>echo &quot;Enter pcap file name: &quot;<br><br>#Checks whether the pcap file exists<br>read pcapFile<br><br>#If pcap file exists<br>if [ -f $pcapFile ]; then<br><br>       #Check and install xxd if not installed<br>       if ! command -v xxd &amp;&gt; /dev/null; then<br>          echo &quot;#-#-#-#-Updating Repo and Installing xxd for HEX to ASCII Conversion-#-#-#-#&quot;<br>          sudo apt-get update;sudo apt-get -y install xxd;<br>       fi<br>       #Check and install tshark if not installed<br>       if ! command -v tshark &amp;&gt; /dev/null; then<br>          echo &quot;#-#-#-#-Updating Repo and Installing tshark for pcap analysis-#-#-#-#&quot;<br>          sudo apt-get update;sudo apt-get -y install tshark;<br>       fi<br>   #Export DNS query name where [protocol=DNS] AND [destination IP = 192.168.157.145] as pcapDNSDetails<br>   tshark -Y &quot;dns and ip.dst == 192.168.157.145&quot; -T fields -e &quot;dns.qry.name&quot; -r $pcapFile &gt; pcapDNSDetails<br><br>   #Removing the first 9 bytes from each line as they are related to the command &amp; control communication, not the data<br>   cat pcapDNSDetails | awk &#39;sub(/^.{18}/,&quot;&quot;)&#39; &gt; output.txt<br><br>   #Removing the &quot;.microsofto365.com&quot; domain name<br>   sed -i &#39;s/.microsofto365.com//g&#39; output.txt<br><br>   #Removing all the [.] fullstops<br>   sed -i &quot;s/\.//g&quot; output.txt<br><br>   #Convert output from HEX to humanreadable<br>   cat output.txt | xxd -r -p &gt; hexDecodedOutput.txt<br>   echo -e &quot;\nhexDecodedOutput.txt Has Been Generated!&quot;<br><br>   #Remove unwanted files<br>   rm -rf pcapDNSDetails output.txt<br>else<br>   echo -e &quot;\nFile $pcapFile Does Not Exist!&quot;<br>fi</pre><p><strong>REFERENCES</strong></p><p><a href="https://leonuz.medium.com/thats-not-my-name-forensic-challenge-writeup-downunderctf-2021-cc8211b6f60b">https://leonuz.medium.com/thats-not-my-name-forensic-challenge-writeup-downunderctf-2021-cc8211b6f60b</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac372663c98b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>