Lion Cipher Lab

Harden a malware feature classifier against benign-feature padding with monotonic constraints

Why it matters

Most production malware detectors have a static, feature-based model somewhere in the pipeline: a program that looks at a file WITHOUT running it, turns it into numbers (how many suspicious imports, how random the code sections look, how many ordinary strings it carries), and scores it. The EMBER dataset made this design the standard teaching example. Its weakness is well documented: a model that has learned 'lots of ordinary content means benign' can be fooled by an author who simply ADDS ordinary content. Adding imports, strings or sections does not remove any malicious functionality, so it…

What you'll learn

Steps in this lab

  1. What you are defending, and the hole in it
  2. Open a terminal, make a scratch folder, install scikit-learn
  3. Write the synthetic data and the two robustness tests
  4. Baseline: train the unconstrained detector, then pad it
  5. Read the exact semantics of monotonic_cst before you choose signs
  6. Retrain with monotonic constraints and re-run the same attack
  7. Measure the cost fairly: the same false-positive budget
  8. The honest negative: the attack monotonicity does not cover
  9. When to use this, when not to, and how a pro does it better

Open the full interactive lab →