Slide 1

Slide 1 text

Lessons Learned from Five Years of Building Capture the Flag Vito Genovese SECCON 2017 Feb. 18, 2018

Slide 2

Slide 2 text

Good Morning!

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Capture the Flag "CTF"

Slide 5

Slide 5 text

DEF CON

Slide 6

Slide 6 text

1996 first game

Slide 7

Slide 7 text

2000 formalized how it was run

Slide 8

Slide 8 text

2002-2004 ghettohackers

Slide 9

Slide 9 text

2005-2008 Kenshoto

Slide 10

Slide 10 text

2009-2012 ddtek

Slide 11

Slide 11 text

2013-2017 Legitimate Business Syndicate

Slide 12

Slide 12 text

2018-? Order of the Overflow

Slide 13

Slide 13 text

Two Distinct Formats

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Jeopardy Style Scoreboard

Slide 16

Slide 16 text

Jeopardy Style Prompt

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Jeopardy Style Solving

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Jeopardy Style Points

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Jeopardy Style DEF CON CTF Quals

Slide 23

Slide 23 text

Photo: robbje @ Eat Speep Pwn Repeat

Slide 24

Slide 24 text

asby From SHA2017 CTF

Slide 25

Slide 25 text

asby Get file

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

asby Identify Windows STDIO .exe

Slide 28

Slide 28 text

asby Determine goal

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

asby Guess the correct input

Slide 31

Slide 31 text

asby •Reverse engineer a Windows binary •Guess each character by hand •Write a program

Slide 32

Slide 32 text

asby Write program

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

asby Get solution

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

asby Get points

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Jeopardy Style 1. Get challenge 2. Solve it 3. Get points

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Attack-Defense •Reverse engineer •Patch flaws •Exploit others •Don't break it

Slide 43

Slide 43 text

⚑ Attack-Defense PPP atmail scorebot Shellphish

Slide 44

Slide 44 text

Attack-Defense PPP atmail scorebot Shellphish deposit ⚑

Slide 45

Slide 45 text

Shellphish Attack-Defense PPP atmail scorebot steal ⚑

Slide 46

Slide 46 text

Shellphish Attack-Defense PPP atmail scorebot redeem ⚑

Slide 47

Slide 47 text

Shellphish Attack-Defense PPP atmail scorebot availability okay availability check

Slide 48

Slide 48 text

Shellphish Attack-Defense PPP atmail scorebot failed availability ☠ ☠can’t steal

Slide 49

Slide 49 text

Attack-Defense DEF CON CTF Finals

Slide 50

Slide 50 text

Rubix

Slide 51

Slide 51 text

Rubix

Slide 52

Slide 52 text

Rubix 54 Rubik's cube instructions …becomes shellcode

Slide 53

Slide 53 text

Lab RATs on Rubix Lab RATs posted a write-up: https://blog.rpis.ec/2017/08/defcon- finals-2017-introduction-rubix.html

Slide 54

Slide 54 text

Lab RATs on Rubix 1. write 9-bit to 8-bit netcat 2. analyze 9-bit strings in libc 3. symbolize libc 4. figure out how main() gets called

Slide 55

Slide 55 text

Lab RATs on Rubix Now the actual analysis starts…

Slide 56

Slide 56 text

Attack-Defense •How is it supposed to work? •How can we attack it? •How can we defend it?

Slide 57

Slide 57 text

Attack-Defense •Get points by capturing flags •Lose points by having flags captured •Lose lots of points by failing checks

Slide 58

Slide 58 text

Attack-Defense Complicated, frustrating, fun!

Slide 59

Slide 59 text

CTF Extremely ambitious

Slide 60

Slide 60 text

CTF •Running Smoothly •Fair Contest •Fun Challenges

Slide 61

Slide 61 text

Running Smoothly

Slide 62

Slide 62 text

Running Smoothly Starts early

Slide 63

Slide 63 text

Running Smoothly Who's on the team?

Slide 64

Slide 64 text

Legitimate Business Syndicate •Half 2005-2007 university team •Half 2012 coworkers

Slide 65

Slide 65 text

Legitimate Business Syndicate in 2006

Slide 66

Slide 66 text

Legitimate Business Syndicate •August 2012: ddtek steps down •December 2012: Gyno starts recruiting •February 2013: Proposal submitted •March 2013: Proposal accepted

Slide 67

Slide 67 text

Legitimate Business Syndicate •"Reverse engineers" 3/4 of the group •Different specialties •Radio: 2014, badger •Hardware: 2015, the year of single- board computers •Esoteric computing: 2017, cLEMENCy

Slide 68

Slide 68 text

Legitimate Business Syndicate 100% dependent on Selir's amazing infrastructure

Slide 69

Slide 69 text

Legitimate Business Syndicate I started for the database backed web application

Slide 70

Slide 70 text

Team Building People grow and change

Slide 71

Slide 71 text

Team Building Roles grow and change

Slide 72

Slide 72 text

Team Building •Who do you know? •Who do you trust? •Who do you like?

Slide 73

Slide 73 text

Communication “It's good.”

Slide 74

Slide 74 text

Communication async (chat) is great weekly meetings are great

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

Smooth Operation Support your team

Slide 77

Slide 77 text

Smooth Operation CTF software is software

Slide 78

Slide 78 text

Smooth Operation Automate testing and deployment

Slide 79

Slide 79 text

CTF •Running Smoothly •Fair Contest •Fun Challenges

Slide 80

Slide 80 text

Fair Contest

Slide 81

Slide 81 text

Fair Contest CTF is computer hacking

Slide 82

Slide 82 text

Fair Contest CTF is computer system

Slide 83

Slide 83 text

Fair Contest Hack the right thing the wrong way

Slide 84

Slide 84 text

Fair Contest Hack the wrong thing

Slide 85

Slide 85 text

Fair Contest Fix a thing the "wrong" way

Slide 86

Slide 86 text

Fair Contest Restrict players more

Slide 87

Slide 87 text

Qualifiers •Services on separate hosts •Multiple hosts in different locations •Connections get separate container •xinetd and runc •Limit system calls •seccomp

Slide 88

Slide 88 text

Finals More complex game More complex problems

Slide 89

Slide 89 text

Finals •Keep the game about reverse engineering •(Not OS administration)

Slide 90

Slide 90 text

Finals •2013: unprivileged team account, unprivileged service accounts •2014: understood "Superman defense" better

Slide 91

Slide 91 text

Superman Defense •Block opponent IPs •Prevent reading the flag

Slide 92

Slide 92 text

Cyber Grand Challenge US Defense Advanced Research Projects Agency (DARPA) project starting in 2014

Slide 93

Slide 93 text

Cyber Grand Challenge CTF for autonomous computers

Slide 94

Slide 94 text

Cyber Grand challenge Extremely formalized

Slide 95

Slide 95 text

Challenge Binaries •"CBs" •32-bit i386 •Special CGCEF executable format •Limited system calls •No retained state

Slide 96

Slide 96 text

Proof of Vulnerability •"PoVs" •32-bit i386 CGCEF •Demonstrate a vulnerability: •Register control •Memory disclosure •Run by scoring system

Slide 97

Slide 97 text

Offline Evaluation •Team interface gives out binaries •Team interface collects replacement CBs, PoVs •Runs availability checks and PoVs in isolation •Designed for reproducibility and audibility

Slide 98

Slide 98 text

Finals •2015: restrict system calls •2016: use CGC game format •2017: everything in limited emulator

Slide 99

Slide 99 text

Fair Contest Release scoring information

Slide 100

Slide 100 text

Fair Contest Think about accessibility

Slide 101

Slide 101 text

CTF •Running Smoothly •Fair Contest •Fun Challenges

Slide 102

Slide 102 text

Fun Challenges Break expectations

Slide 103

Slide 103 text

dosfun4u •Discover that it's a DOS binary •Debug and patch IDA Pro •Start actual reverse engineering

Slide 104

Slide 104 text

badger •MSP-430 on physical hardware •custom CDMA radio network

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

Consensus Evaluation •CGC's big attack-defense innovation •Everyone sees everyone else's patched binaries •Explosion in number of binaries that need reversing

Slide 107

Slide 107 text

1000 cuts / crackme2000 Push teams into automated analysis Hundreds of binaries

Slide 108

Slide 108 text

Consensus Evaluation in 2016 Player asks about losing points Service being attacked, that's why "But we're using the same binariess as the winning team"

Slide 109

Slide 109 text

Consensus Evaluation in 2017 Rubix expected shellcode to work in availability checks Defenders would add checks to block "evil" or allow "good" shellcode Attackers would build new shellcode to pass checks "Felt like a multiplayer game against humans"

Slide 110

Slide 110 text

CTF •Running Smoothly •Fair Contest •Fun Challenges

Slide 111

Slide 111 text

CTF Still more to learn!

Slide 112

Slide 112 text

CTf More work ahead of us

Slide 113

Slide 113 text

CTF Opportunity to grow for more players

Slide 114

Slide 114 text

CTF Best way to learn is to do

Slide 115

Slide 115 text

Five years with the best group of people I've ever worked with

Slide 116

Slide 116 text

Five years building a contest for the friendliest and smartest community I know

Slide 117

Slide 117 text

Thanks for making it amazing!

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

vito@legitbs.net @vito_lbs