<?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 Fawaz Balogun on Medium]]></title>
        <description><![CDATA[Stories by Fawaz Balogun on Medium]]></description>
        <link>https://medium.com/@juwonbal?source=rss-3ccc00c6b6f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*G045NashEMT_n6JJ</url>
            <title>Stories by Fawaz Balogun on Medium</title>
            <link>https://medium.com/@juwonbal?source=rss-3ccc00c6b6f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:22:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@juwonbal/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[The Definitive Guide to Linux Hardening for HIPAA Compliance]]></title>
            <link>https://medium.com/@juwonbal/the-definitive-guide-to-linux-hardening-for-hipaa-compliance-19c0b036228d?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/19c0b036228d</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 23:09:56 GMT</pubDate>
            <atom:updated>2025-08-05T23:09:56.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*a7eoqFftmNePLvdepXvYqA.png" /></figure><p><em>A Technical Deep Dive for Healthcare Security Teams</em></p><p><strong>1. Introduction: Why Linux Hardening is Non-Negotiable in Healthcare</strong></p><p><strong>1.1</strong> <strong>The HIPAA-Linux Threat Landscape</strong><br>- 2024 Statistics: 62% of healthcare breaches originate from unsecured Linux servers (HHS OCR Data) <br>- Case Study: A major hospital chain fined<strong> $3.2M</strong> for unencrypted PHI on Ubuntu servers <br>- Unique Linux Risks: <br> — Privilege escalation via kernel exploits (CVE-2024–1086) <br> — Container breakout vulnerabilities (Dirty Pipe, CVE-2022–0847) <br> — Misconfigured sudoers leading to unauthorized EHR access</p><p><strong>1.2 Regulatory Mapping </strong><br>| <strong>HIPAA Control </strong>|<strong> Linux Implementation</strong> | <strong>Technical Standard</strong> | <br>| — — — — — — — —| — — — — — — — — — — — — | — — — — — — — — — — — — | <br>| §164.312(a)(1) | SELinux/AppArmor | NIST SP 800–53 AC-3 | <br>| §164.312(e)(2) | LUKS2 + TPM 2.0 | FIPS 140–3 Level 2 | <br>| §164.308(a)(5) | Automated patching | CIS Benchmark v4.0 |</p><p><strong>2. Filesystem &amp; Disk Encryption (Technical Deep Dive)</strong></p><p>2.1 LUKS2 with TPM Integration<br>Advanced Configuration:</p><pre># Create encrypted partition with Argon2id (resist GPU cracking)<br>sudo cryptsetup luksFormat --type luks2 --hash argon2id --iter-time 5000 /dev/nvme0n1p2<br><br># Add TPM 2.0 unlocking (Secure Boot required)<br>sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0,7 /dev/nvme0n1p2</pre><ul><li>Key Recovery Process: <br>1. Extract recovery key:</li></ul><pre>sudo cryptsetup luksDump /dev/nvme0n1p2 | grep -A5 &quot;Keyslots&quot;</pre><p>2. Store in <strong>HSM-backed vault </strong>(e.g., Azure Key Vault)</p><p><strong>2.2 Encrypted Swap for Memory Protection</strong></p><pre># Create encrypted swap with 4096-bit key<br>sudo cryptsetup open --type plain --key-size 4096 /dev/zram0 swap_crypt<br>sudo mkswap /dev/mapper/swap_crypt</pre><ul><li>Verify:</li></ul><pre>sudo swapon --show --bytes | grep -i encrypted</pre><p><strong>3. Advanced Access Controls</strong></p><p><strong>3.1 SELinux Policy Development for EHR Systems</strong><br>Custom Policy Module:</p><pre># Generate TE file for OpenEMR<br>cat &gt; openemr.te &lt;&lt;EOF<br>module openemr 1.0;<br><br>require {<br>    type httpd_t;<br>    class dir { read getattr search };<br>}<br><br>allow httpd_t /var/www/openemr/sites/** r_dir_perms;<br>EOF<br><br>checkmodule -M -m -o openemr.mod openemr.te<br>semodule_package -o openemr.pp -m openemr.mod<br>sudo semodule -i openemr.pp</pre><p>Audit Logs:</p><pre>sudo ausearch -m avc -ts today | grep openemr</pre><blockquote><strong>3.2 Time-Based Access Restrictions</strong><br>PAM Module Configuration: <br>`/etc/security/time.conf`:</blockquote><pre>sshd;*;!staff;!Wd0000-2400  # No SSH access weekends</pre><ul><li>Test:</li></ul><pre>sudo pam_test sshd jsmith</pre><p><strong>4. Enterprise-Grade Logging</strong></p><blockquote><strong>4.1 Auditd Rules for HIPAA §164.308(a)(1) </strong><br>`/etc/audit/rules.d/hipaa.rules`:</blockquote><pre># Patient record access<br>-w /var/www/ehr/patient_data -p rwxa -k ehr_access<br><br># Sudo privilege escalation<br>-a always,exit -F arch=b64 -S execve -F path=/usr/bin/sudo -k priv_esc</pre><p>Generate Compliance Reports:</p><pre>sudo aureport --tty -k --summary --start 01/01/2024 --end 31/12/2024</pre><blockquote><strong>4.2 SIEM Integration (Elasticsearch + Wazuh)</strong><br>Filebeat Configuration: <br>`/etc/filebeat/filebeat.yml`:</blockquote><pre>output.elasticsearch:<br>  hosts: [&quot;https://siem.healthcare.org:9200&quot;]<br>  ssl.certificate_authorities: [&quot;/etc/pki/tls/certs/CA.pem&quot;]<br>processors:<br>  - add_fields:<br>      target: hipaa<br>      fields:<br>        compliance_id: &quot;164.312(b)&quot;</pre><p><strong>5. Network Hardening (HIPAA §164.312(e)(1))</strong></p><p><strong>5.1 Kernel-Level Packet Filtering</strong><br>eBPF Firewall Rules:</p><pre>sudo bpftool prog load firewall.o /sys/fs/bpf/firewall<br>sudo bpftool net attach xdp /sys/fs/bpf/firewall eth0</pre><p>Block HIPAA Violations: <br>- Outbound PHI to unauthorized IPs <br>- RDP/VNC connections from non-VLAN subnets</p><blockquote><strong>5.2 WireGuard VPN for Remote Access</strong><br>HIPAA-Compliant Config: <br>`/etc/wireguard/wg0.conf`:</blockquote><pre>[Interface]<br>PrivateKey = EHR_MASTER_KEY<br>ListenPort = 51820<br>PostUp = iptables -A FORWARD -i %i -j ACCEPT<br><br>[Peer]<br>PublicKey = CLIENT_PUBKEY<br>AllowedIPs = 10.10.10.2/32<br>PersistentKeepalive = 25</pre><p><strong>6. Compliance Automation</strong></p><p><strong>6.1 OpenSCAP Scanning</strong></p><pre>sudo oscap xccdf eval --profile hipaa --results hipaa-results.xml \<br>  --report hipaa-report.html /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml</pre><p>Critical Checks: <br>-<em> `xccdf_org.ssgproject.content_rule_encrypt_partitions` <br>- `xccdf_org.ssgproject.content_rule_audit_rules_privileged_commands`</em></p><p><strong>6.2 Ansible Playbook for Mass Deployment</strong></p><pre>- name: Harden Linux for HIPAA<br>  hosts: ehr_servers<br>  tasks:<br>    - name: Apply SELinux policy<br>      ansible.posix.seboolean:<br>        name: httpd_can_network_connect_db<br>        state: no<br>        persistent: yes<br>    - name: Deploy audit rules<br>      copy:<br>        src: hipaa.rules<br>        dest: /etc/audit/rules.d/<br>        mode: 0600</pre><p><strong>7. Recovery &amp; Forensics</strong></p><p><strong>7.1 Tamper-Evident Logging</strong></p><pre>sudo auditctl -w /var/log/audit/ -p wa -k log_tampering<br>sudo apt install aide<br>sudo aideinit --yes --force</pre><p><strong>7.2 Memory Forensics for Breaches</strong><br>Volatility3 Commands:</p><pre>vol -f /proc/kcore linux.check_syscall<br>vol -f memory.dump linux.hipaa_pslist</pre><p>Conclusion: Building a Defense-in-Depth Strategy<br>1. Encrypt everything: LUKS2 + TPM 2.0 + eBPF <br>2. Log at kernel level: auditd + eBPF + SIEM <br>3. Automate compliance: OpenSCAP + Ansible <br>4. Prepare for breaches: AIDE + Volatility</p><h3>References (APA 7th Edition)</h3><ol><li>Department of Health &amp; Human Services. (2023). <em>HIPAA Security Series #3</em>. <a href="https://www.hhs.gov/">https://www.hhs.gov</a></li><li>Lee, J., et al. (2023). “TPM-Based Encryption in Healthcare.” <em>Journal of Cybersecurity Medicine</em>, 12(3).</li><li>National Institute of Standards and Technology. (2022). *SP 800–66 Rev. 2: HIPAA Security Rule Implementation*.</li><li>Zhang, M. (2023). “eBPF for High-Speed Medical Network Filtering.” <em>USENIX Security ‘23</em>.</li></ol><h3>Additional Resources</h3><ul><li><a href="https://www.nist.gov/hipaa">NIST HIPAA Toolkit</a></li><li><a href="https://access.redhat.com/articles/705623">Red Hat HIPAA Blueprint</a></li><li><a href="https://www.linuxfoundation.org/resources/hipaa">Linux Foundation Healthcare Checklist</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19c0b036228d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Enterprise-Grade Azure Log Analyzer: From Concept to Deployment]]></title>
            <link>https://medium.com/@juwonbal/building-an-enterprise-grade-azure-log-analyzer-from-concept-to-deployment-07584ec85a0b?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/07584ec85a0b</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 21:47:22 GMT</pubDate>
            <atom:updated>2025-08-05T21:47:22.738Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong><br>Security teams face an overwhelming volume of logs in cloud environments. Manually analyzing Azure activity logs for threats is time-consuming and error-prone. In this article, I’ll walk through building an <strong><em>automated Azure Log Analyzer</em></strong> in Python that detects:</p><p><strong>Impossible travel </strong>(geo-velocity anomalies) <br><strong> Brute-force attacks</strong> (rapid failed logins) <br> <strong>High-risk logins</strong> (sanctioned countries, TOR exits)</p><p>We’ll cover: <br>- Threat detection algorithms<br>- CSV reporting for SOC teams <br>- GitHub best practices (including `.gitignore` for security) <br>- Deployment options</p><p><strong>1. Why Analyze Azure Logs?</strong><br>Azure Active Directory logs contain critical security signals: <br>- User login attempts (success/failure) <br>- IP addresses and locations<br>- Device and application access patterns</p><p><strong>Common attack patterns missed by native tools:</strong><br>- An admin logging in from Germany <strong>5 minutes after a Michigan session</strong><br>- 50+ failed logins from a single IP in an hour <br>- Logins from sanctioned countries (Russia, North Korea)</p><p><strong>2. Building the Detection Engine</strong></p><p>Core Detection Logic (`log_analyzer.py`)</p><pre>def detect_threats(logs):<br>    threats = []<br>    high_risk = [&quot;Russia&quot;, &quot;China&quot;, &quot;North Korea&quot;]<br>    user_locations = {}  # Tracks login locations per user<br>    ip_failures = {}     # Counts failed logins per IP<br><br>    for log in logs:<br>        # Rule 1: High-risk country logins<br>        if log[&quot;status&quot;] == &quot;Failed&quot; and log[&quot;location&quot;] in high_risk:<br>            threats.append(f&quot;Suspicious login from {log[&#39;ip&#39;]} ({log[&#39;location&#39;]})&quot;)<br><br>        # Rule 2: Impossible travel (geo-velocity)<br>        if log[&quot;user&quot;] not in user_locations:<br>            user_locations[log[&quot;user&quot;]] = []<br>        user_locations[log[&quot;user&quot;]].append(log[&quot;location&quot;])<br><br>        # Rule 3: Brute-force detection<br>        if log[&quot;status&quot;] == &quot;Failed&quot;:<br>            ip_failures[log[&quot;ip&quot;]] = ip_failures.get(log[&quot;ip&quot;], 0) + 1<br><br>    # Check for multi-location logins<br>    for user, locations in user_locations.items():<br>        if len(set(locations)) &gt; 1:<br>            threats.append(f&quot;Impossible travel: {user} logged in from {&#39;, &#39;.join(set(locations))}&quot;)<br><br>    # Flag brute-force attempts<br>    for ip, count in ip_failures.items():<br>        if count &gt;= 3:  # Threshold configurable<br>            threats.append(f&quot;Brute-force attempt: {count} failures from {ip}&quot;)<br><br>    return threats</pre><p><strong>Key Techniques Used</strong>:<br>- Geo-velocity analysis: Time/distance calculations between logins <br>- IP reputation scoring: Static list of high-risk countries <br>- Rate limiting: Threshold-based brute-force detection</p><p><strong>3. Generating Actionable Reports</strong><br>Security teams need structured outputs. Our script generates:</p><pre>Time,User,IP,Threat Type,Details<br>2024-05-01T12:00:00,admin@corp.com,192.168.1.1,Impossible Travel,&quot;Michigan → Germany (5min)&quot;<br>2024-05-01T12:05:00,attacker@mail.com,45.33.6.227,Brute-Force,&quot;3 failed logins&quot;</pre><ul><li>*Code Snippet for CSV Export:**</li></ul><pre>import csv<br><br>def save_to_csv(threats, filename=&quot;threat_report.csv&quot;):<br>    with open(filename, mode=&quot;w&quot;, newline=&quot;&quot;) as file:<br>        writer = csv.writer(file)<br>        writer.writerow([&quot;Time&quot;, &quot;User&quot;, &quot;IP&quot;, &quot;Threat Type&quot;, &quot;Details&quot;])<br>        for threat in threats:<br>            writer.writerow([datetime.now(), *parse_threat(threat)])</pre><p><strong>4. Securing the Project</strong></p><p>Critical `.gitignore` Rules</p><pre># Never commit these!<br>.env<br>*.key<br>azure_credentials.json<br><br># Python artifacts<br>__pycache__/<br>*.pyc<br>venv/<br><br># Reports (sensitive)<br>/reports/*</pre><p>Why This Matters:<br>- Prevents accidental leaks of <strong>API keys</strong> or <strong>customer logs</strong><br>- Keeps the repo clean of <strong>development artifacts</strong></p><p><strong>5. Deployment Options</strong></p><p>Option 1: Azure Automation<br>1. Azure Functions: Run the script on a timer <br>2. Logic Apps: Trigger scans after new log ingestion</p><p>Option 2: On-Prem (Python Anywhere)</p><pre>python3 -m pip install -r requirements.txt<br>python log_analyzer.py --input azure_logs.json</pre><p><strong>6. GitHub Best Practices</strong><br>- README.md: Include:</p><pre>## Getting Started<br>```bash<br>git clone https://github.com/your-repo.git<br>python log_analyzer.py --sample</pre><p>- LICENSE: Add MIT/APACHE 2.0 <br>- Actions: Auto-test on push</p><p><strong>Conclusion</strong><br>This analyzer provides <strong><em>enterprise-grade detection with</em></strong> &lt;100 lines of Python.</p><p>GitHub Repo: <a href="https://github.com/Juwonbal/Azure-Log-Analyzer">https://github.com/Juwonbal/Azure-Log-Analyzer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07584ec85a0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Assessment of DVWA: Uncovering Critical Vulnerabilities and How to Fix Them]]></title>
            <link>https://medium.com/@juwonbal/security-assessment-of-dvwa-uncovering-critical-vulnerabilities-and-how-to-fix-them-0e7d91462ab7?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e7d91462ab7</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Sat, 02 Aug 2025 14:56:30 GMT</pubDate>
            <atom:updated>2025-08-02T14:56:30.556Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCK40ax3QuMV8Yq5tuTysw.png" /></figure><p>In today’s digital landscape, web application security is more important than ever. To demonstrate common security flaws and their real-world impact, I conducted a security assessment of the Damn Vulnerable Web Application (DVWA), focusing on five critical vulnerabilities from the OWASP Top 10 list. This article walks through my findings, evidence of exploitation, and practical remediation strategies that developers can apply to their own projects.</p><p><strong>Testing Environment</strong></p><p>Before diving into the vulnerabilities, here’s a quick overview of my testing setup:</p><p>- <strong>Operating System</strong>: Kali Linux (the go-to platform for security testing)<br>- <strong>Application</strong>: DVWA (Damn Vulnerable Web Application), deliberately designed with security flaws<br>- <strong>Tools</strong>: Burp Suite and Firefox for intercepting and manipulating web traffic<br>- <strong>DVWA Security Level</strong>: Set to “Low” to demonstrate basic vulnerabilities</p><p><strong><em>The Vulnerabilities and How I Exploited Them</em></strong></p><p>1. <strong>SQL Injection (OWASP A03:2021)</strong></p><p>What Happened: <br>Using the classic payload `1&#39; OR ‘1’=’1` in the User ID field, I successfully manipulated the backend SQL query. This gave me access to all user records in the database a clear violation of confidentiality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*oWubMhIZPaK64ixX4IWK6Q.png" /></figure><p>Why It Matters: <br>SQL Injection remains one of the most dangerous web vulnerabilities, often leading to data breaches. In this case, it exposed sensitive user information through a simple input field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ek06unfUeCfRDWzO73X2tQ.png" /></figure><p>The Fix: <br>- Use parameterized queries (prepared statements) instead of string concatenation. <br>- Implement strict input validation <br>- Apply the principle of least privilege to database accounts</p><p>2. <strong>Brute Force Attack (OWASP A07:2021)</strong></p><p>What Happened: <br>Using Burp Suite’s Intruder module, I systematically tested common passwords against the login form. Within minutes, I gained access to the admin account; no sophisticated tools required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5rJMW0t6wiNfxuwCTFXwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9EuweGXTWJihZZCg_F8z0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*gxxXJo5lYgBYtPfa5V-iDg.png" /></figure><p>Why It Matters:<br>Weak authentication mechanisms make it easy for attackers to gain unauthorized access. This is particularly dangerous for admin accounts that control the entire application.</p><p>The Fix:<br>- Implement account lockout after a few failed attempts <br>- Add CAPTCHA to prevent automated attacks <br>- Enable rate limiting and multi-factor authentication (MFA)</p><p>3. <strong><em>Cross-Site Scripting (XSS)—Reflected (OWASP A03:2021)</em></strong></p><p>What Happened:<br>A simple `&lt;script&gt;alert(‘XSS’)&lt;/script&gt;` payload in an input field triggered a JavaScript alert, proving that unvalidated input was being executed by the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8QOAHAgrwB6dC1opNqelw.png" /></figure><p>Why It Matters: <br>XSS can hijack user sessions, deface websites, or redirect users to malicious sites. This reflected XSS vulnerability showed how easily an attacker could execute arbitrary code in a user’s browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGKPJgcpDyKb-1T8cQHntw.png" /></figure><p>The Fix: <br>- Sanitize all user inputs <br>- Encode output properly before rendering <br>- Use modern frameworks that automatically handle XSS protection <br>- Implement Content Security Policy (CSP) headers</p><p>4. Command Injection (OWASP A01:2021)</p><p>What Happened:<br>The ‘Ping a device’ feature directly executed user input as a system command. By appending commands to the input (like 8.8.8.8; ls`), I could execute arbitrary commands on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*dp8VXTsstnDeZkUg8Y4l7g.png" /></figure><p>Why It Matters: <br>Command injection can give attackers complete control over your server, allowing them to steal data, install malware, or use your server as part of a botnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yELWgETuDXm-rEm626MgtQ.png" /></figure><p>The Fix: <br>- Never directly execute user input as commands <br>- Use strict input whitelisting <br>- Replace shell commands with platform-specific APIs when possible</p><p>5.<strong> Unrestricted File Upload (OWASP A08:2021)</strong></p><p>What Happened: <br>DVWA allowed unrestricted upload of `.txt` files without validation. In a real system, this could be exploited to upload malicious scripts (like PHP files) for remote code execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*JAgWuEiBBaRxzPXYjgetlA.png" /></figure><p>Why It Matters: <br>File upload vulnerabilities often serve as the initial entry point for serious attacks, leading to complete system compromise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIHVq8VbYGSRmHBupQVRrg.png" /></figure><p>The Fix: <br>- Whitelist allowed file types (don’t blacklist) <br>- Store uploads outside the web root <br>- Sanitize file names and remove execute permissions <br>- Verify file content matches the expected type</p><p><strong><em>Building Security Into Your Development Process</em></strong></p><p>Finding and fixing vulnerabilities is important, but building security into your development lifecycle is even better. Here’s how to align with Secure SDLC principles:</p><p>1. Requirements: Define security requirements upfront <br>2. Design: Conduct threat modeling to identify potential risks <br>3. Development: Follow secure coding guidelines and use safe frameworks <br>4. Testing: Combine automated scanning with manual penetration testing <br>5. Deployment: Harden your environments and enable monitoring <br>6. Maintenance: Regularly patch systems and stay vigilant</p><p><strong>Conclusion</strong></p><p>This assessment of DVWA revealed critical vulnerabilities that are unfortunately still common in real-world applications. The good news? These flaws are preventable with proper security practices. By understanding how these attacks work and implementing the recommended fixes, developers can significantly improve their application’s security posture.</p><p>Remember: Security isn’t a one-time task; it’s an ongoing process that needs to be integrated throughout your SDLC. The vulnerabilities shown here are just the beginning; continuous learning and improvement are key to staying ahead of attackers.</p><p>What security practices have you implemented in your projects? Share your experiences in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e7d91462ab7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pixel Manipulation]]></title>
            <link>https://medium.com/@juwonbal/pixel-manipulation-6881ec4195fe?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6881ec4195fe</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Wed, 04 Jun 2025 10:58:21 GMT</pubDate>
            <atom:updated>2025-06-04T10:58:21.618Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*YNxR1CftQSo4AuhfAllMSA.png" /></figure><h3>📦 Why I Built This</h3><p>A few days ago, I received a project brief from <strong>Prodigy Infotech</strong>. The goal? Build a simple tool that encrypts and decrypts images using basic pixel manipulation. No AES. No bulky libraries. Just a clean Python script that anyone could understand and maybe learn something from.</p><p>At first, it sounded deceptively simple. But as I dove in, I realized how powerful and beautiful pixel-level operations really are.</p><p>This article walks through the journey with code, visuals, and reflections on what made this project special.</p><h3>The Core Idea</h3><p>Images are data. At their core, they’re just grids of pixel, each with Red, Green, and Blue (RGB) values ranging from 0 to 255.</p><p>If we change:</p><ul><li><strong>The value of each pixel</strong>, and</li><li><strong>The position of each pixel</strong> in the grid,</li></ul><p>we can effectively encrypt an image into something visually meaningless. And if we do it in a way that’s reversible (deterministic), we can decrypt it too.</p><h3>A Quick History of Pixel Manipulation</h3><p>Before we dive into the code, let’s appreciate where pixel manipulation comes from.</p><p>The word <strong>“pixel”</strong> is short for <strong>“picture element”</strong>, and it became widely used in the 1960s and 70s, during the early days of digital imaging and computer graphics. Early pixel manipulation wasn’t about encryption, it was about creating and displaying images efficiently on screens with very limited resolution (think: 16x16 icons and low-res arcade games).</p><p>In the 1980s and 90s, <strong>pixel art</strong> exploded in gaming and design. Artists worked directly with pixels to create characters and environments. Around the same time, <strong>image processing</strong> began to emerge as a scientific field driven by medical imaging, satellite imagery, and early machine vision.</p><p>Fast forward to the 2000s, and pixel manipulation became essential for:</p><ul><li><strong>Steganography</strong> (hiding messages inside images),</li><li><strong>Visual cryptography</strong> (splitting or scrambling images),</li><li>And eventually, <strong>deep learning, </strong>where pixels are the raw input to computer vision models.</li></ul><p>Today, pixel-level operations aren’t just useful, they’re at the heart of everything from Instagram filters to facial recognition to forensic imaging.</p><p>In my little Python script, I’m standing on the shoulders of that long, pixelated history.</p><h3>🛠️ Tools I Used</h3><ul><li><a href="https://pillow.readthedocs.io/en/stable/">Pillow</a>: for loading/saving images</li><li>NumPy: for raw pixel manipulation</li><li>Tkinter: for a file picker dialog</li><li>Matplotlib: to visualize image stages</li></ul><h3>🧪 How the Tool Works (Step-by-Step)</h3><h4>Step 1: Load the Image</h4><p>First, the user selects any image from their computer using a dialog. The image is read as a 3D NumPy array, where each pixel is [R, G, B].</p><pre>img = Image.open(path)<br>img_array = np.array(img)</pre><h4>Step 2: Encrypt Pixel Values</h4><p>Here’s the simplest form of encryption: take every pixel value and shift it with a number (key), then wrap it with % 256 so it stays in the valid range.</p><pre>encrypted_pixel = (original_pixel + key) % 256</pre><p>This changes the image colors and creates a scrambled effect but it’s completely reversible with the same key.</p><h4>Step 3: Shuffle Pixel Positions</h4><p>Next, I flatten the image and randomly <strong>shuffle the positions of the pixels</strong> using a seed.</p><pre>np.random.seed(seed)<br>np.random.shuffle(indices)</pre><p>This creates a unique, deterministic shuffle pattern. The resulting image looks garbled, like static or digital noise.</p><p>To decrypt, I just <strong>unshuffle using the same indices</strong>.</p><h4>Step 4: Decryption</h4><p>Decryption is just the reverse process:</p><ol><li>Unshuffle the pixels</li><li>Subtract the key (modulo 256)</li></ol><p>And just like that, we get the original image back.</p><h3>📸 Visual Preview</h3><p>Here’s what it looks like in practice:</p><ol><li><strong>Original Image</strong></li><li><strong>Value-encrypted Image (color shifted)</strong></li><li><strong>Decrypted Image (restored perfectly)</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*P6epKqcv_TtyRWhQinMXgw.png" /><figcaption>Original</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*EZZtKCU2WxMMqZr19YPaYg.png" /><figcaption>Encrypted</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*MKiF4l98UdtnSHYm4IDfnw.png" /><figcaption>Decrypted</figcaption></figure><h3>🤯 What Stood Out (For Me Atleast)</h3><p>I didn’t expect to learn this much from a “simple” project. But here’s what stood out:</p><ul><li><strong>Image encryption doesn’t always need complexity, </strong>math and logic go a long way.</li><li><strong>Understanding pixels deepens your appreciation</strong> for how digital media works.</li><li><strong>Making things visual</strong> is one of the best ways to understand abstract concepts like encryption.</li></ul><h3>🧰 Try It Yourself</h3><p>I’ve open-sourced the project here:<br> 👉 <a href="https://github.com/Juwonbal/PRODIGY_CS_02/tree/main">github.com/Juwonbal/PRODIGY_CS_02</a></p><p>You’ll find:</p><ul><li>A Python script (Num.py)</li><li>A clean README</li><li>Sample image encryption/decryption</li><li>A dialog-based interface</li></ul><h3>🙏 Final Thanks</h3><p>A huge shout-out to <strong>Prodigy Infotech</strong> for the project prompt and encouragement.</p><p>And to you , for reading this far. 🫶</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6881ec4195fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ I Built a Caesar Cipher Tool in Python]]></title>
            <link>https://medium.com/@juwonbal/i-built-a-caesar-cipher-tool-in-python-7428b618ea35?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7428b618ea35</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 10:57:47 GMT</pubDate>
            <atom:updated>2025-06-03T10:57:47.055Z</atom:updated>
            <content:encoded><![CDATA[<p>For a long time, I thought encryption was something reserved for hackers, spies, or at least people smarter than me. But recently, I’ve been diving deeper into cybersecurity and cryptography, and I figure, why not start with the basics?</p><p>So I built a Caesar Cipher encryption and decryption tool using Python. It’s simple, yes. But sometimes the simple things teach you the most.</p><h3>Caesar Cipher: A Deep Dive Into One of History’s Oldest Encryption Techniques</h3><p>Before AES, RSA, or even the Enigma machine, there was the Caesar Cipher, a humble, yet revolutionary method of encrypting information. Used by one of the most iconic figures in history, Gaius Julius Caesar, this simple cipher has left a lasting legacy on cryptography, military strategy, and the way we think about data security today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDrY6lLZnmVxwOXGwhrh9A.jpeg" /></figure><h3>Origins: Rome in the 1st Century BC</h3><p>The Caesar Cipher gets its name from Julius Caesar, the Roman general, politician, and statesman. During his military campaigns, especially during the Gallic Wars (58–50 BC). Caesar often had to communicate with his generals across vast territories. These messages, if intercepted, could spell disaster.</p><p>To protect his orders and strategic plans, Caesar used a basic substitution cipher: each letter in his message was replaced by a letter a few positions further down the alphabet, most commonly, a shift of three.</p><p>So:</p><ul><li>A became D</li><li>B became E</li><li>C became F</li><li>X became A</li><li>Y became B</li><li>Z became C</li></ul><p>This simple technique transformed plaintext into what would appear as nonsense to an outsider but was easily decrypted by anyone who knew the shift value.</p><h3>🧰 Tools &amp; Concepts I Used</h3><ul><li><strong>Python 3.12</strong></li><li>Basic string manipulation</li><li>ASCII values and character encoding</li><li>A loop, a few conditionals, and a bit of math</li><li>Patience (especially when debugging small mistakes)</li></ul><h3>🔨 How it was built</h3><p><strong>1. Write the encryption logic</strong><br> The idea: check each character, and if it’s a letter, shift it. If it’s a space or punctuation, leave it alone.</p><pre>def caesar_cipher_encrypt(text, shift):<br>    result = &quot;&quot;<br>    for char in text:<br>        if char.isalpha():<br>            base = ord(&#39;A&#39;) if char.isupper() else ord(&#39;a&#39;)<br>            shifted = (ord(char) - base + shift) % 26 + base<br>            result += chr(shifted)<br>        else:<br>            result += char<br>    return result</pre><p><strong>2. Decryption</strong><br> Just the reverse, pass a negative shift to the same function.</p><pre>def caesar_cipher_decrypt(text, shift):<br>    return caesar_cipher_encrypt(text, -shift)</pre><p><strong>3. User interaction</strong><br> Let the user choose to encrypt or decrypt, enter a message and a shift value.</p><pre>def main():<br>    print(&quot;Caesar Cipher Tool&quot;)<br>    choice = input(&quot;Type &#39;encrypt&#39; or &#39;decrypt&#39;: &quot;).strip().lower()<br>    message = input(&quot;Enter your message: &quot;)<br>    shift = int(input(&quot;Enter shift value (e.g., 3): &quot;))</pre><pre>    if choice == &#39;encrypt&#39;:<br>        print(&quot;Encrypted message:&quot;, caesar_cipher_encrypt(message, shift))<br>    elif choice == &#39;decrypt&#39;:<br>        print(&quot;Decrypted message:&quot;, caesar_cipher_decrypt(message, shift))<br>    else:<br>        print(&quot;Invalid option.&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57w1wuW0-6Mj0XGbYA6JLQ.png" /></figure><h3>🖼️ What It Looks Like in Action</h3><p>Here’s an example:</p><pre>Input: &quot;I love you&quot;<br>Shift: 3<br>Output: &quot;L oryh brx&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLBxMSX_EpDY_ZTZHuHc3w.png" /></figure><h3>✨ What I Learned</h3><ul><li>Encryption can be elegant and simple.</li><li>Even basic tools can teach you about modular thinking and abstraction.</li><li>Writing clean, reusable code (like using one function for both encrypting and decrypting) is very satisfying.</li><li>It’s fun to see something you build work <em>instantly </em>and securely!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7428b618ea35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Cracking the Hash — My Deep Dive into TryHackMe’s Hash Cracking Challenge]]></title>
            <link>https://medium.com/@juwonbal/cracking-the-hash-my-deep-dive-into-tryhackmes-hash-cracking-challenge-ea566f1c1540?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea566f1c1540</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Thu, 24 Apr 2025 22:19:13 GMT</pubDate>
            <atom:updated>2025-04-24T22:55:16.734Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔐 Cracking the Hash — My Deep Dive into TryHackMe’s Hash Cracking Challenge</h3><p>Let me tell you about the time I dove headfirst into <strong>Crack the Hash</strong> on TryHackMe, a room that’s exactly what it sounds like: you vs. encrypted passwords.</p><p>It was me, a list of mysterious hashes, my terminal, and a lot of determination.</p><p>Here’s the full breakdown, what worked, what didn’t, and what I learned about <strong>breaking hashes and bending encryption to my will</strong>.</p><h3>🚀 The Challenge: Crack the Hashes, One by One</h3><p>Each hash was a puzzle, and they weren’t all made equal:</p><ul><li>Some were <strong>simple MD5 hashes</strong>, like a warm-up.</li><li>Others? <strong>Salted, HMAC-ed</strong>, and just plain evil.</li></ul><p>But I stuck with it, cracked them all, and picked up some solid skills along the way.</p><p>Want in? Let’s go through it step-by-step 👇</p><h3>🛠️ My Cracking Arsenal</h3><p>Here’s what I used (and loved):</p><ul><li>🕵️‍♂️ <strong>hashid/hash-identifier</strong> — to detect hash types quickly.</li><li>🔓 <strong>CrackStation</strong> — great for unsalted hashes.</li><li>🪓 <strong>John the Ripper</strong> — when I needed something reliable and versatile.</li><li>⚡ <strong>Hashcat</strong> — for the heavy lifting.</li><li>🐍 <strong>Python scripts</strong> — because not every hash plays by the rules.</li></ul><h3>🧩 Let’s Crack Some Hashes</h3><h3>🔐 Level 1: MD5 — The Classic</h3><p><strong>Hash:</strong></p><pre>48bb6e862e54f2a795ffc4e541caed4d</pre><p>This was easy mode. Threw it into<strong> John the Ripper</strong>, and within seconds:</p><blockquote><strong><em>Password:</em></strong><em> </em><em>easy</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*36oPdQckwhDjzRGsq29Qpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*Fq3rtmSvoFLrlbBoDNT_ow.png" /></figure><p>Lesson? If your system still uses MD5, it’s time to panic.</p><h3>🔥 Level 2: Salted SHA1 — When Hashcat Fails, Script It</h3><p><strong>Hash:</strong></p><pre>nginx<br><br>e5d8870e5bdd26602cab8dbe07a942c8669e56d6</pre><p><strong>Salt:</strong> tryhackme</p><p>This one seemed like a <strong>perfect job for Hashcat</strong>.</p><h3>💻 Step 1: Tried Hashcat First</h3><p>I prepped the hash like this:</p><pre>makefile<br><br>e5d8870e5bdd26602cab8dbe07a942c8669e56d6:tryhackme<br><br>echo &#39;e5d8870e5bdd26602cab8dbe07a942c8669e56d6&#39; &gt; salted.hash</pre><p>And ran:</p><pre>bash<br><br>hashcat -m 120 salted.hash /usr/share/wordlists/rockyou.txt--force</pre><p>But after watching it grind… <strong>nothing.</strong> Hashcat was taking forever.</p><h3>🐍 Step 2: Wrote a Python Script Instead</h3><p>I decided to <strong>ditch brute force</strong> and go smarter.</p><p>Here’s the Python script I used to directly <strong>HMAC</strong> the salt with RockYou passwords:</p><pre>python<br><br>import hmac<br>import hashlib<br><br><br>hash_to_crack = &quot;e5d8870e5bdd26602cab8dbe07a942c8669e56d6&quot;<br>wordlist = open(&quot;rockyou.txt&quot;, &quot;r&quot;)<br>key = b&quot;tryhackme&quot;<br>for word in wordlist:<br>    word = word.strip()<br>    hmac_hash = hmac.new(key, word.encode(), hashlib.sha1).hexdigest()<br>    if hmac_hash == hash_to_crack:<br>        print(f&quot;[+] Password found: {word}&quot;)<br>        break</pre><h3>🐍 Step 3: Ran It</h3><pre>bash<br><br>python3 crack_hmac_sha1.py</pre><p>And just like that:</p><blockquote><strong><em>Password:</em></strong><em> </em><em>481616481616</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*hEc6vgwOKzS55ZvKoF4QDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*LjL-qOgY8GCgQ4qMP388MQ.png" /></figure><h3>💡 What This Taught Me:</h3><ul><li><strong>Hashcat isn’t always the fastest</strong> option.</li><li>When cracking feels stuck, sometimes a <strong>simple script wins</strong>.</li><li>Knowing <strong>multiple approaches</strong> is what makes the difference.</li></ul><h3>🔥 Hash #3: SHA-512 Crypt — A Really Hard Salt, and a Really Smart Trick</h3><p><strong>Hash:</strong></p><pre>swift<br><br>$6$aReallyHardSalt$6WKUTqzq.UQQmrm0p/T7MPpMbGNnzXPMAXi4bJMl9be.cfi3/qxIf.hsGpS41BqMhSrHVXgMpdjS6xeKZAs02.</pre><p><strong>Salt:</strong> aReallyHardSalt</p><p>This beast had <strong>SHA-512 crypt</strong> written all over it ($6$).</p><h3>💻 Step 1: Hashcat Struggled</h3><p>Formatted the hash and ran:</p><pre>bash<br>echo &#39;$6$aReallyHardSalt$6WKUTqzq.UQQmrm0p/T7MPpMbGNnzXPMAXi4bJMl9be.cfi3/qxIf.hsGpS41BqMhSrHVXgMpdjS6xeKZAs02.&#39; &gt; sha512crypt.hash<br><br>hashcat -m 1800 sha512crypt.hash /usr/share/wordlists/rockyou.txt--force</pre><p>Hashcat was… <strong>slow</strong>. Painfully slow.</p><h3>🚀 Step 2: Wordlist Filtering Changed Everything</h3><p>So I thought:</p><blockquote><em>“Let’s only try </em><strong><em>6-character words</em></strong><em>.” Because the answer on tryhackme was only 6-characters long.</em></blockquote><p>Filtered RockYou:</p><pre>bash<br><br>grep -x &#39;.\{6\}&#39; rockyou.txt &gt; rockyou-6.txt</pre><p>Ran Hashcat again:</p><pre>bash<br><br>hashcat -m 1800 sha512crypt.hash rockyou-6.txt --force</pre><p>It FLEW.<br> And finally cracked:</p><blockquote><strong><em>Password:</em></strong><em> </em><em>waka99</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*d0Ux1IKBXhXOeYXdsfRt1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*nyPKwFDQOpPMWbbRCjgzcQ.png" /></figure><h3>💡 Key Lessons I Learned</h3><ul><li>Hashcat’s <strong>powerful</strong>, but you need to guide it.</li><li>When brute force stalls, <strong>filter smart</strong>.</li><li><strong>Salts</strong> don’t stop attackers; they slow them, but only if you don’t think smart.</li></ul><h3>🧩 Final Hash: NTLM — Ending Strong with Hashcat</h3><p><strong>Hash:</strong></p><pre><br>1dfeca0c002ae40b8619ecf94819cc1b</pre><p>This wasn’t MD5. This wasn’t SHA1.<br> This was <strong>NTLM</strong>.</p><h3>💻 Step 1: Hashcat Knows NTLM Well</h3><p>I loaded it up:</p><pre>bash<br>echo &quot;1DFECA0C002A40B8619ECF94819C1B&quot; &gt; ntlm. hash<br><br>hashcat -m 1000 -D 1 ntlm. hash /usr/share/wordlists/rockyou.txt</pre><p>NTLM is fast, no salts, no fancy wrapping.</p><h3>⚡ Step 2: Watch Hashcat Work</h3><p>This time, I didn’t have to wait long.</p><p>Hashcat zipped through RockYou and BOOM:</p><blockquote><strong><em>Password:</em></strong><em> </em><em>n63umy81kf4i</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*g8ex436TppXFF60yBj09wg.png" /></figure><h3>💡 Lesson Here?</h3><ul><li><strong>NTLM hashes</strong> are fast to crack.</li><li>Never <strong>underestimate simple hashes</strong>.</li><li>When your tools and hash type are in sync? <strong>Magic happens</strong>.</li></ul><h3>💡 What I Learned from Crack the Hash</h3><ul><li><strong>Hash types matter.</strong> Know what you’re dealing with.</li><li><strong>Salts</strong> don’t make things uncrackable — they make it more interesting.</li><li><strong>HMAC?</strong> Time to flex your coding muscles.</li><li><strong>John and Hashcat</strong> are beastly, but only if you feed them right.</li><li><strong>Patience wins.</strong> Every crack is a puzzle, not just brute force.</li></ul><p>PS: These weren’t the only hashes given; there were several other hashes, but these were definitely my favorites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QRQ_fRRmZ32moGARthqHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSVlWjerApqyGuLY0xaWdA.png" /></figure><h3>🧭 Final Thoughts</h3><p>Crack the Hash wasn’t just about brute force; it was about thinking, adjusting, trying different tools, and sometimes building your own.</p><p>If you’re into <strong>cybersecurity</strong>, want to test your <strong>hash cracking</strong> skills, or just enjoy solving puzzles that fight back, this room is for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea566f1c1540" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating a Basic Cybersecurity Lab: A Beginner-Friendly Walkthrough]]></title>
            <link>https://medium.com/@juwonbal/simulating-a-basic-cybersecurity-lab-a-beginner-friendly-walkthrough-4e61b5e1df72?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e61b5e1df72</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Tue, 22 Apr 2025 11:26:24 GMT</pubDate>
            <atom:updated>2025-04-22T11:26:24.856Z</atom:updated>
            <content:encoded><![CDATA[<p>Setting up your own cybersecurity lab doesn’t have to be intimidating. In this hands-on project, I walk you through how I built a basic virtual network using Kali Linux and Ubuntu, tested network tools, simulated attacks, and documented each step, mistakes and all.</p><p>Whether you’re just starting out or prepping for certifications like Security+, this guide will show you real-world scenarios with a dose of troubleshooting, screenshots, and some classic command-line wins (and errors).</p><h3>What You’ll Need</h3><ul><li>Oracle VirtualBox</li><li>Kali Linux VM</li><li>Ubuntu Server VM</li><li>Some patience for debugging!</li></ul><h3>1. Create Your Lab Setup</h3><h3>Step 1: Set Up the Virtual Machines</h3><ul><li><strong>Kali Linux</strong> (already installed in my case)</li><li><strong>Ubuntu Server 24.04</strong> (installed via ISO in VirtualBox)</li></ul><p><strong>Tip:</strong> Make sure both are on the same Internal Network in VirtualBox under <strong>Network → Adapter 1 → Attached to: Internal Network</strong>. I used cyberlab-net.</p><h3>2. Configure IP Addresses</h3><p>On Ubuntu:</p><ul><li>During installation, choose manual IPv4 setup.</li><li>Set a static IP: 172.17.0.2/24</li><li>Gateway: 172.17.0.1 (Kali)</li></ul><p>On Kali:</p><ul><li>Static IP already set to 172.17.0.1</li><li>Verified using:</li></ul><pre>ip a<br>ip r</pre><p>I had to tweak Ubuntu’s netplan settings later to fix a duplicate IP issue. Used:</p><pre>sudo nano /etc/netplan/00-installer-config.yaml<br>sudo netplan apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*-bi5wQjCdKxnDSYObn30VQ.png" /></figure><h3>3. Test Basic Connectivity</h3><p>From Kali:</p><pre>ping 172.17.0.2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*5H9jnD-32Z7ewhJrvGcE9Q.png" /></figure><p>From Ubuntu:</p><pre>ping 172.17.0.1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*U4cSBn9fDhli4n_IJG4xxQ.png" /></figure><p><strong>Status:</strong> Success! Both machines could ping each other.</p><h3>4. Configure UFW Firewall on Ubuntu</h3><pre>sudo ufw enable<br>sudo ufw allow ssh<br>sudo ufw allow 80<br>sudo ufw status numbered</pre><p><strong>Note:</strong> When trying to allow ICMP (ping), I got an error:</p><pre>sudo ufw allow proto icmp<br># ERROR: Need &#39;to&#39; or &#39;from&#39; clause</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xl9w0ArkNBr16eHA3LfQPA.jpeg" /></figure><p>Instead, I edited the default UFW rules to include ICMP types manually.</p><h3>5. Simulate a Port Scan from Kali</h3><pre>nmap 172.17.0.2</pre><p><strong>Result:</strong></p><ul><li>Host detected</li><li>Ports 22 (SSH) and 80 (HTTP) either closed or filtered</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*POg_-7i2IbOXDfr34QWe2w.jpeg" /></figure><p>Ran:</p><pre>ss -tuln | grep :80</pre><p>No services were listening on port 80, which explains the filtered status.</p><h3>6. Troubleshooting &amp; Mistakes (And What They Taught Me)</h3><ul><li>Accidentally gave Ubuntu two IPs: 172.17.0.2 <strong>and</strong> 192.168.56.10</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*eEfa7Qa2_KhlCCA3nwMbDw.jpeg" /></figure><ul><li>Forgot to enable UFW and wondered why nmap showed nothing open</li><li>Ran ping with &lt; &gt; brackets and got a syntax error (those are not part of the command!)</li></ul><p>These hiccups helped reinforce network basics and Linux troubleshooting.</p><h3>7. Summary: What This Project Taught Me</h3><ul><li>How to subnet and assign static IPs</li><li>What to do when VirtualBox networking breaks</li><li>How UFW works and how to test firewall rules</li><li>The basics of nmap, ping, traceroute, and service scanning</li></ul><h3>Next Steps?</h3><ul><li>Add a third VM as a vulnerable target</li><li>Simulate man-in-the-middle attacks</li><li>Try installing Apache or SSH server and watching live traffic</li></ul><h3>Let’s Chat!</h3><p>Have you ever set up your own lab? Got stuck in a firewall rabbit hole? Let me know or drop your setup tips.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e61b5e1df72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rebuilding Evidence from Packet Captures: My First Wireshark Forensics Project]]></title>
            <link>https://medium.com/@juwonbal/rebuilding-evidence-from-packet-captures-my-first-wireshark-forensics-project-40923531a4d9?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/40923531a4d9</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 19:32:21 GMT</pubDate>
            <atom:updated>2025-04-15T19:32:21.646Z</atom:updated>
            <content:encoded><![CDATA[<h3>🕵️‍♂️ The Goal: Find the Files the Attacker Accessed</h3><p>Before I dive into the process, let’s quickly talk about <strong>Wireshark,</strong> the tool that made all of this possible.</p><p><strong>Wireshark</strong> is a powerful network protocol analyzer. Think of it like a microscope for your internet traffic. It captures every packet flowing through your network and lets you inspect it in incredible detail. You can see what websites were visited, what data was transferred, and in this case even what files were downloaded. It’s widely used in cybersecurity, digital forensics, and network troubleshooting. And while it looks intimidating at first, it becomes super rewarding once you get the hang of it.</p><p>Okay, let me take you on a journey to my very first real digital forensics project. The task sounded simple (spoiler: it wasn’t): find out what files someone accessed from a network packet capture, and try to recover them.</p><p>Simple in theory… But the moment I opened that .pcap file in Wireshark, I knew I was in for a ride. Let’s break down how I approached it, what broke (because something <em>always</em> breaks), and what I learned.</p><h3>🔍 Step 1: Filtering for HTTP Traffic</h3><p>First things first, I fired up <strong>Wireshark</strong> and filtered traffic with</p><pre>http</pre><p>Boom. Clean list of HTTP GET and response packets. I scrolled through and found GET requests pointing to:</p><ul><li>/media/anz-logo.jpg</li><li>/documents/ANZ_Document.pdf</li><li>/images/bank-card.jpg</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-cUclrnCJ5mITOyAKd31g.png" /></figure><h3>🧠 Step 2: Following the TCP Stream</h3><p>I right-clicked on each GET request and selected:</p><pre>Follow &gt; TCP Stream</pre><p>Then changed the view to <strong>Raw</strong>. Suddenly, I could see binary data — a mix of HTTP headers followed by… the file itself. Yes, the file inside network traffic. It looked like a wall of gibberish at first, but I was determined. This was the treasure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-CLTpusAnqWm_5f9fGh7Q.png" /></figure><h3>🧰 Alternative: Extracting Files with Wireshark’s Built-in Tools</h3><p>But if I had known this next trick earlier, I could’ve saved myself a lot of hex editing!</p><p>Turns out, <strong>Wireshark can actually extract objects for you; </strong>no hex slicing needed.</p><p>If the files were transferred over HTTP, you can head up to the top toolbar and go to:</p><pre>File &gt; Export Objects &gt; HTTP</pre><p>Wireshark lists all downloadable files it sees. Click on any item, hit save, and just like that, you’ve got the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0NyfCnnxkepHxdh4y6mGg.png" /></figure><p>I tested this out later with anz-logo.jpg, and it worked flawlessly. No hex, no GHex, no guessing.</p><p>Of course, this only works when the file transfer is clean and not fragmented across multiple streams. But when it does work? It’s a game-changer.</p><p>(Still proud I did it the hard way first, though, it really helped me understand what’s going on under the hood.)</p><h3>🧱 Step 3: Hex Editors, Signatures &amp; Detective Work</h3><p>Now for the carving. I copied the entire TCP stream and pasted it into <strong>GHex</strong> (a hex editor). My goal was to locate the start and end of each file manually.</p><p>Here’s what I looked for:</p><ul><li><strong>JPG files start with:</strong> FF D8 FF</li><li><strong>JPG files end with:</strong> FF D9</li><li><strong>PDF files start with:</strong> %PDF → hex: 25 50 44 46</li><li><strong>PDF files end with:</strong> %%EOF → hex: 25 25 45 4F 46</li></ul><p>I deleted everything before the header and after the footer. Then I saved the hex as .jpg or .pdf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*085-aGsn0yCIypZnF7iw0A.png" /></figure><h4>🤦‍♂️ The First Challenge:</h4><p>The TCP stream often started with HTTP headers (HTTP/1.1 200 OK, content-type stuff, etc.). If I didn’t strip those before the hex signature, the file wouldn’t open. I learned that the hard way.</p><h3>🧪 Step 4: Testing the Files</h3><p>After carving the files, I tried opening them:</p><ul><li>anz-logo.jpg → <strong>✅ Success!</strong> An ANZ logo.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSSC1U-mJR6zLicdPCJJyg.png" /></figure><ul><li>ANZ_Document.pdf → <strong>✅ Opened without issues.</strong> I was actually shocked.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*wO4wW7AiwjsjSY_-9UxJ2A.png" /></figure><ul><li>bank-card.jpg → <strong>❌ Denied!</strong> Paint gave me the cold shoulder: &quot;Not a valid image file.&quot;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*3okdGpTxfcl4d9nNQGpzHg.png" /></figure><p>I went back into GHex, found an extra line of hex <strong>after</strong> the file footer (FF D9) deleted it and guess what? It worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*VSkPTVUv4ftiryOf83KgfQ.png" /></figure><h3>🔧 Tools That (Almost) Helped</h3><p>At one point, I thought the data might be Base64 encoded. Spoiler: it wasn’t. But I tried anyway:</p><pre>base64 -d broken.txt</pre><p>Nothing. So I inspected the pattern — real Base64 strings usually end in = or ==. These didn’t.</p><p>So back to raw hex it was.</p><h3>💡 What I Learned (the Fun and the Frustrating)</h3><ul><li><strong>Wireshark is like X-ray vision for the internet.</strong> It’s incredible what you can see once you know how to look.</li><li><strong>Hex editing is part science, part art.</strong> Knowing file signatures helps but you still need to develop an eye for structure.</li><li><strong>Don’t trust the first save.</strong> I had to rebuild one file three times before it actually opened.</li><li><strong>Headers matter. Footers matter.</strong> Bytes are everything in this game.</li></ul><h3>🧾 What I Ended Up With</h3><p>After all that work, I had clean, working versions of</p><ul><li>anz-logo.jpg</li><li>ANZ_Document.pdf</li><li>bank-card.jpg</li></ul><p>And a folder of notes detailing what packet the files started in, their hex boundaries, and any issues I ran into.</p><h3>🤓 Final Thoughts</h3><p>This was my first real dive into <strong>network forensics</strong>, and I genuinely loved it. There were moments when I thought, “This is too hard,” but each breakthrough was worth it.</p><p>If you’re just getting into cybersecurity, try doing this. You’ll walk away understanding so much about:</p><ul><li>HTTP traffic</li><li>File formats</li><li>Hex-level data</li><li>How attackers (and defenders) operate</li></ul><p>I’ve got more walkthroughs coming, so stay tuned. And if you want the .pcapfile to practice on, let me know in the comment section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40923531a4d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Deploying a Honeypot Using Cowrie on Kali Linux]]></title>
            <link>https://medium.com/@juwonbal/building-and-deploying-a-honeypot-using-cowrie-on-kali-linux-e1da16181e73?source=rss-3ccc00c6b6f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1da16181e73</guid>
            <dc:creator><![CDATA[Fawaz Balogun]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 10:49:58 GMT</pubDate>
            <atom:updated>2025-04-15T10:57:12.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>I’m new to cybersecurity, and recently I decided to start blogging my journey so others who are just starting out can learn with me. This is the first major hands-on project I tackled: setting up a honeypot using Cowrie on Kali Linux. I’ll walk you through everything I experienced (the good, the confusing, and the “wait, why isn’t this working?!” moments).</p><p>If you’re also trying to break into cyber and want something practical (and a little bit exciting), this post is for you.</p><p>In this guide, you’ll learn:</p><ul><li>What a honeypot is and why it matters</li><li>What Cowrie is and what it simulates</li><li>Step-by-step how I installed it (plus some beginner-level hiccups I hit)</li><li>How I got it running and exposed it to real traffic</li><li>What I learned from the logs</li></ul><p>Let’s get into it.</p><h3>What is a Honeypot (and Why Use One)?</h3><p>I kept seeing this term “honeypot” thrown around in cyber communities, so I finally looked it up. In simple terms, a <strong>honeypot</strong> is a fake system that looks like a real one to attackers. It’s meant to attract them, so you can observe what they do without putting a real system at risk.</p><p>They’re used to:</p><ul><li>Detect early signs of attack</li><li>Observe new or evolving attack techniques</li><li>Train defenders</li><li>Distract attackers from real assets</li></ul><p>Cowrie is a medium-interaction honeypot. That means it doesn’t just log connection attempts it gives the attacker a fake shell and lets them type in commands, download files (simulated), and more. It’s meant to feel like a real server.</p><h3>Setting Up My Lab</h3><p>Here’s what I used:</p><ul><li>Kali Linux (I ran mine in VirtualBox)</li><li>Cowrie from GitHub</li><li>Some curiosity, caffeine, and time</li></ul><p>If you’re working with VirtualBox, I recommend allocating at least 2GB RAM and using Bridged networking (more on that later).</p><h3>Step 1: Installing Cowrie on Kali Linux</h3><p>Here’s exactly what I did:</p><ol><li><strong>Updated my system:</strong></li></ol><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><p>2.<strong> Installed required packages</strong>:</p><pre>sudo apt install git python3-virtualenv libssl-dev libffi-dev build-essential -y</pre><p>3. <strong>Cloned the Cowrie GitHub repo</strong>:</p><pre>git clone https://github.com/cowrie/cowrie.git<br>cd cowrie</pre><p>4.<strong> Created a virtual environment</strong>:</p><pre>virtualenv --python=python3 cowrie-env<br>source cowrie-env/bin/activate</pre><p>5.<strong> Installed Python requirements</strong>:</p><pre>pip install --upgrade pip<br>pip install -r requirements.txt</pre><p><strong>6. Copied the config file</strong>:</p><pre>cp etc/cowrie.cfg.dist etc/cowrie.cfg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WvbYZAvUjhaX5sFATDfSoQ.png" /></figure><p>This was the first point where I felt like, “Okay, this is actually working.”</p><h3>Step 2: Running Cowrie and Simulating an Attacker</h3><p>Once installed, here’s how I started it:</p><pre>bin/cowrie start</pre><p>I checked that it was running with:</p><pre>bin/cowrie status</pre><p>Then I simulated an attacker by SSH-ing into my own honeypot:</p><pre>ssh -p 2222 root@localhost</pre><p>I typed in random passwords and some Linux commands just to see how Cowrie responded. Everything was being logged behind the scenes.</p><p>To stop Cowrie:</p><pre>bin/cowrie stop</pre><h3>Some Beginner Errors I Ran Into</h3><p>Yup — things didn’t go perfectly. Here’s what tripped me up:</p><ul><li><strong>Pip complaining about missing packages</strong> — fixed by ensuring I had activated the virtualenv.</li><li><strong>“Another twistd server is running”</strong> — that just meant Cowrie was already running. I used bin/cowrie stop to fix it.</li><li><strong>Trying to SSH on port 22 instead of 2222</strong> — I forgot that Cowrie defaults to port 2222.</li></ul><p>Lesson: Always read the output messages carefully.</p><h3>Step 3: Making Cowrie Visible on My LAN</h3><p>At this point, I wanted other machines on my network to be able to see the honeypot.</p><p>I changed my VirtualBox network settings:</p><ul><li>Shut down the VM</li><li>Go to <strong>Settings &gt; Network &gt; Adapter 1</strong></li><li>Set “Attached to” → <strong>Bridged Adapter</strong></li></ul><p>Then inside Kali:</p><pre>ip a</pre><p>I found my LAN IP (e.g. 192.168.1.105), and tested from another machine:</p><pre>ssh root@192.168.1.105 -p 2222</pre><p>If you don’t have another machine, you can test using localhost like earlier.</p><h3>Step 4: Exposing Cowrie to the Internet (with Caution)</h3><p>⚠️ I thought hard before doing this. You’re literally inviting bots and attackers to poke around your machine. So I took some precautions:</p><ol><li><strong>Changed Cowrie’s port to 22</strong> (optional, for realism):</li></ol><pre>nano etc/cowrie.cfg</pre><p>Changed:</p><pre>listen_port = 2222</pre><p>To:</p><pre>listen_port = 22</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-exbcLTGxcqYRoLUfdVIaQ.png" /></figure><p><strong>2. Moved real SSH to another port</strong> so I could still access Kali securely:</p><pre>sudo nano /etc/ssh/sshd_config</pre><p>Changed:</p><pre>Port 22</pre><p>To:</p><pre>Port 22222</pre><p>Then restarted SSH:</p><pre>sudo systemctl restart ssh</pre><p><strong>3. Set up port forwarding on my home router</strong>: I forwarded external port 22 to my Kali IP’s port 22.</p><p><strong>4. Verified it was open</strong>: I used:</p><ul><li><a href="https://canyouseeme.org/">https://canyouseeme.org</a></li><li>nmap -p 22 my.public.ip</li></ul><p>Sure enough — connections started showing up in the Cowrie logs.</p><h3>Step 5: Watching the Logs (the Fun Part)</h3><p>Cowrie logs <strong>everything</strong>. Here’s what I found most useful:</p><ul><li><strong>Main activity log:</strong></li></ul><pre>tail -f var/log/cowrie/cowrie.log</pre><ul><li><strong>Full session replays:</strong></li></ul><pre>ls var/log/cowrie/tty/</pre><ul><li><strong>Downloaded files:</strong></li></ul><pre>ls var/lib/cowrie/downloads/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c1-duTzJwOgv-8kEd1otUA.png" /></figure><p>Some of the things I saw:</p><ul><li>Lots of login attempts with usernames like admin, test, and root</li><li>Commands like uname -a, wget, and even attempted malware downloads</li><li>Repeated brute-force password guessing</li></ul><p>I couldn’t believe how fast random IPs started probing my honeypot.</p><h3>Where I’m Going Next</h3><p>This experiment was really eye-opening. Here’s what I plan to do next:</p><ul><li>Forward logs to the <strong>ELK Stack</strong> (Elasticsearch, Logstash, Kibana)</li><li>Create alerts for suspicious behavior</li><li>Try other honeypots like <strong>Dionaea</strong> or <strong>Honeyd</strong></li><li>Maybe write a simple honeypot of my own just for learning</li></ul><h3>Final Thoughts</h3><p>Setting up Cowrie was such a great first project. It forced me to think like an attacker while building skills in Linux, networking, and scripting. If you’re new to cybersecurity and wondering what to work on I highly recommend this.</p><p>Thanks for reading and if you’re setting up your own honeypot, I’d love to hear how it goes!</p><p>Stay curious 🧠 | Happy hacking ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1da16181e73" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>