Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What I've Learned Writing CTF Challenges

vito
February 11, 2017

What I've Learned Writing CTF Challenges

BSides Tampa, 2/11/2017

vito

February 11, 2017
Tweet

More Decks by vito

Other Decks in Programming

Transcript

  1. CGC Jargon • Cyber Reasoning System • Proof of Vulnerability

    • Replacement Binary • Challenge Binary
  2. Solving 'em • Correct side of an if statement •

    Cracking a code • Using SQL injection to trick a database • Stealing the garbage file from the Gibson
  3. Start the First One 1. Set up CGC service-template 2.

    Test not-crashing 3. Make binary that doesn’t crash 4. Test crashing 5. Make binary that crashes
  4. First One's Done • Ruby script to spit out 334

    binaries • Vary buffer sizes • Vary stack cookie • Python script running game flow
  5. Integration Testing With Gyno • Finds a bug in like

    30s • Fixing the bug took 30m • (fixing the bug a week prior would've taken 5m)
  6. easy-prasky • single binary • Baby’s First category • Separate

    CRS work from first stab at CGCEF • Hacked to be first in 334 cuts
  7. Useful for Competition Separate teams that solve it from teams

    that don't Prefer strong correlation with finals ranking
  8. Twelve Factor App • VIII. Concurrency • Scale out via

    the process model • IX. Disposability • Maximize robustness with fast startup and graceful shutdown
  9. Twelve Factor Challenges • Limit global state • Process per

    connection • xinetd ftw • Make adding resources cheap
  10. Shared State • Process per connection not always feasible •

    Sandwich challenges in 2014 • JRuby & Celluloid slow to start • State still per connection
  11. Waiting For Your Touch • 2015 web challenge • /r/thebutton

    knockoff • JRuby, Rails, websockets, postgres
  12. Waiting For Your Touch 1. Took it down 2. Opened

    replacement challenge 3. Debugged for an hour
  13. Debugging For Your Touch 4. Leaked and exhausted postgres connections

    5. Fixed leak 6. Allocated more connections
  14. Waiting For My Fix 7. Took an hour 8. Gyno

    forced a fifteen minute cool-down between "is it fixed" and "it is fixed" 9. Reopened
  15. Respect for Your Team Provide easy to run smoke tests

    "Is this exploitable?" should be a one-liner that spits out the flag