Lion Cipher Lab

Exploit an unauthenticated Jenkins for RCE, then lock it down

Why it matters

A continuous-integration (CI) server is where source code turns into shipped software, which makes it one of the most dangerous machines to leave exposed on the whole network. Jenkins is the most widely deployed CI server in the world, and it carries an feature that is wonderful for administrators and catastrophic in the wrong hands: the Script Console, a page that runs arbitrary Groovy code directly on the Jenkins controller, in the Jenkins process, with all of its privileges and access to all of its stored credentials. When Jenkins is secured, that page requires the Administer permission…

What you'll learn

Steps in this lab

  1. What Jenkins is, and why the Script Console is remote code execution
  2. Stand up a deliberately-unsecured Jenkins — your machine only
  3. Confirm unauthenticated code execution (the 'before' measurement)
  4. Why this is possible here but not on a default Jenkins
  5. Apply the fix: a security realm and an authorization strategy
  6. Re-probe and confirm the fix (the 'after' measurement)
  7. What you just did — and how to carry it

Open the full interactive lab →