<?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 Muhammed Emir Tohumcu on Medium]]></title>
        <description><![CDATA[Stories by Muhammed Emir Tohumcu on Medium]]></description>
        <link>https://medium.com/@muhammedemirtohumcu?source=rss-a2431fb8b05b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vuvUTev2ZFBJnO8ESisxRw.jpeg</url>
            <title>Stories by Muhammed Emir Tohumcu on Medium</title>
            <link>https://medium.com/@muhammedemirtohumcu?source=rss-a2431fb8b05b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 11:23:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammedemirtohumcu/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[Building a Custom File Integrity Monitoring (FIM) Agent for Linux: ShadowWatch v1.0]]></title>
            <link>https://medium.com/@muhammedemirtohumcu/building-a-custom-file-integrity-monitoring-fim-agent-for-linux-shadowwatch-v1-0-aca78a4db6b9?source=rss-a2431fb8b05b------2</link>
            <guid isPermaLink="false">https://medium.com/p/aca78a4db6b9</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Muhammed Emir Tohumcu]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 07:35:28 GMT</pubDate>
            <atom:updated>2026-06-02T07:37:41.579Z</atom:updated>
            <content:encoded><![CDATA[<h4>A deep dive into engineering a lightweight, continuous File Integrity Monitoring (FIM) agent for Linux from scratch.</h4><p>In the cybersecurity industry, mastering existing tools is essential, but engineering your own tools provides a profound understanding of how operating systems and security mechanisms truly interact. Instead of relying on pre-built enterprise solutions, I decided to engineer a core component of Endpoint Security from the ground up: A File Integrity Monitoring (FIM) agent.</p><p>The result is <strong>ShadowWatch</strong> — a lightweight, continuous monitoring agent designed for Linux environments. It establishes a cryptographic baseline of your system and detects unauthorized modifications in real-time, all deployable via a single-line terminal command.</p><h3>Table of Contents</h3><ol><li>What is File Integrity Monitoring (FIM)?</li><li>Why Build a Custom FIM Agent?</li><li>Architecture &amp; Engineering Decisions</li><li>Installation &amp; Usage (Quick Start)</li><li>Conclusion &amp; Source Code</li></ol><h3>1. What is File Integrity Monitoring (FIM)?</h3><p>File Integrity Monitoring is a foundational security control. It watches over system files, configuration files, and application logs to ensure they have not been tampered with. If a threat actor breaches a server and modifies the /etc/passwd file to create a rogue admin account, or drops a PHP shell into a web directory, a FIM agent is the defensive layer that detects this anomaly by comparing the current file state against a known, secure baseline.</p><h3>2. Why Build a Custom FIM Agent?</h3><p>Advanced Persistent Threats (APTs) often deploy rootkits that can manipulate file timestamps (timestomping) or bypass signature-based legacy antivirus software. I wanted to build a tool that does not rely on easily spoofed metadata.</p><blockquote>Instead, ShadowWatch relies entirely on cryptographic hashing. By building it from scratch, I had total control over its memory footprint, logging architecture, and deployment methodology.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*U8f_F-A4OnweGPocMN_MnQ.png" /><figcaption>ShadowWatch running in the Arch Linux terminal</figcaption></figure><h3>3. Architecture &amp; Engineering Decisions</h3><p>Building an agent that runs 24/7 requires strict attention to performance and reliability. Here are the core technical problems I addressed during development:</p><h4>Cryptographic Validation (SHA-256)</h4><p>To determine if a file has been altered, checking the “last modified” date is insufficient. Instead, ShadowWatch calculates the SHA-256 hash of every monitored file. Due to the avalanche effect in cryptographic hash functions, changing even a single byte in a file will completely alter its resulting hash. SHA-256 offers the optimal balance between collision resistance and CPU efficiency for local endpoint monitoring.</p><h4>Memory Management &amp; Chunking</h4><p>A naive FIM implementation might read an entire file into memory before hashing it. If the agent attempts to hash a 20GB database file or a massive log archive, it will consume all available system RAM and trigger an Out-Of-Memory (OOM) crash. To ensure enterprise-level stability, I implemented a memory-safe data processing architecture:</p><pre>def calculate_file_hash(file_path):<br>    target_path = Path(file_path).expanduser()<br>    hash_object = hashlib.sha256()<br>    # Reading files in 4KB chunks prevents memory overflow<br>    with open(target_path, &#39;rb&#39;) as file:<br>        while True:<br>            chunk_data = file.read(4096)<br>            if not chunk_data:<br>                break<br>            hash_object.update(chunk_data)<br>    return hash_object.hexdigest()</pre><blockquote>By processing files in 4KB chunks, ShadowWatch can hash files of any size while maintaining a minimal CPU and memory footprint.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*T5-NgurDbo2Utq3VAi58Ug.png" /><figcaption>Real-time detection of unauthorized file modifications</figcaption></figure><h4>Continuous Monitoring &amp; The Infinite Loop</h4><p>Security agents do not sleep. ShadowWatch utilizes a while True: loop structure, scanning the target directory, comparing the hashes against the baseline.json file, and then sleeping for a defined interval.</p><p>To improve the Command Line Interface (CLI) experience, I avoided static terminal output. By utilizing carriage returns (\r) in Python, I developed a dynamic spinner and countdown timer. This provides the user with real-time feedback that the agent is actively running in the background without cluttering the terminal history.</p><h4>Preventing Alert Fatigue</h4><p>Modern operating systems and development folders generate a massive amount of noise. Directories like .venv, .idea, or <strong>pycache</strong> change constantly during routine operations. If a FIM agent logs every change in these directories, it creates “Alert Fatigue” for security analysts. I integrated a smart whitelisting system that ignores these dynamic paths, ensuring that when ShadowWatch generates an alert, it is an event that actually requires investigation.</p><h3>4. Installation &amp; Usage (Quick Start)</h3><p>I designed ShadowWatch to feel like a native Linux utility. Instead of requiring users to manually clone repositories, move files, and adjust permissions, I created a one-liner Bash installation script.</p><p>You can install ShadowWatch globally on your Linux system by running the following command in your terminal:</p><pre>curl -sL https://raw.githubusercontent.com/devsecnox/ShadowWatch/main/install.sh | bash</pre><p><strong>How to Run the Agent:</strong></p><ol><li>Once installed, simply type shadowwatch anywhere in your terminal.</li><li>The agent will prompt you for a target directory: [&gt;] Enter the directory path to monitor: /path/to/target</li><li>Upon its first run, it will automatically hash all files in that directory and generate a baseline.json file.</li><li>Leave it running. If any file is modified or a new file is added, the terminal will instantly display a color-coded alert, and the event will be permanently recorded in shadowwatch_alerts.log.</li><li>Press Ctrl+C to gracefully terminate the agent.</li></ol><h3>5. Conclusion &amp; Source Code</h3><p>Engineering ShadowWatch bridged the gap between cybersecurity theory and practical software development. Understanding the mechanics of system reconnaissance, cryptographic hashing, and memory-safe process execution provided me with a profound perspective on how endpoint security truly functions.</p><p>You can review the source code, inspect the installation script, or contribute to the project by visiting my GitHub repository:</p><p><strong>GitHub Repository:</strong> <a href="https://github.com/devsecnox/ShadowWatch">https://github.com/devsecnox/ShadowWatch</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aca78a4db6b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can a Network Error Crash Your Script? Reconnaissance and Fault Tolerance Management with Python]]></title>
            <link>https://medium.com/@muhammedemirtohumcu/can-a-network-error-crash-your-script-reconnaissance-and-fault-tolerance-management-with-python-7b18ba9a454e?source=rss-a2431fb8b05b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b18ba9a454e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[networksecuritykey]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Muhammed Emir Tohumcu]]></dc:creator>
            <pubDate>Wed, 27 May 2026 13:47:43 GMT</pubDate>
            <atom:updated>2026-05-27T19:11:39.789Z</atom:updated>
            <content:encoded><![CDATA[<h4>Moving from a mere tool user to a creator: Why error handling is a necessity, not a luxury, in production-level cybersecurity scripting.</h4><p>In contemporary penetration testing, the vast majority of cybersecurity professionals initiate their assessments with a rigorous reconnaissance phase. But why is this step considered non-negotiable? Reconnaissance, commonly referred to as “recon,” is the strategic process of gathering critical intelligence about a target asset’s blueprint, network footprint, and systemic identity.</p><p>Understanding the target’s operating environment is paramount; it allows pentesters to map attack surfaces accurately, analyze potential vulnerabilities with precision, and optimize execution time during time-sensitive engagements. This is precisely why experienced security practitioners prioritize comprehensive reconnaissance above all else.</p><p><strong>Q1: Why Build a Custom Python Script When Powerful Tools Already Exist?<br></strong>The cybersecurity landscape is saturated with enterprise-grade scanning frameworks and AI-driven automation tools. While these tools are undeniably efficient, relying solely on third-party software creates a knowledge gap. My primary motivation for building this custom script was twofold: to deeply experience the underlying network protocols and to shed light on practical engineering challenges that any developer or security practitioner might encounter in the field. Moving from a mere user to a creator is where true engineering expertise begins.</p><p><strong>Q2: What is the Core “Real-World Problem” This Script Addresses?<br></strong>Code rarely executes in a perfect laboratory environment. In the field, networks drop, firewalls silently drop packets, and target environments experience unexpected connection resets.</p><p>Consider a standard automation script designed to fingerprint a system: it successfully resolves the internal hostname and queries the local interface for the LAN IPv4 footprint. However, the moment it attempts to query a public API to resolve the external WAN IP, the network connection drops or a TCP reset occurs. In a poorly designed script, this external network failure triggers an unhandled exception (like ConnectionError), causing the entire execution loop to terminate instantly. All previously gathered local intelligence is lost, and the security assessment grind halts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*wW2sLkRUs8fzS8847oaCvA.png" /><figcaption>Figure 1: The script gracefully handling a network timeout/disconnect, returning a ‘None’ state for WAN IP instead of crashing.</figcaption></figure><p><strong>Q3: How Does a Simple </strong><strong>try-except Block Become a &quot;Lifesaver&quot; in Production?<br></strong>To simulate and defend against these unpredictable real-world barriers, I implemented a fault-tolerant engine using a robust error-handling architecture.</p><p>The logic is simple yet vital: retrieving a device’s local network signature is an offline operation, but identifying its public boundary demands active routing. If the WAN routing fails due to a network disconnect, why should we lose the local data?</p><p>By encapsulating the external network requests inside a dedicated try-except block targeting requests.RequestException, the tool shifts dynamically. Instead of crashing, it gracefully logs the external failure, returns a None state for the WAN footprint, and safely delivers the comprehensive host and kernel data it already secured. It transforms a fatal error into a non-disruptive state log.</p><pre>try:<br>    # Querying the external infrastructure for WAN footprint<br>    public_ip = requests.get(&quot;https://api.ipify.org&quot;, timeout=3).text<br>except requests.RequestException:<br>    # Fault-tolerance mechanism triggers here<br>    public_ip = &quot;None&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*vCWQuEJT7JqK19O3zDJ_Lw.png" /><figcaption>Figure 2: Successful execution flow and structural reporting under stable network conditions.</figcaption></figure><p><strong>Q4: Is This Project Completed, or Is It Still Evolving?<br></strong>This initial release (v1.0.0) represents a stable, production-ready core infrastructure, but it is by no means a finished story. This project is actively evolving. It was architected as a modular skeleton, meaning this fault-tolerant foundation will serve as the launchpad for advanced capabilities — such as automated port scanners, network sniffers, and deep-dive security log analysis modules — transforming it from a lightweight fingerprinting script into a comprehensive asset discovery engine.</p><p>You can check out the full source code and follow the development journey on my GitHub repository: <a href="https://github.com/devsecnox/system-recon-tool">GitHub — system-recon-tool</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b18ba9a454e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Security Log Analyzer with Python: From Raw Logs to Visual Analytics]]></title>
            <link>https://medium.com/@muhammedemirtohumcu/building-a-security-log-analyzer-with-python-from-raw-logs-to-visual-analytics-9b28c6593c89?source=rss-a2431fb8b05b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b28c6593c89</guid>
            <category><![CDATA[log-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Muhammed Emir Tohumcu]]></dc:creator>
            <pubDate>Fri, 22 May 2026 18:28:47 GMT</pubDate>
            <atom:updated>2026-05-22T23:03:57.511Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s cyber security landscape, monitoring system logs is one of the most critical steps in detecting threats before they escalate. Automated log parsing allows security analysts to quickly sift through thousands of lines of data to find indicators of compromise (IoCs).</p><p>As a Computer Engineering student focusing on the intersection of cyber security and data science, I developed a Python-based Security Log Analyzer to bridge the gap between raw log data and actionable security insights.</p><p>— -</p><h4>The Core Concept &amp; Tech Stack</h4><p>The goal of this project is to simulate server log data, parse critical metrics, and generate visual threat intelligence reports.<br>To build this tool, I utilized:<br>- <strong><em>Python 3.14: </em></strong>For core automation and logic.<br>- <strong><em>Pandas: </em></strong>To handle data cleaning, sorting, and structural analysis.<br>-<strong><em> Seaborn &amp; Matplotlib: </em></strong>To visualize risk distribution and attack frequencies.</p><p>— -</p><h4>Key Features of the Analyzer</h4><p><strong>1.Automated Log Parsing:</strong> The script efficiently processes standard server log structures, isolating IP addresses, timestamps, HTTP methods, and status codes.<br><strong>2.Malicious Pattern Detection: </strong>Using robust Regular Expressions (Regex), the tool flags signatures associated with common web vectors such as Brute-Force, SQL Injection, and Phishing.<br><strong>3.Statistical Data Imputation: </strong>Missing or corrupted fields (NaN) are intelligently handled using statistical methods to maintain dataset integrity.</p><p>— -</p><h4>Visualizing Threat Intelligence</h4><p>One of the most powerful aspects of this project is transforming text logs into visual analytics. The analyzer automatically outputs three distinct chart types:</p><p>- <strong>Attack Type Distribution: </strong>Visualizes which attack vectors are hitting the system most frequently.<br>-<strong> Mitigation vs. Attack Status: </strong>Displays the efficiency of the firewall rules in blocking threats.<br>- <strong>Risk Score Density:</strong> A boxplot and histogram analysis mapping out the severity levels of the detected incidents.</p><p>— -</p><h4>Future Roadmap: Bringing in AI</h4><p>The next iteration of this project involves moving beyond static regex patterns. I am currently planning to integrate Machine Learning models to detect “low-and-slow” anomalies that traditional rules often miss.</p><blockquote>📌 You can check out the full source code and documentation on my GitHub repository: <a href="https://github.com/devsecnox/security-log-analyzer">GitHub Repository</a></blockquote><p><em>Thank you for reading! Feel free to connect with me on </em><a href="http://www.linkedin.com/in/muhammed-emir-tohumcu-aa7296260"><em>LinkedIn</em></a><em> to discuss cyber security, AI, and system development.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b28c6593c89" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>