However, I want to share my solutions of challs 3-7 https://r3mmalwareanalysis.wordpress.com/2022/11/15/flareon-9/
It is also my first blog post, dm for helpful tips would be appreciated ๐
Next in the malware analysis tools which give you quick wins thread: Binary Refinery (https://github.com/binref/refinery), by the esteemed Mr. @rattle ! This is my #1 most used tool for doing initial triage of malware samples with!
Binary Refinery is a cross-platform collection of command-line tools for processing binary data. The tools can be chained together via pipes to form processing pipelines to extract, decode, transform, and display data. Here is a simple example, where we Base64-decode then Gzip-decompress some data:
$ emit "H4sIAAAAAAACA/NIzcnJVwjPL8pJAQBWsRdKCwAAAA==" | b64 | zl
Hello World
You can think of it as like CyberChef for the command line; however, there are many features that make it extremely useful for malware triage specifically, and which put it (in my opinion) above CyberChef:
There are many units which automagically carve out interesting embedded files in the input for you, similar to what binwalk can do. For example, the carve-pe unit extracts every block of bytes in the input that looks like a PE file; each individually carved PE file can then go through further processing in the pipeline, or be dumped to file.
Similarly, there are units which can automatically carve out text which looks like indicators, or text which looks like encoded data. For example, you can extract all URLs from the input data with xtp url; you can extract everything that looks like it could be Base64-encoded from the input data with carve b64.
It is possible to inspect the data in any part of the pipeline, by inserting the peek unit in a pipeline; by default, peek will give you a hexdump of the beginning of the data, and include some basic information about the size of the data, its entropy, and attempt to determine the filetype of the data.
It provides very good utilities for working with PE files specifically. Ever encounter one of those 300MB PE files filled with null bytes in the PE overlay which artificially inflate the size? You can strip it with the pestrip unit, or take a look at it with the peoverlay unit. You can also view PE file metadata (including signatures) with pemeta, extract each individual section or segment with vsect, or extract PE resources with perc.
As an example, let's take the sample e9e3154e1f71df58e61ade53bb23726927b5c23e8027a452e98b1dbcfafb1ade (available on Malware Bazaar if you want to download and follow along). It's a ZIP file which contains a ~300MB ISO file. With the following 2 pipelines (shown in the attached screenshot), we can extract the contents of the ISO, strip the extra PE overlay bytes from the PE file, peek at both the original and stripped file, dump the stripped file to disk, and look at the PE metadata of the stripped file:
ef 43_85_7369_PDF.ISO | xtiso.br [| peek.br -l5 | pestrip | peek -l5 | dump stripped/{path} ]
ef stripped/43_85_73.EXE | pemeta -t
If you want to go further, it is possible to build powerful malware processing pipelines with Binary Refinery. For good examples, see the tutorials folder on the Binary Refinery repository, which includes a mind-blowing #FlareOn9 writeup: https://github.com/binref/refinery/tree/master/tutorials
๐ Anyone here hack on #FlareOn9 over the last month?
Reading the solutions that got posted and realizing that I was sorta close for #4...
Here's my write-ups of my fun weekend hacking: https://shellcromancer.io/posts/flare-on-9/
Overview The Challenges 01 - Flaredle 02 - Pixel Poker 03 - Magic 8 Ball 04 - Darn Mice 1 Overview Each year the Mandiant FLARE team puts together a month long CTF focused on reverse engineering. This CTF is over a month long which gives me a chance to work on the challenges without destroying my vibrant social life on the weekends. I made it little further this year than last which Iโm pretty happy about, Iโm hoping that applies next year as well if the Google + Mandiant team puts on Flare-On 10.
Anyone here doing #flareon9?
How we holding up? Iโm stuck on #5 atm and donโt know what Iโm doing ๐ซ