<?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 Arbnor Mustafa on Medium]]></title>
        <description><![CDATA[Stories by Arbnor Mustafa on Medium]]></description>
        <link>https://medium.com/@arbnormustafa?source=rss-bde878f342ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FZQ47JjQGqIiDTCO</url>
            <title>Stories by Arbnor Mustafa on Medium</title>
            <link>https://medium.com/@arbnormustafa?source=rss-bde878f342ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:05:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arbnormustafa/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[Web Attacks Detection with Wazuh: Path Traversal (Part 1)]]></title>
            <link>https://medium.com/@arbnormustafa/web-attack-detection-with-wazuh-path-traversal-part-1-f52c54893aaf?source=rss-bde878f342ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/f52c54893aaf</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[file-path-traversal]]></category>
            <category><![CDATA[directory-traversal]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[path-traversal]]></category>
            <dc:creator><![CDATA[Arbnor Mustafa]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 23:46:51 GMT</pubDate>
            <atom:updated>2025-10-22T08:52:55.880Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9tbBQ-AEeCJOuSXJ3FYtw.png" /></figure><p>This blog post explores how Wazuh can be used to detect <strong>Path Traversal attacks</strong> in real time, helping SOC analysts identify and respond to web exploitation attempts more effectively. By leveraging Wazuh’s web application monitoring and rule-based detection capabilities, analysts can automatically flag suspicious URL patterns that attempt to access unauthorized directories or sensitive files on a web server.</p><p>For example, when a web request includes sequences such as ../, ..%2F, or other encoded traversal patterns, Wazuh analyzes the request logs and triggers an alert if it detects attempts to move outside the web root directory. The alert includes the source IP, requested URL, and the exact traversal payload used.</p><p>This automation enables the SOC team to quickly identify exploitation attempts, such as those targeting /etc/passwd or configuration files, without manually reviewing access logs. As a result, web attack detection becomes faster, more accurate, and seamlessly integrated into existing Wazuh dashboards and workflows.</p><h3>1. Understanding Path Traversal</h3><p>Path Traversal: also known as <strong>Directory Traversal, </strong>is a common web attack technique that allows an adversary to access files and directories outside the intended web root folder. This is achieved by manipulating variables that reference files with special sequences like ../ (parent directory).</p><p>If a web application does not properly validate user input, an attacker can exploit this weakness to read sensitive files, application source code, or system configurations.</p><p><strong>Example attack request:</strong></p><pre>GET /../../../../etc/passwd HTTP/1.1<br>Host: vulnerable-site.com</pre><p>When the application concatenates user input directly into a file path (e.g., open(&quot;/var/www/html/&quot; + user_input)), it may unintentionally allow traversal to /etc/passwd.</p><p>Real-world impacts include exposure of credentials, database configurations, and even full system compromise if combined with other vulnerabilities.</p><h3>2. Setting Up the Environment</h3><p>For demonstration purposes, we’ll create a small lab that simulates a vulnerable web server.</p><p><strong>Components used:</strong></p><ul><li><strong>Operating System:</strong> Ubuntu 22.04</li><li><strong>Web Server:</strong> Nginx</li><li><strong>Wazuh Agent:</strong> Installed and configured to monitor web logs</li></ul><p>Ensure the NGINX logs are read from Wazuh Agent by appending the following snippet to <strong><em>/var/ossec/etc/ossec.conf</em> </strong>file:</p><pre>&lt;ossec_config&gt;<br>  &lt;localfile&gt;<br>    &lt;log_format&gt;syslog&lt;/log_format&gt;<br>    &lt;location&gt;/var/log/nginx/access.log&lt;/location&gt;<br>  &lt;/localfile&gt;<br><br>  &lt;localfile&gt;<br>    &lt;log_format&gt;syslog&lt;/log_format&gt;<br>    &lt;location&gt;/var/log/nginx/error.log&lt;/location&gt;<br>  &lt;/localfile&gt;<br>&lt;/ossec_config&gt;</pre><p>This configuration instructs the Wazuh Agent to continuously monitor both <strong>access</strong> and <strong>error</strong> logs generated by NGINX. These logs contain HTTP requests and server error events, which are essential for detecting attacks targeting web applications.</p><p>In Wazuh Manager, edit the <strong><em>/var/ossec/etc/rules/local_rules.xml</em></strong>:</p><pre>&lt;group name=&quot;local.web.path_traversal&quot;&gt;<br><br>  &lt;!-- Path traversal (plain ../) --&gt;<br>  &lt;rule id=&quot;201000&quot; level=&quot;12&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;../&lt;/match&gt;<br>    &lt;description&gt;Path traversal detected in HTTP request (../).&lt;/description&gt;<br>    &lt;group&gt;web,path_traversal&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>  &lt;!-- Encoded traversal variants --&gt;<br>  &lt;rule id=&quot;201001&quot; level=&quot;12&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;%2e%2e%2f&lt;/match&gt;<br>    &lt;description&gt;Path traversal detected (URL-encoded %2e%2e/).&lt;/description&gt;<br>    &lt;group&gt;web,path_traversal&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;201002&quot; level=&quot;12&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;%2e%2e%5c&lt;/match&gt;<br>    &lt;description&gt;Path traversal detected (URL-encoded %2e%2e\).&lt;/description&gt;<br>    &lt;group&gt;web,path_traversal&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;201003&quot; level=&quot;12&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;%252e%252e/&lt;/match&gt;<br>    &lt;description&gt;Path traversal detected (double-encoded).&lt;/description&gt;<br>    &lt;group&gt;web,path_traversal&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>  &lt;!-- Sensitive file probes --&gt;<br>  &lt;rule id=&quot;201020&quot; level=&quot;13&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;/etc/passwd&lt;/match&gt;<br>    &lt;description&gt;Sensitive file probe: /etc/passwd.&lt;/description&gt;<br>    &lt;group&gt;web,sensitive_file&lt;/group&gt;<br>  &lt;/rule&gt;<br>  &lt;rule id=&quot;201021&quot; level=&quot;13&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;wp-config.php&lt;/match&gt;<br>    &lt;description&gt;Sensitive file probe: wp-config.php.&lt;/description&gt;<br>    &lt;group&gt;web,sensitive_file&lt;/group&gt;<br>  &lt;/rule&gt;<br>  &lt;rule id=&quot;201022&quot; level=&quot;13&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;.env&lt;/match&gt;<br>    &lt;description&gt;Sensitive file probe: .env.&lt;/description&gt;<br>    &lt;group&gt;web,sensitive_file&lt;/group&gt;<br>  &lt;/rule&gt;<br>  &lt;rule id=&quot;201023&quot; level=&quot;13&quot;&gt;<br>    &lt;if_matched_sid&gt;31101&lt;/if_matched_sid&gt;<br>    &lt;match&gt;.git/&lt;/match&gt;<br>    &lt;description&gt;Attempt to access VCS dir: .git/.&lt;/description&gt;<br>    &lt;group&gt;web,sensitive_file&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>  &lt;!-- Frequency rule (scanner/enumeration) --&gt;<br>  &lt;rule id=&quot;201030&quot; level=&quot;10&quot; frequency=&quot;6&quot; timeframe=&quot;60&quot;&gt;<br>    &lt;if_matched_group&gt;web,path_traversal|web,lfi|web,sensitive_file&lt;/if_matched_group&gt;<br>    &lt;description&gt;Repeated traversal/LFI/sensitive-file attempts (possible scanner).&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>&lt;/group&gt;</pre><p>Reload Wazuh after editing:</p><pre>sudo systemctl restart wazuh-manager</pre><p>These rules perform behavioral analysis to determine whether the activity represents a potential attack. For instance, rules 201000 through 201003 detect various forms of path traversal patterns, both plain (../) and encoded (%2e%2e%2f, %252e%252e/). The purpose of these detections is to identify attempts to move outside the intended web root directory, a common method used by attackers to read restricted files. Rules 201020 through 201023 focus on direct access attempts to sensitive files such as /etc/passwd, .env, and .git/, which are frequently targeted during reconnaissance or configuration exposure attacks. Finally, rule 201030 introduces a frequency condition that correlates multiple alerts within a short time window, allowing Wazuh to detect and escalate repeated probing behavior as a possible automated scanner or enumeration tool.</p><h3>3. Simulating a Path Traversal Attack</h3><p>Once the environment is ready, we can simulate attacks manually using cURL or a browser.<br>Here are some simple test cases:</p><pre>curl -I &quot;http://localhost/../../../../etc/passwd&quot;<br>curl -I &quot;http://localhost/..%2F..%2F..%2F..%2Fetc/passwd&quot;<br>curl -I &quot;http://localhost/%252e%252e%252f%252e%252e%252fetc/passwd&quot;</pre><p>In Nginx access logs, these will appear as:</p><pre>192.168.1.50 - - [13/Oct/2025:10:22:13 +0200] &quot;GET /../../../../etc/passwd HTTP/1.1&quot; 403 298</pre><p>These requests mimic how attackers test for directory traversal vulnerabilities in unpatched web applications.</p><h3>4. Visualizing the Path Traversal Web Attacks</h3><p>Within the Wazuh Dashboard, you can filter alerts using:</p><pre>rule.id: is one of 201023, 201020, 201022</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaPoSpRCm68JxAxGQGCa0g.png" /></figure><p>The picture below outlines some of the fields</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCfZ0YOkPUxUgPjes_-Ajg.png" /></figure><p>Some important fields:</p><ul><li><a href="http://agent.ip/">agent.ip</a>: IPv4 Address of the agent attacked</li><li>data.srcip: IPv4 Address of the attacker</li><li>full_log: full log received</li><li>data.url: the endpoint that was targeted</li><li>data.protocol: the web protocol [GET]</li><li><a href="http://rule.id/">rule.id</a>: the costum rule we created</li></ul><h3>5. Conclusion</h3><p>In this first part of the <strong>Web Attack Detection</strong> series, we demonstrated how Wazuh can detect Path Traversal attempts through real-time log analysis and alerting. By combining rule customization, visualization, and automated response, security teams can move from reactive monitoring to proactive defense.</p><p>In <strong>Part 2</strong>, we’ll dive deeper into <strong>SQL Injection detection, </strong>showing how Wazuh identifies malicious queries, correlates them with threat intelligence feeds, and helps analysts respond faster to exploitation attempts in dynamic web environments.</p><pre>If you have any question, please let me know at<br>https://www.linkedin.com/in/arbnor-mustafa-77490a1b8/ </pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f52c54893aaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WAZUH x MISP Integration]]></title>
            <link>https://medium.com/@arbnormustafa/wazuh-x-misp-integration-1e8c1f3f3da4?source=rss-bde878f342ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e8c1f3f3da4</guid>
            <dc:creator><![CDATA[Arbnor Mustafa]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 12:32:18 GMT</pubDate>
            <atom:updated>2026-01-29T13:29:53.533Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog post discusses how to integrate Wazuh with the MISP API, making threat intelligence correlation much easier for SOC analysts. By automating this process, analysts will no longer have to manually cross-reference Wazuh alerts with MISP to identify potential Indicators of Compromise (IoCs). For example, when an endpoint makes a DNS query, Wazuh extracts the queried domain and checks MISP to see if it appears in any threat intelligence feeds. If a match is found, MISP responds with the relevant event ID and associated metadata for the IoC. Wazuh then automatically generates a high-severity alert labeled “IoC found.” This real-time enrichment allows our SOC team to receive actionable intelligence instantly, improving response times and eliminating the need for manual investigations.</p><p><strong>Workflow</strong></p><p>This workflow enables the real-time correlation of DNS activity on Windows endpoints with actionable threat intelligence sourced from MISP. By integrating Sysmon, Wazuh, and MISP, security teams can enrich endpoint telemetry with external indicators of compromise (IOCs) to surface high-fidelity alerts and accelerate incident response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*--OaHNdRbJrypRRx" /><figcaption>CTI &amp; SIEM workflow</figcaption></figure><p>Here’s how this architecture functions:</p><ol><li>Detection Trigger: A new alert is generated in Wazuh, such as a process creation event or a DNS request.</li><li>Real-Time Query: A custom script intercepts the alert and queries MISP using key artifacts (e.g., destination IP, domain, hash).</li><li>CTI Match: If a match is found in MISP, the alert is enriched with relevant intelligence, including threat level, campaign name, malware family, and more.</li><li>Actionable Alert: The enriched alert is then forwarded to analysts or escalated for automated response, significantly improving the quality of triage.</li></ol><p><strong>Part I — Windows Sysmon</strong></p><p>Download Sysmon and SwiftOnSecurity’s config. They can be found here</p><pre>https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon<br>https://github.com/SwiftOnSecurity/sysmon-config</pre><p>After downloading Sysmon, run the following command to install Sysmon with the SwiftonSecurity config.</p><pre>sysmon.exe -accepteula -i sysmonconfig-export.xml</pre><p>Update the Wazuh Agent to collect sysmon logs</p><pre>PS&gt; notepad.exe &quot;C:\Program Files (x86)\ossec-agent\ossec.conf&quot;</pre><pre>&lt;localfile&gt;<br>  &lt;location&gt;Microsoft-Windows-Sysmon/Operational&lt;/location&gt;<br>  &lt;log_format&gt;eventchannel&lt;/log_format&gt;<br>&lt;/localfile&gt;</pre><p><strong>Part 2 — Wazuh Rules &amp; Decoders</strong></p><p>Configure MISP Rules</p><pre>nano /var/ossec/etc/rules/local_rules.xml</pre><pre>&lt;group name=&quot;misp&quot;&gt;<br>    &lt;rule id=&quot;100620&quot; level=&quot;10&quot;&gt;<br>        &lt;field name=&quot;integration&quot;&gt;misp&lt;/field&gt;<br>        &lt;match&gt;misp&lt;/match&gt;<br>        &lt;description&gt;MISP Events&lt;/description&gt;<br>        &lt;options&gt;no_full_log&lt;/options&gt;<br>    &lt;/rule&gt;<br>    &lt;rule id=&quot;100621&quot; level=&quot;5&quot;&gt;<br>        &lt;if_sid&gt;100620&lt;/if_sid&gt;<br>        &lt;field name=&quot;misp.error&quot;&gt;\.+&lt;/field&gt;<br>        &lt;description&gt;MISP: API Issues&lt;/description&gt;<br>        &lt;group&gt;misp_error&lt;/group&gt;<br>    &lt;/rule&gt;<br>    &lt;rule id=&quot;100622&quot; level=&quot;12&quot;&gt;<br>        &lt;field name=&quot;misp.category&quot;&gt;\.+&lt;/field&gt;<br>        &lt;description&gt;MISP: IoC found&lt;/description&gt;<br>        &lt;group&gt;misp_alert&lt;/group&gt;<br>    &lt;/rule&gt;<br>&lt;/group&gt;</pre><p>Append the MISP configuration at Wazuh Config</p><pre>nano /var/ossec/etc/ossec.conf</pre><pre>&lt;ossec_config&gt;<br>  &lt;integration&gt;<br>      &lt;name&gt;custom-misp&lt;/name&gt;<br>      &lt;group&gt;sysmon_event1,sysmon_event3,sysmon_event6,sysmon_event7,sysmon_event_15,sysmon_event_22,syscheck&lt;/group&gt;<br>      &lt;alert_format&gt;json&lt;/alert_format&gt;<br>  &lt;/integration&gt;<br>&lt;/ossec_config&gt;</pre><p>On the Sysmon Rule file (0595-win-sysmon_rules.xml), update the Sysmon Windows rule level from 0 to 3 in order to see DNS queries on the Wazuh dashboard.</p><pre>nano /var/ossec/ruleset/rules/0595-win-sysmon_rules.xml</pre><pre>&lt;rule id=&quot;61650&quot; level=&quot;3&quot; overwrite=&quot;yes&quot;&gt;<br>    &lt;if_sid&gt;61600&lt;/if_sid&gt;<br>    &lt;field name=&quot;win.system.eventID&quot;&gt;^22$&lt;/field&gt;<br>    &lt;description&gt;Sysmon - Event 22: DNS Query event&lt;/description&gt;<br>    &lt;options&gt;no_full_log&lt;/options&gt;<br>    &lt;group&gt;sysmon_event_22,&lt;/group&gt;<br>&lt;/rule&gt;</pre><pre>systemctl restart wazuh-manager</pre><p><strong>Part 3 — Wazuh x MISP Integration</strong></p><p>Use the following script to integrate Wazuh with MISP</p><pre>sudo nano /var/ossec/integrations/custom-misp</pre><pre>#!/var/ossec/framework/python/bin/python3<br>import sys<br>import os<br>from socket import socket, AF_UNIX, SOCK_DGRAM<br>from datetime import date, datetime, timedelta<br>import time<br>import requests<br>from requests.exceptions import ConnectionError<br>import json<br>import ipaddress<br>import hashlib<br>import re<br>pwd = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))<br>socket_addr = &quot;{0}/queue/sockets/queue&quot;.format(pwd)<br>def send_event(msg, agent=None):<br>    if not agent or agent[&quot;id&quot;] == &quot;000&quot;:<br>        string = &quot;1:misp:{0}&quot;.format(json.dumps(msg))<br>    else:<br>        string = &quot;1:[{0}] ({1}) {2}-&gt;misp:{3}&quot;.format(<br>            agent[&quot;id&quot;],<br>            agent[&quot;name&quot;],<br>            agent[&quot;ip&quot;] if &quot;ip&quot; in agent else &quot;any&quot;,<br>            json.dumps(msg),<br>        )<br>    sock = socket(AF_UNIX, SOCK_DGRAM)<br>    sock.connect(socket_addr)<br>    sock.send(string.encode())<br>    sock.close()<br>false = False<br># Read configuration parameters<br>alert_file = open(sys.argv[1])<br># Read the alert file<br>alert = json.loads(alert_file.read())<br>alert_file.close()<br># New Alert Output if MISP Alert or Error calling the API<br>alert_output = {}<br># MISP Server Base URL<br>misp_base_url = &quot;https://misp.local/attributes/restSearch/&quot;<br># MISP Server API AUTH KEY<br>misp_api_auth_key = &quot;&quot;<br># API - HTTP Headers<br>misp_apicall_headers = {<br>    &quot;Content-Type&quot;: &quot;application/json&quot;,<br>    &quot;Authorization&quot;: f&quot;{misp_api_auth_key}&quot;,<br>    &quot;Accept&quot;: &quot;application/json&quot;,<br>}<br>## Extract Sysmon for Windows/Sysmon for Linux and Sysmon Event ID<br>event_source = alert[&quot;rule&quot;][&quot;groups&quot;][0]<br>event_type = alert[&quot;rule&quot;][&quot;groups&quot;][2]<br>## Regex Pattern used based on SHA256 lenght (64 characters)<br>regex_file_hash = re.compile(&quot;\w{64}&quot;)<br>if event_source == &quot;windows&quot;:<br>    if event_type == &quot;sysmon_event1&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    elif (<br>        event_type == &quot;sysmon_event3&quot;<br>        and alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;destinationIsIpv6&quot;] == &quot;false&quot;<br>    ):<br>        try:<br>            dst_ip = alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;destinationIp&quot;]<br>            if ipaddress.ip_address(dst_ip).is_global:<br>                wazuh_event_param = dst_ip<br>            else:<br>                sys.exit()<br>        except IndexError:<br>            sys.exit()<br>    elif (<br>        event_type == &quot;sysmon_event3&quot;<br>        and alert_output[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;destinationIsIpv6&quot;] == &quot;true&quot;<br>    ):<br>        sys.exit()<br>    elif event_type == &quot;sysmon_event6&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    elif event_type == &quot;sysmon_event7&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    elif event_type == &quot;sysmon_event_15&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    elif event_type == &quot;sysmon_event_22&quot;:<br>        try:<br>            wazuh_event_param = alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;queryName&quot;]<br>        except IndexError:<br>            sys.exit()<br>    elif event_type == &quot;sysmon_event_23&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    elif event_type == &quot;sysmon_event_24&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    elif event_type == &quot;sysmon_event_25&quot;:<br>        try:<br>            wazuh_event_param = regex_file_hash.search(<br>                alert[&quot;data&quot;][&quot;win&quot;][&quot;eventdata&quot;][&quot;hashes&quot;]<br>            ).group(0)<br>        except IndexError:<br>            sys.exit()<br>    else:<br>        sys.exit()<br>    misp_search_value = &quot;value:&quot; f&quot;{wazuh_event_param}&quot;<br>    misp_search_url = &quot;&quot;.join([misp_base_url, misp_search_value])<br>    try:<br>        misp_api_response = requests.get(<br>            misp_search_url, headers=misp_apicall_headers, verify=False<br>        )<br>    except ConnectionError:<br>        alert_output[&quot;misp&quot;] = {}<br>        alert_output[&quot;integration&quot;] = &quot;misp&quot;<br>        alert_output[&quot;misp&quot;][&quot;error&quot;] = &quot;Connection Error to MISP API&quot;<br>        send_event(alert_output, alert[&quot;agent&quot;])<br>    else:<br>        misp_api_response = misp_api_response.json()<br>        # Check if response includes Attributes (IoCs)<br>        if misp_api_response[&quot;response&quot;][&quot;Attribute&quot;]:<br>            # Generate Alert Output from MISP Response<br>            alert_output[&quot;misp&quot;] = {}<br>            alert_output[&quot;integration&quot;] = &quot;misp&quot;<br>            alert_output[&quot;misp&quot;][&quot;source&quot;] = {}<br>            alert_output[&quot;misp&quot;][&quot;event_id&quot;] = misp_api_response[&quot;response&quot;][<br>                &quot;Attribute&quot;<br>            ][0][&quot;event_id&quot;]<br>            alert_output[&quot;misp&quot;][&quot;category&quot;] = misp_api_response[&quot;response&quot;][<br>                &quot;Attribute&quot;<br>            ][0][&quot;category&quot;]<br>            alert_output[&quot;misp&quot;][&quot;value&quot;] = misp_api_response[&quot;response&quot;][&quot;Attribute&quot;][<br>                0<br>            ][&quot;value&quot;]<br>            alert_output[&quot;misp&quot;][&quot;type&quot;] = misp_api_response[&quot;response&quot;][&quot;Attribute&quot;][<br>                0<br>            ][&quot;type&quot;]<br>            alert_output[&quot;misp&quot;][&quot;source&quot;][&quot;description&quot;] = alert[&quot;rule&quot;][&quot;description&quot;]<br>            send_event(alert_output, alert[&quot;agent&quot;])<br>elif event_source == &quot;linux&quot;:<br>    if (<br>        event_type == &quot;sysmon_event3&quot;<br>        and alert[&quot;data&quot;][&quot;eventdata&quot;][&quot;destinationIsIpv6&quot;] == &quot;false&quot;<br>    ):<br>        try:<br>            dst_ip = alert[&quot;data&quot;][&quot;eventdata&quot;][&quot;DestinationIp&quot;]<br>            if ipaddress.ip_address(dst_ip).is_global:<br>                wazuh_event_param = dst_ip<br>                misp_search_value = &quot;value:&quot; f&quot;{wazuh_event_param}&quot;<br>                misp_search_url = &quot;&quot;.join([misp_base_url, misp_search_value])<br>                try:<br>                    misp_api_response = requests.get(<br>                        misp_search_url, headers=misp_apicall_headers, verify=False<br>                    )<br>                except ConnectionError:<br>                    alert_output[&quot;misp&quot;] = {}<br>                    alert_output[&quot;integration&quot;] = &quot;misp&quot;<br>                    alert_output[&quot;misp&quot;][&quot;error&quot;] = &quot;Connection Error to MISP API&quot;<br>                    send_event(alert_output, alert[&quot;agent&quot;])<br>                else:<br>                    misp_api_response = misp_api_response.json()<br>                    # Check if response includes Attributes (IoCs)<br>                    if misp_api_response[&quot;response&quot;][&quot;Attribute&quot;]:<br>                        # Generate Alert Output from MISP Response<br>                        alert_output[&quot;misp&quot;] = {}<br>                        alert_output[&quot;integration&quot;] = &quot;misp&quot;<br>                        alert_output[&quot;misp&quot;][&quot;event_id&quot;] = misp_api_response[<br>                            &quot;response&quot;<br>                        ][&quot;Attribute&quot;][0][&quot;event_id&quot;]<br>                        alert_output[&quot;misp&quot;][&quot;category&quot;] = misp_api_response[<br>                            &quot;response&quot;<br>                        ][&quot;Attribute&quot;][0][&quot;category&quot;]<br>                        alert_output[&quot;misp&quot;][&quot;value&quot;] = misp_api_response[&quot;response&quot;][<br>                            &quot;Attribute&quot;<br>                        ][0][&quot;value&quot;]<br>                        alert_output[&quot;misp&quot;][&quot;type&quot;] = misp_api_response[&quot;response&quot;][<br>                            &quot;Attribute&quot;<br>                        ][0][&quot;type&quot;]<br>                        send_event(alert_output, alert[&quot;agent&quot;])<br>            else:<br>                sys.exit()<br>        except IndexError:<br>            sys.exit()<br>    else:<br>        sys.exit()<br>elif event_source == &quot;ossec&quot; and event_type == &quot;syscheck_entry_added&quot;:<br>    try:<br>        wazuh_event_param = alert[&quot;syscheck&quot;][&quot;sha256_after&quot;]<br>    except IndexError:<br>        sys.exit()<br>    misp_search_value = &quot;value:&quot; f&quot;{wazuh_event_param}&quot;<br>    misp_search_url = &quot;&quot;.join([misp_base_url, misp_search_value])<br>    try:<br>        misp_api_response = requests.get(<br>            misp_search_url, headers=misp_apicall_headers, verify=false<br>        )<br>    except ConnectionError:<br>        alert_output[&quot;misp&quot;] = {}<br>        alert_output[&quot;integration&quot;] = &quot;misp&quot;<br>        alert_output[&quot;misp&quot;][&quot;error&quot;] = &quot;Connection Error to MISP API&quot;<br>        send_event(alert_output, alert[&quot;agent&quot;])<br>    else:<br>        misp_api_response = misp_api_response.json()<br>        # Check if response includes Attributes (IoCs)<br>        if misp_api_response[&quot;response&quot;][&quot;Attribute&quot;]:<br>            # Generate Alert Output from MISP Response<br>            alert_output[&quot;misp&quot;] = {}<br>            alert_output[&quot;integration&quot;] = &quot;misp&quot;<br>            alert_output[&quot;misp&quot;][&quot;event_id&quot;] = misp_api_response[&quot;response&quot;][<br>                &quot;Attribute&quot;<br>            ][0][&quot;event_id&quot;]<br>            alert_output[&quot;misp&quot;][&quot;category&quot;] = misp_api_response[&quot;response&quot;][<br>                &quot;Attribute&quot;<br>            ][0][&quot;category&quot;]<br>            alert_output[&quot;misp&quot;][&quot;value&quot;] = misp_api_response[&quot;response&quot;][&quot;Attribute&quot;][<br>                0<br>            ][&quot;value&quot;]<br>            alert_output[&quot;misp&quot;][&quot;type&quot;] = misp_api_response[&quot;response&quot;][&quot;Attribute&quot;][<br>                0<br>            ][&quot;type&quot;]<br>            send_event(alert_output, alert[&quot;agent&quot;])<br>else:<br>    sys.exit()</pre><p>*This script was created by Taylor Walton (SOCFortress)</p><p>From the script, make sure to replace the <em>misp.local</em> with your MISP URL</p><pre>misp_base_url = &quot;https://misp.local/attributes/restSearch/&quot;</pre><p>and your MISP API key</p><pre>misp_api_auth_key = &quot;&quot;</pre><p>After the script has been created, set the appropriate permissions:</p><pre>chown root:wazuh /var/ossec/integrations/custom-misp<br>chmod 750 /var/ossec/integrations/custom-misp<br>systemctl restart wazuh-manager</pre><p><strong>Part 4 — Testing</strong></p><p>From the Windows 11 endpoint where Sysmon is configured, execute a ping command to the domain chemsentinel[.]com or any other up to date malicious domain.</p><pre>ping chemsentinel[.]com</pre><p>The DNS query is captured and forwarded to Wazuh, which then triggers the Windows-Sysmon Rule that does a real-time lookup against MISP for threat intelligence correlation. In this scenario, the domain chemsentinel[.]com exists in MISP’s threat database, marking it as suspicious. As a result, Wazuh generates an alert and displays it on the analyst dashboard, indicating that a potentially malicious domain was queried by an endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JEDPZuJur43D6Zbd" /><figcaption>MISP IoC visualized on Wazuh</figcaption></figure><p><strong>Conclusion</strong></p><p>SOC Level 1 analysts are overwhelmed not by lack of tools, but by disconnected tools. Static CTI feeds, repetitive alert handling, and limited context all contribute to burnout and reduced detection efficiency. By adopting event-driven CTI correlation, organizations can close the operational gap between threat intelligence and detection empowering analysts with real-time, actionable insights that make triage faster, smarter, and more accurate.</p><p>Threat intelligence is only useful if it’s used. Let’s stop letting it sit idle.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e8c1f3f3da4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>