Lion Cipher Lab

Emulate a malware binary with Qiling to extract its behaviour and config

Why it matters

Two of the hardest problems in malware analysis are recovering a config that is encrypted at rest and observing what a sample DOES without letting it run on a real machine. Static tools stall at the first hurdle: `strings` and a disassembler show you the encrypted husk, not the http://... the loader decrypts into memory a millisecond before it beacons. A full sandbox solves the second problem but is heavy, is loud (malware often detects it), and for a Windows sample you may not have the right OS handy. Full-binary EMULATION is the scalpel in between. Qiling loads a whole PE or ELF, gives it…

What you'll learn

Steps in this lab

  1. Why a second emulator: Qiling is a whole OS around Unicorn
  2. Set up a clean venv and install Qiling (pinned)
  3. Get a rootfs for the emulated machine
  4. Build a benign sample that hides its config like real malware
  5. Prove static analysis cannot see the config
  6. Find the addresses you will hook
  7. Emulate the whole binary with Qiling
  8. Dump the decrypted config from emulated memory with a hook
  9. Read the behaviour: the dropped file landed in the rootfs, not your disk
  10. Surgical control: patch a branch to skip a check
  11. The limits, and when to reach for what (the judgment)

Open the full interactive lab →