Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building DEF CON CTF with Ruby
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
vito
February 21, 2014
Programming
610
0
Share
Building DEF CON CTF with Ruby
Presented at Big Ruby Conference, Grapevine, TX, Feb. 20 2014
vito
February 21, 2014
More Decks by vito
See All by vito
Modernizing SQL Injection CTF Challenges
vito
0
220
Raw Water: Quenching Your Thirst for SQL Injection
vito
0
95
Lessons Learned from Five Years of Building Capture the Flag
vito
0
510
What I've Learned Writing CTF Challenges
vito
0
170
Capture the Flag: An Owner's Manual
vito
0
110
Other Decks in Programming
See All in Programming
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
790
AI-DLC Deep Dive
yuukiyo
9
4.5k
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
220
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
2
770
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
170
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
0
360
Road to RubyKaigi: Play Hard(ware)
makicamel
1
300
Running Swift without an OS
kishikawakatsumi
0
850
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
160
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
560
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
260
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
370
Navigating Team Friction
lara
192
16k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
WCS-LA-2024
lcolladotor
0
540
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Building Applications with DynamoDB
mza
96
7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Transcript
Building DEF CON CTF with Ruby
Hello Vito Genovese @vito_lbs
[email protected]
Building DEF CON CTF •DEF CON and CTF •Team building
•Qualifications •Finals
What is DEF CON? “DEF CON is one of the
oldest continuous running hacker conventions around, and also one of the largest.” - DEF CON FAQ
What is DEF CON? “Black Hat… is more the university…
DEF CON is the fraternity party.” - USA Today, “Suits and punks convene in Las Vegas for hacker conferences,” Aug. 1 2006
What is DEF CON?
What is DEF CON?
What is CTF? (Capture The Flag)
Jeopardy-Style CTF •Pick a problem •Hack it •Get points
Attack-Defense CTF 1. Hack services 2. Steal tokens every round
3. Get points 1. Patch services 2. Pass SLA checks 3. Don’t lose points
Competing in CTF •Build a team •Get really good at
assembly •Get good at web vulns and crypto too •Compete and solve problems •Write up solutions
Competing in CTF
Sample Challenges http://hypeman.shallweplayaga.me http://worsemedicine.shallweplayaga.me
Hour 30
Building DEF CON CTF •DEF CON and CTF •Team building
•Qualifications •Finals
Team Building “Dark Tangent is looking for new CTF organizers,
want to help write a proposal?”
Team Building Software vulnerability experts Hardware engineers Network ops deity
Web application generalist
Team Building •Opinionated smart people •That need to work together
•On a software project with dozens of moving parts •On a very public stage •With immovable deadlines
Team Building Always have an exit strategy
Building DEF CON CTF •DEF CON and CTF •Team building
•Qualifications •Finals
Qualifications “Quals”
Quals “Jeopardy-style” Self-contained questions Open Entry 48 hours over a
weekend
None
Quals Scoreboard Rails Unicorn Heroku 1GB Dynos $50/month Postgres
Quals Scoreboard No Redis No memcached
Quals Scoreboard No push Only polling
Quals Scoreboard
Quals Scoreboard
Quals Scoreboard Game Start Adjusting dynos
Quals Challenges •Sinatra •PHP •Python •x86 •Golang •ARM
Sinatra Used Heroku It ruled
PHP, Python, x86, Golang EC2 Started with Micro Upgraded to
Large
PHP, Python, x86, Golang Never use Micro instances
PHP, Python, x86, Golang Sometimes you get DoS’d
ARM Challenges
Quals Problems I slept… Through a part where we had
to edit a question and put something on S3.
Quals Problems Some challenges weren’t ready until halfway through the
game
https://twitter.com/roman_soft/status/346325078369263616
Quals •IRC and Twitter: invaluable •Have a reset password flow
•Don’t forget public views •Fight bus numbers
Building DEF CON CTF •DEF CON and CTF •Team building
•Qualifications •Finals
Finals OMG
None
Finals http://www.cnbc.com/id/101179977
Finals
Finals
Finals Twenty Teams Twenty Servers One Network
Finals •Attack-defense style •Teams get a server running services •Find
vulnerabilities in services •Patch own vulnerabilities •Exploit vulnerabilities on other teams
Finals Scoring Fifty-thousand flags Five-minute rounds Tokens from services redeemed
for flags Flags lost when stolen and downtime Zero-sum for game theory reasons
Finals Scoreboard Rails, Apache, Passenger, Postgres Ubuntu on Mac Mini
HTTPS Client Certificates Kibana (Logstash, Elasticsearch) No push, no polling, just meta refresh
Finals Scoreboard Client certs rule No password resets No hacking,
no sniffing Twenty CDs of certs and keys… eh
Kibana
None
None
Kibana Log Everything
Tokens and Uptime Console Ruby script Restartable in a sensible
fashion Use Postgres and wall clock time as state Save immediately, don’t queue
Tokens and Uptime Two weeks prior: “I’m just going to
call a shell script, everyone else write your own uptime checker.”
Tokens and Uptime Three hours in: “Uh, how do we
make these shell scripts time out?”
Tokens and Uptime Ten hours in: “We should run these
in parallel.”
Tokens and Uptime Sixteen hours in: “Huh some team is
puking binary out.”
Finals Problems Teams could score on themselves
Finals Problems Flags didn’t get redistributed correctly
Finals Problems Have a better way to find issues than
rails console, SQL, and log queries
None
Finals Problems API Documentation
Finals Problems Life’s easy when you have 160 users and
they’re all right there
Finals Team Boxes
Finals Team Boxes Services run as dedicated users Teams have
sudo to service No root
None
Finals Lessons Scheduled downtime is the best
Building DEF CON CTF •DEF CON and CTF •Team building
•Qualifications •Finals
Lessons Stuff will break
Lessons Own your mistakes
Lessons Fight scope creep
Lessons JFDI
Thanks Vito Genovese @vito_lbs
[email protected]
https://legitbs.net http://bit.ly/br-ctf
Bonus Slides
DEF CON and Jeopardy
Quals Expenses What How much Heroku $126 AWS $138 Cloudflare
$20 Whisky $340
Finals Services ARM binaries ASLR, NX bit, some PIE
Finals Services Release new services Update existing services
Finals Team Boxes Boot from MicroSD Start container from iSCSI