<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://ancailliau.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://ancailliau.github.io//" rel="alternate" type="text/html" /><updated>2024-11-04T10:18:31+00:00</updated><id>https://ancailliau.github.io//feed.xml</id><title type="html">ancailliau’s brain dump</title><subtitle>Antoine Cailliau&apos;s brain dump, bits and bytes about computers and cybersecurity</subtitle><author><name>Antoine Cailliau</name></author><entry><title type="html">Highlights from Hack.lu 2024 (Day 4)</title><link href="https://ancailliau.github.io//2024/11/04/Highlights-from-Hack-lu-2024-Day-4.html" rel="alternate" type="text/html" title="Highlights from Hack.lu 2024 (Day 4)" /><published>2024-11-04T00:00:00+00:00</published><updated>2024-11-04T00:00:00+00:00</updated><id>https://ancailliau.github.io//2024/11/04/Highlights-from-Hack-lu-2024-Day-4</id><content type="html" xml:base="https://ancailliau.github.io//2024/11/04/Highlights-from-Hack-lu-2024-Day-4.html"><![CDATA[<p>The fourth day of Hack.lu 2024 brought valuable insights into the evolving
tactics of cybercriminals, proactive network defense, and innovative threat
detection methods. Covering a range of topics from router compromises to
firmware analysis, the sessions offered practical knowledge for security
professionals focused on anticipating adversary actions, securing network
infrastructure, and improving threat detection accuracy.</p>

<p><strong>The Ouroboros of Cybercrime - Witnessing Threat Actors go from Pwn to Pwn’d</strong>:
This talk highlighted the cyclical nature of cybercrime, where threat actors who
compromise systems are themselves targeted and compromised by other groups. It
illustrated how attacks evolve and often come full circle, underscoring the
volatility and risks within the cybercrime ecosystem.</p>

<p><strong>The XE Files - Trust No Router</strong>: James Atack provided an in-depth look into
Cisco Talos’s recent findings on widespread router compromises, revealing that
tens of thousands of routers remain vulnerable to backdoors. He emphasized the
persistence of the adversary and the concerning lack of response from some
organizations, calling for enhanced vigilance around network devices.</p>

<p><strong>New Features in the Zeek Network Monitor</strong>: Christian Kreibich discussed the
latest advancements in Zeek, including scriptability with JavaScript,
performance improvements, and enhanced telemetry integration with Prometheus.
These updates open new possibilities for network analysis, making Zeek an even
more robust tool for proactive network monitoring.</p>

<p><strong>Sigma Unleashed - A Realistic Implementation</strong>: Mathieu Le Cleach from CERT-EU
shared a real-world implementation of Sigma rules for better detection across
multiple SIEMs and EDRs. His tool, Droid, supports versioning, modular rule
validation, and cross-platform deployment, helping organizations maintain
adaptable and effective detection capabilities.</p>

<p><strong>Predictive Analytics for Adversary Techniques in the MITRE ATT&amp;CK Framework
using Rule Mining</strong>: Tristan Madani presented a predictive model using
association rule mining to anticipate adversary techniques based on historical
data within the MITRE ATT&amp;CK framework. By applying Apriori and FP-Growth
algorithms, he showcased how this approach can enhance threat hunting by
identifying probable attack patterns and improving proactive defense.</p>

<p><strong>Exploring Firmwares - Tools and Techniques for New Cartographers</strong>: Eloïse
Brocas introduced attendees to firmware analysis, guiding them through file
system extraction and cartography using tools like Pyrrha and Numbat. She
demonstrated how custom parsers with Kaitai Struct and visual mapping can
uncover vulnerabilities and provide deep insights into firmware structure,
aiding in securing IoT and embedded devices.</p>]]></content><author><name>Antoine Cailliau</name></author><category term="conference" /><summary type="html"><![CDATA[The fourth day of Hack.lu 2024 brought valuable insights into the evolving tactics of cybercriminals, proactive network defense, and innovative threat detection methods. Covering a range of topics from router compromises to firmware analysis, the sessions offered practical knowledge for security professionals focused on anticipating adversary actions, securing network infrastructure, and improving threat detection accuracy.]]></summary></entry><entry><title type="html">Maximizing Your Conference Experience as a CTI Analyst</title><link href="https://ancailliau.github.io//2024/11/04/Maximizing-Your-Conference-Experience-as-a-CTI-Analyst.html" rel="alternate" type="text/html" title="Maximizing Your Conference Experience as a CTI Analyst" /><published>2024-11-04T00:00:00+00:00</published><updated>2024-11-04T00:00:00+00:00</updated><id>https://ancailliau.github.io//2024/11/04/Maximizing-Your-Conference-Experience-as-a-CTI-Analyst</id><content type="html" xml:base="https://ancailliau.github.io//2024/11/04/Maximizing-Your-Conference-Experience-as-a-CTI-Analyst.html"><![CDATA[<p>Having been to various conferences, from hack.lu and CTI Summit to botconf,
FOSDEM, and SANS events across the EU and the US, I’ve learned that attending a
conference is far more than just showing up and taking notes. Each event holds
unique opportunities for growth, networking, and skills validation. Here’s how
to make the most of them based on what I’ve gathered along the way.</p>

<h2 id="building-a-reliable-network">Building a Reliable Network</h2>

<p>One of the most rewarding aspects of conferences is networking. Over the years,
the people I’ve met at these events have become go-to resources, especially when
urgent information is needed—whether for an incident response or tracking
specific threat actors. Networking at conferences goes beyond just meeting
people; it’s about building a trusted circle that becomes invaluable over time.
Through these connections, I’ve gained access to private communities where
tradecraft, Indicators of Compromise (IoCs), and other crucial intelligence are
shared within trusted circles—information you won’t find on public feeds. This
network provides a distinct advantage, allowing faster, more informed responses
to emerging threats.</p>

<ul>
  <li><strong>Get Out There</strong>: A firm handshake and a quick chat can lead to partnerships
that prove crucial down the line. Conferences offer a rare chance to meet key
players in the field face-to-face, from vendor contacts to fellow CTI
analysts.</li>
  <li><strong>Follow-Up Is Key</strong>: Once the event wraps, I make it a point to follow up
with new contacts through email or social media. Consistent interaction
ensures the network grows beyond just a business card collection.</li>
</ul>

<h2 id="tools-and-techniques-always-something-new">Tools and Techniques: Always Something New</h2>

<p>Each conference is packed with workshops and talks that showcase the latest
tools and techniques. I’ve found this invaluable in staying updated and avoiding
the “outdated” trap that can sneak up if you skip even a year.</p>

<ul>
  <li><strong>Evaluation Through Practice</strong>: I look at each new tool with an eye on its
practical applications. Will it replace an existing tool? Fill a gap?
Workshops provide a low-risk way to test drive and evaluate, often with
feedback from the presenters and other attendees.</li>
  <li><strong>Inspiration for Efficiency</strong>: Each event brings fresh insights. Listening to
discussions or just chatting during breaks has sparked ideas on how to refine
my daily workflows.</li>
</ul>

<div class="callout">
	<span class="callout-title">[!NOTE] Star and Fork on GitHub</span>
	My advice is to star and fork valuable projects on GitHub whenever possible. This practice not only keeps the tools accessible but also helps me monitor updates and engage with the developer community.
</div>

<h2 id="test-training-providers-before-committing">Test Training Providers Before Committing</h2>

<p>Professional training can be costly, and conference workshops offer a rare
chance to try before you buy, which I find invaluable:</p>

<ul>
  <li><strong>Preview Content and Format</strong>: Testing out a training provider’s content,
format, and instructor style through workshops is key. It gives a snapshot of
the depth of training on offer and helps me decide if it’s worth the
investment.</li>
  <li><strong>Collect Resources for Evaluation</strong>: I try to gather any resources provided,
as they give me a better sense of the program’s scope and whether it meets my
needs.</li>
</ul>

<h2 id="personal-development-validation-gaps-and-reflection">Personal Development: Validation, Gaps, and Reflection</h2>

<p>Conferences offer a unique space for personal growth. Not only do they validate
existing skills, but they also highlight areas for improvement and encourage
meaningful self-reflection.</p>

<ul>
  <li><strong>Validate Skills</strong>: When a workshop feels straightforward, it’s a boost—an
indicator that I’m on track. Occasionally, it even pushes me to consider
running a workshop myself or sharing insights with peers.</li>
  <li><strong>Identify Knowledge Gaps</strong>: Areas that prove challenging are equally
valuable, showing me where to focus my development efforts in the coming
months.</li>
  <li><strong>Self-Reflection and Feedback</strong>: Conferences allow me to step back and
reflect on my daily practices. Traveling with colleagues offers a great
opportunity to gather feedback and brainstorm on our workflows.</li>
</ul>

<h2 id="documentation-bringing-the-value-home">Documentation: Bringing the Value Home</h2>

<p>To keep the value of each conference alive, I make documentation a priority.
This not only benefits my future self but also my colleagues, who may not have
attended.</p>

<ul>
  <li><strong>Notes and Feedback</strong>: I take time to refine my notes post-conference, aiming
for constructive feedback that I’d find helpful myself. It’s about creating
something that others can understand and apply.</li>
  <li><strong>Resource Collection</strong>: Gathering slides, videos, and any shared materials is
part of my routine. These resources help me revisit topics and keep the
content fresh long after the event.</li>
  <li><strong>Sharing What Matters</strong>: I believe in going beyond a summary, focusing on
relevance. Sharing insights with colleagues—what’s important and why—ensures
the knowledge serves the team, not just myself.</li>
</ul>

<p>By documenting each event thoroughly, I’ve been able to track which conferences
were truly impactful over the years—those that resulted in actionable changes in
my practice versus those that offered less value. Time is a critical resource,
especially when balancing conference attendance with full-time work. Proper
records allow me to focus on the most beneficial events going forward and help
build a track record I can use to demonstrate the value of attendance to
management. This documentation becomes evidence, supporting the need to attend
future events by showcasing the direct impact these conferences have had on my
work.</p>

<p>For me, conferences have become a cornerstone of both my professional and
personal growth. They’re not just events but essential check-ins on my journey
as a CTI analyst, each one shaping my skills, network, and outlook in the
cybersecurity world.</p>]]></content><author><name>Antoine Cailliau</name></author><category term="conference" /><summary type="html"><![CDATA[Having been to various conferences, from hack.lu and CTI Summit to botconf, FOSDEM, and SANS events across the EU and the US, I’ve learned that attending a conference is far more than just showing up and taking notes. Each event holds unique opportunities for growth, networking, and skills validation. Here’s how to make the most of them based on what I’ve gathered along the way.]]></summary></entry><entry><title type="html">Highlights from Hack.lu 2024 (Day 3)</title><link href="https://ancailliau.github.io//2024/10/24/Highlights-from-Hack-lu-2024-Day-3.html" rel="alternate" type="text/html" title="Highlights from Hack.lu 2024 (Day 3)" /><published>2024-10-24T00:00:00+00:00</published><updated>2024-10-24T00:00:00+00:00</updated><id>https://ancailliau.github.io//2024/10/24/Highlights-from-Hack-lu-2024-Day-3</id><content type="html" xml:base="https://ancailliau.github.io//2024/10/24/Highlights-from-Hack-lu-2024-Day-3.html"><![CDATA[<p>Day 3 of Hack.lu featured a mix of talks exploring both physical and digital
security challenges. From discussions on outdated physical security measures to
vulnerabilities in cutting-edge mobile app frameworks and critical
infrastructure systems, the day offered valuable insights for cybersecurity
professionals. The sessions provided practical demonstrations and real-world
examples of how attackers exploit weaknesses in both physical and virtual
environments, while also highlighting tools and techniques for enhancing
detection and prevention.</p>

<h2 id="morning-sessions">Morning Sessions</h2>

<p><strong>Back to the Failure - Did Your Physical Security Really Evolve in the Last 40
Years?</strong> Presented by Simon Geusebroek from Synacktiv, this talk revisited the
evolution (or lack thereof) of physical security measures over the past four
decades. Geusebroek demonstrated how many physical security systems, such as
locks and access controls, remain vulnerable to basic bypass techniques. The
session highlighted how outdated security practices and reliance on
certifications give a false sense of security, allowing attackers to easily
breach supposedly “secure” facilities.</p>

<p><strong>Blowing up Gas Stations for Fun and Profit</strong> Pedro Umbelino exposed
vulnerabilities in Automated Tank Gauging (ATG) systems, which monitor fuel
levels in critical infrastructures like gas stations and military bases.
Umbelino revealed several zero-day vulnerabilities that could allow attackers
to remotely manipulate fuel storage systems, potentially causing environmental
and economic damage. Despite previous warnings, many ATG systems remain
unprotected and accessible online, leaving critical infrastructure at risk.</p>

<p><strong>Reversing Flutter with Blutter and Radare2</strong> This technical workshop delved
into the complexities of reverse engineering Flutter applications. Axelle
Apvrille guided attendees through the complexities of reverse engineering
Flutter applications. Flutter, a popular cross-platform mobile development
framework, poses unique challenges for reverse engineers due to its custom
binary format. Apvrille introduced tools like Blutter and Radare2 to analyze
and manipulate Flutter binaries, offering practical techniques to uncover
vulnerabilities and modify app behavior.</p>

<h2 id="afternoon-sessions">Afternoon Sessions</h2>

<p><strong>Scanning with the Artemis Security Scanner</strong> Presented by Krzysztof Zając,
this session focused on Artemis, an open-source tool for automating
vulnerability scanning across domains. Zając walked through how CSIRTs, network
administrators, and hosting providers can set up Artemis to scan large networks
and automatically report findings. The hands-on session covered the tool’s
installation, configuration, and reporting capabilities, providing a scalable
solution for identifying vulnerabilities across thousands of domains.</p>

<p><strong>iOS Compromise Detection Using Open Source Tools</strong> David Durvaux and
Christophe Vandeplas led this workshop on detecting compromises on iOS devices
using sysdiagnose and other open-source tools. They demonstrated how
sysdiagnose can collect detailed diagnostic data from iPhones and iPads, and
how security teams can use these tools to uncover potential breaches, including
spyware and misconfigurations. Participants learned how to parse sysdiagnose
files and use the data to build timelines, enabling more efficient and thorough
investigations of iOS device</p>]]></content><author><name>Antoine Cailliau</name></author><category term="conference" /><summary type="html"><![CDATA[Day 3 of Hack.lu featured a mix of talks exploring both physical and digital security challenges. From discussions on outdated physical security measures to vulnerabilities in cutting-edge mobile app frameworks and critical infrastructure systems, the day offered valuable insights for cybersecurity professionals. The sessions provided practical demonstrations and real-world examples of how attackers exploit weaknesses in both physical and virtual environments, while also highlighting tools and techniques for enhancing detection and prevention.]]></summary></entry><entry><title type="html">Highlights from Hack.lu 2024 (Day 2)</title><link href="https://ancailliau.github.io//2024/10/23/Highlights-from-Hack-lu-2024-Day-2.html" rel="alternate" type="text/html" title="Highlights from Hack.lu 2024 (Day 2)" /><published>2024-10-23T00:00:00+00:00</published><updated>2024-10-23T00:00:00+00:00</updated><id>https://ancailliau.github.io//2024/10/23/Highlights-from-Hack-lu-2024-Day-2</id><content type="html" xml:base="https://ancailliau.github.io//2024/10/23/Highlights-from-Hack-lu-2024-Day-2.html"><![CDATA[<p>The second day of the conference offered a lot of insights, covering topics
from incident response to emerging threats in IoT, Kubernetes, and edge-device
security. Both morning and afternoon sessions provided practical takeaways, as
well as deeper perspectives on evolving attack surfaces and cybersecurity
techniques. The talks spanned diverse subjects, from corporate cybersecurity
incidents to advanced APT tracking, making for a dynamic and engaging day.</p>

<h2 id="morning-sessions">Morning Sessions</h2>

<p><strong>CSIRT and the Chocolate Factory</strong>: This case study detailed how a small
company in the chocolate machinery business faced a ransomware attack. Despite
paying the ransom, they were unable to decrypt their files. The CSIRT team
stepped in, uncovering a flaw in the ransomware that allowed them to recover
the files without needing the decryption key, providing key insights into
ransomware analysis and remediation.</p>

<p><strong>The Gist of Hundreds of Incident Response Cases</strong>: Stephan Berger shared
lessons learned from his experience in incident response, emphasizing the
importance of focusing on key artifacts, such as Anti-Virus logs and suspicious
network activity. He also highlighted the importance of automating and
streamlining incident investigations to handle large environments more
efficiently.</p>

<p><strong>IoT Hacks Humans: Unexpected Angles of Human Process Compromise</strong>: This
talk explored how IoT devices, which interact closely with human processes, can
be manipulated to create significant security risks. By collecting data from
connected devices, attackers can influence behaviors, spread disinformation,
and exploit digital identities. He highlighted real-world examples, such as
opinion manipulation and personal surveillance. The talk emphasized the
expanding human attack surface due to connected environments and stressed the
need for better defenses and awareness to counter these growing threats.</p>

<p><strong>KubeHound: Identifying Attack Paths in Kubernetes Clusters</strong>: Julien
Terriac introduced KubeHound, a tool designed to automate the identification of
attack paths in Kubernetes clusters. By applying graph theory, KubeHound allows
security teams to visualize and prioritize vulnerabilities, making it easier to
protect large-scale Kubernetes environments.</p>

<p><strong>It Has Been 0 Days Since the Last Edge-Device Security Incident</strong>: Paul
Rascagneres from Volexity discussed recent zero-day vulnerabilities in edge
devices, focusing on Ivanti Connect Secure and Palo Alto Global Protect. The
talk highlighted the challenges of detecting and responding to these
vulnerabilities and emphasized the need for better monitoring and forensics on
edge devices.</p>

<h2 id="afternoon-sessions">Afternoon Sessions</h2>

<p><strong>Chrome V8 Exploitation Training for Beginners</strong>: Hoseok Lee led a hands-on
workshop that introduced participants to the inner workings of the Chrome V8
engine. The training covered debugging techniques, analyzing vulnerabilities,
and exploiting bugs, providing beginners with a comprehensive guide to V8
exploitation.</p>

<p><strong>Securing the Stars: Modern Satellite Vulnerabilities</strong>: Vic Huang
presented an analysis of satellite vulnerabilities, including real-world cases
of compromised communication systems. He highlighted weaknesses in both
traditional satellite systems and open-source CubeSat projects, emphasizing the
urgent need for better security in space technology.</p>

<p><strong>DFIQ: Codifying Digital Forensic Intelligence</strong>: Thomas Chopitea
introduced DFIQ, a framework designed to organize and automate digital forensic
investigations. By codifying investigative questions and creating structured
workflows, DFIQ aims to standardize forensic practices and improve consistency
in investigations.</p>

<p><strong>Cyber Threats to Advanced Intelligent Connected Vehicle Systems</strong>: Shihao
Xue and Yuqiao Ning detailed the vulnerabilities present in Intelligent
Connected Vehicles (ICVs), including issues with the T-Box and CAN bus
interfaces. They demonstrated how these vulnerabilities could be exploited for
remote vehicle control and data theft, stressing the need for stronger security
in automotive systems.</p>

<p><strong>APT28: Following Bear Tracks Back to the Cave</strong>: Golo Baulig from IBM
X-Force explored the operations of the Russian state-sponsored group ITG05
(APT28), detailing recent campaigns, evolving malware, and infrastructure
changes. Baulig’s analysis provided insights into ITG05’s activities, including
their targeting of NATO member states and their continuous adaptation to
geopolitical shifts.</p>]]></content><author><name>Antoine Cailliau</name></author><category term="conference" /><summary type="html"><![CDATA[The second day of the conference offered a lot of insights, covering topics from incident response to emerging threats in IoT, Kubernetes, and edge-device security. Both morning and afternoon sessions provided practical takeaways, as well as deeper perspectives on evolving attack surfaces and cybersecurity techniques. The talks spanned diverse subjects, from corporate cybersecurity incidents to advanced APT tracking, making for a dynamic and engaging day.]]></summary></entry><entry><title type="html">Highlights from Hack.lu 2024 (Day 1)</title><link href="https://ancailliau.github.io//2024/10/22/Highlights-from-Hack-lu-2024-Day-1.html" rel="alternate" type="text/html" title="Highlights from Hack.lu 2024 (Day 1)" /><published>2024-10-22T00:00:00+00:00</published><updated>2024-10-22T00:00:00+00:00</updated><id>https://ancailliau.github.io//2024/10/22/Highlights-from-Hack-lu-2024-Day-1</id><content type="html" xml:base="https://ancailliau.github.io//2024/10/22/Highlights-from-Hack-lu-2024-Day-1.html"><![CDATA[<p>The ongoing edition of Hack.lu, the well-known cybersecurity conference,
provided today a wealth of knowledge, with both morning and afternoon sessions
delivering insights into emerging threats and advanced defensive strategies.
Across the day’s talks, we explored a range of topics—from the evolving nature
of botnets and Linux rootkits to unconventional malware persistence techniques
and the integration of new tools in threat intelligence workflows. These
sessions highlighted not only the sophistication of modern cyber threats but
also the innovative methods and tools being developed to counter them.
Additionally, a hands-on workshop on Return Oriented Programming (ROP) on ARM64
allowed me to gain practical skills in exploit development, making the day
highly valuable. Detailed feedback from each session will be published, in
accordance with the sharing rules.</p>

<h2 id="morning-sessions">Morning Sessions</h2>

<p>The morning sessions at the conference provided an in-depth look at the
evolving cybersecurity landscape, covering a range of topics from the
resilience of modern botnets to advancements in automation and threat
intelligence tools. Each talk presented unique insights into how the threat
environment is changing and the innovations being developed to counter these
risks, offering valuable lessons for CTI professionals.</p>

<p><strong>Insights from Modern Botnets</strong> Miguel Hernández’s presentation delved into
the inner workings of modern botnets, illustrating how these threats remain
highly adaptable. Botnets like Mirai and Shellbot continue to evolve, with
numerous variants easily accessible and used for DDoS attacks and cryptomining.
Hernández highlighted how botnets operate as a service, rebranding when
discovered, and often target critical sectors such as government and finance.
The research emphasized the growing sophistication and accessibility of these
threats.</p>

<p><strong>NeuroCTI: Benchmarking, Successes, Failures, and Lessons Learned</strong> Aaron
Kaplan shared his work on NeuroCTI, a custom large language model (LLM)
fine-tuned for CTI purposes. Kaplan discussed the challenges of training local
models for CTI data extraction, the difficulty of building a reliable dataset,
and the privacy concerns around cloud-based solutions. The model shows promise
in tasks such as summarization, named entity recognition (NER), and mapping
TTPs to MITRE ATT&amp;CK, but off-the-shelf LLMs still present tough competition.
The session underscored the need for fine-tuning and local deployment to
protect sensitive data.</p>

<p><strong>Tales of the Future Past</strong> Saâd Kadhi from CERT-EU provided a reflective talk
on the lessons learned from past cyber incidents and how they shape the future
of cybersecurity. He discussed the ongoing importance of traditional attack
vectors, such as cyberespionage and information operations, while highlighting
the potential threats posed by emerging technologies like AI. Kadhi cautioned
that while AI offers automation potential, it lacks the human intuition
necessary for comprehensive threat detection, urging caution in over-relying on
machine intelligence for security tasks.</p>

<p><strong>Integrating New Tools in Your Workflows Within Minutes in MISP</strong> Sami
Mokaddem demonstrated the ease of integrating new tools into existing
cybersecurity workflows using MISP. The session showcased how the MISP
automation framework, including <em>pymisp</em>, <em>misp-modules</em>, and <em>workflows</em>,
allows for the quick deployment of external tools to enrich threat intelligence
data. Mokaddem highlighted the flexibility of MISP’s workflow editor, which can
automate enrichment of <code>.onion</code> addresses, while restricting the sharing of
undesirable content.</p>

<p><strong>Lessons Learned from (almost) 8 Years of Sigma Development</strong> Thomas Patzke
offered valuable insights from his experience maintaining the open-source Sigma
project, a language for creating detection rules across different security
platforms. Patzke discussed the challenges of balancing simplicity and
scalability, highlighting the benefits of a complete toolchain rewrite in 2020.
The separation of code and rules, along with the adoption of better development
practices like test-driven development, improved the project’s maintainability
and adoption, but also introduced new complexities around coordination and
dependency management.</p>

<h2 id="afternoon-sessions">Afternoon Sessions</h2>

<p>This afternoon’s sessions provided in-depth insights into the evolving threat
landscape and defensive strategies across different platforms, from Windows
malware persistence to Linux rootkits, industrial protocol vulnerabilities, and
an innovative approach to honeypots using large language models (LLMs). Each
talk presented actionable strategies for detection and defense against these
sophisticated threats, alongside a hands-on workshop that introduced
participants to Return Oriented Programming (ROP) on ARM64, further equipping
attendees with practical skills in exploit development.</p>

<p><strong>Workshop: ROP on ARM64 - A Hands-On Tutorial</strong> In the workshop, Saumil Shah
provided participants with a practical introduction to Return Oriented
Programming (ROP) on ARM64. The tutorial covered essential ARM64 assembly
concepts, common ROP gadgets, and practical exploit development techniques,
including building ROP chains. Shah’s workshop offered a hands-on experience
with an ARM64 emulator and equipped participants with the skills to navigate
the unique challenges posed by the ARM64 architecture, making it a valuable
session for anyone interested in exploit development on this platform.</p>

<p><strong>Malware and Hunting for Persistence</strong> Cocomelonc’s presentation focused on
unconventional malware persistence techniques in Windows environments. The
session highlighted how adversaries use registry modifications and DLL
hijacking to maintain persistence on compromised systems. Through case studies,
including vulnerabilities in Internet Explorer, Microsoft Teams, and
cryptographic APIs, Cocomelonc demonstrated how attackers exploit legitimate
Windows resources to evade detection and maintain long-term access, emphasizing
the importance of robust detection strategies to counter these attacks.</p>

<p><strong>Breaking Industrial Protocol Translation Devices</strong> Claire Vacherot shared
insights from her research into vulnerabilities in Anybus X-gateways, critical
devices used for translating industrial protocols. Vacherot revealed how these
often-overlooked gateways are prime targets for attackers, given their role in
maintaining communication between OT systems. She detailed three critical
vulnerabilities in the device, including unauthenticated access, manipulation
of proprietary protocols, and denial-of-service attacks, showing how attackers
can exploit these weaknesses to disrupt industrial processes.</p>

<p><strong>In-Depth Study of Linux Rootkits: Evolution, Detection, and Defense</strong> Stephan
Berger’s talk explored the evolution of Linux rootkits, from early userland
techniques to modern kernel-level rootkits. Berger outlined advanced rootkit
techniques, such as hooking kernel functions and exploiting eBPF, and provided
a thorough review of detection strategies using integrity checking, behavioral
analysis, and memory forensics. By analyzing rootkits like Bedevil and
Diamorphine, Berger underscored the importance of using modern detection tools
to uncover sophisticated threats in Linux environments.</p>

<p><strong>Decoding Galah: an LLM-Powered Web</strong> Adel Karimi introduced Galah, an
innovative honeypot powered by large language models (LLMs) that dynamically
generates realistic HTTP responses to simulate multiple web applications.
Karimi discussed the challenges of building Galah, including issues with
response formatting and the difficulty of maintaining deception. Despite these
challenges, Galah successfully engaged attackers, particularly in cases
involving open proxy emulation. This approach showcased the potential of using
LLMs to improve honeypot realism and increase attacker interaction.</p>]]></content><author><name>Antoine Cailliau</name></author><category term="conference" /><summary type="html"><![CDATA[The ongoing edition of Hack.lu, the well-known cybersecurity conference, provided today a wealth of knowledge, with both morning and afternoon sessions delivering insights into emerging threats and advanced defensive strategies. Across the day’s talks, we explored a range of topics—from the evolving nature of botnets and Linux rootkits to unconventional malware persistence techniques and the integration of new tools in threat intelligence workflows. These sessions highlighted not only the sophistication of modern cyber threats but also the innovative methods and tools being developed to counter them. Additionally, a hands-on workshop on Return Oriented Programming (ROP) on ARM64 allowed me to gain practical skills in exploit development, making the day highly valuable. Detailed feedback from each session will be published, in accordance with the sharing rules.]]></summary></entry><entry><title type="html">Dissecting a File Upload in Vertex Synapse</title><link href="https://ancailliau.github.io//2023/02/10/Dissecting-a-File-Upload-in-Vertex-Synapse.html" rel="alternate" type="text/html" title="Dissecting a File Upload in Vertex Synapse" /><published>2023-02-10T00:00:00+00:00</published><updated>2023-02-10T00:00:00+00:00</updated><id>https://ancailliau.github.io//2023/02/10/Dissecting-a-File-Upload-in-Vertex-Synapse</id><content type="html" xml:base="https://ancailliau.github.io//2023/02/10/Dissecting-a-File-Upload-in-Vertex-Synapse.html"><![CDATA[<p>In this post, we’ll explore how files get stored in a Vertex Axon and recorded
on the Vertex Synapse platform. The Axon is a tool for storing binary data
securely within the Synapse framework; it indexes binaries using SHA-256 hash
so that no duplicate storage occurs. By default, blobs are stored inside an
LMDB Slab.</p>

<p>I created this post to gain a more extensive comprehension of file uploads,
allowing me to rebuild the feature within my custom Telepath client in C#. In
a following blog entry, I will look into how one can download files from
Synapse/Axon.</p>

<h2 id="lmdb">LMDB?</h2>

<p>LMDB (Lightning Memory-Mapped Database) is a powerful software library that
facilitates lightning-fast transactions for applications requiring massive
amounts of data storage and access. It’s specifically designed to be fast,
reliable, and endlessly scalable - rendering it the optimal selection for
programs needing substantial performance levels with minimal latency.</p>

<p>LMDB employs a revolutionary technique known as memory mapping, which gives the
system permission to process a file just like it were part of its internal
memory. As a result, it becomes simple and quick for users to access data
stored in the database since no copying or transferring is needed — data can be
acquired directly from memory!</p>

<p>The transactional nature of LMDB is integral, providing a reliable way to
manage database updates and ensure that they remain consistent. This durability
is especially essential in applications where data integrity can’t be
compromised, as it guarantees the preservation of an unchanged state - even if
there’s a power failure or system crash!</p>

<p>LMDB offers an impressive, dynamic database solution fit for applications that
need rapid and reliable access to enormous amounts of data. This technology is
utilized all over the world in a wide range of contexts, from advanced web apps
to embedded systems and even databases themselves.</p>

<h2 id="test-bed">Test bed</h2>

<p>For the purpose of this post, we will be uploading two files. The first one is
an empty file named <code>test.txt</code> and contains nothing inside it; while the second
one is titled <code>hello-world.txt</code>, which only has a string that says <code>Hello
World!</code>.</p>

<pre><code>$ shasum -a 256 test.txt 
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  test.txt
$ shasum -a 256 hello-world.txt 
7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069  hello-world.txt
</code></pre>

<p>To initiate transmission of our two data files, we first launched a Vertex
Synapse node (via Docker) on port 8903 to interact with the Telepath API. We
then fired up Wireshark to capture the traffic between server and client before
running the following commands in a Storm client:</p>

<pre><code>$ python3 -m synapse.tools.storm tcp://root:***@localhost:8903/

Welcome to the Storm interpreter!

Local interpreter (non-storm) commands may be executed with a ! prefix:
    Use !quit to exit.
    Use !help to see local interpreter commands.

storm&gt; !pushfile test.txt
uploading file: test.txt
.........
file:bytes=sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        :name = test.txt
        :sha256 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        .created = 2023/02/10 07:32:06.671
complete. 1 nodes in 105 ms (9/sec).
storm&gt;  !pushfile hello-world.txt
uploading file: hello-world.txt
.........
file:bytes=sha256:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
        :name = hello-world.txt
        :sha256 = 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
        .created = 2023/02/10 08:01:12.755
complete. 1 nodes in 25 ms (40/sec).

storm&gt; !quit
o/
</code></pre>

<p>We paused the Wireshark capture and scrutinized the relevant packets, paying
special attention to their msgpack-encoded messages. By copying these as a hex
stream in Wireshark, we were able to <a href="https://msgpack.solder.party/">decode them
online</a>. with ease.</p>

<h2 id="exchanges-telepath-messages">Exchanges Telepath Messages</h2>

<p>To begin, we must fetch a handle to write onto and save. The best way to do
this is by sending out the <code>t2:init</code> message for the method <a href="https://synapse.docs.vertex.link/en/latest/synapse/autodocs/synapse.html?highlight=getAxonUpload#synapse.cortex.CoreApi.getAxonUpload"><code>getAxonUpload</code></a>. With
that done, we can write our desired data.</p>

<pre><code>[
  "t2:init",
  {
    "todo": [
      "getAxonUpload",
      [],
      {}
    ],
    "name": null,
    "sess": "865026c78fe7e6fa304394d460738505"
  }
]
</code></pre>

<p>The server will return a response containing various key values, with one of
the most important being <code>iden</code> which we’ll need to upload our file.</p>

<pre><code>[
  "t2:share",
  {
    "iden": "730bc4268e211064c973c27510acd2d1",
    "sharinfo": {
      "meths": {},
      "syn:commit": "92fc8df3c249f39c26d76ff2db2a48b2b5abd41f",
      "syn:version": [
        2,
        122,
        0
      ],
      "classes": [
        "synapse.axon.UpLoadProxy",
        "synapse.lib.share.Share",
        "synapse.lib.base.Base"
      ]
    }
  }
]
</code></pre>

<p>To start, we will be uploading the empty file <code>test.txt</code>. We have nothing to
write in this case, thus all that is needed is a call of <code>save</code> on our handle
(which you should remember as <code>synapse.axon.UpLoadProxy</code>).</p>

<pre><code>[
  "t2:init",
  {
    "todo": [
      "save",
      [],
      {}
    ],
    "name": "730bc4268e211064c973c27510acd2d1",
    "sess": "865026c78fe7e6fa304394d460738505"
  }
]
</code></pre>

<p>The server provides the following affirmative notifications, confirming that we
have completed our task.</p>

<pre><code>[
  "t2:fini",
  {
    "retn": [
      true,
      [
        0,
        {
          "type": "Buffer",
          "data": [
            227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 
            185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 
            120, 82, 184, 85
          ]
        }
      ]
    ]
  }
]
[
  "share:fini",
  {
    "share": "730bc4268e211064c973c27510acd2d1"
  }
]
</code></pre>

<p>The value in the field <code>data</code> provides us with the SHA256 hash of the file,
as you can decode for example with <a href="https://gchq.github.io/CyberChef/#recipe=From_Decimal('Comma',false)To_Hex('None',0)&amp;input=MjI3LCAxNzYsIDE5NiwgNjYsIDE1MiwgMjUyLCAyOCwgMjAsIDE1NCwgMjUxLCAyNDQsIDIwMCwgMTUzLCAxMTEsIDE4NSwgMzYsIDM5LCAxNzQsIDY1LCAyMjgsIDEwMCwgMTU1LCAxNDcsIDc2LCAxNjQsIDE0OSwgMTUzLCAyNywgMTIwLCA4MiwgMTg0LCA4NQ">CyberChef</a>.</p>

<p>For the second instance, we are uploading a text file titled <code>hello-world.txt</code>
which isn’t blank; it carries the string <code>Hello World!</code> that is translated as:</p>

<pre><code>$ hexdump -C hello-world.txt
00000000  48 65 6c 6c 6f 20 57 6f  72 6c 64 21              |Hello World!|
0000000c
</code></pre>

<p>That is, in decimal</p>

<pre><code>$ hexdump -e'"%07.8_ad  " 8/1 "%d " "  " 8/1 "%d " "  |"' -e'16/1  "%_p"  "|\n"' hello-world.txt 
00000000  72 101 108 108 111 32 87 111 114 108 100 33      |Hello World!|
</code></pre>

<p>By using the <code>write</code> method on our handle, we can store the bytes contained in
the field <code>data</code>, which are expressed as decimals.</p>

<pre><code>[
  "t2:init",
  {
    "todo": [
      "write",
      [
        {
          "type": "Buffer",
          "data": [
            72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33
          ]
        }
      ],
      {}
    ],
    "name": "730bc4268e211064c973c27510acd2d1",
    "sess": "865026c78fe7e6fa304394d460738505"
  }
]
</code></pre>

<p>After executing the operation, we received confirmation that it was a success.</p>

<pre><code>[
  "t2:fini",
  {
    "retn": [
      true,
      null
    ]
  }
]
</code></pre>

<p>We can now save the file, like demonstrated above with the empty file.</p>

<p>Uploading the file to Axon does not register in Synapse’s server. Thus, there
is a need for us to record a <code>file:bytes</code> node in Synapse and we do this by
sending a <code>t2:init</code> message for the
<a href="https://synapse.docs.vertex.link/en/latest/synapse/autodocs/synapse.html?highlight=write#synapse.cortex.CoreApi.storm"><code>storm</code></a> method with query <code>[
file:bytes=$sha256 ] { -:name [ :name = $name] }</code> along with its corresponding
mapping variable.</p>

<pre><code>[
  "t2:init",
  {
    "todo": [
      "storm",
      [
        "[ file:bytes=$sha256 ] { -:name [:name=$name] }"
      ],
      {
        "opts": {
          "repr": true,
          "vars": {
            "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
            "name": "test.txt"
          }
        }
      }
    ],
    "name": null,
    "sess": "865026c78fe7e6fa304394d460738505"
  }
]
</code></pre>

<p>In return, we get a generator and the node. For brevity in our explanation,we
will omit any message related to node-edits from this output.</p>

<pre><code>[
  "t2:genr",
  {}
]
[
  "t2:yield",
  {
    "retn": [
      true,
      [
        "init",
        {
          "tick": 1676014326577,
          "text": "[ file:bytes=$sha256 ] { -:name [:name=$name] }",
          "task": "453997a728583c8038263f8116cab3ca"
        }
      ]
    ]
  }
]
...
(skipping two node-edit message)
...
[
  "t2:yield",
  {
    "retn": [
      true,
      [
        "node",
        [
          [
            "file:bytes",
            "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          ],
          {
            "iden": "3fda2bf653ccbf15df887152bcf2fa86a0a95375cefd45e47dbe1f76051e2b87",
            "tags": {},
            "props": {
              ".created": 1676014326671,
              "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
              "name": "test.txt"
            },
            "tagprops": {},
            "nodedata": {},
            "reprs": {
              ".created": "2023/02/10 07:32:06.671"
            },
            "tagpropreprs": {},
            "path": {}
          }
        ]
      ]
    ]
  }
]
...
[
  "t2:yield",
  {
    "retn": [
      true,
      [
        "fini",
        {
          "tock": 1676014326682,
          "took": 105,
          "count": 1
        }
      ]
    ]
  }
]
</code></pre>

<p>Our Synapse instance has just added a new node, which our <code>t2:yield</code> with node
details. We can verify that the files exist in our client:</p>

<pre><code>storm&gt; file:bytes
file:bytes=sha256:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
        :name = hello-world.txt
        :sha256 = 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
        .created = 2023/02/10 08:01:12.755
file:bytes=sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        :name = test.txt
        :sha256 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        .created = 2023/02/10 07:32:06.671
complete. 2 nodes in 5 ms (400/sec).
</code></pre>

<p>It is possible to create a model of any given file in Synapse without having to
manually upload the file. This comes in handy when you are working on malicious
intrusions, for example: <em>“sample xxx drops yyy”</em> where both <em>xxx</em> and <em>yyy</em>
refer to specific hashes. We can then design the files as <code>file:bytes</code> with
their corresponding hash properties set up. If at some point we decide to
upload these files (e.g., from VirusTotal), Synapse will automatically detect
this and avoid recreating it if its original hashes match those on record.</p>]]></content><author><name>Antoine Cailliau</name></author><category term="synapse" /><category term="storm" /><summary type="html"><![CDATA[In this post, we’ll explore how files get stored in a Vertex Axon and recorded on the Vertex Synapse platform. The Axon is a tool for storing binary data securely within the Synapse framework; it indexes binaries using SHA-256 hash so that no duplicate storage occurs. By default, blobs are stored inside an LMDB Slab.]]></summary></entry><entry><title type="html">Tracking Organizations in Vertex Synapse</title><link href="https://ancailliau.github.io//2023/02/03/Tracking-Organizations-in-Vertex-Synapse.html" rel="alternate" type="text/html" title="Tracking Organizations in Vertex Synapse" /><published>2023-02-03T00:00:00+00:00</published><updated>2023-02-03T00:00:00+00:00</updated><id>https://ancailliau.github.io//2023/02/03/Tracking-Organizations-in-Vertex-Synapse</id><content type="html" xml:base="https://ancailliau.github.io//2023/02/03/Tracking-Organizations-in-Vertex-Synapse.html"><![CDATA[<p>In this blog post, I will provide insight into tracking organizations using the
Vertex <a href="https://vertex.link/synapse">Synapse</a> system. This centralized
intelligence platform will store all important data and intelligence. The core
component of the system is open source.</p>

<p>Structured data and data modeling enables us to gain a deeper comprehension of
the world and how it works. We can query our system to uncover correlations,
retrieve information or create statistics, warnings, etc. In Synapse, for
example, I model organizations with <code>ou:org</code> type which is referred to as “A
human organization such as a company or military unit.”</p>

<p>With <code>ou:org</code>, there is an abundance of properties available. But rather than
being overwhelmed by the multitude of possibilities, focus on your specific
needs to determine what fields would be essential for you to record information
and answer any future questions. Utilize your primary intelligence and
collection requirements to identify which elements you should prioritize to
achieve optimal results.</p>

<table>
  <thead>
    <tr>
      <th>Property</th>
      <th>Description</th>
      <th>Type</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>.seen</td>
      <td>The time interval for first/last observation of the node.</td>
      <td>ival</td>
    </tr>
    <tr>
      <td>loc</td>
      <td>Location for an organization.</td>
      <td>loc</td>
    </tr>
    <tr>
      <td>name</td>
      <td>The localized name of an organization.</td>
      <td>ou:name</td>
    </tr>
    <tr>
      <td>type</td>
      <td>The type of organization.</td>
      <td>str</td>
    </tr>
    <tr>
      <td>orgtype</td>
      <td>The type of organization.</td>
      <td>ou:orgtype</td>
    </tr>
    <tr>
      <td>vitals</td>
      <td>The most recent/accurate ou:vitals for the org.</td>
      <td>ou:vitals</td>
    </tr>
    <tr>
      <td>desc</td>
      <td>A description of the org.</td>
      <td>str</td>
    </tr>
    <tr>
      <td>logo</td>
      <td>An image file representing the logo for the organization.</td>
      <td>file:bytes</td>
    </tr>
    <tr>
      <td>names</td>
      <td>A list of alternate names for the organization.</td>
      <td>array</td>
    </tr>
    <tr>
      <td>alias</td>
      <td>The default alias for an organization.</td>
      <td>ou:alias</td>
    </tr>
    <tr>
      <td>phone</td>
      <td>The primary phone number for the organization.</td>
      <td>tel:phone</td>
    </tr>
    <tr>
      <td>sic</td>
      <td>The Standard Industrial Classification code for the organization.</td>
      <td>ou:sic</td>
    </tr>
    <tr>
      <td>naics</td>
      <td>The North American Industry Classification System code for the organization.</td>
      <td>ou:naics</td>
    </tr>
    <tr>
      <td>industries</td>
      <td>The industries associated with the org.</td>
      <td>array</td>
    </tr>
    <tr>
      <td>us:cage</td>
      <td>The Commercial and Government Entity (CAGE) code for the organization.</td>
      <td>gov:us:cage</td>
    </tr>
    <tr>
      <td>founded</td>
      <td>The date on which the org was founded.</td>
      <td>time</td>
    </tr>
    <tr>
      <td>dissolved</td>
      <td>The date on which the org was dissolved.</td>
      <td>time</td>
    </tr>
    <tr>
      <td>url</td>
      <td>The primary url for the organization.</td>
      <td>inet:url</td>
    </tr>
    <tr>
      <td>subs</td>
      <td>An set of sub-organizations.</td>
      <td>array</td>
    </tr>
    <tr>
      <td>orgchart</td>
      <td>The root node for an orgchart made up ou:position nodes.</td>
      <td>ou:position</td>
    </tr>
    <tr>
      <td>hq</td>
      <td>A collection of contact information for the “main office” of an org.</td>
      <td>ps:contact</td>
    </tr>
    <tr>
      <td>locations</td>
      <td>An array of contacts for facilities operated by the org.</td>
      <td>array</td>
    </tr>
    <tr>
      <td>dns:mx</td>
      <td>An array of MX domains used by email addresses issued by the org.</td>
      <td>array</td>
    </tr>
    <tr>
      <td>goals</td>
      <td>The assessed goals of the organization.</td>
      <td>array</td>
    </tr>
  </tbody>
</table>

<p>It’s interesting to note the distinction between <code>type</code> and <code>orgtype</code>, as both
captures essentially the same thing. The <code>ou:orgtype</code> type captures an
organization-type taxonomy with a more specific set of values than what is
found in the free text field. Having such constrained values can be extremely
useful when creating statistics; for example, you could define types such as
corporation, non-profit organization, government agency, or cooperative.</p>

<p>The <code>ou:org</code> type is based on a GUID, so finding a unique identifier for
deconfliction can prove difficult. However, we can use an alternative property</p>
<ul>
  <li>such as the organization’s name – to identify if it already exists when
importing or creating our organizations. This saves us from having to conduct
searches every time! To achieve this goal, Synapse proposes GUID generators
driven by an extra property. We are particularly interested in the
<code>$lib.gen.orgByName(name)</code> generator which will generate an ou: org with the
specified name if it does not already exist yet. Furthermore, another generator
of interest is <code>$lib.gen.orgByFqdn(fqdn)</code>, which returns a generated
organization node based on a domain used for emailing purposes - usually taken
from an email address itself!</li>
</ul>

<p>As an initial case study, let’s discuss my enterprise Cyantlabs. The following
steps will generate the node (or retrieve it if it has already been created).</p>

<pre><code>storm&gt; $lib.gen.orgByName("cyantlabs")
</code></pre>

<p>Afterward, we can broaden the node’s properties with more detailed information.</p>

<pre><code>storm&gt; ou:org:name="cyantlabs" [ loc="be.bru.brussels" dns:mx=$lib.list("cyantlabs.com") ]
</code></pre>

<p>By introducing the organization, we can now transition from an individual email
address to that of the company. For instance</p>

<pre><code>storm&gt; inet:email="spam@cyantlabs.com" -&gt; inet:fqdn -&gt; ou:org
</code></pre>

<p>We can also utilize the second generator based off of a domain name. For
instance, after starting with an email address, we acquire its related domain
to subsequently create (if necessary) the organization node.</p>

<pre><code>storm&gt; [ inet:email="info@nviso.eu" ] -&gt; inet:fqdn $lib.gen.orgByFqdn($node)
</code></pre>

<p>An intriguing element is the ‘loc’ datatype, which forms a hierarchy with
dot-separated strings. For instance, we can easily fetch all Belgian
organizations stored in our system:</p>

<pre><code>storm&gt; ou:org:loc=be.*
</code></pre>

<p>or organizations situated in the Brussels region</p>

<pre><code>storm&gt; ou:org:loc=be.bru.*

ou:org=8a9d383c25ebf82bd710b274e75ef5fd
    .created=2023/02/04 01:03:05.826
    name=nviso
    loc=be.bru.etterbeek
    dns:mx=(nviso.eu)
ou:org=17c8a7cdaae78909c954a28ea7cec2b9
    .created=2023/02/01 23:21:06.839
    dns:mx=(cyantlabs.com)
    name=cyantlabs
    loc=be.bru.schaerbeek
</code></pre>

<p>By tracking organizations in Vertex Synapse, you can leverage the <code>ou:org</code> node
and its various properties to effectively manage your organization roster. Once
the nodes are created, several useful properties can be utilized - such as
location and DNS MX records - to gain a better understanding of the
organizations you’re tracking. As this article shows, Vertex Synapse provides
an intuitive way to record and monitor your (cyber) structured data.</p>

<p>Happy modeling! :)</p>]]></content><author><name>Antoine Cailliau</name></author><category term="synapse" /><category term="storm" /><summary type="html"><![CDATA[In this blog post, I will provide insight into tracking organizations using the Vertex Synapse system. This centralized intelligence platform will store all important data and intelligence. The core component of the system is open source.]]></summary></entry><entry><title type="html">Hunting on custom log files with Chainsaw</title><link href="https://ancailliau.github.io//2022/08/24/Hunting-on-custom-log-files-with-chainsaw.html" rel="alternate" type="text/html" title="Hunting on custom log files with Chainsaw" /><published>2022-08-24T00:00:00+00:00</published><updated>2022-08-24T00:00:00+00:00</updated><id>https://ancailliau.github.io//2022/08/24/Hunting-on-custom-log-files-with-chainsaw</id><content type="html" xml:base="https://ancailliau.github.io//2022/08/24/Hunting-on-custom-log-files-with-chainsaw.html"><![CDATA[<p>The previous posts looked on how we could hunt on <a href="/2022/08/17/Creating-EVTX-for-malicious-activity.html">forged EVTX 
files</a>. However, in the course of an incident response or advanced threat
hunting, not all logs lies in properly formated EVTX files. For example, some firewalls
export their logs in JSON format, some application will output XML. On Windows
servers, these might eventually reach an event log but on Linux, it will most
likely remains as it is. As I don’t like wasting my time, I want to leverage
Sigma rules on JSON and XML files. Today, I focus my post on JSON files.</p>

<p>In an ideal scenario, these logs are ingested in your SIEM and you can
compile your <a href="https://github.com/SigmaHQ/Sigma">Sigma</a> rule to the proper backend. But in real life, that is not always the
case and you sometimes need to fallback on good ol’ text files. During an 
incident response, you don’t have the luxury to wait for the logs to be ingested;
during a threat hunt you don’t want the SOC to spend time ingesting a useless
log source.</p>

<p>To illustrate the process, let’s take a log entry from <a href="https://docs.aws.amazon.com/network-firewall/latest/developerguide/firewall-logging.html">AWS Network Firewall</a></p>

<pre><code>{
  "firewall_name": "test-firewall",
  "availability_zone": "us-east-1b",
  "event_timestamp": "1602627001",
  "event": {
    "timestamp": "2020-10-13T22:10:01.006481+0000",
    "flow_id": 1582438383425873,
    "event_type": "alert",
    "src_ip": "203.0.113.4",
    "src_port": 55555,
    "dest_ip": "192.0.2.16",
    "dest_port": 111,
    "proto": "TCP",
    "alert": {
      "action": "allowed",
      "signature_id": 5,
      "rev": 0,
      "signature": "test_tcp",
      "category": "",
      "severity": 1
    }
  }
}
</code></pre>

<p>While <code>grep</code>, <code>cut</code>, <code>sort</code>, <code>awk</code> or <code>jq</code> are of great help (in particular when the
log file is <code>jsonl</code>), they form
recipe that are difficult to share and document. Good luck if your log format is XML however. You could probably create the
<code>grep</code> expression that would matches the log entries you assessed malicious but
you would like to hoard that knowledge.</p>

<p>When the SOC has completed its job of ingesting the log source, you don’t want to come back and re-create a detection rule.</p>

<p>A solution is to write a Sigma rule and apply it directly to the text file.
<a href="https://github.com/WithSecureLabs/chainsaw/releases/tag/v2.0.0">Chainsaw 2.0</a> released yesterday supports JSON logs, with some caveat.</p>

<p>For our example, we could assess for example that this log entry is malicious
because it is an alert (<code>"event_type":"alert"</code>) to the destination ip <code>192.0.2.16</code> (so <code>"dest_ip":"192.0.2.16"</code>).
A possible rule is then</p>

<pre><code class="language-yaml">title: Suspicious activity to compromised machine
id: 94f9921a-23b2-11ed-861d-0242ac120002
status: experimental
description: An alert for the test rule test_tcp to a compromised machine
author: Antoine Cailliau
date: 2022/08/24
detection:
    selection:
        EventType: 'alert'
        DestinationIp: '192.0.2.16'
    condition: selection
level: low
fields:
    - Signature
    - SourceIp
    - DestinationIp
falsepositives:
    - Unknown    
</code></pre>

<p>Before being able to execute the rule against the JSON file, we need to create a mapping
that will translate the fields of the Sigma rule to the correct JSON fields. 
For the example here, I decided the following mapping:</p>

<table>
  <thead>
    <tr>
      <th>Sigma Field</th>
      <th>JSON Path</th>
      <th>Example Value</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>FirewallName</td>
      <td>firewall_name</td>
      <td>test-firewall</td>
    </tr>
    <tr>
      <td>AvailabilityZone</td>
      <td>availability_zone</td>
      <td>us-east-1b</td>
    </tr>
    <tr>
      <td>TimeCreated</td>
      <td>event_timestamp</td>
      <td>1602627001</td>
    </tr>
    <tr>
      <td>Timestamp</td>
      <td>event.timestamp</td>
      <td>2020-10-13T22:10:01.006481+0000</td>
    </tr>
    <tr>
      <td>FlowID</td>
      <td>event.flow_id</td>
      <td>1582438383425873</td>
    </tr>
    <tr>
      <td>EventType</td>
      <td>event.event_type</td>
      <td>alert</td>
    </tr>
    <tr>
      <td>SourceIp</td>
      <td>event.src_ip</td>
      <td>203.0.113.4</td>
    </tr>
    <tr>
      <td>SourcePort</td>
      <td>event.src_port</td>
      <td>55555</td>
    </tr>
    <tr>
      <td>DestinationIp</td>
      <td>event.dest_ip</td>
      <td>192.0.2.16</td>
    </tr>
    <tr>
      <td>DestinationPort</td>
      <td>event.dest_port</td>
      <td>111</td>
    </tr>
    <tr>
      <td>Protocol</td>
      <td>event.proto</td>
      <td>TCP</td>
    </tr>
    <tr>
      <td>Action</td>
      <td>event.alert.action</td>
      <td>allowed</td>
    </tr>
    <tr>
      <td>SignatureID</td>
      <td>event.alert.signature_id</td>
      <td>5</td>
    </tr>
    <tr>
      <td>Revision</td>
      <td>event.alert.rev</td>
      <td>0</td>
    </tr>
    <tr>
      <td>Signature</td>
      <td>event.alert.signature</td>
      <td>test_tcp</td>
    </tr>
    <tr>
      <td>Category</td>
      <td>event.alert.category</td>
      <td> </td>
    </tr>
    <tr>
      <td>Severity</td>
      <td>event.alert.severity</td>
      <td>1</td>
    </tr>
  </tbody>
</table>

<p>That can be translate in Chainsaw format as follow. Note that the format requires
a <code>filter</code> section, commonly on the provider. Here I decided to call the provider
<code>AWS-Network-Firewall</code>.</p>

<pre><code>---
name: Chainsaw's Sigma mappings to AWS Firewall logs
kind: json
rules: sigma

groups:
  - name: Sigma
    timestamp: Timestamp
    filter:
      Provider: "*"
    fields:
      - name: Firewall Name
        from: FirewallName
        to: firewall_name
      - name: Availability Zone
        from: AvailabilityZone
        to: availability_zone
      - name: Time Created
        from: TimeCreated
        to: event_timestamp
      - name: Timestamp
        from: Timestamp
        to: event.timestamp 
      - name: Flow ID
        from: FlowID
        to: event.flow_id
      - name: Event Type
        from: EventType
        to: event.event_type
      - name: Source Ip
        from: SourceIp
        to: event.src_ip
      - name: Source Port
        from: SourcePort
        to: event.src_port
      - name: Destination Ip
        from: DestinationIp
        to: event.dest_ip 
      - name: Destination Port
        from: DestinationPort
        to: event.dest_port 
      - name: Protocol
        from: Protocol
        to: event.proto 
      - name: Action
        from: Action
        to: event.alert.action 
      - name: SignatureID
        from: Signature ID
        to: event.alert.signature_id 
      - name: Revision
        from: Revision
        to: event.alert.rev 
      - name: Signature
        from: Signature
        to: event.alert.signature
      - name: Category
        from: Category
        to: event.alert.category
      - name: Severity
        from: Severity
        to: event.alert.severity 
      - name: Provider
        from: Provider
        to: provider
</code></pre>

<p>For our JSON lines to have a chance to match the rule, we need to massage it for Chainsaw:</p>
<ol>
  <li>Our log file is composed on JSON lines and Chainsaw requires an array of JSON objects.</li>
  <li>Our log file does not contain the <em>provider</em> field.</li>
  <li>The format of the date <code>2020-10-13T22:10:01.006481+0000</code> does not please Chainsaw.</li>
</ol>

<p>Hopefully, <code>jq</code> can apply such transform very easily.</p>

<pre><code class="language-shell">$ cat 20220824-aws-network-firewall.json \
    | jq '.provider = "AWS-Network-Firewall"' \
    | jq '.event.timestamp = (.event.timestamp | split(".")[0] | strptime("%Y-%m-%dT%H:%M:%S") | strftime("%Y-%m-%dT%H:%M:%S.0000Z"))' \
    | jq -s . \
    &gt; 20220824-aws-network-firewall_chainsaw.json
</code></pre>

<p>and we can now run the Sigma rule against the log file,</p>

<pre><code class="language-shell">$ ./chainsaw hunt ./20220824-aws-network-firewall_chainsaw.json \
    --sigma ./example-aws-rule.yaml \
    --mapping ./mappings/sigma-aws-firewall.yml
</code></pre>

<p>For example,</p>

<pre><code class="language-shell">$ ./chainsaw hunt ./20220824-aws-network-firewall_chainsaw.json --sigma ./example-aws-rule.yaml --mapping ./mappings/sigma-aws-firewall.yml  --json -q | jq .
[
  {
    "group": "Sigma",
    "kind": "individual",
    "document": {
      "kind": "json",
      "data": {
        "availability_zone": "us-east-1b",
        "event": {
          "alert": {
            "action": "allowed",
            "category": "",
            "rev": 0,
            "severity": 1,
            "signature": "test_tcp",
            "signature_id": 5
          },
          "dest_ip": "192.0.2.16",
          "dest_port": 111,
          "event_type": "alert",
          "flow_id": 1582438383425873,
          "proto": "TCP",
          "src_ip": "203.0.113.4",
          "src_port": 55555,
          "timestamp": "2020-10-13T22:10:01.0000Z"
        },
        "event_timestamp": "1602627001",
        "firewall_name": "test-firewall",
        "provider": "AWS-Network-Firewall"
      }
    },
    "name": "Suspicious activity to compromised machine",
    "timestamp": "2020-10-13T22:10:01+00:00",
    "authors": [
      "Antoine Cailliau"
    ],
    "level": "low",
    "source": "sigma",
    "status": "experimental",
    "falsepositives": [
      "Unknown"
    ],
    "id": "94f9921a-23b2-11ed-861d-0242ac120002"
  }
]
</code></pre>

<p>Happy hunting :bow_and_arrow:</p>]]></content><author><name>Antoine Cailliau</name></author><category term="Sigma" /><category term="threat-hunting" /><category term="chainsaw" /><summary type="html"><![CDATA[The previous posts looked on how we could hunt on forged EVTX files. However, in the course of an incident response or advanced threat hunting, not all logs lies in properly formated EVTX files. For example, some firewalls export their logs in JSON format, some application will output XML. On Windows servers, these might eventually reach an event log but on Linux, it will most likely remains as it is. As I don’t like wasting my time, I want to leverage Sigma rules on JSON and XML files. Today, I focus my post on JSON files.]]></summary></entry><entry><title type="html">Creating EVTX for malicious activity</title><link href="https://ancailliau.github.io//2022/08/17/Creating-EVTX-for-malicious-activity.html" rel="alternate" type="text/html" title="Creating EVTX for malicious activity" /><published>2022-08-17T00:00:00+00:00</published><updated>2022-08-17T00:00:00+00:00</updated><id>https://ancailliau.github.io//2022/08/17/Creating-EVTX-for-malicious-activity</id><content type="html" xml:base="https://ancailliau.github.io//2022/08/17/Creating-EVTX-for-malicious-activity.html"><![CDATA[<p><a href="/2022/08/16/Developing-Sigma-rules-with-chainsaw.html">Previous post</a> explained my process for developing <a href="https://github.com/SigmaHQ/Sigma">Sigma</a> rules to detect 
suspicious activity. A key element in developing such rules is the log file
itself. While incident response will provides you plenty of (large) event logs
with malicious activity, it might be time-consuming to read hundreds of
thousands log lines to find the one you are interested in detecting. Or you might
not even have the possiblity to get such event logs; For example, a new version
of <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon">SysMon</a> is released and you would like to test the new capabilities.</p>

<p>Webshell
are a very common plague in today attack and are used by almost all the 
documented threat actors. You can find plenty webshells freely available on 
GitHub. A few YARA rules to webshells are commonly available, and a few <a href="https://github.com/SigmaHQ/Sigma/search?q=webshell">Sigma rules</a>
detects suspicious process spawned from common web server executables.</p>

<p>Let’s assume for the example a webshell in C# (because that is my favorite 
language) that compiles and execute the code dynamically, like <a href="https://d.uijn.nl/2019/04/18/yet-another-apt34-oilrig-leak-quick-analysis/">one</a> 
allegedly used by APT34 leaked in 2019, <a href="https://www.sentinelone.com/labs/solarwinds-understanding-detecting-the-supernova-webshell-trojan/">SUPERNOVA</a> as used during the SolarWinds compromise or in <a href="https://github.com/antonioCoco/SharPyShell">ShaPyShell</a> 
released a year ago. The webshell will take a source code as a parameter, will
compile the code, and execute the compiled code. A second attack we will have
a look at will drop an executable in the <code>C:\inetpub\wwwroot</code> folder. I will not provide such webshell,
there is no reason to lower the bar for any attacker.</p>

<p>First, I started with a clean Windows 10 machine, installed IIS and ASP.NET
components, and the webshell causing the activity I want to detect. For monitoring and detection, I’m focused on SysMon and wanted to
test the latest version that went out yesterday. I thereby installed SysMon 14
and used a <a href="https://github.com/SwiftOnSecurity/sysmon-config">default configuration file</a>
with a small addition to trigger the latest capability of SysMon:</p>

<pre><code class="language-xml">&lt;RuleGroup name="" groupRelation="or"&gt;
    &lt;FileBlockExecutable onmatch="include"&gt;
        &lt;TargetFilename condition="contains all"&gt;C:\inetpub\wwwroot&lt;/TargetFilename&gt;
    &lt;/FileBlockExecutable&gt;
&lt;/RuleGroup&gt;
</code></pre>

<p>Now, the testing harness is set up. We can simulate the attack and generate the
EVTX file. My process is</p>

<ol>
  <li>Test the malicious activity to ensure that it works.</li>
  <li>Open <code>eventvwr</code> and clear the SysMon log (or other log source I can use to detect the behavior)</li>
  <li>Execute the malicious activity.</li>
  <li>Refresh the <code>eventvwr</code> and export the relevant log file(s) as EVTX.</li>
</ol>

<p>For the example, I generated the following 3 events. An event recording <code>w3wp.exe</code> writing a DLL,</p>

<pre><code class="language-{xml}">&lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
        &lt;Provider Name="Microsoft-Windows-Sysmon" Guid="{5770385f-c22a-43e0-bf4c-06f5698ffbd9}" /&gt; 
        &lt;EventID&gt;11&lt;/EventID&gt; 
        &lt;Version&gt;2&lt;/Version&gt; 
        &lt;Level&gt;4&lt;/Level&gt; 
        &lt;Task&gt;11&lt;/Task&gt; 
        &lt;Opcode&gt;0&lt;/Opcode&gt; 
        &lt;Keywords&gt;0x8000000000000000&lt;/Keywords&gt; 
        &lt;TimeCreated SystemTime="2022-08-17T14:36:03.5803606Z" /&gt; 
        &lt;EventRecordID&gt;2246&lt;/EventRecordID&gt; 
        &lt;Correlation /&gt; 
        &lt;Execution ProcessID="3000" ThreadID="1232" /&gt; 
        &lt;Channel&gt;Microsoft-Windows-Sysmon/Operational&lt;/Channel&gt; 
        &lt;Computer&gt;MalwareLab&lt;/Computer&gt; 
        &lt;Security UserID="S-1-5-18" /&gt; 
    &lt;/System&gt;
    &lt;EventData&gt;
        &lt;Data Name="RuleName"&gt;DLL&lt;/Data&gt; 
        &lt;Data Name="UtcTime"&gt;2022-08-17 14:36:03.568&lt;/Data&gt; 
        &lt;Data Name="ProcessGuid"&gt;{0fd50764-f82f-62fc-4504-000000001600}&lt;/Data&gt; 
        &lt;Data Name="ProcessId"&gt;8124&lt;/Data&gt; 
        &lt;Data Name="Image"&gt;c:\windows\system32\inetsrv\w3wp.exe&lt;/Data&gt; 
        &lt;Data Name="TargetFilename"&gt;C:\Windows\Temp\qriyblj4.dll&lt;/Data&gt; 
        &lt;Data Name="CreationUtcTime"&gt;2022-08-17 14:36:03.568&lt;/Data&gt; 
        &lt;Data Name="User"&gt;IIS APPPOOL\DefaultAppPool&lt;/Data&gt; 
    &lt;/EventData&gt;
&lt;/Event&gt;
</code></pre>

<p>An event recording <code>w3wp.exe</code> executing a compiler <code>csc.exe</code>,</p>

<pre><code class="language-{xml}">&lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
        &lt;Provider Name="Microsoft-Windows-Sysmon" Guid="{5770385f-c22a-43e0-bf4c-06f5698ffbd9}" /&gt; 
        &lt;EventID&gt;1&lt;/EventID&gt; 
        &lt;Version&gt;5&lt;/Version&gt; 
        &lt;Level&gt;4&lt;/Level&gt; 
        &lt;Task&gt;1&lt;/Task&gt; 
        &lt;Opcode&gt;0&lt;/Opcode&gt; 
        &lt;Keywords&gt;0x8000000000000000&lt;/Keywords&gt; 
        &lt;TimeCreated SystemTime="2022-08-17T14:36:03.6081662Z" /&gt; 
        &lt;EventRecordID&gt;2248&lt;/EventRecordID&gt; 
        &lt;Correlation /&gt; 
        &lt;Execution ProcessID="3000" ThreadID="1232" /&gt; 
        &lt;Channel&gt;Microsoft-Windows-Sysmon/Operational&lt;/Channel&gt; 
        &lt;Computer&gt;MalwareLab&lt;/Computer&gt; 
        &lt;Security UserID="S-1-5-18" /&gt; 
    &lt;/System&gt;
    &lt;EventData&gt;
        &lt;Data Name="RuleName"&gt;-&lt;/Data&gt; 
        &lt;Data Name="UtcTime"&gt;2022-08-17 14:36:03.601&lt;/Data&gt; 
        &lt;Data Name="ProcessGuid"&gt;{0fd50764-fcd3-62fc-9104-000000001600}&lt;/Data&gt; 
        &lt;Data Name="ProcessId"&gt;6300&lt;/Data&gt; 
        &lt;Data Name="Image"&gt;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe&lt;/Data&gt; 
        &lt;Data Name="FileVersion"&gt;4.8.4084.0 built by: NET48REL1&lt;/Data&gt; 
        &lt;Data Name="Description"&gt;Visual C# Command Line Compiler&lt;/Data&gt; 
        &lt;Data Name="Product"&gt;Microsoft® .NET Framework&lt;/Data&gt; 
        &lt;Data Name="Company"&gt;Microsoft Corporation&lt;/Data&gt; 
        &lt;Data Name="OriginalFileName"&gt;csc.exe&lt;/Data&gt; 
        &lt;Data Name="CommandLine"&gt;"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\WINDOWS\TEMP\qriyblj4.cmdline"&lt;/Data&gt; 
        &lt;Data Name="CurrentDirectory"&gt;C:\inetpub\wwwroot\&lt;/Data&gt; 
        &lt;Data Name="User"&gt;IIS APPPOOL\DefaultAppPool&lt;/Data&gt; 
        &lt;Data Name="LogonGuid"&gt;{0fd50764-f82f-62fc-acea-9d0000000000}&lt;/Data&gt; 
        &lt;Data Name="LogonId"&gt;0x9deaac&lt;/Data&gt; 
        &lt;Data Name="TerminalSessionId"&gt;0&lt;/Data&gt; 
        &lt;Data Name="IntegrityLevel"&gt;High&lt;/Data&gt; 
        &lt;Data Name="Hashes"&gt;MD5=F65B029562077B648A6A5F6A1AA76A66,SHA256=4A6D0864E19C0368A47217C129B075DDDF61A6A262388F9D21045D82F3423ED7,IMPHASH=EE1E569AD02AA1F7AECA80AC0601D80D&lt;/Data&gt; 
        &lt;Data Name="ParentProcessGuid"&gt;{0fd50764-f82f-62fc-4504-000000001600}&lt;/Data&gt; 
        &lt;Data Name="ParentProcessId"&gt;8124&lt;/Data&gt; 
        &lt;Data Name="ParentImage"&gt;C:\Windows\System32\inetsrv\w3wp.exe&lt;/Data&gt; 
        &lt;Data Name="ParentCommandLine"&gt;c:\windows\system32\inetsrv\w3wp.exe -ap "DefaultAppPool" -v "v4.0" -l "webengine4.dll" -a \\.\pipe\iisipmda7b0f18-2ba4-4c04-ae39-359c977c2aa7 -h "C:\inetpub\temp\apppools\DefaultAppPool\DefaultAppPool.config" -w "" -m 0 -t 20 -ta 0&lt;/Data&gt; 
        &lt;Data Name="ParentUser"&gt;IIS APPPOOL\DefaultAppPool&lt;/Data&gt; 
    &lt;/EventData&gt;
&lt;/Event&gt;
</code></pre>

<p>And an event recording <code>w3wp.exe</code> dropping an executable in the inetpub folder,</p>

<pre><code class="language-{xml}">&lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
        &lt;Provider Name="Microsoft-Windows-Sysmon" Guid="{5770385f-c22a-43e0-bf4c-06f5698ffbd9}" /&gt; 
        &lt;EventID&gt;27&lt;/EventID&gt; 
        &lt;Version&gt;5&lt;/Version&gt; 
        &lt;Level&gt;4&lt;/Level&gt; 
        &lt;Task&gt;27&lt;/Task&gt; 
        &lt;Opcode&gt;0&lt;/Opcode&gt; 
        &lt;Keywords&gt;0x8000000000000000&lt;/Keywords&gt; 
        &lt;TimeCreated SystemTime="2022-08-17T14:36:04.2708793Z" /&gt; 
        &lt;EventRecordID&gt;2252&lt;/EventRecordID&gt; 
        &lt;Correlation /&gt; 
        &lt;Execution ProcessID="3000" ThreadID="1232" /&gt; 
        &lt;Channel&gt;Microsoft-Windows-Sysmon/Operational&lt;/Channel&gt; 
        &lt;Computer&gt;MalwareLab&lt;/Computer&gt; 
        &lt;Security UserID="S-1-5-18" /&gt; 
    &lt;/System&gt;
    &lt;EventData&gt;
        &lt;Data Name="RuleName"&gt;-&lt;/Data&gt; 
        &lt;Data Name="UtcTime"&gt;2022-08-17 14:36:04.270&lt;/Data&gt; 
        &lt;Data Name="ProcessGuid"&gt;{0fd50764-f82f-62fc-4504-000000001600}&lt;/Data&gt; 
        &lt;Data Name="ProcessId"&gt;8124&lt;/Data&gt; 
        &lt;Data Name="User"&gt;IIS APPPOOL\DefaultAppPool&lt;/Data&gt; 
        &lt;Data Name="Image"&gt;c:\windows\system32\inetsrv\w3wp.exe&lt;/Data&gt; 
        &lt;Data Name="TargetFilename"&gt;C:\inetpub\wwwroot\MyAppCopy.exe&lt;/Data&gt; 
        &lt;Data Name="Hashes"&gt;MD5=870000F5100C6F8F407540C96200D5C4,SHA256=DA19CCE90EA7B0CB0A0FC754BB10C015ECCC73147EBB7712F2818A44D1663BC9,IMPHASH=698FA83DA166EDB916866EF085B426D9&lt;/Data&gt; 
    &lt;/EventData&gt;
&lt;/Event&gt;
</code></pre>

<p>Based on these three events, we can write Sigma rules that detects the suspicious
activity.</p>

<ul>
  <li>The first event is suspicious because it looks abnormal for IIS (<code>Image</code> ends with <code>w3wp.exe</code>) to write (<code>EventID: 11</code>) a DLL in the temp folder (<code>TargetFilename</code> starts with <code>C:\Windows\Temp\</code> and ends with <code>.dll</code>, avoid regular expression where possible).</li>
  <li>The second event is suspicious because it looks abnormal for IIS (<code>ParentImage</code> ends with <code>w3wp.exe</code>) to call (<code>EventID: 1</code>) spawn a C# compiler (<code>Image</code> ends with <code>csc.exe</code>).</li>
  <li>The third event is suspicious because it looks abnormal for IIS (<code>Image</code> ends with <code>w3wp.exe</code>) to drop an executable (<code>EventID: 27</code>).</li>
</ul>

<p>Because the first two events are related to the dynamic execution of C# code
within IIS, I decided to group them within a single Sigma rule.</p>

<pre><code class="language-yaml">title: Dynamic C# Webshell compilation by IIS
id: ebf2c122-d2fc-416c-a90c-698a4ba9161e
status: experimental
description: Detects dynamic compilation of C# code executed by IIS.
tags:
    - attack.execution
author: Antoine Cailliau
date: 2022/08/17
logsource:
    category: process_creation
    product: windows
detection:
    selection_csc:
        EventID: 1
        ParentImage|endswith: 'w3wp.exe'
        Image|endswith: 'csc.exe'
    selection_compiled_output:
        EventID: 11
        Image|endswith: 'w3wp.exe'
        TargetFilename|endswith: 'dll'
        TargetFilename|startswith: 'C:\Windows\Temp'
    condition: selection_csc or selection_compiled_output
level: medium
falsepositives:
    - Legitimate dynamic web applications
</code></pre>

<p>The third event is not related to that specific type of webshell and we created
a second Sigma rule.</p>

<pre><code class="language-yaml">title: IIS writing executable file
id: 2f8504e9-b715-4a7f-bb7c-fa3100dc8246
status: experimental
description: Detects a blocked executable dropped by IIS
tags:
    - attack.execution
author: Antoine Cailliau
date: 2022/08/17
logsource:
    category: file_creation
    product: windows
detection:
    selection:
        EventID: 27
        Image|endswith: 'w3wp.exe'
    condition: selection
level: low
falsepositives:
    - Unknown
</code></pre>

<p>Now, we complete the process described <a href="/2022/08/16/Developing-Sigma-rules-with-chainsaw.html">here</a> by testing the rules on many EVTX to avoid false positive and include more true positive.</p>

<p>I do not claim that these rules are fool proof and they are likely to require
some tuning depending on your environment. Knowing your baseline is key aspect
in detection, and could be part of a complete post series.</p>]]></content><author><name>Antoine Cailliau</name></author><category term="Sigma" /><category term="threat-hunting" /><summary type="html"><![CDATA[Previous post explained my process for developing Sigma rules to detect suspicious activity. A key element in developing such rules is the log file itself. While incident response will provides you plenty of (large) event logs with malicious activity, it might be time-consuming to read hundreds of thousands log lines to find the one you are interested in detecting. Or you might not even have the possiblity to get such event logs; For example, a new version of SysMon is released and you would like to test the new capabilities.]]></summary></entry><entry><title type="html">Developing Sigma rules with Chainsaw</title><link href="https://ancailliau.github.io//2022/08/16/Developing-sigma-rules-with-chainsaw.html" rel="alternate" type="text/html" title="Developing Sigma rules with Chainsaw" /><published>2022-08-16T00:00:00+00:00</published><updated>2022-08-16T00:00:00+00:00</updated><id>https://ancailliau.github.io//2022/08/16/Developing-sigma-rules-with-chainsaw</id><content type="html" xml:base="https://ancailliau.github.io//2022/08/16/Developing-sigma-rules-with-chainsaw.html"><![CDATA[<p>From my experience, when you find evidence of malicious activity in a log file, 
there is probably more somewhere else, and the actor is likely to continue using
the same tools and techniques unless you detect it. Instead of just looking at
lines in a log file, when you discovered a malicious activity, write a detection
rule that can be applied to all your systems for retro-hunting, added to your
detection stack for future events, and shared with peers and partners to
benefit the greater good.</p>

<p>My language of choice for detecting suspicious log entries is Sigma. Sigma is
to logs what Yara is to files and Snort is to network traffic. 
(Florian Roth)[https://twitter.com/cyb3rops] already shares a tremendous amount 
of Sigma rules that detect suspicious events but some events will be specific to
your environment and your incidents. For example,</p>

<ul>
  <li>
    <p>If you detected an abused account, you can write a detection rule
that triggers on any log mentioning the account and be notified of any 
further event.</p>
  </li>
  <li>
    <p>If you detected a compromised host that is used to RDP to other machines, you
can write a detection rules that, when executed against the event logs of all
your machines, will help you scoping the intrusion.</p>
  </li>
</ul>

<p>Because Sigma rules are source-agnostic, you can write one rule and use it to
run against collected event log files, as a Kibana query or as a Sentinel KQL 
query. With the increasing diversity in systems, it is a bless to not have to 
maintain many detection rules that achieve the same logic.</p>

<p>To learn more about detection engineering with Sigma, I recommend the following 
course: <a href="https://www.networkdefense.co/courses/sigma/">Detection Engineering with Sigma</a>
that has, in my opinion, a good return on investment.</p>

<p>My process to develop Sigma rules against Windows Event logs:</p>

<ol>
  <li>Find malicious or suspicious activity in event log entries.</li>
  <li>Characterize <strong>why</strong> the activity is suspicious, focus on your rationale for 
assessing that the activity is not right.</li>
  <li>Write a Sigma rules that detects the activity</li>
  <li>Run the rules against event logs that contains the suspicious activity (to 
confirm the rule is detecting the activity), against event logs that are 
known to be clean (to assess the false positive rate), and against a 
collection of generic event logs containing malicious activity as in the 
(evtx-attack-sample)[https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES] 
dataset.</li>
  <li>Assess the true and false positives rates, refine and go to Step 4 until you
are satisfied.</li>
</ol>

<p>To run the rules, I use <a href="https://github.com/WithSecureLabs/chainsaw">Chainsaw</a>
to run the sigma rules against EVTX files.</p>

<p>You first need to install and compile the tool:</p>

<pre><code class="language-shell">$ git clone https://github.com/countercept/chainsaw.git
$ cd chainsaw
$ cargo build --release
</code></pre>

<p>You might need to install dependencies first. On ubuntu:</p>

<pre><code class="language-shell">$ sudo apt install cargo gcc-multilib
</code></pre>

<p>The tool is then available in the <code>target/release/</code> folder:</p>

<pre><code class="language-shell">$ cd target/release/
$ ./chainsaw --help
</code></pre>

<p>When installed you can run the rules with <code>hunt</code> command:</p>

<pre><code class="language-shell">$ ./chainsaw hunt /path/to/evtx/folder/ \
    --sigma /path/to/sigma/rules/ \
    --mapping ../../mappings/sigma-event-logs-all.yml
</code></pre>

<p>For example, to train, we would like to run the set of “standard” Sigma rules 
from the (official repository)[https://github.com/SigmaHQ/sigma] against the 
known-to-be-malicious evtx files from 
(evtx-attack-sample)[https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES].</p>

<p>First, clone the rules and the samples</p>

<pre><code class="language-shell">$ git clone https://github.com/SigmaHQ/sigma
$ git clone https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES.git 
</code></pre>

<p>Then, we can detect malicious activity by running the tool (I assume that your
are in <code>chainsaw/target/release</code> folder)</p>

<pre><code class="language-shell">$ ./chainsaw hunt /mnt/hgfs/Cases/EVTX-ATTACK-SAMPLES/ \
    --sigma /mnt/hgfs/Cases/sigma/rules \
    --mapping ../../mappings/sigma-event-logs-all.yml
</code></pre>

<p>Depending on your marchine it can take a while to complete. In my case, it 
detected quite a few log entries to check :-)</p>

<pre><code class="language-shell">[+] 1353 Detections found on 924 documents
</code></pre>

<p>Other useful ressources:</p>

<ul>
  <li><a href="https://rustrepo.com/repo/countercept-chainsaw">Rapidly Search and Hunt through Windows Event Logs</a></li>
  <li><a href="https://www.vanimpe.eu/2022/08/16/down-the-chainsaw-path-to-analyse-windows-event-logs/">Down the Chainsaw path to analyse Windows Event logs</a></li>
</ul>]]></content><author><name>Antoine Cailliau</name></author><category term="sigma" /><category term="threat-hunting" /><summary type="html"><![CDATA[From my experience, when you find evidence of malicious activity in a log file, there is probably more somewhere else, and the actor is likely to continue using the same tools and techniques unless you detect it. Instead of just looking at lines in a log file, when you discovered a malicious activity, write a detection rule that can be applied to all your systems for retro-hunting, added to your detection stack for future events, and shared with peers and partners to benefit the greater good.]]></summary></entry></feed>