<?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 Aghaverdi Kalantarli on Medium]]></title>
        <description><![CDATA[Stories by Aghaverdi Kalantarli on Medium]]></description>
        <link>https://medium.com/@aghaverditk?source=rss-10898a256034------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QKYwraa2Kw4E9a31BQlmVg.png</url>
            <title>Stories by Aghaverdi Kalantarli on Medium</title>
            <link>https://medium.com/@aghaverditk?source=rss-10898a256034------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 10:37:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aghaverditk/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[Beyond Authentication: Understanding BOLA in API Security]]></title>
            <link>https://medium.com/@aghaverditk/beyond-authentication-understanding-bola-in-api-security-09b12cc36938?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/09b12cc36938</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bola]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[bfla]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 07:21:32 GMT</pubDate>
            <atom:updated>2026-08-18T08:20:25.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9boTAPQqoNWOLjnDHEBIUg.jpeg" /></figure><p>Modern applications increasingly rely on APIs to exchange data and perform business operations. As APIs become the backbone of web and mobile applications, authorization failures can expose sensitive resources even when authentication itself is implemented correctly.</p><p>One of the most important API authorization vulnerabilities to understand is <strong>Broken Object Level Authorization (BOLA)</strong>.</p><p>BOLA occurs when an API fails to properly verify whether the authenticated user is authorized to access or perform an action on a specific object.</p><p>In simple terms:</p><blockquote><strong><em>Authentication answers: “Who are you?”</em></strong><em><br></em><strong><em>Authorization answers: “What are you allowed to access?”</em></strong></blockquote><p>BOLA is primarily an authorization problem.</p><h3>Understanding API’s before testing their security</h3><p>Before discussing API vulnerabilities such as Broken Object Level Authorization (BOLA), it is useful to understand what an API is, how it communicates, and the different approaches used to build APIs.</p><p>At a high level, API communication is commonly described using two components: the <strong>client</strong> and the <strong>server</strong>.</p><p>The client is the application that sends a request, while the server processes that request and returns a response.</p><p>For example, in a weather application, the mobile application acts as the client. It sends a request for weather information, while the backend service containing or retrieving the weather data acts as the server.</p><p>A simplified communication flow looks like this:</p><pre>Client<br>   |<br>   |  Request<br>   ↓<br>API / Server<br>   |<br>   |  Response<br>   ↓<br>Client</pre><p>The way this communication is implemented depends on the API architecture, protocol, and requirements of the application.</p><p>Some of the most common approaches include <strong>SOAP, RPC, REST, and WebSocket-based APIs</strong>.</p><h3>SOAP API’s</h3><p><strong>SOAP (Simple Object Access Protocol)</strong> is a protocol designed for exchanging structured messages between applications.</p><p>SOAP commonly uses <strong>XML</strong> for request and response messages and follows a more strictly defined communication model than many modern web APIs.</p><p>A simplified SOAP interaction might look like:</p><pre>Client<br>   |<br>   | XML Request<br>   ↓<br>SOAP Server<br>   |<br>   | XML Response<br>   ↓<br>Client</pre><p>SOAP has historically been widely used in enterprise environments, particularly where strict contracts, formal standards, and extensive enterprise features are required.</p><p>From a security testing perspective, SOAP APIs can introduce issues around XML processing, authentication, authorization, and improper input handling. However, the underlying authorization principle remains the same: the server must verify whether the authenticated user is authorized to access or manipulate the requested resource.</p><h3>RPC API’s</h3><p><strong>RPC (Remote Procedure Call)</strong> APIs are based on the idea of allowing a client to invoke a function or procedure on a remote server.</p><p>Instead of primarily thinking in terms of resources, RPC APIs often expose operations or actions.</p><p>Conceptually:</p><pre>Client<br>   |<br>   |  executeFunction(parameters)<br>   ↓<br>Server<br>   |<br>   |  result<br>   ↓<br>Client</pre><p>For example:</p><pre>createUser()<br>getUser()<br>deleteUser()</pre><p>The client requests that the server execute a specific operation, and the server returns the result.</p><p>RPC implementations can use different serialization and transport mechanisms. Examples include <strong>gRPC</strong> and JSON-RPC.</p><p>From a security perspective, RPC APIs require careful authorization at both the function and object levels. This distinction becomes particularly important when differentiating <strong>BOLA</strong> from <strong>Broken Function Level Authorization (BFLA)</strong>.</p><h3>WebSocket API’s</h3><p>Unlike traditional request-response APIs, <strong>WebSocket-based communication</strong> provides a persistent connection that allows both the client and server to send messages.</p><p>This makes WebSockets particularly useful for real-time applications such as:</p><ul><li>chat applications;</li><li>live notifications;</li><li>trading platforms;</li><li>collaborative applications;</li><li>real-time dashboards;</li><li>online gaming.</li></ul><p>The communication model can be represented as:</p><pre>Client  ←────────────→  Server<br>          Persistent<br>           Connection</pre><p>The server does not necessarily have to wait for a new request before sending data. It can push messages to connected clients whenever an event occurs.</p><p>This bidirectional communication makes WebSockets different from the traditional request-response model commonly associated with REST APIs.</p><p>However, WebSocket applications still require strong authentication and authorization controls. Security testing should consider not only the initial connection but also the permissions associated with individual messages, actions, channels, and objects.</p><h3>REST API’s</h3><p><strong>REST (Representational State Transfer)</strong> is one of the most widely used architectural styles for web APIs.</p><p>REST APIs typically expose resources through URLs and use HTTP methods to perform operations on those resources.</p><p>For example:</p><pre>GET /api/users/15</pre><p>could retrieve a user, while:</p><pre>POST /api/users</pre><p>could create a new user.</p><p>Other common HTTP methods include:</p><pre>GET     → Retrieve a resource<br>POST    → Create a resource<br>PUT     → Replace a resource<br>PATCH   → Modify a resource<br>DELETE  → Delete a resource</pre><p>A typical REST API interaction looks like:</p><pre>Client<br>   |<br>   | HTTP Request<br>   | GET /api/users/15<br>   ↓<br>API Server<br>   |<br>   | HTTP Response<br>   | 200 OK + JSON<br>   ↓<br>Client</pre><p>REST APIs commonly exchange data using <strong>JSON</strong>, although other representations can also be used.</p><p>For example:</p><pre>{<br>    &quot;id&quot;: 15,<br>    &quot;username&quot;: &quot;samarithan&quot;,<br>    &quot;name&quot;: &quot;Arnold&quot;<br>}</pre><p>The simplicity and flexibility of REST have made it extremely common in web and mobile applications.</p><p>However, this flexibility also means that APIs frequently expose object identifiers directly to clients.</p><p>For example:</p><pre>GET /api/users/15<br>GET /api/orders/1024<br>GET /api/documents/543</pre><p>From an API security testing perspective, these object references are particularly interesting.</p><p>The security question is not simply whether the client can modify:</p><pre>15 → 16</pre><p>The important question is whether the server properly verifies authorization after the identifier has been changed.</p><p>This brings us directly to one of the most important API authorization vulnerabilities: <strong>Broken Object Level Authorization (BOLA)</strong>.</p><h3>What Is Broken Object Level Authorization?</h3><p>Imagine an API exposes the following endpoint:</p><pre>GET /api/users/15</pre><p>The number 15 represents an object identifier. If the authenticated user is allowed to access user 15, the request should succeed. But what happens if the same user changes the identifier?</p><pre>GET /api/users/16</pre><p>If the API returns user 16 even though that object belongs to another user, the application may be vulnerable to BOLA. The important point is that <strong>changing an object identifier is not, by itself, a vulnerability</strong>. The vulnerability exists when the server fails to perform the required authorization check for the requested object. This distinction is important when performing API security assessments.</p><h3>Why is BOLA so common in API’s?</h3><p>API endpoints frequently expose direct references to backend objects. These references can appear in many forms:</p><pre>/api/users/123<br>/api/orders/456<br>/api/documents/789</pre><p>They can also appear as query parameters:</p><pre>/api/orders?id=456</pre><p>or inside request bodies:</p><pre>{<br> &quot;user_id&quot;: 456<br>}</pre><p>They may even be represented by UUIDs or other identifiers.</p><p>From a testing perspective, object references are therefore important points of interest.</p><p>The identifier might be:</p><ul><li>a sequential integer;</li><li>a UUID;</li><li>a username;</li><li>an order number;</li><li>a document ID;</li><li>a vehicle identification number;</li><li>or another application-specific reference.</li></ul><p>However, predictable IDs are <strong>not a prerequisite for BOLA</strong>. An unpredictable UUID can still be vulnerable if the server does not verify whether the requesting user is authorized to access that object.</p><h3>The Core Security Problem</h3><p>A common mistake is to assume that authentication automatically provides authorization.</p><p>For example, an API may correctly validate an access token:</p><blockquote>Authorization: Bearer &lt;token&gt;</blockquote><p>The token proves that the request comes from an authenticated user.</p><p>But that does not necessarily mean the user is allowed to access every object exposed by the API.</p><p>The server should effectively perform a decision similar to:</p><p>Is this user authenticated?<br> ↓<br>Which user is making the request?<br> ↓<br>Which object is being requested?<br> ↓<br>Does this user have permission to access this object?<br> ↓<br>Allow or deny the operation</p><p>The critical step is the object-level authorization check.</p><p>OWASP describes BOLA as a failure to properly enforce authorization checks for each object accessed through an API.</p><h3>A Practical BOLA testing example</h3><p>To better understand the vulnerability, I performed a controlled test against a deliberately vulnerable API environment using <strong>Postman, Burp Suite and vAPI</strong>.</p><p>The objective was simple: create a user, identify the object ID returned by the API, access that object, and then test whether changing the object identifier would allow access to another user’s resource.</p><h3>Step 1 — Creating a User</h3><p>I started by creating a new user using a POST request.</p><p>The API returned a successful response and assigned the newly created object an identifier:</p><pre>id: 15</pre><p>This gave me a known object belonging to the current test context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZxHGuS_OcqBfWO3tPoYmsA.png" /><figcaption>Figure 1: Creating a user through the API and receiving the assigned object ID.</figcaption></figure><h3>Step 2 — Accessing the Created Object</h3><p>Next, I accessed the newly created object using:</p><pre>GET /vapi/api1/user/15</pre><p>The API returned the expected object:</p><pre>{<br> &quot;id&quot;: 15,<br> &quot;username&quot;: &quot;samarithan&quot;,<br> &quot;name&quot;: &quot;Arnold&quot;,<br> &quot;course&quot;: &quot;waltz&quot;<br>}</pre><p>At this stage, the behavior was expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUrEJr-WSnpnmRve_SZ03w.png" /><figcaption><em>Figure 2: Accessing the object associated with the expected object identifier.</em></figcaption></figure><p>Step 3 — Manipulating the Object Identifier</p><p>The interesting part of the test came next.</p><p>Instead of requesting object 15, I changed the identifier to another value:</p><p>GET /vapi/api1/user/17</p><p>The API responded with:</p><p>HTTP/1.1 200 OK</p><pre>{<br> &quot;id&quot;: 17,<br> &quot;username&quot;: &quot;agunix&quot;,<br> &quot;name&quot;: &quot;Aghaverdi&quot;,<br> &quot;course&quot;: &quot;Painting&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*zpSrqrR1RD8iVDECPpWnDA.png" /><figcaption>Figure 3: Changing the object identifier resulted in access to another user’s object.</figcaption></figure><p>This behavior demonstrates the core issue behind BOLA: the API accepted the request but did not sufficiently enforce whether the authenticated user was authorized to access the requested object.</p><h3>BOLA Is About Authorization, Not Just ID Manipulation</h3><p>It is tempting to describe BOLA simply as:</p><blockquote>“Change the ID and access another user’s data.”</blockquote><p>That description is useful for explaining the vulnerability at a high level, but it misses the underlying security problem.</p><p>The actual issue is:</p><blockquote>The server failed to enforce authorization at the object level.</blockquote><p>For example, consider:</p><pre>GET /api/users/15</pre><p>and</p><pre>GET /api/users/17</pre><p>There is nothing inherently insecure about allowing users to request different IDs.</p><p>The security question is whether the application evaluates the relationship between:</p><pre>Authenticated User<br>        +<br>Requested Object<br>        +<br>Requested Action</pre><p>before returning the resource.</p><p>If the authorization decision is missing or incorrectly implemented, an attacker may be able to access objects belonging to other users.</p><h3>Potential impact of BOLA</h3><p>The impact depends heavily on the type of object and operation exposed by the vulnerable endpoint.</p><p>A successful BOLA vulnerability can result in unauthorized:</p><ul><li>access to personal information;</li><li>access to financial or business data;</li><li>modification of another user’s resources;</li><li>deletion of another user’s resources;</li><li>access to sensitive documents;</li><li>access to account-related information;</li><li>horizontal privilege escalation;</li><li>and, in some cases, further compromise of an account or application.</li></ul><p>For example, a vulnerable GET endpoint may allow unauthorized information disclosure:</p><pre>GET /api/orders/1002</pre><p>while a vulnerable PUT or PATCH endpoint could potentially allow unauthorized modification:</p><pre>PUT /api/orders/1002</pre><p>Similarly, a vulnerable DELETE endpoint could allow one user to delete another user&#39;s resource.</p><p>OWASP’s API testing guidance specifically recommends testing object references across different HTTP methods, including GET, POST, PUT, PATCH, and DELETE.</p><h3>Example attack scenarios</h3><h3>Scenario 1: E-Commerce platform</h3><p>Consider an e-commerce platform where stores can access their revenue data through:</p><pre>GET /shops/{shopName}/revenue_data.json</pre><p>If the application fails to verify that the authenticated user actually owns or has permission to access the requested shop, an attacker could potentially manipulate the shopName value.</p><p>For example:</p><pre>/shopA/revenue_data.json</pre><p>could become:</p><pre>/shopB/revenue_data.json</pre><p>If the API returns the second store’s information without performing an authorization check, the application is exposing another object’s data.</p><h3>Scenario 2 : Connected vehicles</h3><p>Imagine a vehicle management API that allows users to remotely perform actions such as:</p><ul><li>starting a vehicle;</li><li>stopping the engine;</li><li>locking doors;</li><li>unlocking doors.</li></ul><p>The API might receive a vehicle identifier such as a VIN:</p><pre>{<br>    &quot;vin&quot;: &quot;ABC123...&quot;<br>}</pre><p>If the server verifies only that the user is authenticated but fails to verify that the requested vehicle actually belongs to that user, an attacker could potentially manipulate the VIN and interact with another vehicle.</p><p>In this scenario, the consequences could go beyond information disclosure and involve unauthorized actions against another user’s resource.</p><h3>Scenario 3: Online document storage</h3><p>Consider an online document storage service where users can create, edit, and delete documents.</p><p>A delete operation might look like:</p><pre>DELETE /api/documents/123</pre><p>If document 123 belongs to another user and the API deletes it without checking ownership or authorization, the application has an object-level authorization failure.</p><p>In this case, the impact is not simply unauthorized data access — it is <strong>unauthorized modification or destruction of another user’s resource</strong>.</p><h3>BOLA VS Broken Function Level Authorization</h3><p>BOLA and <strong>Broken Function Level Authorization (BFLA)</strong> are related, but they target different authorization dimensions.</p><h3>BOLA</h3><p>The user can access a function, but should not be able to access <strong>that particular object</strong>.</p><p>For example:</p><pre>GET /api/users/17</pre><p>The endpoint itself is available to the user, but object 17 belongs to someone else.</p><h3>BFLA</h3><p>The user should not be able to access <strong>the function or operation itself</strong>.</p><p>For example, a normal user accessing an administrative endpoint:</p><pre>DELETE /api/admin/users/17</pre><p>when that administrative function should only be available to privileged users.</p><p>OWASP categorizes BOLA as <strong>API1:2023</strong> and BFLA as <strong>API5:2023</strong>, reflecting that they represent different authorization failures.</p><p>A useful way to remember the difference is:</p><blockquote><strong>BOLA = “Can I access this object?”</strong><br><strong>BFLA = “Can I perform this function?”</strong></blockquote><h3>How to prevent BOLA?</h3><p>The most important mitigation is straightforward:</p><p><strong>Perform authorization checks for every object access.</strong></p><p>The server should never rely solely on an object ID supplied by the client.</p><p>Instead, it should determine whether the authenticated principal has permission to perform the requested action on that specific object.</p><p>For example, conceptually:</p><pre>Authenticated User<br>        ↓<br>Requested Object<br>        ↓<br>Authorization Policy<br>        ↓<br>Is the requested action allowed?<br>        ↓<br>YES → Continue<br>NO  → Deny</pre><p>Authorization policies may be implemented using mechanisms such as:</p><ul><li><strong>RBAC (Role-Based Access Control);</strong></li><li><strong>ABAC (Attribute-Based Access Control);</strong></li><li><strong>ownership checks;</strong></li><li><strong>tenant isolation;</strong></li><li><strong>relationship-based access control;</strong></li><li><strong>least privilege.</strong></li></ul><p>The exact mechanism depends on the application’s business model.</p><h4>Don’t rely only on sequential ID’s</h4><p>Using predictable identifiers can make enumeration easier.</p><p>For example:</p><pre>/user/101<br>/user/102<br>/user/103<br>/user/104</pre><p>Using UUIDs or other unpredictable identifiers can make large-scale enumeration more difficult.</p><p>However, this should be considered <strong>defense in depth</strong>, not the primary solution.</p><p>A UUID does not fix BOLA.</p><p>If the server accepts:</p><pre>GET /api/users/550e8400-e29b-41d4-a716-446655440000</pre><p>without checking whether the authenticated user is authorized to access that object, the application can still be vulnerable.</p><p>The correct approach is:</p><blockquote><strong>Unpredictable identifiers + proper server-side authorization.</strong></blockquote><h3>Test Authorization, Not Just Authentication</h3><p>One of the most important lessons from API security testing is that authentication and authorization should be tested separately.</p><p>A valid token does not automatically mean that every object is accessible.</p><p>During an API assessment, it is useful to identify object references and test whether access controls remain enforced when those references are modified.</p><p>For example:</p><pre>User A → Object A → Expected: ALLOW<br>User A → Object B → Expected: DENY</pre><p>This can be extended across different operations:</p><pre>GET<br>POST<br>PUT<br>PATCH<br>DELETE</pre><p>and across different object types.</p><p>OWASP’s testing guidance recommends using distinct authenticated identities when appropriate to verify whether one user’s resources can be accessed by another user. This type of authorization testing is also well suited to automated regression testing. Authorization policies can be represented as an authorization matrix and continuously tested as the application evolves.</p><h3>Final Thoughts</h3><p>BOLA is a good example of why API security cannot be reduced to authentication, tokens, or input validation alone.</p><p>An API can have:</p><ul><li>strong authentication;</li><li>HTTPS;</li><li>secure tokens;</li><li>rate limiting;</li><li>input validation;</li></ul><p>and still expose sensitive resources if object-level authorization is implemented incorrectly.</p><p>The fundamental question should always be:</p><blockquote><strong>“Is this authenticated user authorized to perform this action on this specific object?”</strong></blockquote><p>That question sits at the heart of BOLA.</p><p>From a penetration testing perspective, seemingly simple object references can therefore be valuable testing points. A change from:</p><pre>GET /api/resource/15</pre><p>to:</p><pre>GET /api/resource/17</pre><p>is not automatically a vulnerability.</p><p>But if that simple change allows an authenticated user to access or manipulate another user’s resource without authorization, it can reveal a significant access-control weakness.</p><p>And that is the real lesson behind <strong>Broken Object Level Authorization</strong>:</p><blockquote>Authentication tells the application who you are. Authorization must determine what you are allowed to do — and which objects you are allowed to do it to.</blockquote><h3>References</h3><ul><li><a href="https://owasp.org/API-Security/editions/2023/en/0x00-toc/?utm_source=chatgpt.com">OWASP API Security Top 10 — API1:2023 Broken Object Level Authorization</a></li><li><a href="https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/12-API_Testing/02-API_Broken_Object_Level_Authorization?utm_source=chatgpt.com">OWASP Web Security Testing Guide — API Broken Object Level Authorization</a></li><li><a href="https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/12-API_Testing/04-API_Broken_Function_Level_Authorization?utm_source=chatgpt.com">OWASP Web Security Testing Guide — API Broken Function Level Authorization</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html?utm_source=chatgpt.com">OWASP Authorization Cheat Sheet</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09b12cc36938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure Nginx Web Server on Microsoft Azure with Fail2Ban, ClamAV, and Zabbix Server]]></title>
            <link>https://medium.com/@aghaverditk/building-a-secure-nginx-web-server-on-microsoft-azure-with-fail2ban-clamav-and-zabbix-server-f823c30bec24?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/f823c30bec24</guid>
            <category><![CDATA[fail2ban]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[zabbix]]></category>
            <category><![CDATA[clamav]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 19:17:54 GMT</pubDate>
            <atom:updated>2026-07-20T19:17:54.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i0NiJrxxPMvCsIFNtyq4tg.png" /></figure><h3>Project Overview</h3><p>This project demonstrates the design and implementation of a secure Linux-based web infrastructure deployed on <strong>Microsoft Azure Cloud</strong>. The environment consists of three Ubuntu virtual machines, each assigned a dedicated security role:</p><ul><li>Reverse Proxy Server</li><li>Web Server</li><li>Zabbix Monitoring Server</li></ul><p>The primary objective was not only to host multiple websites, but also to harden the servers, implement layered security controls, monitor infrastructure health, and protect the environment against unauthorized access, brute-force attacks, malicious bots, and malware.</p><p>The project follows a Defense-in-Depth approach by combining secure SSH configuration, reverse proxy architecture, SSL-ready deployment, Fail2Ban intrusion prevention, ClamAV malware protection, and centralized monitoring using Zabbix.</p><h3>Infrastructure Architecture</h3><p>The infrastructure consists of three independent Ubuntu virtual machines running on Microsoft Azure.</p><h3>Reverse Proxy Server</h3><p>The Proxy Server acts as the public entry point for all incoming traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4czmXI1t9M_DkUmEGmqsmA.png" /></figure><p>Responsibilities include:</p><ul><li>Receiving client HTTP/HTTPS requests</li><li>Hiding the real public IP address of the Web Server</li><li>Reverse proxying traffic to internal web services</li><li>Blocking direct exposure of backend servers</li><li>Preparing the environment for SSL termination</li><li>Preventing ICMP (Ping) requests</li><li>Providing an additional security layer before requests reach the backend server</li></ul><h3>Web Server</h3><p>The Web Server hosts two independent websites running on Nginx.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FyTb43Rf9qcGngWCBbHJOw.png" /></figure><p>Implemented features include:</p><ul><li>Multi-site Nginx configuration</li><li>Separate virtual hosts</li><li>Individual document roots</li><li>Static website deployment</li><li>Malware protection with ClamAV</li><li>Brute-force mitigation using Fail2Ban</li></ul><p>The web server is intentionally isolated behind the Reverse Proxy to reduce its attack surface.</p><h3>Zabbix Monitoring Server</h3><p>The monitoring server provides centralized infrastructure monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GxDab_c_9Q3KVrLjxcEOjA.png" /></figure><p>It continuously monitors:</p><ul><li>Proxy Server availability</li><li>Web Server availability</li><li>HTTP response codes</li><li>Service status</li><li>Resource utilization</li><li>Agent communication</li><li>Website uptime</li></ul><p>This allows administrators to detect service failures before users experience downtime.</p><h3>Azure Network Deployment</h3><p>All three virtual machines were deployed on Microsoft Azure with dedicated Public IP addresses.</p><p>Each VM received:</p><ul><li>Static Public IP</li><li>Individual hostname</li><li>Independent firewall configuration</li><li>Secure SSH access</li></ul><p>Azure Network Security Groups (NSGs) were configured to allow only required services while minimizing unnecessary exposure.</p><h3>Linux Hardening</h3><p>To improve server security, every machine was hardened following Linux security best practices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KC1PM8a32hJGS7nLY78oNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOqpPbo0pGatm-9q0XJAEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dG6px8p6kw9IRfsm7SOexA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVIFm7owF-_J2TPyirIDAQ.png" /></figure><p>The following actions were performed on all three servers:</p><ul><li>Created a dedicated administrator account</li><li>Added the account to the wheel (sudo) group</li><li>Disabled direct root login</li><li>Allowed SSH access only for authorized users</li><li>Changed the default SSH port from 22 to 2020</li><li>Reduced unnecessary attack vectors</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*rCO38M9_isMRYHCHcH2Bww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*_bEZITAY-7ZzhrajpLJeUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*Yg0zTHOMHEeGD3nUzNcA9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2dL_ZTqYkVnEuFiuXlN-9Q.png" /></figure><blockquote><strong>After redirecting ports from 22 to 2020 on all servers, SSH ports on each server machine were redirected with the following command</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6TIjiL6bfAY_rkfIUUgXg.png" /><figcaption>Checking SSH connection to the Web Server</figcaption></figure><p>Changing the SSH port does not replace proper authentication mechanisms but helps reduce automated scanning attempts targeting the default SSH port.</p><p>These hardening steps significantly decrease the likelihood of successful brute-force attacks.</p><h3>Nginx Web Server Deployment</h3><p>Nginx was selected as the web server because of its:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LtF-ZoYh9mNfzqxyFOSOMA.png" /></figure><ul><li>High performance</li><li>Low memory consumption</li><li>Reverse proxy capabilities</li><li>Scalability</li></ul><p>The following tasks were completed:</p><ul><li>Installed Nginx</li><li>Configured multiple virtual hosts</li><li>Hosted two independent websites</li><li>Created custom directory structure under:</li></ul><p>/WebSite/www/</p><p>Each website has its own isolated document root, improving maintainability and reducing configuration conflicts.</p><h3>Website Deployment</h3><p>Two separate websites were deployed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aHBUanlQUN00nER10-SsPw.png" /></figure><p>Each website includes:</p><ul><li>Independent Nginx configuration</li><li>Individual document root</li><li>Static HTML/CSS template</li><li>Separate server block</li></ul><p>This approach simulates hosting multiple customer websites on a single production server.</p><h3>Reverse Proxy Configuration</h3><p>Instead of exposing the Web Server directly to the Internet, all requests first reach the Reverse Proxy.</p><p>Benefits include:</p><ul><li>Backend IP address protection</li><li>Easier SSL management</li><li>Centralized traffic routing</li><li>Additional filtering capabilities</li><li>Better scalability</li><li>Simplified load balancing in future deployments</li></ul><p>Users only communicate with the Proxy Server while the Web Server remains hidden.</p><h3>Preparing SSL Infrastructure</h3><p>Although SSL certificates were intentionally planned for later deployment, the infrastructure was designed with SSL readiness in mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fgfx8U5pm-DvLukJPKIXw.png" /></figure><p>I am optionally used Python3 Certbot Nginx SSL</p><p>The architecture supports:</p><ul><li>Let’s Encrypt</li><li>Certbot automation</li><li>HTTPS redirection</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPCAd7cW3qQr2QDr_w1mmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gqxtE_bebNzVHuQCycC-w.png" /></figure><ul><li>Reverse Proxy SSL termination</li></ul><p>This design allows future HTTPS deployment with minimal configuration changes.</p><h3>ClamAV Integration</h3><p>To protect hosted websites from malicious files, ClamAV was installed on both the Web Server and the Zabbix Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSc0mBDJ0xtR_4MXfiwLgg.png" /></figure><p>The antivirus solution provides:</p><ul><li>Malware detection</li><li>Signature-based scanning</li><li>Website protection</li><li>File integrity validation</li></ul><p>Although daemon jobs were not required by the project, the software was fully installed and configured for manual scanning.</p><h3>Fail2Ban Security</h3><p>Fail2Ban was deployed to automatically block malicious clients attempting unauthorized access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bw26K9_tHrecRT76H1zIHg.png" /></figure><p>Implemented protections include:</p><ul><li>SSH brute-force mitigation</li><li>Authentication failure monitoring</li><li>Automatic IP banning</li><li>Custom Regular Expressions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9SLsGNlFkCyIxVsn-HEBw.png" /></figure><ul><li>Custom jail.local configuration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nr0aNwUzdgcKGdqSaAOscA.png" /></figure><ul><li>300-second ban duration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5v8hwE-jfvjGQDu6qsllZQ.png" /></figure><ul><li>Protection against malicious web bots</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZRaQGulfc8nO5ObV1J9ExA.png" /></figure><p>Both Web Server and Proxy Server received independent Fail2Ban configurations.</p><p>Custom Regular Expressions were also written to improve detection accuracy beyond the default rules.</p><p>The project demonstrates how Fail2Ban can automatically react to suspicious behavior without manual intervention.</p><h3>Daemon Services</h3><p>To ensure automatic startup after reboot, critical services were configured as system services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UtvPirvriJob50LiAFYt-g.png" /></figure><p>Configured services include:</p><ul><li>Nginx</li><li>Fail2Ban</li><li>Zabbix Server</li><li>Zabbix Agent</li></ul><p>This guarantees service availability following maintenance or unexpected server restarts.</p><p>Checking websites</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GppC7du1Fh6Bp-RylN35jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJRErigaycRYaWYkCij8RA.png" /></figure><h3>Zabbix Monitoring</h3><p>A centralized monitoring platform was implemented using Zabbix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuyB6DW7LIUz7awx6odMgg.png" /></figure><p>The monitoring system collects:</p><ul><li>Server availability</li><li>CPU usage</li><li>Memory usage</li><li>Network status</li><li>Service health</li><li>HTTP checks</li><li>Agent availability</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*go9G8qcI5HaVJMOvOvCUQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0vHXr0rZmiOWepr2YREXqQ.png" /></figure><p>Both the Proxy Server and Web Server were registered as monitored hosts using Zabbix Agent.</p><h3>HTTP Availability Monitoring</h3><p>One of the most important monitoring tasks was website availability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylxBp3l3hTedpGYlmzjlxg.png" /></figure><p>Zabbix Agent deployment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJSB85PhDGVTCSvdCm_wlQ.png" /></figure><p>All servers are connected to Zabbix</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzEhKIjsMsha7lEoCpnQeg.png" /></figure><p>Zabbix dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikOnGxaowtaz-1hMWdDLsg.png" /></figure><p>Zabbix continuously checks whether the hosted websites return:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tGTBzzOIZue1yED84N0CQ.png" /></figure><p><strong>HTTP Status Code 200 (OK)</strong></p><p>Receiving HTTP 200 confirms:</p><ul><li>Nginx is operational</li><li>Website content is accessible</li><li>Reverse Proxy is functioning correctly</li><li>Network communication is healthy</li></ul><p>This allows administrators to immediately detect website outages.</p><p>Finally</p><h3>Security Improvements Achieved</h3><p>By completing this project, the infrastructure now benefits from:</p><ul><li>Hardened Linux servers</li><li>Secure SSH configuration</li><li>Hidden backend infrastructure</li><li>Reverse Proxy architecture</li><li>Multi-site hosting</li><li>Malware protection</li><li>Automated brute-force defense</li><li>Centralized monitoring</li><li>HTTP uptime verification</li><li>Service auto-start</li><li>Reduced attack surface</li><li>Layered security architecture</li></ul><h3>Conclusion</h3><p>This project demonstrates how multiple open-source technologies can be combined to build a secure, production-oriented Linux infrastructure on Microsoft Azure. Rather than focusing on a single security control, the environment applies multiple defensive layers — including server hardening, reverse proxying, intrusion prevention, malware detection, and centralized monitoring — to create a more resilient web hosting platform.</p><p>The resulting architecture provides a solid foundation that can be further extended with HTTPS enforcement, Web Application Firewalls (WAF), SIEM integration, automated incident response, containerization, or load balancing for enterprise-scale deployments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f823c30bec24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Incident Response with Splunk: Investigating a Cerber Ransomware attack using SPL Queries]]></title>
            <link>https://medium.com/@aghaverditk/incident-response-with-splunk-investigating-a-cerber-ransomware-attack-using-spl-queries-1e730d87098e?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e730d87098e</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 14:44:18 GMT</pubDate>
            <atom:updated>2026-07-14T14:44:18.588Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-MyUwvmRB2ZtSRXL6zAmAg.jpeg" /></figure><p>Every cyber attack leaves behind digital evidence. The challenge for a SOC analyst is not collecting logs — it’s asking the right questions. In this walkthrough, we will investigate a real Cerber ransomware attack using Splunk Enterprise Security and SPL queries. Rather than simply presenting answers, we will follow the same investigative workflow used by Security Operations Centers to reconstruct an attack timeline, identify Indicators of Compromise (IOCs), and understand the attacker’s actions. Throughout this investigation, every SPL query answers a specific forensic question that moves the investigation one step closer to uncovering the full attack.</p><p>From this scenario a workstation has triggered multiple IDS alerts related to malicious network traffic. Shortly afterward, users report inaccessible files on a shared file server. Initial evidence suggests a ransomware infection.</p><p>Our mission is to determine:</p><ul><li>How the attack started</li><li>Which user was compromised</li><li>Which systems were affected</li><li>What malware was executed</li><li>Whether persistence was established</li><li>Which Indicators of Compromise should be reported</li></ul><h3>Initial access</h3><ol><li><strong>What was the correct password used to compromise the CMS?</strong></li></ol><p><strong>Objective:</strong> Determine whether the attacker successfully brute-forced the CMS login and identify the valid credential that granted access.</p><p><strong>Investigation logic: </strong>Brute-force attacks usually generate hundreds of failed authentication attempts before a successful login. By filtering successful authentication events, analysts can identify the credential that ultimately granted access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3P8FBR71pQMW94CJZ1f1rQ.png" /></figure><pre>index=&quot;botsv1&quot; sourcetype=&quot;stream:http&quot; dest_ip=&quot;192.168.250.70&quot; http_method=&quot;POST&quot; form_data=*username*passwd*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Clens7qaYKlrH_rqNPC_Yg.png" /></figure><p>Expected result:</p><p>Login: <strong>admin</strong></p><p>Password: <strong>batman</strong></p><p>The attacker successfully authenticated after multiple failed attempts, indicating a password guessing or brute-force attack. This confirms that compromised credentials — not an exploit — were the initial access vector.</p><p><strong>Why this matters?</strong></p><p>This finding immediately maps to MITRE ATT&amp;CK: <strong>T1110 Brute Force</strong></p><p><a href="https://attack.mitre.org/techniques/T1110/">https://attack.mitre.org/techniques/T1110/</a></p><h3>Measuring the attack</h3><p><strong>2. How many unique passwords were attempted in the brute force attempt?</strong></p><p><strong>Objective:</strong> Measure the intensity of the brute-force attack.</p><p><strong>Investigation logic:</strong> Instead of focusing only on the successful login, analysts quantify the attack by counting all unique password attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bcIcsQYxH55-meEDQaqbsA.png" /></figure><pre>index=&quot;botsv1&quot; sourcetype=&quot;stream:http&quot; dest_ip=&quot;192.168.250.70&quot; http_method=POST form_data=*username*passwd*<br>| rex field=form_data &quot;passwd=(?&lt;password&gt;\w+)&quot;<br>| stats count by password</pre><p>Result: <strong>412 unique passwords</strong></p><p>A dictionary attack involving over 400 unique passwords strongly indicates automated brute-force tooling rather than manual login attempts.</p><h3>Malware execution</h3><p><strong>3. Which ransomware payment domain appeared after encryption?</strong></p><p><strong>Objective: </strong>Identify attacker-controlled infrastructure.</p><p><strong>Investigation logic: </strong>Cerber displays a payment portal once encryption finishes. DNS logs reveal the ransomware’s Command-and-Control infrastructure.</p><p><strong>SPL query:</strong></p><pre>index=&quot;botsv1&quot; sourcetype=&quot;stream:dns&quot; src_ip=&quot;192.168.250.100&quot; NOT query=*.local AND query=*.arpa AND NOT query=*.com AND NOT query=*.microsoft.com AND NOT query=*.windows.com AND NOT query=*.info AND NOT query=*.net AND NOT query=*.org<br>| table query<br>| dedup query</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VI0rANMFsmfDrVsgB9aCyA.png" /></figure><p>Expected result is:</p><p><strong>cerberhyed5frqa.xmfir0.win</strong></p><p>This domain serves as a strong IOC that can be shared with threat intelligence platforms or blocked at the DNS layer to prevent future communication.</p><h3>Patient Zero</h3><p><strong>4. What was the first suspicious domain visited by we8105desk in 24AUG2016?</strong></p><p><strong>Objective: </strong>Determine where the infection began.</p><p><strong>Investigation logic: </strong>The earliest malicious domain often reveals the initial compromise vector, such as phishing or a drive-by download.</p><pre>index=&quot;botsv1&quot; sourcetype=&quot;stream:dns&quot; src_ip=&quot;192.168.250.100&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eX-MoteGOQqPZh7Rkx7x0w.png" /></figure><p>Searching result for suspicious domain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r38G2Gdvdd3yc4uKQU7-Tg.png" /></figure><p>Result: <strong>solidaritedeproximite.org</strong></p><p><strong>5. What is the name of the USB key inserted by Bob Smith?</strong></p><p><strong>Objective: </strong>Determine whether a removable USB device was connected to the compromised workstation and identify the specific device involved. This helps analysts assess whether external media played a role in the initial infection or could have been used for data exfiltration.</p><p><strong>Investigation logic: </strong>Removable storage devices are common vectors for both malware delivery and unauthorized data transfer. During incident response, analysts should review Windows device connection events to identify recently attached USB devices, correlate them with user activity, and determine whether the timing aligns with other suspicious events observed during the investigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dmxqU7Bnuz4bEhgazEBzkg.png" /></figure><pre>index=&quot;botsv1&quot; sourcetype=&quot;winregistry&quot; host=&quot;we8105desk&quot; friendlyname</pre><p>Answer: <strong>Miranda</strong></p><p><strong>6. Bob Smith’s workstation (we8105desk) was connected to a file server during the ransomware outbreak. What is the IP address of the file server?</strong></p><p><strong>Objective: </strong>Identify the remote file server accessed by the infected workstation to determine whether the ransomware propagated beyond the local system and impacted shared network resources.</p><p><strong>Investigation logic: </strong>Modern ransomware rarely limits encryption to the local machine. Once executed, it actively searches for mapped network drives and SMB shares to maximize its impact. By examining network connection logs, analysts can identify file servers contacted by the compromised host and determine which systems should be included in the incident scope and containment efforts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXGnYwebvCUbs0xmcAl8FQ.png" /></figure><pre>index=&quot;botsv1&quot; sourcetype=&quot;stream:smb&quot; src_ip=&quot;192.168.250.100&quot;</pre><p>Answer: <strong>192.168.250.20</strong></p><p><strong>7. How many distinct PDF files did the ransomware encrypt on the remote file server?</strong></p><p><strong>Objective: </strong>Measure the extent of the ransomware’s impact on the organization’s shared file server by identifying the number of encrypted PDF documents.</p><p><strong>Investigation logic: </strong>Quantifying encrypted files helps incident responders estimate business impact, prioritize recovery activities, and assess the effectiveness of containment measures. Monitoring file modification events also provides valuable indicators of ransomware behavior, such as rapid bulk encryption targeting common business document formats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnR1YYyMkfNoEnJBBFKEkA.png" /></figure><pre>index=&quot;botsv1&quot; host=we9041srv *.pdf<br>| stats dc(Relative_Target_Name) as file</pre><p>Answer: <strong>3968</strong></p><p><strong>8. The VBScript found in question 25 launches 121214.tmp. What is the ParentProcessId of this initial launch?</strong></p><p><strong>Objective: </strong>Reconstruct the malware execution chain by identifying which parent process initiated the ransomware encryptor.</p><p><strong>Investigation logic: </strong>Process lineage is one of the most valuable forensic artifacts during malware investigations. Rather than analyzing an isolated malicious process, analysts should trace its parent-child relationships to understand how execution began. Identifying the Parent Process ID reveals whether the malware was launched by a script interpreter, an Office application, PowerShell, or another trusted process commonly abused by attackers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5eLoxIhxwWU97ndvYUCnA.png" /></figure><pre>index=&quot;botsv1&quot; 121214.tmp vbs</pre><p>Answer: <strong>3968</strong></p><p><strong>9. The Cerber ransomware encrypts files located in Bob Smith’s Windows profile. How many .txt files does it encrypt?</strong></p><p><strong>Objective: </strong>Determine the extent of file encryption within the victim’s local user profile and identify how aggressively the ransomware targeted personal documents.</p><p><strong>Investigation logic: </strong>Ransomware commonly prioritizes user-generated files because they are more valuable to victims than operating system files. By examining file creation, modification, and rename events, analysts can estimate the volume of encrypted data, assess user impact, and gather evidence required for incident reporting and recovery planning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YyFQunSUecVfBISmtCPPg.png" /></figure><pre>index=&quot;botsv1&quot; host=&quot;we8105desk&quot; *.txt<br>| dedup TargetFilename<br>| table TargetFilename</pre><p>Answer: <strong>415</strong></p><p><strong>10. The malware downloads a file that contains the Cerber ransomware crypto code. What is the name of that file?</strong></p><p><strong>Objective: </strong>Identify the secondary payload downloaded during the attack and determine which file contains the ransomware’s encryption component.</p><p><strong>Investigation logic: </strong>Many ransomware families use a staged infection process. Instead of delivering the full malware immediately, the initial downloader retrieves additional payloads from attacker-controlled infrastructure. Identifying these downloaded files enables analysts to recover Indicators of Compromise (IOCs), analyze malware behavior, and improve future detection capabilities by monitoring similar download patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cw5uYNStmI3-BkEPgcZLcw.png" /></figure><p>Answer: <strong>eve.json (Suricata)</strong></p><pre>| Time  | Analyst Observation                            |<br>| ----- | ---------------------------------------------- |<br>| 16:48 | User accessed `solidaritedeproximite.org`      |<br>| 16:49 | Malicious payload downloaded                   |<br>| 16:50 | VBScript launched `121214.tmp`                 |<br>| 16:51 | Cerber ransomware started encryption           |<br>| 16:52 | DNS request to `cerberhyed5frqa.xmfir0.win`    |<br>| 16:53 | Shared file server (`192.168.250.20`) accessed |<br>| 16:54 | 258 PDF files and 415 TXT files encrypted      |</pre><p><strong>Analyst Conclusion:</strong> Based on the temporary filename (121214.tmp), the execution chain through VBScript, and the known behavior of the Cerber ransomware family, the encryptor most likely employs <strong>packed executable techniques combined with randomized filenames and string obfuscation</strong>. These methods hinder static analysis and signature-based detection, allowing the malware to evade traditional antivirus solutions. This behavior aligns with <strong>MITRE ATT&amp;CK T1027 – Obfuscated Files or Information</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e730d87098e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publishing a Private Web Server to the Internet with FortiGate VIP]]></title>
            <link>https://medium.com/@aghaverditk/publishing-a-private-web-server-to-the-internet-with-fortigate-vip-34fc83160727?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/34fc83160727</guid>
            <category><![CDATA[dnat]]></category>
            <category><![CDATA[vip]]></category>
            <category><![CDATA[fortigate]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Tue, 30 Jun 2026 18:39:26 GMT</pubDate>
            <atom:updated>2026-06-30T18:39:26.866Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iajZArdMO_O8HKVeC7NKZg.png" /></figure><p>A firewall plays a critical role in securely publishing internal services by controlling incoming traffic from untrusted networks. FortiGate provides Virtual IP (VIP) functionality, which allows administrators to perform Destination NAT (DNAT) and securely forward public traffic to internal servers without directly exposing private infrastructure.</p><p>In this article, we will configure external WAN access to a private Nginx Web Server hosted on a RHEL-based server using FortiGate Firewall. The lab demonstrates how to prepare the web server, configure firewall access, create a Virtual IP object, and publish an internal web service to the public network.</p><ol><li>Preparing Nginx Web Server Service</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQclbMuK8xAoVahcgncUtA.png" /></figure><p>The first step is preparing the internal web server that will be published externally.</p><p>In this lab environment, an Nginx web server is installed and configured on a RHEL-based Linux system. Nginx provides the HTTP service that will handle incoming web requests from clients.</p><p>Before publishing the service, it is important to verify that:</p><ul><li>Nginx package is installed</li><li>The service is running successfully</li><li>The web server is listening on the required HTTP port</li></ul><p>The internal web server will remain inside the private network while FortiGate will control external access.</p><p>2. Allowing HTTP Traffic Through RHEL Firewalld</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySYowDgp648--v1MLvoY-A.png" /></figure><p>After confirming that Nginx is running, the next step is allowing HTTP traffic through the operating system firewall.</p><p>By default, RHEL firewalld blocks incoming connections unless explicitly permitted. Therefore, TCP port 80 must be added to the active firewall service configuration.</p><p>This allows FortiGate forwarded traffic to reach the Nginx application.</p><p>Example configuration concept:</p><ul><li>Service: HTTP</li><li>Protocol: TCP</li><li>Port: 80</li></ul><p>After applying the firewall rule, the Nginx server becomes reachable from the internal network.</p><p>3. Verifying Nginx Default Web Page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kE0eytNj6UQnXHcO1XuMw.png" /></figure><p>At this stage, the Nginx web page is tested directly from the internal network.</p><p>This verification confirms that:</p><ul><li>The web server is responding correctly</li><li>The HTTP service is available</li><li>The application layer is working before implementing external access</li></ul><p>Testing the internal service first helps troubleshoot potential issues before configuring NAT and firewall rules.</p><p>4. Creating Virtual IP (VIP) for Internal Nginx Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WrZs-yeURDXMz_LF_OILoA.png" /></figure><p>The next step is creating a Virtual IP object on FortiGate.</p><p>A VIP performs Destination NAT by mapping a public IP address and port to a private server address.</p><p>In this scenario:</p><p><strong>External side:</strong></p><ul><li>Public IP Address</li><li>Incoming HTTP connection</li></ul><p><strong>Internal side:</strong></p><ul><li>RHEL Nginx Web Server</li><li>Private IP Address</li><li>TCP Port 80</li></ul><p>The VIP allows external users to access the private web server without exposing the actual internal IP address.</p><p>This method is commonly used for publishing:</p><ul><li>Web applications</li><li>Mail services</li><li>Remote access portals</li><li>API services</li></ul><p>5. Creating Firewall Policy for VIP Access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HvcTjR70-4o9GbxP61v-g.png" /></figure><p>After creating the VIP object, a firewall policy is required to allow incoming WAN traffic.</p><p>The firewall rule defines:</p><ul><li>Source interface: WAN</li><li>Destination: VIP object</li><li>Service: HTTP</li><li>Action: Accept</li><li>NAT: Disabled (because VIP performs DNAT)</li></ul><p>Additional security profiles such as IPS, Antivirus, Web Filtering, or Application Control can also be enabled depending on organizational requirements.</p><p>This policy ensures that only authorized traffic reaches the internal web server.</p><p>6. Publishing Web Server Using Custom External Port</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3QtP37y7IHClgYVku84bw.png" /></figure><p>In this final step, the internal Nginx server is published using a custom external port.</p><p>Instead of exposing TCP/80 directly, FortiGate maps an external port (<strong>8181</strong>) to the internal HTTP service.</p><p>Traffic flow:</p><p>Client Browser<br> ↓<br> Public IP : 8181<br> ↓<br> FortiGate VIP<br> ↓<br> Private RHEL Server : 80<br> ↓<br> Nginx Web Server</p><p>Using custom ports can help reduce automated scanning noise and provides additional flexibility when multiple internal services need to share the same public IP address.</p><p>After completing the configuration, the Nginx web page becomes accessible from the public network.</p><h3>Conclusion</h3><p>Publishing internal web services securely requires careful control of network exposure and traffic flow. Using FortiGate Virtual IP (VIP) functionality provides a secure method to make private servers accessible from external networks while maintaining network segmentation.</p><p>In this practical lab, we configured an Nginx Web Server on RHEL, allowed HTTP traffic through the local firewall, created a FortiGate VIP object, configured WAN-to-LAN firewall access, and successfully published the private web service using a custom external port.</p><p>This approach demonstrates a common enterprise scenario where internal applications need controlled public access without placing servers directly on the Internet.</p><p>FortiGate VIP combined with firewall policies provides administrators with a flexible and secure solution for publishing services while maintaining visibility and control over inbound traffic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34fc83160727" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating C2 Traffic Detection using Python, Zeek and Suricata]]></title>
            <link>https://medium.com/@aghaverditk/automating-c2-traffic-detection-using-python-zeek-and-suricata-53ea86c93507?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/53ea86c93507</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[zeek]]></category>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[suricata]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 14:04:36 GMT</pubDate>
            <atom:updated>2026-07-10T20:29:09.961Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwQNC-l-fZ6rExuFujjOyw.png" /></figure><p>Command and Control (C2) communication remains one of the most critical indicators of compromise within modern cyber attacks. Attackers often rely on C2 channels to maintain persistence, execute remote commands, and exfiltrate sensitive data from compromised systems. In this article, we demonstrate how Zeek, Suricata, and Python can be integrated to automate the detection of suspicious network activities, including DNS anomalies, port scanning, and reverse shell communications. Additionally, we centralize security events using the ELK Stack to provide enhanced visibility and faster incident investigation capabilities.</p><h3>1. Adding Suricata to Repositories</h3><p>Before installing Suricata, the official package repository should be added to Ubuntu. This ensures access to the latest stable version and security updates. Using the official repository is recommended because default Ubuntu repositories may contain older releases. After adding the repository, the package manager can retrieve updated package information.</p><pre>sudo add-apt-repository ppa:oisf/suricata-stable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*yi78UbuWTxn1-o75ThrkHA.png" /></figure><h3>2. sudo apt update</h3><p>The sudo apt update command refreshes the local package database and retrieves the latest package information from configured repositories.</p><pre>sudo apt update</pre><h3>3. Installing Suricata</h3><p>Suricata can be installed directly using the Ubuntu package manager. During installation, required dependencies are automatically downloaded and configured.</p><pre>sudo apt install suricata -y</pre><h3>4. Configuration of /etc/suricata/suricata.yml File (Must Be Root User)</h3><p>The primary Suricata configuration file is located at /etc/suricata/suricata.yml. Administrative privileges are required to modify this file because it controls critical IDS/IPS settings. Network interfaces, logging options, rule paths, and packet capture methods are configured here. Any changes should be carefully reviewed before deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxe5WaheoJ4sZYicn7280Q.png" /></figure><h3>5. Add Network Adapter to AF-Packet Field</h3><p>The AF-Packet section specifies which network interface Suricata will monitor. The correct adapter name, such as eth0 or ens33, must be configured to capture network traffic. Without selecting the proper interface, Suricata will not inspect packets. This configuration enables high-performance packet processing directly from the Linux kernel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w0USldV254aSbe62lnlSQA.png" /></figure><h3>6. After installation empty rule folder</h3><p>Probably you have 2 problem that are <strong>nothing any rules </strong>and <strong>AF_Packet fanout:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*PcEPkaWT__-EE5EF75vT3Q.png" /></figure><p>For solve this problem we must write following commands:</p><pre>root@server:~# sudo suricata-update<br>23/5/2026–17:50:12 — &lt;Info&gt; — Using data-directory /var/lib/suricata.<br>23/5/2026–17:50:12 — &lt;Info&gt; — Using Suricata configuration /etc/suricata/suricata.yaml<br>23/5/2026–17:50:12 — &lt;Info&gt; — Using /usr/share/suricata/rules for Suricata provided rules.<br>23/5/2026–17:50:12 — &lt;Info&gt; — Found Suricata version 8.0.5 at /usr/bin/suricata.<br>23/5/2026–17:50:12 — &lt;Info&gt; — Loading /etc/suricata/suricata.yaml<br>23/5/2026–17:50:12 — &lt;Info&gt; — Disabling rules for protocol pgsql<br>23/5/2026–17:50:12 — &lt;Info&gt; — Disabling rules for protocol modbus<br>23/5/2026–17:50:12 — &lt;Info&gt; — Disabling rules for protocol dnp3<br>23/5/2026–17:50:12 — &lt;Info&gt; — Disabling rules for protocol enip<br>23/5/2026–17:50:12 — &lt;Info&gt; — No sources configured, will use Emerging Threats Open<br>23/5/2026–17:50:12 — &lt;Info&gt; — Fetching https://rules.emergingthreats.net/open/suricata-8.0.5/emerging.rules.tar.gz.<br> 100% — 5471864/5471864</pre><p>At last of the update seeing 100% then we must see downloaded rules:</p><pre>23/5/2026–17:50:16 — &lt;Info&gt; — Loaded 66144 rules.<br>23/5/2026–17:50:16 — &lt;Info&gt; — Disabled 16 rules.<br>23/5/2026–17:50:16 — &lt;Info&gt; — Enabled 0 rules.<br>23/5/2026–17:50:16 — &lt;Info&gt; — Modified 0 rules.<br>23/5/2026–17:50:16 — &lt;Info&gt; — Dropped 0 rules.<br>23/5/2026–17:50:16 — &lt;Info&gt; — Enabled 136 rules for flowbit dependencies.</pre><p>For check all of this write following command:</p><pre>sudo suricata -T</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*-9qgEMSmcFzsdPWytNLZbg.png" /></figure><p>Now, we give restart to Suricata:</p><pre>systemctl restart suricata</pre><h3>7. Suricata Rules are already available</h3><p>Now we will look at the <strong>/var/lib/suricata/rules</strong> folder <strong>suricata.rules</strong> file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*wphAVtlou3WsZDnp4rOMSQ.png" /></figure><p>Check availability Suricata creating a manual request to the server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*D9JCZOq6lVptEtAfhhdLiA.png" /></figure><p>After this request check <strong>/var/log/suricata/fast.log</strong> file using following command for logging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68wQUxoKe_gmIbfK-l1GhA.png" /></figure><pre>root@server:~# tail -f /var/log/suricata/fast.log <br>05/23/2026–18:07:39.148607 [**] [1:2013504:6] ET INFO GNU/Linux APT User-Agent Outbound likely related to package management [**] [Classification: Not Suspicious Traffic] [Priority: 3] {TCP} 192.168.100.93:47308 -&gt; 94.20.20.125:80<br>05/23/2026–18:07:48.383400 [**] [1:2100498:7] GPL ATTACK_RESPONSE id check returned root [**] [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 18.165.72.39:80 -&gt; 192.168.100.93:43136</pre><p>Let’s solve second problem, which related with <strong>AF-Packet.</strong></p><h3>9. Changing cluster-id from 99 to 98 for AF_Packet error</h3><p>In some environments, AF-Packet may generate cluster conflicts when multiple packet capture applications are running. Adjusting the cluster-id value from 99 to 98 resolves interface resource conflicts. Each packet processing application should use a unique cluster identifier. After modifying the value, Suricata should be restarted.</p><p><strong>/etc/suricata/suricata.yaml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xs-dYckjC3rpS0DMiMz_jA.png" /></figure><p>Now we began to install <strong>Zeek </strong>to our Ubuntu Server using following command:</p><pre>sudo apt install cmake make gcc g++ flex bison libpcap-dev libssl-dev python3-dev swig zlib1g-dev -y</pre><h3>10. Zeek configure command result</h3><p>The Zeek configuration process verifies that required libraries and dependencies are available. Successful output confirms that Zeek can be built and deployed on the system. Configuration checks include compiler compatibility, packet capture support, and installation paths. Any missing components are reported during this phase.</p><pre>sudo wget https://download.zeek.org/zeek-8.0.8.tar.gz</pre><p>After installing this file, use <strong>tar -xvf zeek-8.0.8.tar.gz </strong>for extract and change directory to the following file and run <strong>./configure </strong>command for installing <strong>Zeek</strong>.</p><blockquote>Note: Before using <strong>./configure</strong> command please be sure all of the following packets are installed: (<strong>cmake</strong>; <strong>make</strong>; <strong>gcc</strong>; <strong>g++</strong>; <strong>flex</strong>; <strong>bison</strong>; <strong>libpcap-dev</strong>; <strong>libssl-dev</strong>; <strong>python3-dev, swig zlib1g-dev </strong>and <strong>libzmq3-dev </strong>(ZeroMQ))</blockquote><p>After installing <strong>Zeek </strong>we use <strong>./configure</strong>, <strong>make</strong> and <strong>make install</strong></p><h3>12. Changing Interface Name</h3><p>For change interface type to own interface name:</p><pre>sudo nano /usr/local/zeek/etc/node.cfg<br><br>then change<br><br>interface=ens33</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*HUGKd4G9P_Din_Y5Jw2ydw.png" /></figure><h3>13. zeekctl deploy Command</h3><p>The zeekctl deploy command applies configuration changes and starts Zeek processes. During deployment, Zeek loads scripts, initializes packet capture, and activates logging components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*6wndyW67S2on3j-0Z5gUfw.png" /></figure><h3>14. Creating Victim machine</h3><p>For checking logs I am conducting Nmap to specific IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bydTxJdJicnTMQezSd--sw.png" /></figure><p>Attack to victim using Nmap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*JzH2jo2iXGtqnPSpwmbSbg.png" /></figure><h3>15. Port Scanning Using Nmap from Kali Linux</h3><p>Nmap is used from the Kali Linux attacker machine to perform network reconnaissance. The scan identifies open ports, running services, and potential attack surfaces. Port scanning is one of the most common techniques observed during the early stages of an attack. Security monitoring tools should detect and log these activities.</p><p>Result of <strong>Suricata</strong>: Log file located in <strong>/var/log/suricata/fast.log</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k647HIlX6k-LuC_dD4ItOw.png" /></figure><h3>16. Nmap Result to Ubuntu Machine</h3><p>The Nmap scan reveals exposed services and listening ports on the Ubuntu host. Results may include SSH, HTTP, DNS, or other network services depending on system configuration. Attackers use this information to identify potential entry points. Security analysts can correlate scan activity with detection logs.</p><p>Result of Zeek: Log file located in <strong>/usr/local/zeek/logs/current/conn.log</strong></p><p>There are shows simply connection logs with current machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ztGqm7W74sKysnFuKRVSzg.png" /></figure><h3>17. Now coming to advance part to DNS Tunneling using iodine</h3><p>Both of <strong>Attacker </strong>and <strong>Victim </strong>machine install iodine</p><pre>apt install iodine</pre><p>18. DNS example using <strong>nslookup </strong>both of machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*oxozL-ypIcW_Ne8DwzhwpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*b5UZCV_3jjcQpiXxfM8UHQ.png" /></figure><h3>19. DNS creation generated log in Zeek</h3><p>The Ubuntu machine also performs DNS lookups during normal network usage. Monitoring these requests establishes a baseline of legitimate behavior. Analysts can compare normal DNS activity against suspicious patterns. This comparison helps identify anomalies and malicious communications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8TlE57DreIsGNzlZa4CDg.png" /></figure><h3>20. Than checking Reverse shell example</h3><p>Zeek records detailed DNS transactions in dns.log. Information such as queried domains, response codes, query types, and timestamps is stored for analysis. These logs provide valuable visibility into network name resolution activity. DNS monitoring is a key component of threat detection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OgRLj3nWu8o6jJ_2PpCIFg.png" /></figure><h3>21. Zeek logs for Reverse Shell</h3><p>When a reverse shell is established, Zeek records the associated network connections within its logs. Connection metadata such as IP addresses, ports, duration, and transferred data becomes available. Analysts can use these records to identify unusual outbound communications. Reverse shells often exhibit patterns that differ from normal traffic.</p><p>In this case I’ve use <strong>dns.log</strong> file in <strong>Zeek</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ZsxC3Bb4Vm9Rwu6qkjg2FQ.png" /></figure><p>Now checking connections from <strong>conn.log</strong> file in <strong>Zeek</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGkhvAcqKafSm1W_ATPbAQ.png" /></figure><h3>21. <strong>Detection Engineering</strong></h3><p>When a reverse shell is established, Zeek records the associated network connections within its logs. Connection metadata such as IP addresses, ports, duration, and transferred data becomes available. Analysts can use these records to identify unusual outbound communications. Reverse shells often exhibit patterns that differ from normal traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OgRLj3nWu8o6jJ_2PpCIFg.png" /></figure><h3>22. Blue Team — Zeek Cat Query</h3><p>Blue Team analysts can use command-line tools such as cat, grep, and zeek-cut to quickly analyze Zeek logs. These commands help extract specific indicators and connection records. Rapid log analysis enables faster incident response. Simple queries often reveal valuable evidence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ZsxC3Bb4Vm9Rwu6qkjg2FQ.png" /></figure><h3>Example: Zeek Suspicious Connection Detection</h3><p>Suspicious connections can be identified by reviewing Zeek connection logs for unusual destinations, uncommon ports, or abnormal durations. Analysts may also correlate events across multiple log sources. Such investigations help uncover malicious communications. Zeek provides extensive metadata for this purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGkhvAcqKafSm1W_ATPbAQ.png" /></figure><h3>23. Creating New File of local.rules</h3><p>A custom local.rules file allows administrators to create organization-specific detection signatures. This approach separates custom rules from vendor-provided rule sets. Maintaining a dedicated file simplifies updates and management. Custom detections can be tailored to local threats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*v6YTLpEem7-7f6lVYsmDpw.png" /></figure><h3>24. Add New Path and local.rules File to suricata.yml</h3><p>After creating the custom rules file, its path must be added to the Suricata configuration. This ensures that the detection engine loads the new signatures during startup. Multiple rule files can be defined if required. Proper configuration enables rule activation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*kj_Wsb0XhEofD3vwOzC9xg.png" /></figure><h3>25. Adding new rule for detect possible Reverse Shell Attack</h3><p>A custom Suricata rule can be created to identify reverse shell behavior based on network characteristics. Detection criteria may include suspicious ports, payload patterns, or connection directions. Such rules enhance visibility into attacker activity. Testing should be performed to validate effectiveness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*QaniuSUXeFDOeF2Ces6oow.png" /></figure><h3>26. Suricata New Rule Accepting</h3><p>Once added, the new rule should be validated and loaded by Suricata. Configuration testing confirms that the rule syntax is correct. Successful loading indicates that the engine is ready to use the detection logic. Any syntax errors must be corrected before deployment. Suricata new rule accpeting using current command: <strong>suricata -T -c /etc/suricata/suricata.yaml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gx4b-cLK6-_994IiBp3ylw.png" /></figure><p>Lets creating own security rules for this project.</p><p>If we don’t create this rules, then we have a lot of False Positives. Thus, An alert appears if you <strong>do not</strong> perform an Nmap scan, browser traffic looks like malware, internal DNS request appears suspicious and etc. In this case we achieve reducing useless alerts, keep only real threats, increase detection accuracy and etc. Against this situation we must create some special rules.</p><p>Let’s continue with port scanning.</p><p>Sometimes we get some alert from network like, vulnerability scanner, monitoring tool or internal admin scan.</p><p>For example: <strong>nmap -sS 192.168.50.10</strong></p><p>If the source IP is your own <strong>admin machine</strong>, you may want to ignore this.</p><p>The solution to this is to add a <strong>threshold </strong>to the <strong>local.rules </strong>file<strong>:</strong></p><pre>alert tcp any any -&gt; any any \<br>(msg:&quot;Possible Port Scan&quot;; flags:S; \<br>threshold:type both, track by_src, count 20, seconds 60; \<br>sid:100002; rev:1;)</pre><blockquote>Note: This rule does not alert if there are not 20 SYN packets within 60 seconds.</blockquote><p>Another way for increase threat-focused detection we may add some rule against creation of <strong>Internal network alerts</strong>.</p><p>In <strong>/etc/suricata/suricata.yaml</strong> file have HOME_NET feature, this feature help us to check our local network which we appointed ever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*rGyLDpFo0_4jd1SsXr-A1g.png" /></figure><blockquote>Note: Purpose of this approach: <strong>only your internal network is monitored<br>external noise is reduced.</strong></blockquote><p>An another different purpose is for example <strong>DNS Tunneling false positive reduction</strong>.</p><p>Some normal domains sometimes sends long query’s, such as CDN, telemetry, antivirus update and etc.</p><p>This example I’ve used Python Entropy treshold:</p><pre>if entropy(domain) &gt; 4.5:</pre><p>You can also simplify the detection part by making it more focus-based by adding network analysis rules that suit your goals and environment.</p><p>At last, for easy visualization we can integrate different service with Suricata and Zeek.</p><h3>28. Elasticsearch installing</h3><p>Elasticsearch serves as the central data storage and search platform within the ELK Stack. Installation prepares the environment for collecting and indexing security logs. Once operational, it enables fast searching and correlation of events. Elasticsearch forms the foundation of the analytics platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*_iH2bqqcghopOVUsd0ePpA.png" /></figure><h3>29. elasticsearch.yml network configuration</h3><p>The elasticsearch.yml file controls network communication and cluster settings. Administrators configure listening addresses, ports, and node parameters within this file. Proper network settings allow other components such as Filebeat and Kibana to connect. Configuration accuracy is critical for cluster functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*hDrnyErhBss-KxQWm6ETQA.png" /></figure><h3>30. Elasticsearch is ready</h3><p>After startup, Elasticsearch should report a healthy status and accept incoming connections. Successful operation confirms that indexing and search services are available. At this stage, log ingestion can begin. Verification is typically performed using API requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wm6qevQWvlRW6-jgLnDmMQ.png" /></figure><h3>31. Filebeat sends Zeek logs to Elasticsearch</h3><p><strong>Filebeat </strong>collects <strong>Zeek </strong>log files and forwards them to <strong>Elasticsearch </strong>for storage and analysis. This automated process eliminates the need for manual log transfers. Structured data is indexed and becomes searchable. Centralized visibility significantly improves monitoring capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VHiMK5ylWOkvjYi5f-zHEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_U-k2FrrfRnp_n1Hm7dzA.png" /></figure><h3>32. Zeek Logs on ELK</h3><p>Once ingested, <strong>Zeek </strong>logs become available within <strong>Kibana </strong>dashboards and search views. Analysts can investigate connections, DNS activity, and protocol events from a single interface. Visualization capabilities simplify threat hunting and incident response. Centralized analysis improves operational efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a0DDXBhwUdmvl7f_3b9w3A.png" /></figure><h3>33. Suricata Logs in ELK</h3><p>Suricata alerts are also forwarded to Elasticsearch and displayed within Kibana. Detection events can be searched, filtered, and visualized in real time. Combining <strong>Suricata </strong>and <strong>Zeek </strong>data provides stronger security visibility. Correlation between data sources enhances detection accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCfVJmIKVHA5fO8lhWIuaQ.png" /></figure><h3>36. Port scanning from attacker machine to specific IP</h3><p>To simulate reconnaissance activity, the attacker machine performs a targeted Nmap scan against a specific IP address. This generates network events that can be captured by monitoring tools. Such simulations help validate detection capabilities. The resulting traffic provides realistic testing data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*mg2sO5Q3yCp3XsxB_rEawQ.png" /></figure><h3>37. Network Scanning Attack Detection by Zeek in ELK Logging</h3><p><strong>Zeek </strong>records scanning behavior and forwards the resulting logs to <strong>Elasticsearch </strong>through <strong>Filebeat</strong>. Within <strong>Kibana</strong>, analysts can identify scanning patterns, source hosts, and targeted systems. Visualization dashboards make attack activity easier to investigate. This demonstrates the value of centralized detection and monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqTIkyiloi6XF_nnG8TAuA.png" /></figure><h3>Conclusion</h3><p>By combining Zeek’s powerful network visibility, Suricata’s signature-based detection capabilities, and Python-driven automation, security teams can significantly improve their ability to identify and investigate potential C2 communications. The integration of these tools with the ELK Stack provides centralized monitoring, efficient log analysis, and real-time threat detection. This practical lab demonstrates how open-source security solutions can be leveraged to build an effective and scalable network detection and response environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53ea86c93507" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proactive threat mitigation with FortiGate IPS: From signature tuning to botnet traffic blocking]]></title>
            <link>https://medium.com/@aghaverditk/proactive-threat-mitigation-with-fortigate-ips-from-signature-tuning-to-botnet-traffic-blocking-1bed82c64642?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bed82c64642</guid>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[fortigate]]></category>
            <category><![CDATA[fortinet]]></category>
            <category><![CDATA[ip]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Mon, 18 May 2026 12:42:05 GMT</pubDate>
            <atom:updated>2026-05-18T12:42:05.780Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*QcaqVTdAIoyHgrUfmNeldQ.png" /></figure><p>Müasir şəbəkə təhlükəsizliyində sadəcə firewall istifadə etmək artıq kifayət etmir. Hücumların sürətlə inkişaf etdiyi bir dövrdə, real-time threat detection və intrusion prevention mexanizmləri kritik əhəmiyyət daşıyır. Bu məqalədə Fortinet əsaslı IPS (Intrusion Prevention System) konfiqurasiyasının mərhələli şəkildə necə tətbiq olunduğunu nümayiş etdirəcəyəm.</p><p>Burada IPS profilinin yaradılması, xüsusi signature filter əlavə edilməsi, riskli “Flash Media Player” signature-larının analiz olunması, botnet bağlantılarının bloklanması və nəhayət həmin IPS siyasətinin firewall policy üzərinə inteqrasiyası addım-addım izah edilir. Məqsəd yalnız trafiki filtrasiya etmək deyil, həm də potensial exploit və command-and-control (C2) əlaqələrinin qarşısını proaktiv şəkildə almaqdır.</p><p>Bu yanaşma SOC mühəndisləri, şəbəkə administratorları və security engineer-lər üçün praktik və real-world təhlükəsizlik ssenarilərinə uyğun nümunə təqdim edir.</p><p>Gəlin praktiki test üzərindən gedək…</p><h3>1. Intrusion Prevention creating</h3><p>Bu mərhələdə şəbəkə trafikinin real-time analiz olunması üçün yeni IPS (Intrusion Prevention System) profili yaradılır. IPS profilinin məqsədi məlum exploit, malware və anormal trafik davranışlarını avtomatik aşkarlamaq və bloklamaqdır. Düzgün konfiqurasiya edilmiş IPS sistemi şəbəkənin proaktiv şəkildə qorunmasına imkan yaradır və potensial hücum səthini minimuma endirir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIDSwG-yAmCI-o8naulvFw.png" /></figure><h3>2. Added to filter or signature of IPS</h3><p>IPS profilinə xüsusi filter və signature-ların əlavə olunması təhlükələrin daha dəqiq aşkarlanmasını təmin edir. Bu yanaşma administratora yalnız kritik və riskli threat signature-larını aktiv saxlamağa imkan verir. Nəticədə həm performans optimallaşdırılır, həm də false positive hallarının qarşısı alınır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yoIEz0OkIawU7gprrEgR7Q.png" /></figure><p>Gördüyümüz kimi sağ künc hissədə dashboard bizə tapılan boşluqların CVE qeydiyyatlarını təqdim edir.</p><h3>3. Search for Flash media player signature and found</h3><p>Bu addımda köhnəlmiş və təhlükəli hesab olunan Flash Media Player ilə əlaqəli IPS signature-ları axtarılıb analiz edilir. Flash əsaslı zəifliklər uzun müddət exploit və remote code execution hücumlarında istifadə olunub. Uyğun signature-ların müəyyən edilməsi həmin risklərin erkən mərhələdə bloklanmasına kömək edir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AqCwm09ceECtcFdasDyRnA.png" /></figure><h3>4. Block to the outgoing connection of botnet sites</h3><p>Bu konfiqurasiya vasitəsilə daxili şəbəkədən botnet və command-and-control (C2) serverlərinə göndərilən outbound trafik bloklanır. Məqsəd kompromiz olunmuş sistemlərin zərərli serverlərlə əlaqə qurmasının qarşısını almaqdır. Bu yanaşma data exfiltration və malware communication risklərini əhəmiyyətli dərəcədə azaldır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*QJtYyXbYsuZ1Ach8rRgw-g.png" /></figure><h3>5. Adding IPS to the relevant policy in Firewall Policy section</h3><p>Son mərhələdə yaradılmış IPS profili uyğun firewall policy üzərinə tətbiq edilir. Bunun nəticəsində müəyyən edilmiş təhlükəsizlik qaydaları aktiv trafik üzərində işləməyə başlayır. IPS və firewall inteqrasiyası şəbəkənin daha güclü, çoxqatlı müdafiə mexanizmi ilə qorunmasını təmin edir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjNc0l9kY6yelbrqrEGHgA.png" /></figure><h3>Nəticə olaraq:</h3><p>Effektiv IPS implementasiyası yalnız signature aktivləşdirməkdən ibarət deyil — düzgün filter seçimi, risk əsaslı trafik analizi və firewall siyasətləri ilə inteqrasiya birlikdə işlədikdə real təhlükəsizlik təmin edilir.</p><p>Bu konfiqurasiya nəticəsində şəbəkə daxilində exploit cəhdləri daha erkən mərhələdə aşkarlanır, botnet və zərərli outbound əlaqələr bloklanır və sistemlərin ümumi təhlükəsizlik səviyyəsi əhəmiyyətli dərəcədə artırılır.</p><p>Xüsusilə Fortinet IPS texnologiyalarının düzgün tətbiqi müəssisələrə həm visibility, həm də automated threat prevention baxımından ciddi üstünlük qazandırır. Bu cür yanaşmalar müasir defensive security strategiyalarının əsas komponentlərindən biri hesab olunur.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bed82c64642" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Autonomous SOC Engineering: From Active Directory Compromise to AI-Driven Automated Incident…]]></title>
            <link>https://medium.com/@aghaverditk/autonomous-soc-engineering-from-active-directory-compromise-to-ai-driven-automated-incident-9f19ad46eb81?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f19ad46eb81</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[soar]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Fri, 15 May 2026 11:54:14 GMT</pubDate>
            <atom:updated>2026-05-15T12:04:48.199Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Autonomous SOC Engineering: From Active Directory Compromise to AI-Driven Automated Incident Response</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FikDkQYXb8PHoihebEj4tg.png" /></figure><p><em>An end-to-end Security Engineering project covering phishing, Active Directory attacks, detection engineering, SIEM monitoring, and SOAR automation in a modern SOC environment.</em></p><p>In modern enterprise environments, cyber attacks rarely stop at initial access. What begins as a simple phishing attempt can rapidly evolve into credential compromise, lateral movement, Active Directory enumeration, privilege escalation, and full infrastructure takeover. At the same time, Security Operations Centers are expected not only to detect these threats in real time, but also to automate response workflows, enrich alerts with threat intelligence, and centralize visibility across heterogeneous systems.</p><p>This project was designed to simulate a realistic enterprise security environment by combining both offensive and defensive security operations within a single integrated SOC architecture. The lab environment includes Active Directory infrastructure, Windows and Linux endpoints, phishing simulations, post-exploitation activities, detection engineering, centralized logging, SIEM monitoring, SOAR automation, and automated incident response pipelines.</p><p>Throughout this research, multiple technologies were integrated into a unified ecosystem, including Wazuh for SIEM and detection engineering, Sysmon and auditd for endpoint telemetry collection, TheHive for incident management, and Shuffle for SOAR-based workflow orchestration and alert automation. The objective of this project was not only to demonstrate attack techniques such as phishing, Pass-the-Hash, Active Directory enumeration, and reverse shell execution, but also to show how modern SOC environments can detect, correlate, enrich, and automatically respond to these threats using integrated security tooling and custom detection logic.</p><p>By combining Red Team attack simulation with Blue Team monitoring and SOAR automation, this project demonstrates how enterprise-grade detection engineering and incident response can be implemented within a practical and scalable SOC laboratory environment.</p><p>Want to divide this project to the three part:</p><p>Red team activities</p><h3>1. Wazuh Docker Installation</h3><p>The environment initialization phase started with deploying Wazuh using Docker containers to establish a centralized SIEM and threat monitoring infrastructure. The deployment included core services such as the Wazuh Manager, Indexer, and Dashboard components. Containerized deployment provided flexibility, rapid scalability, and simplified service orchestration across the lab environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vnb9R1HN4X0U0WiqZgd58Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmgXh-F34uLiW_OHa7MhCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ypPJi034WkuyZoJ_Yw36Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1Y-G3qs6iAMEFbx72nEjg.png" /></figure><h3>2. Windows Server with Domain Controller</h3><p>A Windows Server machine was configured as a Domain Controller within the Active Directory infrastructure. This server became the primary authentication and authorization authority responsible for domain-wide identity management, Kerberos authentication, Group Policies, and centralized administrative control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTPxnvoJHxzNNppMvBlEjA.png" /></figure><h3>3. Creating administrative user and Domain Network Configuration</h3><p>A dedicated domain administrator account was created to simulate privileged enterprise-level access. During this stage, network configurations such as DNS settings, hostname resolution, domain naming structure, and internal IP segmentation were also configured to ensure proper communication across the Active Directory environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*QYSfOSBHYZft8XAyFU8bow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SL-JinCMuoW_lXck0s1kww.png" /></figure><h3>4. Client connected to secureless.lan Domain</h3><p>A Windows client workstation was successfully joined to the secureless.lan Active Directory domain. This process simulated a real-world enterprise endpoint integrated into centralized authentication infrastructure and allowed domain-level policy enforcement and credential validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FBxepPVWpwegaoRZOOpGeQ.png" /></figure><h3>5. Nmap result for Client Machine</h3><p>Reconnaissance activities were conducted using Nmap against the client endpoint to identify exposed services, active ports, and network fingerprints. The scan revealed operating system indicators, open communication channels, and potentially vulnerable services available for enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Td7GIzvhPQCrKnUV0VoeA.png" /></figure><p>Note: WS-Management (WSMAN) protocol for remote PowerShell management and administration.</p><h3>6. Nmap result for Windows Server</h3><p>A deeper enumeration scan targeted the Domain Controller to identify critical Active Directory-related services such as Kerberos, LDAP, SMB, DNS, and RPC. This reconnaissance stage provided insight into authentication mechanisms and attack surfaces exposed by the domain infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*okDjxa_H6vpCUu_FwPxxgA.png" /></figure><h3>7. Phishing payload preparation and credential harvesting</h3><p>Using SEToolkit, a phishing simulation campaign was prepared by generating a malicious payload and designing a custom HTML phishing template to imitate a trusted login interface. The attack delivery phase targeted victim interaction and successfully captured login credentials, including usernames and passwords entered by users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XfsYgAPGAT63-fGvZH2S-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oP3yS6ORD-qowif3pTQASw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9enVrcf8A5khKaJZcoQGrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJ1h4hBwhmlBWwc7uh_FgA.png" /></figure><h3>8. Pivoting and Privilege Escalation</h3><p>Following credential compromise, pivoting techniques and privilege escalation methodologies were used to move laterally through the environment. Administrative credentials enabled unauthorized access to the Windows Server, demonstrating how a single compromised account can escalate into complete infrastructure compromise.</p><p>After enumerating several users, I log in to the system with the user “linus torvalds”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y8fY2teGZ5bT1cFeykllTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwsybayc-5ZNLoK3JWPWQA.png" /></figure><h3>9. Active Directory User Enumeration</h3><p>Enumeration activities within the Active Directory environment were initiated to gather information about domain users, groups, privileges, organizational units, and accessible resources. This phase simulated adversarial reconnaissance commonly performed during internal compromise scenarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLlddIgQybo-sS2orbzJCQ.png" /></figure><h3>10. Active Directory service enumeration with Nmap</h3><p>Advanced Nmap scans identified exposed Kerberos and LDAP services used by Active Directory authentication systems. The results highlighted key ports responsible for identity management and domain communication, providing intelligence useful for further attack simulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKZI5mfBZufqUHvgNp0w7Q.png" /></figure><h3>11. Domain enumeration and NetBIOS information gathering</h3><p>Additional enumeration scans were conducted against domain services to extract NetBIOS names, workgroup details, domain identifiers, and host discovery information. These findings assisted in mapping the internal enterprise network structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-Tl3Uen2pXVEXe0f7VIag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnIkrxGqnKhyG9is4s98LA.png" /></figure><p>The NTDS.dit (New Technology Directory Services Directory Information Tree) file is the core database of Microsoft Active Directory Domain Services (AD DS). It acts as the central repository for all Active Directory data, including user accounts, computer objects, groups, security policies, and encrypted password hashes for all users in a domain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qxXGqCJ7fSbrl3gg8Cakg.png" /></figure><p>In the end we conduct port scanning within the NetBIOS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5MvvOhTSoEZRK51BjMR4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdwAURo0HhcfOJ0WYZugng.png" /></figure><p>The initial phase of the Red Team activities demonstrated how a modern enterprise environment can be compromised beginning from reconnaissance and phishing-based credential harvesting, eventually progressing toward Active Directory enumeration and privileged access. Through the use of tools such as Nmap and SEToolkit, critical infrastructure services, exposed attack surfaces, and user credentials were successfully identified and leveraged during post-exploitation operations. Additionally, techniques including pivoting, privilege escalation, and Pass-the-Hash attacks highlighted how quickly attackers can move laterally within poorly segmented environments after obtaining administrative access. The enumeration of Kerberos, LDAP, SMB, and NetBIOS services further demonstrated the importance of securing Active Directory infrastructures against internal reconnaissance and credential abuse. Overall, this stage emphasized the realistic attack lifecycle frequently observed in enterprise environments and established the foundation for subsequent detection engineering, monitoring, and incident response operations implemented throughout the SOC infrastructure.</p><p>Let’s perform a security assessment to test the vulnerabilities of a Linux system we have.</p><p>A vulnerable Linux machine was accessed through bootloader manipulation by entering Ubuntu advanced recovery options during startup. This demonstrated how physical or console-level access can be abused to bypass security restrictions and gain elevated access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CecIUGPlZcuU5ot_uC6SSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HkXhk0VEW7tCi8bY5pt6Cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JlJxjgj9qsAJrVLimcrMTA.png" /></figure><p>On the bottom example we must change <strong>audit.d</strong> service configuration file values of <strong>write_logs=yes</strong> and <strong>log_format=RAW</strong>.</p><p>Now let’s start connecting the machines to Wazuh SIEM.</p><h3>12. Windows server connected with Wazuh Server</h3><p>The Domain Controller was successfully onboarded to the Wazuh infrastructure through agent deployment and secure communication configuration. This enabled centralized collection of Windows event logs and security telemetry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yaYuWdbchfPxb1_gcekDpQ.png" /><figcaption>Windows Server connected to Wazuh</figcaption></figure><h3>13. Windows client connected with Wazuh Server</h3><p>The Windows client endpoint was integrated into the Wazuh monitoring environment, enabling real-time event forwarding and centralized security analytics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNolSaK0rKH-3BJQY5lPVQ.png" /><figcaption>Windows Client connected to Wazuh</figcaption></figure><h3>14. VulnLinux agent deployment for Wazuh</h3><p>A Wazuh agent was deployed on the vulnerable Linux system to monitor authentication logs, system activities, process execution events, and audit records generated on the Linux endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAs3KE1hqOG1JxlPhZ1nRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*rSuxXAURy4rnEdBEc4F9iA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulMET91eyCM-tWcoc5PqjA.png" /><figcaption>Vulnerable server connected to the Wazuh</figcaption></figure><h3>15. Wazuh Agent configuration (ossec.conf)</h3><p>The ossec.conf configuration file was customized to define log sources, agent behavior, rule monitoring policies, integration settings, and alert forwarding parameters for improved visibility and detection accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mllc-SIt-he2QDtCvBLQ_g.png" /><figcaption>Wazuh Agent on Server machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sd3xcWMX-L_zRXtU8oqG7A.png" /><figcaption>Wazuh Agent on Client machine</figcaption></figure><p>Windows logs successfully comes to Wazuh SIEM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdAZ-ZPgV7_7xuzBSQyQOw.png" /></figure><h3>16. Accessing Wazuh Docker containers</h3><p>Administrative access to Wazuh Docker containers was established in order to modify configuration files located under /var/ossec/etc. This phase enabled deeper customization of monitoring rules and integrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ci3xmJBklw3IiRaqJIpucA.png" /></figure><h3>17. Sysmon rules added to shared agent configuration</h3><p>Custom Sysmon-related monitoring rules were added to /var/ossec/etc/shared/default/agent.conf to improve endpoint telemetry collection and behavioral detection capabilities across all connected agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn8Cw6kNUqA6Qv-e0WLXRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JkxLWzNslu--kgoTdYRxg.png" /></figure><h3>18. Wazuh Manager log verification</h3><p>The Wazuh Manager logs were analyzed to confirm successful event ingestion and agent communication. Log validation ensured that monitored events were correctly reaching the SIEM infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVVzbMAj97altfoWZUAX_Q.png" /></figure><p>Custom rules were created for auditd to capture Linux-specific security events and forward them into Wazuh for centralized analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*-AzfUzt8gnfM7wXSbWuO9w.png" /></figure><p>Auditd-generated security logs from the vulnerable Linux system were successfully ingested into the Wazuh platform, enabling visibility into command execution, privilege escalation attempts, and suspicious user activities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ud0NLgRBQWGaj1f0sYDyWQ.png" /></figure><p>I have run some tests on Vulnerable Server for security purposes and I am sharing the results with you.</p><p>Written shell script for reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsa4Si8PHw3QnueAQWkPEA.png" /></figure><p>Using the user enumeration technique, I determined that there is a user named onuser on the Vulnerable Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PA8oGdA01iFJwvVtpjUTzQ.png" /></figure><p>After Execute shell script in victim Vulnerable Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wFi0YAAdv_-gO0GfYbirIw.png" /><figcaption>Brute force attack to the current user</figcaption></figure><p>Now conduct some penetration test methods for additional information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2BY7Sbf8f3Av5YmSOdTnHg.png" /><figcaption>Using Dirbuster for Web directory finding.png</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbTZYK6wGiEzBJNxvSlZSw.png" /><figcaption>Nmap Version and Syn scan result</figcaption></figure><p>Using NSE script in vulnerable Server I found CVE-2011–3192.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNSjv7EJQcVOtaiWQSfE1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SU_U7cLpC5RSSxKK434cZw.png" /></figure><p>Now we are forwarding SIEM Alerts to Telegram to increase availability.</p><p>Adding API of Telegram to the ossec.conf file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dA-sYgCgTr782II3L0pN0A.png" /></figure><p>Getting user chat ID for Telegram bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYAkLbBqoVBaT9B98ekXrQ.png" /></figure><p>Changing owner to Wazuh from ossec.conf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kR0gCO8mNrBaFQWYAeh_zQ.png" /></figure><p>Now we can see log alerts from SIEM in our Telegram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIeYs4wmvkdYJduMhdMg3A.png" /><figcaption>Vulnerable Server Alerts</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KwxMl-iQtb0V-lsmMeRZGw.png" /><figcaption>Windows Server Alerts</figcaption></figure><p>Since the rule I wrote for telegram in the ossec conf file was deleted after the restart, I wrote a shell script and this script goes and backs up the additional basic and current file I created for ossec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xf9O3TxyuysTYej4kE8cDA.png" /></figure><h3>19. Custom Telegram Python Integration</h3><p>A dedicated Python integration file (custom-telegram.py) was configured to process auditd log events from Linux systems and generate formatted Telegram notifications for SOC analysts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DiMFlu1tJNobiIV7wiUUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ndpAjisUciD4e5HJAgAP7g.png" /><figcaption>Custom Rules for Auditd</figcaption></figure><h3>20. Suspicious Command Detection Rules</h3><p>Custom suspicious command detection logic was developed by creating a command_list file within /var/ossec/etc/lists. This list included dangerous Linux commands and attacker behaviors commonly associated with post-exploitation activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrzUiKFZlGjO1XqGOsUk7Q.png" /></figure><h3>21. Auditd Integration with Suspicious Command Lists</h3><p>The suspicious command list was integrated into ossec.conf and linked with auditd monitoring rules to enable automated detection of potentially malicious command execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ehsi0SQuEB3ueLy13sWq3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9k7Vct0uVZkqAxim2xpTbw.png" /><figcaption>I added a list to the audit.rules file to catch suspicious commands on the agent machine.</figcaption></figure><h3>22. Linux Audit Rules for Threat Detection</h3><p>Additional audit rules were deployed on monitored Linux agents to capture execution of suspicious commands and unauthorized administrative actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pfnc-rWzDeDveuGKyd2MoQ.png" /></figure><p>Now audit logs comes to SIEM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkgBejtn0NRVqmEX96CN8w.png" /></figure><p>For example, there are an alert for suspicious command executing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYKAs9Vrk6ynywdFGOWqRA.png" /></figure><h3>SOAR &amp; Incident Response Automation</h3><h3>23. TheHive Docker Installation</h3><p>TheHive was deployed using Docker containers to establish an incident response and case management platform integrated with the SIEM environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NNkQ0KBPTBZYbccnUq2YgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FlT3UmZ1SgtbE6cq3oh1Pw.png" /></figure><h3>24. TheHive Platform Configuration</h3><p>TheHive platform configuration included user creation, organization setup, API generation, and service integration for centralized SOC operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vd6KEJT-KzhVSkgW-vYjWw.png" /></figure><p>API keys were generated to establish secure communication between Wazuh and TheHive, enabling automated alert ingestion and incident creation workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*94yVCE3NulfIoBQxmPXwVw.png" /></figure><p>Python3 and required dependencies were upgraded and installed to support automation scripts and API-based integrations between Wazuh, TheHive, and SOAR components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ybav4yaCyM5M2VYgUfmqg.png" /></figure><p>Integration settings were configured to allow Wazuh alerts to automatically generate incidents and observable objects inside TheHive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gh_4zm_BHlDNkeW9GZnVzA.png" /></figure><p>Wazuh Custom rule for TheHive integration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*By-7lpa_mK3BUd4XPH3-FQ.png" /></figure><h3>25. Docker Compose Startup Configuration</h3><p>Persistent startup configurations were implemented for Docker Compose services to ensure that TheHive and Shuffle environments automatically recovered after system reboot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIu8M5gCXxOPQ2fnu337-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jd4EB5DyyMl0iYo4AtXYFg.png" /><figcaption>etc/audit/rules.d/audit.rules file added new rules</figcaption></figure><h3>26. Shuffle SOAR Integration</h3><p>Shuffle was deployed and configured as an orchestration layer for automated security workflows and incident response pipelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sTGENEqJEy4XIzk5ZRy7A.png" /><figcaption>Main page of Shuffle SOAR</figcaption></figure><h3>27. Shuffle Workflow Development</h3><p>Custom workflows were developed within Shuffle to receive Wazuh alerts through webhooks and automate downstream response operations. For this we use following Python script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DuMvxL2rnVJgnTtC49ahw.png" /><figcaption>Python integration script adding to var/ossec/etc/integrations/custom.shuffle file</figcaption></figure><p>Shell script for integration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00cM2ynJc6-XXu6uxSstaQ.png" /></figure><p>Creating Workflow for Shuffle SOAR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2QwoNJ0FK51oop-DdENvQ.png" /></figure><p>Adding custom rule to Wazuh for integration with Shuffle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARmP6D-MwWJhbakvhn6zKw.png" /></figure><h3>28. Wazuh Alerts Successfully Delivered to Shuffle</h3><p>Wazuh-generated alerts were successfully forwarded into Shuffle SOAR, validating end-to-end integration between detection and automation layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UemKxruuYAO3RIst4SMm6Q.png" /></figure><p>Wazuh alerts are successfully transmitted to SOAR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6d-o0TkEW9GlUOWRnCQEiw.png" /></figure><p>Added TheHive user API key, organization name and localhost and port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1Ilp5uyTJ7Qnesp1dghHw.png" /></figure><h3>29. TheHive Alert Creation from Wazuh</h3><p>Security alerts originating from Wazuh were automatically transformed into incident records inside TheHive for structured investigation and response management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7RbxRL0T8Kgqn-QCsH8hA.png" /></figure><h3>30. VirusTotal API Integration</h3><p>VirusTotal API integration was added into Wazuh to enrich alerts with malware reputation and threat intelligence context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdMWdpXVauoADBrBRRernQ.png" /></figure><p>VirusTotal API adding to ossec.conf file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQ_TArZ0wU57KoD_Ad_nEg.png" /></figure><h3>31. AbuseIPDB API Integration</h3><p>AbuseIPDB integration was configured to correlate malicious IP addresses and enhance brute-force detection capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PZW6G8-aMfMGOgwUZthPrA.png" /></figure><p>AbuseIPDB API key added to Wazuh Docker ossec_conf file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jck9j7tg5RVnZbi6gZnaWQ.png" /></figure><h3>32. Wazuh Alerts Forwarded to TheHive Through Shuffle</h3><p>End-to-end SOAR orchestration was successfully validated by forwarding Wazuh alerts into Shuffle workflows, which automatically created actionable alerts and cases inside TheHive incident response platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSWdqWE4gPxEIs9RKpgywg.png" /></figure><p>For example: Brute force attatck alert in TheHive ticketing system:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1wtfqRjTyAQcTYmYcKp0g.png" /></figure><h3>SOC Environment Operational Readiness</h3><p>The environment was finalized with dedicated SOC administrators, organization structures, alert pipelines, automated workflows, threat intelligence integrations, and centralized visibility across Windows and Linux systems.</p><h3>Conclusion</h3><p>This project demonstrated the complete lifecycle of a modern cyber attack within an enterprise-style SOC environment — beginning from initial phishing delivery and credential harvesting, progressing through lateral movement, privilege escalation, Active Directory enumeration, and post-exploitation activities, and ultimately ending with centralized detection, automated alerting, and incident response orchestration.</p><p>During the implementation process, multiple security technologies were successfully integrated into a unified detection and response ecosystem. Windows and Linux telemetry collection was centralized through Wazuh, advanced endpoint visibility was achieved using Sysmon and Linux Auditd, and real-time security alerts were automated through Telegram integrations, custom detection rules, and SOAR workflows powered by Shuffle and TheHive.</p><p>In addition to attack simulation, the project also focused heavily on detection engineering by creating custom rules for suspicious commands, auditd monitoring, threat intelligence enrichment using VirusTotal and AbuseIPDB, and automated alert escalation pipelines capable of transforming raw telemetry into actionable security incidents.</p><p>One of the most important outcomes of this project was demonstrating how offensive security operations and defensive monitoring capabilities can coexist within the same environment to improve visibility, detection accuracy, and incident response readiness. Rather than treating Red Team and Blue Team activities as isolated domains, this implementation highlights the value of integrating adversary simulation directly into SOC engineering workflows.</p><p>Ultimately, this lab environment represents a practical implementation of a modern Security Operations Center architecture — combining SIEM, SOAR, detection engineering, threat intelligence, Active Directory monitoring, Linux auditing, and automated incident response into a centralized and scalable security ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f19ad46eb81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enabling AV Scan Functionality in Wazuh with ClamAV Integration]]></title>
            <link>https://medium.com/@aghaverditk/enabling-av-scan-functionality-in-wazuh-with-clamav-integration-1a13158cab87?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a13158cab87</guid>
            <category><![CDATA[va]]></category>
            <category><![CDATA[clamav]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Wed, 06 May 2026 13:15:30 GMT</pubDate>
            <atom:updated>2026-07-12T11:03:07.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y88xL2hImqz3GIzo3KrSDw.png" /></figure><p>Modern cybersecurity requires more than a single defensive layer, as today’s threats are increasingly complex and dynamic. Instead of relying solely on traditional protection methods, it is more effective to combine multiple security solutions that can both detect and respond to suspicious activity in real time.</p><p>ClamAV serves as a reliable open-source antivirus solution that identifies malicious files through signature-based scanning, while Wazuh enhances this capability by collecting, analyzing, and correlating logs across the system. When these two tools work together, antivirus scan results are no longer isolated — they become part of a broader security monitoring process, allowing for faster detection and more meaningful alerts.</p><p>This article focuses on the practical implementation of integrating ClamAV with Wazuh on an Ubuntu environment. It walks through the installation and configuration steps, demonstrates how to enable detailed logging, and shows how scan outputs can be monitored and analyzed within Wazuh. Through this approach, it becomes possible to build a more robust and responsive security setup that improves visibility, strengthens threat detection, and supports efficient incident response.</p><p>Let’s go!</p><p><strong>1. Installing ClamAV on Ubuntu machine</strong><br>ClamAV was installed on the Ubuntu system to provide antivirus scanning capabilities. This includes core components such as clamscan for on-demand scanning and supporting services for signature updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HgI9jnmq_dWZS9xUH1KXpQ.png" /></figure><p><strong>2. Verifying freshclam.service is running</strong><br>The freshclam service, responsible for automatically updating virus signature databases, was checked and confirmed to be in a running state. This ensures that ClamAV uses the latest threat intelligence for accurate detection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTLUQVYy7vxwJLqX3Izyvg.png" /></figure><p><strong>3. Modifying freshclam.conf configuration</strong><br>The <em>freshclam.conf</em> file was updated to enhance logging and optimize update intervals. Specifically, LogVerbose and LogSyslog were enabled to improve visibility of update activities, while the Checks parameter was reduced from 24 to 1 to increase the frequency of signature updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R7J-m7EL6KeCfcNJyZuXHw.png" /></figure><p><strong>4. Installing Wazuh Agent on Ubuntu machine</strong><br>The Wazuh Agent was installed and configured on the same Ubuntu machine, allowing it to monitor system activity, collect logs, and forward them to the Wazuh Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXc3Cpn6CpgHBZmeBoL6FQ.png" /></figure><p><strong>5. Establishing log exchange between Wazuh and Ubuntu machine</strong><br>A secure communication channel was established between the Wazuh Agent and Manager, ensuring that logs generated on the Ubuntu endpoint (including ClamAV logs) are reliably transmitted for centralized analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qji0kZmB9goDnHrdigH2QQ.png" /></figure><p><strong>6. Initiating scan using clamscan and logging results</strong><br>A manual antivirus scan was performed using the clamscan utility. Scan results, including detected files and scan status, were redirected and stored in a dedicated log file (e.g., <em>scan.log</em>) for further monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zlw5Of3-DbuBhanG_I8xYA.png" /></figure><p><strong>7. Detecting EICAR signature in scan.log file</strong><br>The scan results indicated the presence of the EICAR Test File signature within the <em>scan.log</em> file. This confirms that ClamAV is functioning correctly and capable of identifying known threats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Lj0d6j9QyNtANTQrZ7GGQ.png" /></figure><p><strong>8. Generating EICAR-Signature alert in Wazuh</strong><br>Based on log monitoring and predefined rules, Wazuh successfully detected the EICAR signature event and generated a corresponding security alert, demonstrating effective integration between antivirus scanning and SIEM monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cJrTnR8tRc67lSljcKDkA.png" /></figure><p>In conclusion, integrating ClamAV with Wazuh significantly enhances endpoint security by combining antivirus scanning with centralized log analysis and alerting. This setup enables real-time detection of malicious signatures and ensures that scan results are continuously monitored and correlated within a broader security context. The successful identification of the EICAR Test File highlights the reliability of this integration, making it a practical and effective solution for strengthening defensive capabilities in modern environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a13158cab87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Application Attack Monitoring, Severity-Based Telegram Alerting, and Response with Wazuh (XSS…]]></title>
            <link>https://medium.com/@aghaverditk/web-application-attack-detection-and-alerting-with-wazuh-xss-use-case-839947254933?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/839947254933</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Wed, 06 May 2026 13:15:12 GMT</pubDate>
            <atom:updated>2026-07-12T09:30:58.416Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web Application Attack Monitoring, Severity-Based Telegram Alerting, and Response with Wazuh (XSS Use Case)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsZFDUq-nnnsv9erF0vL4Q.png" /></figure><h3>Introduction</h3><p>Modern web applications are constantly exposed to attack attempts such as Cross-Site Scripting (XSS), SQL Injection, and malicious payload delivery. Detecting these threats in real time and responding immediately has become a critical requirement for modern Security Operations Centers (SOC). In this article, we will focus on how Wazuh can be used to detect XSS attack attempts through web server log monitoring and generate actionable security alerts for incident response workflows.</p><p>The project demonstrates a practical attack detection pipeline where malicious web requests are identified, categorized, and forwarded as security alerts for rapid analyst visibility. Particular attention is given to the integration of Wazuh alerting with Telegram notifications, where alerts are automatically delivered based on 7 different severity levels. This approach enables security teams to prioritize incidents efficiently, reduce response time, and maintain continuous awareness of critical web application threats in real time.</p><p>Through this XSS use case, the article highlights how centralized log analysis, rule-based detection, and automated alert delivery can strengthen web application security monitoring in both lab and production-like environments.</p><p><strong>1. Installing and configuring DVWA</strong><br>In this step, the Damn Vulnerable Web Application (DVWA) is installed on the local environment. Basic configuration is performed, including setting up the web root directory and ensuring proper connectivity with the web server. This prepares a controlled vulnerable environment for testing security scenarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qYvLdq_bqnLLrDI6UNccw.png" /></figure><p><strong>2. Creating DB for DVWA and changing owner of the DVWA files</strong><br>A dedicated database for DVWA is created (typically using MySQL/MariaDB). Necessary tables are initialized, and file ownership/permissions are adjusted (e.g., www-data) to ensure the web server can properly access and manage DVWA files securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Bwow91wU9_4WC2hGawPaA.png" /></figure><p><strong>3. Installing modules for Apache2</strong><br>Required Apache2 modules are installed and enabled to support DVWA functionality. These may include PHP modules and other dependencies necessary for proper execution of dynamic web content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TtnR8rucZrfob7DbbjZFUA.png" /></figure><p><strong>4. DVWA is Ready</strong><br>At this stage, DVWA is fully operational. The web interface is accessible via browser, and all configurations have been validated to ensure the lab environment is functioning correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdG-iatMr3F8PhPfovXGEA.png" /></figure><p><strong>5. Wazuh All-In-One installation</strong><br>The Wazuh All-in-One solution is installed, which includes the Wazuh Manager, Indexer, and Dashboard components. This provides a centralized SIEM platform for log collection, analysis, and visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LG4PH-oE4NuAYX5-fT_-dA.png" /></figure><p><strong>6. Wazuh is ready</strong><br>After installation, Wazuh services are verified to be running correctly. The dashboard is accessible, and the system is ready to receive logs and events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYxpo-pODrF1sQS88RvJ8g.png" /></figure><p><strong>7. Wazuh Agent is up</strong><br>The Wazuh Agent is installed on the target machine (where Apache/DVWA is hosted) and successfully started. This agent is responsible for collecting logs and sending them to the Wazuh Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M83TyLTFZZtsGYud6-Do8g.png" /></figure><p><strong>8. Agent is ready</strong><br>The agent is successfully registered and connected to the Wazuh Manager. Communication between agent and server is confirmed to be stable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bn1ZgeYMLzA5Q09NKHEFAw.png" /></figure><p><strong>9. Sending logs from Apache2 to Wazuh</strong><br>Apache log files (e.g., access.log, error.log) are configured to be monitored by the Wazuh Agent. This enables real-time log forwarding to Wazuh for analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCz0AAHMSHVYiPl5IhmKVQ.png" /></figure><p><strong>10. Tested XSS Reflected Attack in DVWA</strong><br>A Reflected XSS attack is executed within DVWA to simulate a real-world attack scenario. This helps generate relevant log entries for detection testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvMiiRWgUISMo1cuMaHRjw.png" /></figure><p><strong>11. XSS Reflected Attack log sending to Wazuh</strong><br>The logs generated from the XSS attack are successfully captured by the agent and forwarded to Wazuh, confirming proper log pipeline functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GH_WYOqiRm0hN5Yfy29ISQ.png" /></figure><p><strong>12. Using a2enmod to enable dumpio module</strong><br>The Apache dumpio module is enabled using the a2enmod command. This module allows detailed logging of HTTP request/response data, including request bodies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*66YImqChPviGXMNla3bvMg.png" /></figure><p><strong>13. Configuring Apache2 to send POST request logs to Wazuh</strong><br>Apache configuration files (apache2.conf or related) are modified to enable logging of POST request bodies. This ensures deeper visibility into HTTP traffic. Apache does not log the body of <strong>POST requests</strong> by default primarily due to <strong>security, privacy, and performance considerations</strong>.</p><p>From a <strong>security and privacy</strong> perspective, POST request bodies often contain sensitive information such as login credentials, session tokens, personal data, or form inputs. Logging this data in plain text within log files could expose critical information if logs are accessed by unauthorized users or compromised systems.</p><p>From a <strong>performance and storage</strong> standpoint, POST bodies can be significantly larger than typical URL query strings (used in GET requests). Logging full request bodies for every request would rapidly increase log file size, consume disk space, and negatively impact system performance, especially in high-traffic environments.</p><p>Additionally, from a <strong>logging design perspective</strong>, Apache’s default logging (e.g., access.log) is intended to capture high-level request metadata (IP address, request method, URL, response code, etc.) rather than full payload content. Deep inspection of request bodies is considered an advanced use case and requires explicit configuration (e.g., enabling modules like mod_dumpio).</p><p>Therefore, POST request body logging is <strong>disabled by default</strong> and must be manually enabled when deeper traffic analysis or security monitoring (such as detecting XSS or injection attacks) is required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QrEmxjaPOMFUokx21PShpA.png" /></figure><p><strong>13.1 Enabling proxy and proxy_http modules and checking error_log</strong><br>Additional Apache modules (proxy and proxy_http) are enabled. The error_log file is reviewed to verify that POST request data is being captured correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*udLzKJXB_4rCi_ZbDZ7eAQ.png" /></figure><p><strong>14. Adding manual Decoder to Wazuh for reading POST request body from error_log</strong><br>A custom Wazuh decoder is created to parse POST request body data from Apache error logs. This enables structured analysis of previously unparsed log content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iE-Dqn35yjXAqaDZ9xZq_A.png" /></figure><p><strong>15. Adding manual Rule using Decoder for reading file from error_log</strong><br>Custom Wazuh rules are written based on the created decoder. These rules define conditions to detect suspicious patterns such as XSS payloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CF8SlMVR9YW52_oMnDENDA.png" /></figure><p><strong>16. Result of Decoder and Rule — POST request body visible in Wazuh</strong><br>The effectiveness of the decoder and rules is validated. POST request body data is now correctly parsed and visible in Wazuh alerts/logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFIlfa-LwSJrXmu4n9GD6A.png" /></figure><p><strong>17. Wazuh Telegram bot</strong><br>A Telegram bot is created to integrate with Wazuh for alert notifications. This allows real-time messaging for detected security events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u0bQBtXEkeNrpWWwzukIYQ.png" /></figure><p><strong>18. Adding Telegram API to ossec.conf integration file</strong><br>The Telegram bot API token is added to the Wazuh integration configuration file (ossec.conf), enabling communication between Wazuh and Telegram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCitrZ76wVk_fu_Em3UIug.png" /></figure><p><strong>19. Chat ID for Telegram</strong><br>The Telegram chat ID (user/group) is identified, which is required to direct alerts to the correct destination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YpPbzEt37iqR56iFjMRrwg.png" /></figure><p><strong>19.1 Adding Chat ID in Python script</strong><br>The chat ID is configured within the integration script (typically written in Python) to ensure alerts are delivered properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hL_Qpdgz6fAxrfXMUd_mZg.png" /></figure><p><strong>20. Wazuh with Telegram Integration is OK</strong><br>Integration is tested successfully. Wazuh can now send alerts directly to Telegram in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1E5bfnMgzmbEPzm0BR93Q.png" /></figure><p><strong>21. XSS alert in Wazuh</strong><br>An XSS attack is detected by Wazuh based on the defined rules. The system generates a corresponding alert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*394r7FUZPJZpszZYqsefNg.png" /></figure><p><strong>22. Result — XSS alert sent to Telegram</strong><br>The generated XSS alert is successfully delivered to Telegram, confirming end-to-end alerting functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYCm2FNtSxWhOx-G94xKCQ.png" /></figure><p><strong>23. XSS Stored Attack in Wazuh</strong><br>A Stored XSS attack is executed in DVWA, and Wazuh successfully detects it using custom rules and decoders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfGSClX7ovi8VOPaaIidmw.png" /></figure><p><strong>24. Result — Stored XSS alert sent to Telegram</strong><br>The Stored XSS detection alert is sent to Telegram, demonstrating full detection and notification capability for multiple XSS attack types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jpc2n4FLhR_0IL80GohPNw.png" /></figure><h3>Conclusion</h3><p>This lab demonstrated how to build a practical, end-to-end security monitoring pipeline for detecting XSS attacks using DVWA, Apache logs, and the Wazuh SIEM platform. By simulating both Reflected and Stored XSS attacks, it was possible to observe how web-based threats manifest within server logs and how they can be effectively captured and analyzed.</p><p>Through the implementation of custom decoders and rules, deeper visibility into HTTP traffic — especially POST request bodies — was achieved, enabling more accurate detection of complex attack patterns such as DOM-based XSS. Furthermore, integrating Telegram for real-time alerting showcased how security teams can respond promptly to potential threats in a production-like environment.</p><p>Overall, this lab highlights the importance of log analysis, SIEM integration, and proactive alerting in modern cybersecurity operations. It also provides a strong foundation for developing Blue Team capabilities in detecting, analyzing, and responding to web application attacks in real-world scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=839947254933" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ELK Stack (Elasticsearch, Logstash, Kibana) installation and configuration]]></title>
            <link>https://medium.com/@aghaverditk/elk-stack-elasticsearch-logstash-kibana-installation-and-configuration-c27ff03a8689?source=rss-10898a256034------2</link>
            <guid isPermaLink="false">https://medium.com/p/c27ff03a8689</guid>
            <category><![CDATA[ubuntu-server]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[logstash]]></category>
            <category><![CDATA[elk-stack]]></category>
            <dc:creator><![CDATA[Aghaverdi Kalantarli]]></dc:creator>
            <pubDate>Tue, 05 May 2026 10:40:40 GMT</pubDate>
            <atom:updated>2026-05-18T11:58:03.790Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKAk1fMaV6E2JeJUi4vckw.png" /></figure><h3>Introduction</h3><p>In modern IT environments, the ability to efficiently collect, process, and analyze logs is essential for maintaining system reliability, performance, and security. Organizations increasingly rely on centralized logging solutions to gain real-time visibility into their infrastructure and quickly detect anomalies or potential threats. This is where the ELK Stack — composed of Elasticsearch, Logstash, and Kibana — plays a critical role.</p><p>The ELK Stack provides a unified platform for aggregating logs from multiple sources, transforming and processing them, and presenting the data through intuitive visual dashboards. When combined with Filebeat, a lightweight data shipper, the stack enables seamless log forwarding from endpoints to a centralized system for analysis.</p><p>In this article, we walk through a practical, step-by-step implementation of the ELK Stack on an Ubuntu environment. The process covers installation, configuration, integration between components, and validation of log flow — from initial data collection to final visualization in Kibana. This hands-on approach demonstrates how to build a fully functional logging pipeline that can be used for monitoring, troubleshooting, and security analysis in real-world scenarios.</p><ol><li><strong>Installing required packages for Elasticsearch</strong><br>Before installing Elasticsearch, essential dependencies and system packages (such as Java runtime, transport tools, and repository configurations) were installed to ensure a stable and compatible environment.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Op9NL3YCqExTjvDnaQJxhA.png" /></figure><p><strong>2. Installing Elasticsearch</strong><br>Elasticsearch was installed and configured as the core search and indexing engine, responsible for storing and analyzing incoming log data efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Iffz6xcimirxwmUzME9sQ.png" /></figure><p><strong>3. Installing Logstash</strong><br>Logstash was installed to act as a data processing pipeline, enabling log collection, transformation, and forwarding to Elasticsearch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCTLMK6xB_GElEodGrNBpA.png" /></figure><p><strong>4. Installing Kibana</strong><br>Kibana was installed to provide a web-based interface for visualizing and exploring the indexed data stored in Elasticsearch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ht-KpM7w9mr50dPk6vvBng.png" /></figure><p><strong>5. Testing Elasticsearch with a GET request</strong><br>A GET request (e.g., using curl) was performed against the Elasticsearch API to verify that the service was running correctly and responding with valid cluster information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3hNXJGxy6NEVu57ODkkuQ.png" /></figure><p><strong>6. Setting Username and Password for Kibana</strong><br>Authentication credentials were configured to secure access to Kibana, ensuring that only authorized users can access dashboards and system data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKC-IsSGKUKFiLcLGHGGjw.png" /></figure><p><strong>7. Configuring Kibana web server</strong><br>Kibana’s configuration file (e.g., <em>kibana.yml</em>) was updated to define server host, port, and Elasticsearch connection settings, enabling proper communication between services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcwiB49KlSG4xW2B7fM99A.png" /></figure><p><strong>8. Creating a soft link and configuring firewall access</strong><br> A symbolic link was created for easier service management, and Ubuntu firewall rules were updated to allow full access to the Kibana web interface (default port 5601).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1eJuNXzTVm-fgWgstj-mnw.png" /></figure><p><strong>9. Verifying Kibana in browser and checking Beats integration</strong><br>Kibana was accessed via a web browser to confirm successful deployment, and built-in integrations (Beats dashboards and data streams) were reviewed for readiness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHcGFHtYLgmLTQv_R0fsNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s5pvWSLF-USKJOzhlU6wxw.png" /></figure><p><strong>10. Configuring Logstash input Beats in /etc/logstash</strong><br>Within Logstash configuration, input plugins for Beats were defined to receive log data (e.g., from Filebeat) over designated ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LUZYpniJMwtUbArdyBF5A.png" /></figure><p><strong>11. Configuring Logstash output Beats in /etc/logstash</strong><br>Output settings were configured in Logstash to forward processed logs into Elasticsearch indices, ensuring proper data flow and indexing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZFeIpc1Qd1xT3aUl-gjq1Q.png" /></figure><p><strong>12. Testing configuration functionality</strong><br>All configurations were validated using Logstash test commands and service checks to ensure there were no syntax errors or pipeline issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9MTmVVYiUqcEogbrapT26A.png" /></figure><p><strong>13. Installing Filebeat on Ubuntu</strong><br>Filebeat was installed to collect and ship log files from the system to Logstash for further processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICbwlNb5JtMZbuQVbQeV_A.png" /></figure><p><strong>14. Adjusting Filebeat output configuration</strong><br>In the Filebeat configuration file, the Elasticsearch output section was commented out, and the Logstash output section was enabled. This ensures logs are first sent to Logstash for processing before being indexed in Elasticsearch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dYG3PlTOj9ORAeBHpn8sQ.png" /></figure><p><strong>15. Enabling Filebeat modules</strong><br>Relevant Filebeat modules were enabled to simplify log collection for common services (e.g., system logs, authentication logs), providing prebuilt parsing and dashboards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-mqccV0TrCzn4IAnAhuDw.png" /></figure><p><strong>16. Enabling Filebeat output indexing</strong><br>Index templates and output configurations were enabled to ensure that logs are properly structured and stored in Elasticsearch indices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AjZmWN1uNxqmlo2tDqU6pw.png" /></figure><p><strong>17. Restarting Filebeat service and enabling at boot</strong><br>The Filebeat service was restarted and added to system startup (daemonized) to ensure continuous log collection even after system reboots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fHMnimvw4Uk2-DiO32p0A.png" /></figure><p><strong>18. Testing log transmission with curl GET request</strong><br>A GET request was used to query Elasticsearch indices and confirm that logs were successfully received and indexed from Filebeat via Logstash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WAyjWtArgw77HlinL4v2A.png" /></figure><p><strong>19. Verifying logs in Kibana</strong><br>Finally, logs were visualized in Kibana dashboards, confirming end-to-end data flow from source to visualization within the ELK Stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a7N7nW1qYr6B8ZtISfjFJQ.png" /></figure><h3>Conclusion</h3><p>ELK Stack — comprising Elasticsearch, Logstash, and Kibana — provides a powerful and scalable solution for centralized logging and real-time data analysis. By integrating Filebeat as a log shipper, the architecture ensures efficient data collection, processing, and visualization. This step-by-step setup demonstrates how logs can be securely transmitted, transformed, and indexed, ultimately enabling deep insights through intuitive dashboards. Such an implementation is essential for modern system monitoring, troubleshooting, and security analysis in both local and production environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c27ff03a8689" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>