WEBVTT

00:08.580 --> 00:10.260
Good afternoon.

00:10.800 --> 00:13.480
It's a wonderful honor to be here today.

00:13.480 --> 00:17.460
Tonight, or this afternoon, I'm going to be talking about Capture the Flag.

00:17.920 --> 00:21.880
Capture the Flag is a contest we like to run at DEF CON.

00:21.920 --> 00:24.340
DEF CON, you're here.

00:24.380 --> 00:30.280
We've run Capture the Flag at DEF CON in Las Vegas for several years now.

00:31.160 --> 00:35.400
In 1996, the first Capture the Flag game at DEF CON was held.

00:35.880 --> 00:40.840
And in the year 2000, so after four years, they formalized how it was run.

00:40.840 --> 00:52.500
So for the first few years, how Capture the Flag worked at DEF CON was players would either bring software that they wanted somebody to hack for them, or they would hack somebody else's software.

00:52.660 --> 01:06.400
And the human judges that were authenticating and running the contest had to make the these decisions every time something got hacked, whether it was easy, whether it was hard, who got the points, and it was very, very confusing.

01:06.720 --> 01:13.680
So starting in the year 2000, the DEF CON goons running Capture the Flag created rules, and they created services.

01:14.640 --> 01:21.700
So starting in 2002 and running through 2004, a group called Ghetto Hackers took over Capture the Flag.

01:21.700 --> 01:29.380
And this is kind of how Capture the Flag became a name brand event, where the Ghetto Hackers had a different brand name, slightly different from DEF CON.

01:29.380 --> 01:31.500
They had continuity from year to year.

01:32.820 --> 01:36.920
Starting in 2005, a new team called Kenshoto took over.

01:36.920 --> 01:39.580
And this is also when I started playing Capture the Flag.

01:39.660 --> 01:45.560
Kenshoto had a much more difficult game that made a lot more people more interested in Capture the Flag.

01:47.200 --> 01:59.020
Starting in 2009, the next team called DD Tech and started running Capture the Flag themselves.

01:59.880 --> 02:07.580
And then, starting in 2013 and running up until last year, my team, the legitimate business syndicate, took over.

02:08.260 --> 02:15.160
And starting literally tomorrow, the new team, Order of the Overflow, is taking over running DEF CON Capture the Flag.

02:16.500 --> 02:22.700
So the way we think about Capture the Flag and how Capture the Flag works with DEF CON is that there are two distinct formats.

02:23.120 --> 02:26.220
This format is Jeopardy format, named after the U.S.

02:26.220 --> 02:27.200
game show.

02:27.320 --> 02:31.020
And how this works is teams pick a question or a challenge from this grid.

02:31.020 --> 02:34.680
They receive a prompt and solve the challenge for some points.

02:35.040 --> 02:38.120
The main part of this game is the scoreboard that we just saw.

02:38.300 --> 02:40.480
On the scoreboard, you find a prompt.

02:40.720 --> 02:46.900
In this case, the prompt is giving us a network address, including a port number and a file to download.

02:47.680 --> 02:49.960
From there, we solve the challenge.

02:50.200 --> 02:55.300
In a lot of cases, these challenges involve a lot of assembly programming or reading assembly.

02:55.300 --> 02:56.680
And they involve Python.

02:57.740 --> 03:04.680
Once the challenge has been solved, you return the answer to the question to the scoreboard for points.

03:04.880 --> 03:07.560
And then you go on to the next challenge.

03:07.620 --> 03:12.880
Right here, we see a handful of challenges that have been solved by somebody with different point amounts.

03:12.880 --> 03:19.560
And one challenge that has not been solved yet and that will give the person who solves it scoreboard control.

03:20.380 --> 03:25.880
So Defcon Capture the Flag qualifiers is one of the most famous Jeopardy-style CTFs in the world.

03:25.880 --> 03:32.780
But I'm going to talk about a challenge from a different event, the Shaw 2017 Capture the Flag contest.

03:32.780 --> 03:41.300
So Shaw 2017 was an outdoor computer festival held in the Netherlands last August, the week after Defcon.

03:41.300 --> 03:43.980
And I went there and had a wonderful time.

03:44.000 --> 03:49.220
And part of the wonderful time was a contest that the Dutch team Eindhoven ran at this event.

03:49.820 --> 03:52.660
I'm going to talk about a challenge called Asby.

03:52.720 --> 03:55.100
With Asby, we get a file.

03:55.100 --> 04:03.920
This is the prompt that has a little bit of backstory where their team member named Asby got a reputation for solving challenges the wrong way.

04:04.740 --> 04:09.240
So once I downloaded this file, I discovered it was a Windows executable.

04:09.620 --> 04:17.340
And because I just, like, downloaded this executable randomly from the internet, I decided to run it and figure out what I had to do.

04:17.700 --> 04:29.260
So the goal with this is we need to enter in the flag, and the executable will tell us if it's correct or not, and starting from here, how many characters are correct.

04:30.160 --> 04:32.740
So I need to guess the correct input.

04:32.820 --> 04:35.100
So I have three ways that I can do this.

04:35.100 --> 04:43.320
I can either reverse engineer a Windows binary, and I'm not very good at reverse engineering and I don't usually use Windows, so that was kind of out.

04:43.400 --> 04:53.220
I could guess each character by hand, which looked like it would take a long time, or I could write a program, which I foolishly believed would go really, really quickly.

04:55.880 --> 04:58.080
So I chose to write the program.

04:58.580 --> 05:00.280
And this is the program.

05:00.280 --> 05:08.640
It's a little Ruby script, and mostly what it does is it opens the wine emulator with the Asby executable.

05:09.060 --> 05:14.680
I hand guessed a bunch of the flag before I tried writing the program, so I have that part of the flag at the top.

05:14.760 --> 05:22.060
And then we just loop over and over, guessing which of our flag characters goes into the executable and tells us it's correct.

05:22.520 --> 05:28.220
If we get to a point where something weird happens, we print out what we have so far and exit.

05:29.220 --> 05:39.620
In theory, after a long time writing this program and switching back and forth between, oh, I can't program computers anymore, I'm just going to do this by hand, I eventually got the solution.

05:39.880 --> 05:44.180
The solution is right here, right above the stack trace, which is cool.

05:44.180 --> 05:51.540
I solved it, I got some points, the organizers gave me some beverages while I was sitting there, and I had a lot of fun.

05:51.680 --> 05:53.160
So that's Jeopardy style.

05:53.160 --> 05:56.480
You get a challenge, you solve it, and you get some points.

05:57.360 --> 06:02.860
This is the visualization from our finals game, which is an attack-defense format capture the flag.

06:02.880 --> 06:04.680
It's very, very different.

06:04.680 --> 06:13.940
Here we see teams shooting successful attacks at each other in a soundboard-themed, or like audio mixer-themed event.

06:14.460 --> 06:18.020
So how this works is all these steps happen at the same time.

06:18.020 --> 06:21.480
Teams are reverse engineering the challenges or the services.

06:21.480 --> 06:27.940
They're patching the flaws in the services at the same time they're trying to exploit other teams' services.

06:28.120 --> 06:32.580
And in all of this, they're trying to not break their own services to lose points.

06:33.620 --> 06:37.340
So here's a small example of how attack-defense works.

06:37.380 --> 06:41.460
At the top, we have the score bot, or the scoring system of the capture the flag game.

06:41.600 --> 06:47.980
On the left, we have PPP's service called AppMail, and on the right, we have a team called Shellfish.

06:49.020 --> 07:00.100
So, every round, the score bot deposits a new flag or a new piece of random data in PPP's AppMail service, and everybody else's services as well.

07:02.100 --> 07:13.660
Sometime during the round, Shellfish manages to send some network traffic to AppMail that causes it to disclose this flag, or as we call it, Shellfish has stolen the flag.

07:15.020 --> 07:21.620
Then, they take that flag, submit it to the score bot, or they redeem it to the score bot, and get some points.

07:23.220 --> 07:28.900
In the meantime, score bot is checking PPP's AppMail service to make sure it's working okay.

07:28.900 --> 07:30.160
Can it send messages?

07:30.160 --> 07:31.680
Can it receive messages?

07:31.820 --> 07:32.880
Is it happy?

07:33.880 --> 07:46.240
And, if PPP has broken their AppMail, if they've, you know, turned it off or deleted it, or just written a bad patch that makes it do things wrong, that's a failed availability check.

07:46.260 --> 07:56.580
And we assume that if there's a failed availability check, that Shellfish is also not able to steal from it, so we make a failed availability check lose a whole lot of points.

07:57.120 --> 08:00.800
And, again, this is the format we used for Defcon Capture the Flag finals.

08:01.700 --> 08:02.940
Here's an example.

08:02.940 --> 08:04.560
It's a service called Rubix.

08:04.560 --> 08:07.680
This is a service we put in place last year.

08:08.180 --> 08:19.700
How it works is teams connect to the Rubix service on another team, and it simulates this Rubix puzzle cube where you rotate the cube and try and get all the colours on the same side.

08:20.100 --> 08:22.260
But it's a virtual version of that.

08:22.340 --> 08:33.800
Teams submit instructions to rotate the cube into a valid configuration, and once the Rubix cube is happy, it executes the instructions as if they were CPU instructions.

08:34.940 --> 08:36.760
Which is kind of clever.

08:37.620 --> 08:42.200
So we're going to follow along with a write-up from a team called Lab Rats.

08:42.240 --> 08:44.940
They publish this write-up and we can follow along.

08:45.380 --> 08:56.860
So the first steps to solve this, the computers we used for Defcon CTF finals last year was one we made up, and it used 9-bit bytes instead of 8-bit bytes to make it miserable for teams.

08:57.200 --> 09:04.340
So they first had to write software that could deal with 9-bit traffic, which nobody has normally.

09:04.760 --> 09:13.760
Then they had to figure out what parts of these binaries were part of the standard C library, and what parts of these binaries were which functions in the C library.

09:14.640 --> 09:20.140
After that, they can figure out how the main gets called and what the part of the program that they care about actually is.

09:20.800 --> 09:27.520
Once they've done all that work, which took several hours, they could actually start analyzing what the service does.

09:27.860 --> 09:29.200
So what are they analyzing?

09:29.200 --> 09:30.740
How is it supposed to work?

09:30.740 --> 09:34.200
What is the benign traffic supposed to do?

09:34.880 --> 09:36.980
Once they figure that out, how can they attack it?

09:36.980 --> 09:39.380
How can they make the service release its secrets?

09:39.760 --> 09:43.480
And after they figure that out, they can try and figure out how to defend it.

09:43.480 --> 09:48.120
How can we prevent the service from revealing its secrets to other teams?

09:48.900 --> 09:52.220
So all this is in support of the game goals.

09:52.220 --> 10:00.160
You get points by capturing flags, you lose points by having flags captured, and you lose lots of points by failing availability checks.

10:01.100 --> 10:05.420
It's extremely complicated, it's extremely frustrating, but it's a lot of fun.

10:05.420 --> 10:09.720
For both organizers and most importantly, it's fun for players.

10:10.700 --> 10:12.180
But I should go back.

10:12.180 --> 10:15.720
Every kind of Capture the Flag game is extremely ambitious.

10:15.860 --> 10:20.840
Jeopardy style, they're extremely ambitious to run, they're difficult to play on purpose.

10:20.880 --> 10:23.580
Attack defense, also difficult.

10:24.340 --> 10:31.260
So some of our goals for Capture the Flag games are making them run smoothly, making them a fair contest, and having fun challenges.

10:31.520 --> 10:36.080
If the game doesn't run smoothly, players are going to get frustrated and find something else to do.

10:36.180 --> 10:39.500
If it's not fair, players aren't going to put in a legit effort.

10:39.620 --> 10:45.600
You know, if the same team is always going to win because they're friends with the organizers, why play?

10:45.640 --> 10:49.540
And if the challenges aren't fun, then the challenges aren't fun.

10:49.920 --> 10:52.460
So let's talk about running the game smoothly.

10:52.540 --> 10:57.900
And just like any big ambitious project, running a Capture the Flag game project starts early.

10:58.100 --> 11:03.920
And the most important part of it is who you're running it with, who is on the organizing team.

11:04.600 --> 11:14.400
So legitimate business syndicate is about half of us are friends from university that competed together then, and about half were people that worked together in 2012.

11:15.140 --> 11:18.520
So here's my friend Gino, kind of the team captain and I.

11:19.000 --> 11:24.620
Twelve years ago, we were participating in a college level contest, and we just solved a difficult problem.

11:24.620 --> 11:26.640
And we were very, very happy about it.

11:26.640 --> 11:30.920
And also a little bit weird from being in a windowless room all day.

11:32.820 --> 11:35.840
So how did we start to run DEF CON CTF?

11:35.840 --> 11:43.100
We found out during closing ceremonies at DEF CON 2012, that the previous organizers, DD Tech, were stepping down.

11:43.660 --> 11:51.060
In December, Gino realized that, hey , I should make a team that runs CTF because that's my dream.

11:51.320 --> 12:00.220
So he started talking to us, and I remember at a chicken wing restaurant, the day after Christmas is when he told me about this, and I was in.

12:00.760 --> 12:10.540
So in February 2013, we all got together in the same room, wrote down a proposal for how we wanted the game to work, and found out in March that the proposal got accepted.

12:10.780 --> 12:12.680
And then the real work began.

12:14.120 --> 12:16.800
So what is our group made out of?

12:16.940 --> 12:21.240
So about three quarters of the group are people that I would normally call reverse engineers.

12:21.680 --> 12:24.740
But people, you know, people aren't just their skills.

12:24.800 --> 12:27.140
And all these people have different specialties.

12:27.320 --> 12:32.380
So we have a radio specialist who did a lot of work on our 2014 Challenge Badger.

12:32.600 --> 12:42.820
We have several people who were good just with computer hardware in general, which was really useful for 2015, the year we brought, I think, 40 different computers to Las Vegas.

12:43.160 --> 12:50.780
And in 2017, the game ran on the work of our esoteric computing expert for the Clemency system.

12:52.020 --> 13:00.520
But besides reverse engineers, my friend Salir is just a genius when it comes to computer infrastructure of any kind.

13:01.020 --> 13:01.640
Networking.

13:01.640 --> 13:06.100
He can type commands into routers faster than I could just mash my fingers on a keyboard.

13:06.100 --> 13:07.740
I don't understand it.

13:08.420 --> 13:13.560
I worked on the database-backed web application because that's something I really enjoy.

13:13.840 --> 13:17.460
But the most important part is that people grow and change.

13:17.680 --> 13:20.000
I'm not the same person I was five years ago.

13:20.000 --> 13:21.100
None of us are.

13:21.260 --> 13:27.920
So whenever somebody, you know, grows into a new skill set or gets excited about something, don't say you're the web app person.

13:27.920 --> 13:29.240
Just deal with that.

13:29.700 --> 13:33.680
Like, if they're excited about something, that's a big benefit for everybody.

13:34.680 --> 13:39.540
And that means that players' role or team members' roles also grow and change over time.

13:40.140 --> 13:48.820
So if you are putting together a capture -the-flag team, either for playing or for organizing, think about who you know and who you know that you trust and who do you like?

13:48.820 --> 13:50.620
Who do you want to hang out with a lot?

13:52.480 --> 13:56.380
So once you've figured out who's on the team, you need to be able to talk to your team.

13:56.380 --> 13:58.420
And that's what communication is for.

13:58.940 --> 14:06.860
We, after the first year, we ended up using Slack or the chat program Slack for asynchronous chat basically all the time.

14:06.860 --> 14:11.020
It's great because you don't have to, you know, talk to somebody immediately.

14:11.020 --> 14:12.820
They'll just see the message later.

14:13.240 --> 14:22.440
We did eventually settle on having meetings every week, which is really, really useful to, you know, have these little iterations where you commit to something and get it done.

14:23.220 --> 14:27.700
But whenever we have an actual contest to run, we like to be all in the same place.

14:27.920 --> 14:32.480
So this is the rental house we had for our 2017 qualifiers.

14:32.560 --> 14:36.800
And this is right before the game starts where we're figuring out what order challenges get unlocked.

14:38.080 --> 14:50.260
Once we get to Vegas, we find it really nice to have a shared hotel room where we set up all the noisy computers and stash all the snacks and stash all the drinks, including lots of water because it's important to stay hydrated.

14:51.340 --> 14:55.020
And, you know, that's kind of our home base when we're in Vegas.

14:56.260 --> 15:02.160
And the snacks and the drinks are really, really important because your team is a team made out of people.

15:02.380 --> 15:07.540
And people, you know, people require food and snacks.

15:07.880 --> 15:12.980
So in 2014, we were having computer problems.

15:12.980 --> 15:25.680
One of the team's instances, their actual physical hardware was acting really flaky and it needed to get unplugged and plugged back in a lot, like more than any other team should.

15:25.740 --> 15:32.520
And it was causing a delay of the game because processes would be trying to talk to that machine and it was just not on.

15:32.600 --> 15:36.840
So I was on stage trying to figure out why the scoreboard was going slow.

15:36.840 --> 15:48.560
And Salir was walking back and forth between his computer on stage to read logs and the rack of hardware off the stage to unplug and plug it back in to power cycle the machine.

15:49.000 --> 15:52.560
And I was kind of like getting impatient with how things were going.

15:52.560 --> 15:57.120
And I just kind of asked him, how much longer is this going to take?

15:57.820 --> 16:01.340
And whenever he walked off stage, he didn't go to the hardware.

16:01.340 --> 16:03.260
He just kind of left the room.

16:04.300 --> 16:11.220
And Salir is normally like the most stable, level-headed, friendliest person.

16:11.220 --> 16:13.440
And that's not something that ever happens.

16:13.440 --> 16:17.720
And that really, really scared the rest of us running this game.

16:18.140 --> 16:22.760
And eventually after about half an hour, he came back with a drink.

16:22.760 --> 16:27.380
He came back with a sandwich and he solved the problem basically instantly.

16:27.720 --> 16:37.300
And what I'd kind of neglected was to think about what he needed, you know, both in emotional terms and also it was lunchtime and that's why we were both kind of crabby.

16:37.840 --> 16:44.520
So supporting the CTF players means supporting the organizing team and making sure everybody's well fed.

16:46.500 --> 16:52.720
The final point I need to talk about with smooth operation is that Capture the Flag software is still software.

16:52.980 --> 17:00.320
And just like any kind of software or any other computer system, the way to make this software work reliably is really screwed up.

17:00.320 --> 17:08.360
By the end, we could have another machine spun up in about five minutes and we usually had hot spares ready to go anyways, which was great.

17:09.660 --> 17:12.760
So next up, I'm going to talk about running a fair contest.

17:12.760 --> 17:25.860
And a fair contest is really challenging because Capture the Flag is a game about computer hacking, but DEF CON CTF is also a computer system, which means that we have to be really, really paranoid.

17:25.860 --> 17:30.600
And we have to worry about teams trying to hack the right service the wrong way.

17:31.680 --> 17:35.120
We also want to make sure that teams don't hack the wrong thing.

17:35.120 --> 17:37.060
We want them to hack a vulnerable service.

17:37.060 --> 17:39.260
We don't want them to attack the scoreboard.

17:40.300 --> 17:49.280
And for attack defense games, we have another problem where teams may want to fix a broken software the wrong way.

17:49.460 --> 17:55.440
And the way we eventually, you know, solve this is by restricting what players can do more.

17:55.980 --> 17:59.780
So for qualifiers, we tend to run services on separate hosts.

17:59.780 --> 18:03.940
And we eventually got to running multiple hosts in multiple locations.

18:04.280 --> 18:12.840
So for the different challenges we have in qualifiers, each one would get at least one machine per data center.

18:13.000 --> 18:14.500
So teams in the U.S.

18:14.500 --> 18:18.180
would connect to a data center in North Virginia or something.

18:18.220 --> 18:25.120
Teams in Europe would go to Ireland, Asia Pacific, wherever Amazon's Asia Pacific hub is, which was great.

18:25.120 --> 18:30.920
Teams got lower ping times and we didn't have to worry about the entire service getting screwed up globally.

18:32.200 --> 18:43.300
Next, each connection to a vulnerable service would get a separate container using the run C container run time and xinitd to actually manage the connections.

18:43.300 --> 18:54.700
Using xinitd also has a really nice benefit where instead of writing each service having to have its own, like, network handling code, we could write all these services as just standard in and out executables.

18:55.420 --> 19:04.460
And then finally, in 2015, what we started doing was limiting what system calls each service would be able to make using the set comp tools in Linux.

19:06.580 --> 19:11.300
Finals is a much more complex game with much more complex problems.

19:11.440 --> 19:18.640
And one of the problems that we had was we kept trying to keep the game about reverse engineering and not a game about operating system administration.

19:19.560 --> 19:35.180
Starting in 2013, what we did was each team, whenever they connected to their machine, instead of getting root or super user access, they'd get an unprivileged team account that all it could really do is overwrite the service binaries that then ran under their own accounts.

19:35.800 --> 19:43.560
So we had a problem starting that year, and it got really bad in 2014, and it was a phenomenon we called the Superman defense.

19:43.560 --> 19:49.960
After the comic book character who just, like, one of his special powers is, oh, he just doesn't get hurt ever.

19:50.260 --> 20:03.080
So some of the Superman defenses would be like a firewall rule that says this traffic coming from the scoring system is okay, let it through, but this traffic coming from an opponent team is not okay, so just block it.

20:03.080 --> 20:05.560
And we never let teams have firewalls that way.

20:06.280 --> 20:11.960
However, a Superman defense that was very successful was preventing the flag being read from disk.

20:12.760 --> 20:18.440
So teams would run the service in an emulator, and the emulator wouldn't have flag access, and that was that.

20:18.520 --> 20:26.440
And we tried to solve that with making legitimate pollers read the flag, but it didn't always fit into a service nicely.

20:27.600 --> 20:31.580
So what we learned was that the U.S.

20:31.620 --> 20:38.780
Defense Advanced Research Projects Agency, or DARPA, started this project called Cyber Grand Challenge in 2014.

20:39.680 --> 20:47.780
And one of their goals was to, or their one goal, was to build a capture the flag game for autonomous computers with extremely formal rules.

20:48.560 --> 20:57.780
So for their thing, instead of having, you know, just services on a disk that would run, they came up with new jargon for it called challenge binaries, or CBs.

20:58.060 --> 21:07.660
These CBs were all 32-bit x86 binaries, but they used a special executable format that had limited system calls and couldn't store state.

21:07.820 --> 21:13.460
So what this meant was that teams couldn't just break out of the jail, or they couldn't wrap it in an emulator.

21:13.600 --> 21:17.240
They had to solve these things the, quote, right way.

21:18.900 --> 21:31.660
Similar to that, instead of just launching exploits over a network, CGC gave us this idea of a proof of vulnerability, which was the same kind of executable, but it had a few extra functions it could do.

21:31.660 --> 21:42.700
It could declare that it was going to demonstrate that it could control registers of a target program, or leak memory from the target program, and the scoring system instead of the teams managed how they ran.

21:44.560 --> 21:55.020
So these were put in place to support this goal of offline evaluation, where teams connect to a website and they get the binaries, the challenge binaries that other teams are using.

21:55.200 --> 22:00.100
And whenever they go to patch it, they upload it to the team interface website again.

22:00.240 --> 22:04.740
Whenever they have an attack, they write a proof of vulnerability and submit it.

22:05.040 --> 22:10.480
So the scoring system then runs the availability checks and proofs of vulnerability and isolation.

22:10.720 --> 22:19.160
And the value there is that we can run those offline, or we can run them later in a way that's designed to be reproducible and auditable.

22:20.940 --> 22:26.380
So once we learned about that, in finals, we could bring some of that technology to our game.

22:26.420 --> 22:32.220
Starting in 2015, we would restrict what system calls vulnerable services could make.

22:32.440 --> 22:41.320
And in 2016, the day after the Cyber Grand Challenge, we ran our game using their same format, with challenge binaries with proofs of vulnerability.

22:42.160 --> 22:51.560
And then finally, for our last year, we ran the entire game in a limited emulator that didn't have a lot of hooks into the messy real world of Linux.

22:54.280 --> 22:58.980
Another part of our fair contest is releasing the scoring information after the game's over.

22:59.320 --> 23:05.580
For qualifiers, we release the, you know, scoring information and a little bit of that.

23:05.580 --> 23:15.680
For finals, we release just, here's the database dump from Postgres, here's all the binaries teams uploaded, here's packet captures for the entire game.

23:16.020 --> 23:22.400
And that meant that a lot of teams could spend time after the game analyzing what was being used against them.

23:22.440 --> 23:27.300
Third parties could audit the scores and figure out how the actual scoring system in the game worked.

23:30.360 --> 23:34.580
An important part of running a fair contest is thinking about accessibility.

23:34.700 --> 23:38.640
And accessibility can mean a lot of things, and all these things are important.

23:39.040 --> 23:43.760
Our first year, we had a challenge called Die Hard, which required sensitive timing.

23:43.880 --> 23:52.940
This was a problem because the name of the challenge was supposed to be a clue, based on a popular movie in the US, about what players had to do.

23:53.200 --> 24:00.640
And the timing was difficult if you were on a, you know, internet connection that wasn't super close to where the game was being run.

24:00.760 --> 24:06.720
And what we had to do in future years, well, that year we, you know, had a really bad solution.

24:06.720 --> 24:17.740
We told teams to rent space near our servers and play from there and write a program, which is like, I don't want to be in the middle of a CTF game renting new servers.

24:18.800 --> 24:23.500
Long term, what we had to do was we had to rethink how a lot of our challenges were being built.

24:23.500 --> 24:34.500
We had to remove this idea that, you know, teams should be familiar in, you know, United States online, you know, hacker culture from our game.

24:34.500 --> 24:38.300
We had to eliminate the whole idea of precise timing for our game.

24:38.300 --> 24:40.560
And I think our game improved for that.

24:41.500 --> 24:48.120
Some of the other accessibility issues are just the languages we use online in our official communication.

24:48.300 --> 24:52.400
Because not everybody's a, you know, the same language as you are.

24:52.660 --> 24:57.100
And a lot of people are going to use machine translation because it works.

24:57.280 --> 25:01.540
But you have to, you know, use shorter sentences, use smaller words.

25:01.600 --> 25:04.640
And it's difficult to get in that frame of mind.

25:04.640 --> 25:08.700
And I don't know if we did a great job, but we thought about it at least.

25:11.160 --> 25:16.700
So, the last aspect of Capture the Flag and what I've learned running it is this idea of fun challenges.

25:16.920 --> 25:24.780
And the fun challenges that we spent a lot of time on, that we think were the most successful, we went and broke expectations.

25:26.140 --> 25:31.280
One of the ones from 2015 was a challenge called DOS Fun For You.

25:31.400 --> 25:34.060
And there's one writeup for this online.

25:34.060 --> 25:41.480
And the writeup starts with discover this challenge is a DOS binary, the disk operating system from the 80s.

25:42.240 --> 25:47.960
And they discovered that the IDA Pro disassembly tool was doing it wrong.

25:47.960 --> 25:54.120
So, they ended up debugging their disassembler and patching it before they could actually start the reverse engineering.

25:54.660 --> 26:06.340
And some teams found out that they had to use the emulator we told them to use because if they used something else, if they used DOS box, it would get some of the subtle timing wrong and they'd have a bad time.

26:07.880 --> 26:12.160
Another fun one was our Badger challenge from 2015 finals.

26:12.160 --> 26:25.480
And what it was, was a service running on MSP430 microcontroller on physical hardware that communicated with other teams with the game network using a custom CDMA radio network.

26:25.660 --> 26:27.320
So, this is it right here.

26:28.160 --> 26:31.960
We had two versions, I think three different versions of this badge.

26:31.960 --> 26:34.020
We had the one for competing teams.

26:34.020 --> 26:38.160
We had the one for organizers and VIPs that showed game scores.

26:38.160 --> 26:44.420
We had the base station which was hung up on a string over the game area and had a bunch of wires hanging out of it.

26:47.360 --> 26:52.580
So, one thing that we learned from Cyber Grand Challenge was this idea of consensus evaluation.

26:53.380 --> 27:05.640
So, with most with a traditional attack defense game, whenever you patch a binary on your machine, your opponents don't get to see how the binary has been patched, they just notice that their attacks don't work anymore.

27:06.140 --> 27:17.200
And what CGC did was they introduced this idea called consensus evaluation, where whenever you patch or you replace a binary with a fixed one, everybody else gets to see that.

27:17.200 --> 27:24.000
Which means that if your patch isn't complete, other teams, you know, can still attack it.

27:24.060 --> 27:28.360
And it also means that if your patch is really good, other teams will start using it.

27:28.360 --> 27:41.740
But the important part of that is that now, instead of us releasing eight services over an entire weekend and only getting eight binaries, every time somebody patches it, there's a new binary that needs reversing.

27:42.160 --> 27:52.160
So, what I wanted to do with these quals challenges was I wanted to push teams into this idea that automated program analysis is important.

27:52.200 --> 27:57.220
You can't just, you know, open up IDA Pro, solve a binary, and then, you know, you're done.

27:57.220 --> 28:03.420
You need to start thinking about programs, not just as software that runs, but as input for other programs.

28:03.600 --> 28:14.160
So, I worked on this thousand cuts category in 2015, 16, and on a category called Crack Me 2000 in 2017.

28:14.460 --> 28:18.960
Each of these challenges had hundreds of binaries that required automated analysis.

28:19.580 --> 28:21.600
And I feel they were successful.

28:21.700 --> 28:29.020
I saw a lot of blog posts and a lot of write-ups about how to solve these that mentioned they'd never done automated program analysis before.

28:31.720 --> 28:35.620
Consensus evaluation and finals gave us some really funny moments.

28:35.860 --> 28:42.760
So, a player from a team that I'm going to refrain from naming walked up to the organizer's table and asked why they were losing points.

28:43.120 --> 28:45.520
You know, their service was being attacked.

28:46.040 --> 28:47.300
We looked at the scoreboard.

28:47.300 --> 28:48.940
It's like, yeah, your service is being attacked.

28:48.940 --> 28:50.040
That's why you're losing points.

28:50.040 --> 28:51.940
It's called capture the flag.

28:52.200 --> 28:57.720
But they claimed they were using the same binaries as the winning team and that it couldn't be that.

28:57.760 --> 29:00.600
And we just kind of, like, looked at them.

29:02.720 --> 29:06.740
And then they just kind of did this and walked away.

29:06.760 --> 29:20.000
Because what they realized was that the winning team had put a secret code in their, or a backdoor in their binary to allow them to attack anybody that didn't, that just used their binary without thinking about it.

29:20.340 --> 29:22.320
That was really funny.

29:22.320 --> 29:26.920
You know, we still laugh about just the expression on that guy's face all the time.

29:28.400 --> 29:31.440
So, the Rubik's service from 2017.

29:32.040 --> 29:34.140
A few minutes ago I mentioned how it worked.

29:34.140 --> 29:43.460
You upload the instructions to rotate a Rubik's cube and then if you've done it successfully, those instructions get evaluated as just CPU byte code.

29:44.000 --> 30:03.860
So, how this worked in practice was teams would start to write code to block the evil, whenever shellcode would come in, the scoring system would submit some that didn't steal the flag, but attacking players would submit shellcode that did try and steal the flag.

30:04.220 --> 30:14.840
So, defenders would start using the extra space in this binary and they'd patch it by saying this shellcode let it through, this shellcode block it, this code let it through, this code block it.

30:15.040 --> 30:34.960
So, what that meant was whenever a team would patch Rubik's, somebody that was already successfully attacking them would disassemble the binary, see their previous attack reflected in it, and have to build a new attack, which felt like the comments we got after the game were that this felt like a multiplayer game against other people.

30:35.000 --> 30:38.480
We were having, I was having a back and forth with somebody on this other team.

30:38.520 --> 30:40.900
They'd patch it, I'd write a new exploit.

30:41.080 --> 30:43.460
They'd patch it, I'd write a new exploit.

30:43.560 --> 30:49.640
And we also had to update the scoring system to, you know, create new good shellcode.

30:49.640 --> 30:55.220
But it was a lot of fun for the players and it just fascinates me.

30:56.240 --> 31:03.660
So, we've talked about running smoothly, we've talked about running a fair contest, and we've talked about fun challenges.

31:04.040 --> 31:10.040
This is not everything that we know about Capture the Flag, and this is not everything that there is to know about Capture the Flag.

31:10.320 --> 31:19.620
There's still a lot more to learn, and there's a lot more work ahead of us building new Capture the Flag games that create new opportunities for new players.

31:20.960 --> 31:23.320
CTF is not a huge community yet.

31:24.000 --> 31:27.360
How many people in here have never played a Capture the Flag game?

31:29.200 --> 31:32.580
Okay, that's actually really impressive.

31:32.660 --> 31:40.440
But I think in a lot of the world, there's still a lot more work that we can do to make Capture the Flag for new players.

31:41.440 --> 31:45.460
The best way to learn how to do Capture the Flag is to do it.

31:45.460 --> 31:54.380
Either play a Capture the Flag game, or once you're happy with that, build your own Capture the Flag game for your friends and for people that you like to play.

31:56.000 --> 32:09.860
Capture the Flag has given me five years with the best group of people I've ever worked with, and it's given me an amazing five years building a contest for the CTF community around the world, the friendliest and smartest community I know.

32:10.260 --> 32:12.380
Thank you for making it amazing.

32:12.860 --> 32:19.220
And if you're curious about DEF CON Capture the Flag, order The Overflow, the new DEF CON CTF organizers.

32:19.220 --> 32:23.000
They're starting their game tomorrow morning at 8am Beijing time.

32:23.000 --> 32:27.160
You can learn more about it at oooverflow.io

