Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
What I've Learned Writing CTF Challenges
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
vito
February 11, 2017
Programming
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What I've Learned Writing CTF Challenges
BSides Tampa, 2/11/2017
vito
February 11, 2017
Transcript
97 slides
What I’ve Learned Writing CTF Challenges Vito Genovese BSides Tampa
February 11, 2017
What is CTF?
What is CTF?
Jeopardy Style
Attack-Defense
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
CGC Jargon • Cyber Reasoning System • Proof of Vulnerability
• Replacement Binary • Challenge Binary
BSTies http://bsties.notmalware.ru
CTF Challenges Teams attack it
CTF Challenges Protects something of in-game value
CTF Challenges Ideally: known solvable
CTF Challenges Also ideally: appropriately tricky
None
None
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
Actually Building One
None
Original Goal
Original Goal
• Given same STDIN • Same STDOUT • Same clock
cycles • Same syscalls
https://xkcd.com/1319/
Why Automate?
None
Thousand Cuts
Thousand Cuts
Thousand Cuts
Actually Building It
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
First One's Done • Ruby script to spit out 334
binaries • Vary buffer sizes • Vary stack cookie • Python script running game flow
First Set's Done Figure out how to make second and
third sets
Second Set Python script to add stuff to source code
Third Set Python script to rearrange source code
All Sets Done Test the difficulty
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)
More Integration Testing kind of weird
easy-prasky • single binary • Baby’s First category • Separate
CRS work from first stab at CGCEF • Hacked to be first in 334 cuts
Deployment • Determine ops requirements • CGC kernel • Python
installed • Open port
Deployment Puppetize it!
Deployment
Running it just kinda worked (once teams Got It)
CTF Challenge Process 1.Idea 2.Build 3.Test
CTF Challenge Framework • Configuration • Build • Testing •
Deployment
CTF Challenge Framework CGC service-template
CTF Challenge Deployment put it on a server lol
It's Just Software
Software Goals Useful Usable Reliable
Useful for Competition Separate teams that solve it from teams
that don't Prefer strong correlation with finals ranking
Useful for Education Teach new players something Get players over
a hang-up
Usable Intended difficulty only Minimize corner cases Unintended vulnerabilities?
Reliable Remain vulnerable
Reliability is Hard Players like to attack Players like to
brute Players like to complain
Reliability is Hard
Reliability is Demanding
Reliability is Expensive If you want it to be
Reliability is Cheap Build software that can be run reliably
Twelve Factor App • VIII. Concurrency • Scale out via
the process model • IX. Disposability • Maximize robustness with fast startup and graceful shutdown
Twelve Factor Challenges • Limit global state • Process per
connection • xinetd ftw • Make adding resources cheap
Adding Resources Automate!
Operations Automation Puppet or Chef for server provisioning
Operations Automation Docker is slow to spin up RunC is
fast
Shared State • Process per connection not always feasible •
Sandwich challenges in 2014 • JRuby & Celluloid slow to start • State still per connection
Shared State • Global state and web challenges • Persisted
XSS • Tricking a global database
Waiting For Your Touch • 2015 web challenge • /r/thebutton
knockoff • JRuby, Rails, websockets, postgres
Waiting For Your Touch
Waiting For The Challenge Slow when not slow 500s Thankfully
during the day
Waiting For Your Touch 1. Took it down 2. Opened
replacement challenge 3. Debugged for an hour
Debugging For Your Touch 4. Leaked and exhausted postgres connections
5. Fixed leak 6. Allocated more connections
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
Most Important Part People are the most important
Respect People • Respect for yourself • Respect for your
team • Respect for players
Respect for Yourself
Respect for Your Team
Respect for Your Team
Respect for Your team Make services easy to keep running
Document!
Respect for Your Team Provide easy to run smoke tests
"Is this exploitable?" should be a one-liner that spits out the flag
Respect for Players
Respect for Players
Respect for Players
Respect for Players
Building Challenges is Software Development Useful Usable Reliable
Reliability Imposes Constraints Limit state Limit dependencies Automate
Respect Is Fundamental Self Team Players
Thanks! Vito Genovese
[email protected]
@vito_lbs GPG B07D616143CAA77B https://legitbs.net @legitbs_ctf
More Decks by vito
See All by vito
Modernizing SQL Injection CTF Challenges
vito
0
370
Raw Water: Quenching Your Thirst for SQL Injection
vito
0
120
Lessons Learned from Five Years of Building Capture the Flag
vito
0
530
Capture the Flag: An Owner's Manual
vito
0
140
Building DEF CON CTF with Ruby
vito
0
630
Other Decks in Programming
See All in Programming
オーケストレーション記述言語 Katari
yukikurage
0
250
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
320
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
260
Performance Optimization With LLMs
xleitix
0
260
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
250
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
370
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
100
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
230
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
11k
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.3k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
300
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
650
Side Projects
sachag
456
43k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
400
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
660
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
660
The agentic SEO stack - context over prompts
schlessera
0
1k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
430
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
How to train your dragon (web standard)
notwaldorf
96
6.9k