B1g_Mac picoCTF 2019 Solution

Published: April 2, 2026

Description

Download the file and find the flag. Analyze the non-standard binary.

Download the file.

bash
wget <url>/b1g_mac
bash
chmod +x b1g_mac
  1. Step 1Identify the file type
    Run file, xxd, and strings on the downloaded file. It may be a non-standard format, a multi-architecture binary, or have embedded data. binwalk can detect embedded file systems or archives.
    bash
    file b1g_mac
    bash
    xxd b1g_mac | head -10
    bash
    strings b1g_mac | head -40
    bash
    binwalk b1g_mac
    Learn more

    The file command reads the magic bytes at the beginning of a file to identify its type. binwalk scans the entire file for embedded signatures of known file types - useful for finding hidden archives, images, or executables concatenated onto another file.

  2. Step 2Extract embedded content if present
    If binwalk finds embedded files, extract them with binwalk -e. Then examine each extracted file for the flag.
    bash
    binwalk -e b1g_mac
    bash
    ls _b1g_mac.extracted/
    bash
    strings _b1g_mac.extracted/* | grep picoCTF
    Learn more

    Files can be concatenated in many ways: a JPEG with a ZIP appended at the end, a PNG with extra data after the IEND chunk, or an ELF binary with a tar archive in its data section. binwalk handles all of these by scanning for magic bytes throughout the file.

  3. Step 3Run and/or decompile
    If it is an executable, run it and note the output. If it requires deeper analysis, load it in Ghidra. The flag may be printed at runtime or hardcoded as a string.
    bash
    ./b1g_mac
    bash
    ghidra b1g_mac &
    Learn more

    Mach-O is Apple's executable format (used on macOS and iOS). If the file is a Mach-O binary, you can analyze it on Linux using tools like jtool2 or in Ghidra which supports Mach-O format. The challenge name 'B1g_Mac' hints at a macOS connection.

Flag

picoCTF{...}

Use file, strings, and binwalk to identify the format and extract embedded data or run the binary to find the flag.

Want more picoCTF 2019 writeups?

Useful tools for Forensics

Related reading

What to try next