[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:19.00,0:00:20.82,Default,,0000,0000,0000,,We are about to start the next talk right Dialogue: 0,0:00:20.82,0:00:23.35,Default,,0000,0000,0000,,here. So, I am very happy to introduce Dialogue: 0,0:00:23.35,0:00:25.54,Default,,0000,0000,0000,,Hanemile. Who is going to talk a little Dialogue: 0,0:00:25.54,0:00:28.28,Default,,0000,0000,0000,,bit about the struggles you are facing Dialogue: 0,0:00:28.28,0:00:30.65,Default,,0000,0000,0000,,when trying to find the next capture the Dialogue: 0,0:00:30.65,0:00:32.76,Default,,0000,0000,0000,,flag (CTF) adventure and how he is Dialogue: 0,0:00:32.76,0:00:34.36,Default,,0000,0000,0000,,proposing to solve the problem. Dialogue: 0,0:00:36.04,0:00:37.88,Default,,0000,0000,0000,,Please join me in welcoming Emile. Dialogue: 0,0:00:43.48,0:00:45.93,Default,,0000,0000,0000,,Hi, I am going to talk about CTF in a box. Dialogue: 0,0:00:45.93,0:00:47.96,Default,,0000,0000,0000,,It is the story of what problems we Dialogue: 0,0:00:47.96,0:00:50.54,Default,,0000,0000,0000,,found when playing CTFs. How we plan Dialogue: 0,0:00:50.54,0:00:52.22,Default,,0000,0000,0000,,to solve the problems; we built a Dialogue: 0,0:00:52.22,0:00:55.48,Default,,0000,0000,0000,,prototype, tested it and the problems Dialogue: 0,0:00:55.90,0:00:59.60,Default,,0000,0000,0000,,that came after that. So, first who am I Dialogue: 0,0:00:59.60,0:01:04.51,Default,,0000,0000,0000,,I am Emile, @hanmile at post platforms. Dialogue: 0,0:01:05.14,0:01:06.91,Default,,0000,0000,0000,,Studying computer science at Düsseldorf. Dialogue: 0,0:01:06.91,0:01:09.49,Default,,0000,0000,0000,,Playing CTF with @flexerilla or sometimes Dialogue: 0,0:01:09.49,0:01:11.29,Default,,0000,0000,0000,,as a single player. Dialogue: 0,0:01:12.50,0:01:14.67,Default,,0000,0000,0000,,Lets start with the current solutions. Dialogue: 0,0:01:15.03,0:01:18.63,Default,,0000,0000,0000,,Playing CTF we currently have, like, 3 Dialogue: 0,0:01:18.88,0:01:22.71,Default,,0000,0000,0000,,main platforms. The most used framework Dialogue: 0,0:01:22.74,0:01:25.53,Default,,0000,0000,0000,,used currently is CTFd. Dialogue: 0,0:01:25.88,0:01:30.25,Default,,0000,0000,0000,,CTFd is the first thing you'll find if you Dialogue: 0,0:01:30.25,0:01:32.80,Default,,0000,0000,0000,,google "hey I want to host a CTF, what Dialogue: 0,0:01:32.80,0:01:33.60,Default,,0000,0000,0000,,do I do?" Dialogue: 0,0:01:34.49,0:01:36.44,Default,,0000,0000,0000,,Second thing is hack the box Dialogue: 0,0:01:36.71,0:01:39.92,Default,,0000,0000,0000,,that is another case study, well case Dialogue: 0,0:01:39.92,0:01:45.28,Default,,0000,0000,0000,,study. More so a framework to host CTFs Dialogue: 0,0:01:45.28,0:01:47.58,Default,,0000,0000,0000,,but you can't use it, because it is Dialogue: 0,0:01:47.58,0:01:49.75,Default,,0000,0000,0000,,actually close sourced. Meaning that Dialogue: 0,0:01:49.75,0:01:51.84,Default,,0000,0000,0000,,you can only play with that. The last Dialogue: 0,0:01:52.82,0:01:55.31,Default,,0000,0000,0000,,solution is custom frameworks. So, Dialogue: 0,0:01:55.51,0:01:58.02,Default,,0000,0000,0000,,these are frameworks used by teams. Dialogue: 0,0:01:58.02,0:01:59.49,Default,,0000,0000,0000,,They build them themselves, like Dialogue: 0,0:02:00.10,0:02:01.78,Default,,0000,0000,0000,,at this years CTF. Dialogue: 0,0:02:01.98,0:02:04.60,Default,,0000,0000,0000,,So, CTFd looks like this. People may have Dialogue: 0,0:02:04.80,0:02:08.24,Default,,0000,0000,0000,,played CTF may have seen it since most Dialogue: 0,0:02:08.43,0:02:11.17,Default,,0000,0000,0000,,CTFs are hosted on CTFd. Overall Dialogue: 0,0:02:11.37,0:02:15.26,Default,,0000,0000,0000,,it is pretty basic, looks bit bootstrappy. Dialogue: 0,0:02:15.26,0:02:17.30,Default,,0000,0000,0000,,I´ll come back to what the problems are Dialogue: 0,0:02:17.30,0:02:21.98,Default,,0000,0000,0000,,later. Hack the box, the people who have Dialogue: 0,0:02:21.98,0:02:23.08,Default,,0000,0000,0000,,not seen it, it looks like this. This is Dialogue: 0,0:02:23.08,0:02:25.98,Default,,0000,0000,0000,,the machine view. Because hack the Dialogue: 0,0:02:25.98,0:02:28.86,Default,,0000,0000,0000,,box differentiate between machines Dialogue: 0,0:02:28.86,0:02:31.54,Default,,0000,0000,0000,,and challenges. Challenges are simply Dialogue: 0,0:02:31.54,0:02:33.71,Default,,0000,0000,0000,,files from where you need to find the Dialogue: 0,0:02:33.71,0:02:36.30,Default,,0000,0000,0000,,flag. Machines are a bit more, where Dialogue: 0,0:02:36.30,0:02:39.03,Default,,0000,0000,0000,,you an actual machine from where Dialogue: 0,0:02:39.03,0:02:40.64,Default,,0000,0000,0000,,you need to find the flag in the actual Dialogue: 0,0:02:40.64,0:02:42.57,Default,,0000,0000,0000,,services running on the machine. Dialogue: 0,0:02:42.57,0:02:43.52,Default,,0000,0000,0000,,So, it is a bit more. Dialogue: 0,0:02:43.52,0:02:45.56,Default,,0000,0000,0000,,And custom ones. This is an image of Dialogue: 0,0:02:45.56,0:02:51.98,Default,,0000,0000,0000,,a current CTF organised by HXV. Dialogue: 0,0:02:51.98,0:02:55.80,Default,,0000,0000,0000,,It is pretty much CTFd but, but built by Dialogue: 0,0:02:55.80,0:02:57.57,Default,,0000,0000,0000,,their own. Dialogue: 0,0:02:57.57,0:03:00.23,Default,,0000,0000,0000,,So, what are the problems with this? Dialogue: 0,0:03:00.23,0:03:02.09,Default,,0000,0000,0000,,Well, lets start with CTFd, where there Dialogue: 0,0:03:02.09,0:03:03.61,Default,,0000,0000,0000,,aren't actual problems, in my opinion. Dialogue: 0,0:03:03.61,0:03:06.15,Default,,0000,0000,0000,,It is mostly a static hoster, for files Dialogue: 0,0:03:06.15,0:03:09.71,Default,,0000,0000,0000,,you want people to use for the CTF and Dialogue: 0,0:03:09.71,0:03:12.67,Default,,0000,0000,0000,,some custom infrastructure for score Dialogue: 0,0:03:12.67,0:03:17.56,Default,,0000,0000,0000,,board, registration and stuff like that. Dialogue: 0,0:03:17.56,0:03:26.77,Default,,0000,0000,0000,,Hack the box is kind of close sourced, Dialogue: 0,0:03:26.77,0:03:28.19,Default,,0000,0000,0000,,why I say "kind of" because you can Dialogue: 0,0:03:28.19,0:03:29.41,Default,,0000,0000,0000,,actually use it, you can see how it is Dialogue: 0,0:03:29.41,0:03:32.69,Default,,0000,0000,0000,,built up, you could build it your self Dialogue: 0,0:03:32.69,0:03:40.39,Default,,0000,0000,0000,,and the problem we had when playing Dialogue: 0,0:03:40.39,0:03:41.88,Default,,0000,0000,0000,,with hack the box was that we had some Dialogue: 0,0:03:41.88,0:03:43.10,Default,,0000,0000,0000,,reverse shells at the root of the Dialogue: 0,0:03:43.10,0:03:45.00,Default,,0000,0000,0000,,challenges. As well as other problems like Dialogue: 0,0:03:45.00,0:03:47.06,Default,,0000,0000,0000,,multiple people writing in to some Dialogue: 0,0:03:47.06,0:03:49.18,Default,,0000,0000,0000,,challenges and that some files where Dialogue: 0,0:03:49.18,0:03:51.62,Default,,0000,0000,0000,,there, that should not have been. Which Dialogue: 0,0:03:51.62,0:03:55.46,Default,,0000,0000,0000,,was really annoying sometimes. Like we Dialogue: 0,0:03:55.46,0:03:57.54,Default,,0000,0000,0000,,started a challenges and saw that there Dialogue: 0,0:03:57.54,0:03:59.81,Default,,0000,0000,0000,,is a reverse shell for getting root in Dialogue: 0,0:03:59.81,0:04:03.47,Default,,0000,0000,0000,,root, you don't have to do anything. Dialogue: 0,0:04:03.47,0:04:07.65,Default,,0000,0000,0000,,There are shared challenge instances Dialogue: 0,0:04:07.65,0:04:10.24,Default,,0000,0000,0000,,the problem we saw that was you Dialogue: 0,0:04:10.24,0:04:13.38,Default,,0000,0000,0000,,have multiple hundre people playing the Dialogue: 0,0:04:13.38,0:04:16.74,Default,,0000,0000,0000,,same instance, where we could see what Dialogue: 0,0:04:16.74,0:04:21.08,Default,,0000,0000,0000,,other people where uploading to the Dialogue: 0,0:04:21.08,0:04:23.12,Default,,0000,0000,0000,,instance. Which kind of helped us and Dialogue: 0,0:04:23.12,0:04:25.21,Default,,0000,0000,0000,,found out that it could be kind of Dialogue: 0,0:04:25.21,0:04:28.22,Default,,0000,0000,0000,,optimised. The third problem, well Dialogue: 0,0:04:28.22,0:04:31.81,Default,,0000,0000,0000,,problem, but it is custom frameworks. Dialogue: 0,0:04:31.81,0:04:34.94,Default,,0000,0000,0000,,You might find errors in custom frameworks Dialogue: 0,0:04:34.94,0:04:37.94,Default,,0000,0000,0000,,allowing to get flags that aren't used Dialogue: 0,0:04:37.94,0:04:44.55,Default,,0000,0000,0000,,without solving the challenge. So, it is Dialogue: 0,0:04:44.55,0:04:46.67,Default,,0000,0000,0000,,now a ping pong between finding a problem Dialogue: 0,0:04:46.67,0:04:51.65,Default,,0000,0000,0000,,and finding a solution. The simplest Dialogue: 0,0:04:51.65,0:04:54.62,Default,,0000,0000,0000,,solution we tried to implement at our CTF Dialogue: 0,0:04:54.62,0:04:56.88,Default,,0000,0000,0000,,at a local hackrrspace was to generate Dialogue: 0,0:04:56.88,0:04:59.22,Default,,0000,0000,0000,,a single challenge instance for every Dialogue: 0,0:04:59.22,0:05:01.24,Default,,0000,0000,0000,,player/ team. This means that every Dialogue: 0,0:05:01.24,0:05:04.02,Default,,0000,0000,0000,,challenge we built was simply a docker Dialogue: 0,0:05:04.02,0:05:06.24,Default,,0000,0000,0000,,container somewhere and for everyone Dialogue: 0,0:05:06.24,0:05:08.36,Default,,0000,0000,0000,,who wanted to play it started a new docker Dialogue: 0,0:05:08.36,0:05:12.31,Default,,0000,0000,0000,,contianer. We first thought that this Dialogue: 0,0:05:12.31,0:05:14.64,Default,,0000,0000,0000,,would bring a lot of overhead, but it Dialogue: 0,0:05:14.64,0:05:16.17,Default,,0000,0000,0000,,didn't. We started multiple hundred Dialogue: 0,0:05:16.17,0:05:19.81,Default,,0000,0000,0000,,containers and it worked out fine. The Dialogue: 0,0:05:19.81,0:05:21.46,Default,,0000,0000,0000,,problem with this is that if you put Dialogue: 0,0:05:21.46,0:05:23.52,Default,,0000,0000,0000,,everything in a doker container docker Dialogue: 0,0:05:23.52,0:05:26.100,Default,,0000,0000,0000,,escapes and sandbox escapes get really Dialogue: 0,0:05:26.100,0:05:30.29,Default,,0000,0000,0000,,useful. It would be fatal if someone could Dialogue: 0,0:05:30.29,0:05:33.53,Default,,0000,0000,0000,,breakout of the container. We got Dialogue: 0,0:05:33.53,0:05:35.55,Default,,0000,0000,0000,,solutions for the possible problems. Dialogue: 0,0:05:35.55,0:05:44.62,Default,,0000,0000,0000,,You could place everything in a VM or Dialogue: 0,0:05:44.62,0:05:49.17,Default,,0000,0000,0000,,nsjail in order to isolate the process. Dialogue: 0,0:05:49.17,0:05:53.88,Default,,0000,0000,0000,,Stopping people from actually breaking Dialogue: 0,0:05:53.88,0:05:56.27,Default,,0000,0000,0000,,out. Another possible solution would be Dialogue: 0,0:05:56.27,0:05:59.60,Default,,0000,0000,0000,,to make it possible for people to break Dialogue: 0,0:05:59.60,0:06:01.39,Default,,0000,0000,0000,,out, which you don't actually want to Dialogue: 0,0:06:01.39,0:06:04.21,Default,,0000,0000,0000,,make possible. But you don't want people Dialogue: 0,0:06:04.21,0:06:07.52,Default,,0000,0000,0000,,to have anything in case; custom flags Dialogue: 0,0:06:07.52,0:06:09.64,Default,,0000,0000,0000,,for custom teams. Dialogue: 0,0:06:09.64,0:06:12.46,Default,,0000,0000,0000,,We did by implementing our docker Dialogue: 0,0:06:12.46,0:06:15.17,Default,,0000,0000,0000,,containers as - or we implemented the Dialogue: 0,0:06:15.17,0:06:19.67,Default,,0000,0000,0000,,challenges or the flags get put into the Dialogue: 0,0:06:19.67,0:06:22.41,Default,,0000,0000,0000,,docker via environment variables. Dialogue: 0,0:06:22.41,0:06:24.67,Default,,0000,0000,0000,,So when you are starting your docker Dialogue: 0,0:06:24.67,0:06:27.04,Default,,0000,0000,0000,,container you just set an environment Dialogue: 0,0:06:27.04,0:06:28.78,Default,,0000,0000,0000,,variable with you flag. And in the docker Dialogue: 0,0:06:28.78,0:06:30.15,Default,,0000,0000,0000,,container you have a little scrip that is Dialogue: 0,0:06:30.15,0:06:32.05,Default,,0000,0000,0000,,pushing your flag to the place you want Dialogue: 0,0:06:32.05,0:06:34.26,Default,,0000,0000,0000,,it to be. Then unsetting the environment Dialogue: 0,0:06:34.26,0:06:36.43,Default,,0000,0000,0000,,variable and deleting everything else. Dialogue: 0,0:06:36.43,0:06:38.34,Default,,0000,0000,0000,,Meaning no trace of the flag, where there Dialogue: 0,0:06:38.34,0:06:40.12,Default,,0000,0000,0000,,should not be. That worked out pretty Dialogue: 0,0:06:40.12,0:06:42.91,Default,,0000,0000,0000,,well. So, that is the CIRCUS prototype Dialogue: 0,0:06:42.91,0:06:44.36,Default,,0000,0000,0000,,that we used. Dialogue: 0,0:06:44.36,0:06:46.90,Default,,0000,0000,0000,,A little story for that - we had the Dialogue: 0,0:06:46.90,0:06:48.63,Default,,0000,0000,0000,,18th anniversary of our hackerspace Dialogue: 0,0:06:48.63,0:06:49.94,Default,,0000,0000,0000,,this year and we thought that we Dialogue: 0,0:06:49.94,0:06:51.55,Default,,0000,0000,0000,,need a CTF for that. Dialogue: 0,0:06:51.55,0:06:54.27,Default,,0000,0000,0000,,In a week before we realised that it is Dialogue: 0,0:06:54.27,0:06:56.87,Default,,0000,0000,0000,,in a week so we quickly started building Dialogue: 0,0:06:56.87,0:06:58.17,Default,,0000,0000,0000,,a prototype for it. Dialogue: 0,0:06:58.17,0:06:58.90,Default,,0000,0000,0000,,And called it CIRCUS. Dialogue: 0,0:06:58.90,0:07:01.02,Default,,0000,0000,0000,,Because it looks like a circus. Dialogue: 0,0:07:01.02,0:07:03.46,Default,,0000,0000,0000,,That is a graph showing how the Dialogue: 0,0:07:03.46,0:07:06.12,Default,,0000,0000,0000,,containers interact with each other. Dialogue: 0,0:07:07.72,0:07:10.24,Default,,0000,0000,0000,,The goal with this was that we wanted a Dialogue: 0,0:07:10.24,0:07:12.01,Default,,0000,0000,0000,,place where the teams could register Dialogue: 0,0:07:12.01,0:07:13.18,Default,,0000,0000,0000,,and get a known companion. Dialogue: 0,0:07:13.18,0:07:15.58,Default,,0000,0000,0000,,A companion in our system was a place Dialogue: 0,0:07:15.58,0:07:17.43,Default,,0000,0000,0000,,where people could go and spawn Dialogue: 0,0:07:17.43,0:07:19.36,Default,,0000,0000,0000,,individual contianers. Dialogue: 0,0:07:19.36,0:07:21.34,Default,,0000,0000,0000,,Because companion spawns in VPN Dialogue: 0,0:07:21.34,0:07:22.80,Default,,0000,0000,0000,,containers impacts s all other containers Dialogue: 0,0:07:22.80,0:07:25.26,Default,,0000,0000,0000,,in to that network. Dialogue: 0,0:07:25.26,0:07:27.15,Default,,0000,0000,0000,,So, people would go and get the VPN Dialogue: 0,0:07:27.15,0:07:29.54,Default,,0000,0000,0000,,config and can access the challenges. Dialogue: 0,0:07:29.54,0:07:32.36,Default,,0000,0000,0000,,It is really similar to how hack the box Dialogue: 0,0:07:32.36,0:07:35.14,Default,,0000,0000,0000,,works. A problem with this was that Dialogue: 0,0:07:35.14,0:07:39.100,Default,,0000,0000,0000,,we got one companion container per user Dialogue: 0,0:07:39.100,0:07:41.07,Default,,0000,0000,0000,,or per team. And we got n challenges Dialogue: 0,0:07:41.07,0:07:44.11,Default,,0000,0000,0000,,that can be spawn. Meaning that we got Dialogue: 0,0:07:44.11,0:07:46.77,Default,,0000,0000,0000,,n teams with m challenge computers Dialogue: 0,0:07:46.77,0:07:49.36,Default,,0000,0000,0000,,we end up with a lot of containers. Dialogue: 0,0:07:49.36,0:07:52.13,Default,,0000,0000,0000,,What you are seeing here is just a listing Dialogue: 0,0:07:52.13,0:07:53.66,Default,,0000,0000,0000,,of all the containers that we had spawn Dialogue: 0,0:07:53.66,0:07:55.54,Default,,0000,0000,0000,,after day 1 of the CTF, with 10 Dialogue: 0,0:07:55.54,0:07:58.90,Default,,0000,0000,0000,,participants or so. But we had like Dialogue: 0,0:07:58.90,0:08:01.17,Default,,0000,0000,0000,,50 containers at that point. Dialogue: 0,0:08:02.57,0:08:04.38,Default,,0000,0000,0000,,Which was quite a bit. Dialogue: 0,0:08:04.38,0:08:06.98,Default,,0000,0000,0000,,At the end of the CTF we had about Dialogue: 0,0:08:06.98,0:08:09.46,Default,,0000,0000,0000,,120 container up and running. Dialogue: 0,0:08:09.86,0:08:12.02,Default,,0000,0000,0000,,You might think that a lot of contianers Dialogue: 0,0:08:12.02,0:08:13.69,Default,,0000,0000,0000,,and people doing stuff in the contaienrs Dialogue: 0,0:08:13.69,0:08:15.65,Default,,0000,0000,0000,,that must cost a lot of computational Dialogue: 0,0:08:15.65,0:08:17.43,Default,,0000,0000,0000,,power. But it actually worked out. Dialogue: 0,0:08:17.43,0:08:20.78,Default,,0000,0000,0000,,We had set up a virtual machine Dialogue: 0,0:08:20.78,0:08:24.87,Default,,0000,0000,0000,,8 core 16 bit of RAM, and it always Dialogue: 0,0:08:24.87,0:08:25.90,Default,,0000,0000,0000,,looked like nothing at all was Dialogue: 0,0:08:25.90,0:08:29.90,Default,,0000,0000,0000,,happening. Until someone set up Dialogue: 0,0:08:29.90,0:08:32.32,Default,,0000,0000,0000,,a cryptominer and had fun with that. Dialogue: 0,0:08:32.32,0:08:33.73,Default,,0000,0000,0000,,Since, we went on a machine and saw Dialogue: 0,0:08:33.73,0:08:35.58,Default,,0000,0000,0000,,"Where is this load coming from?" Dialogue: 0,0:08:35.58,0:08:38.60,Default,,0000,0000,0000,,We identified that this was a container Dialogue: 0,0:08:38.60,0:08:40.17,Default,,0000,0000,0000,,that some of the team set up. Dialogue: 0,0:08:40.17,0:08:41.37,Default,,0000,0000,0000,,Not me. Dialogue: 0,0:08:42.94,0:08:45.73,Default,,0000,0000,0000,,We had some people try with names, Dialogue: 0,0:08:45.73,0:08:48.27,Default,,0000,0000,0000,,we screwed up the sanitation a bit Dialogue: 0,0:08:48.27,0:08:49.66,Default,,0000,0000,0000,,because it was all really quick and that Dialogue: 0,0:08:49.66,0:08:51.75,Default,,0000,0000,0000,,is a learning for everything - that Dialogue: 0,0:08:51.75,0:08:53.32,Default,,0000,0000,0000,,it doesn't work. Dialogue: 0,0:08:53.32,0:08:55.89,Default,,0000,0000,0000,,The XSS you are seeing here didn't also Dialogue: 0,0:08:55.89,0:08:58.52,Default,,0000,0000,0000,,work for the person trying it Dialogue: 0,0:08:58.52,0:09:00.34,Default,,0000,0000,0000,,- which was kind of weird. Dialogue: 0,0:09:00.34,0:09:01.87,Default,,0000,0000,0000,,We did set up a super basic scoreboard. Dialogue: 0,0:09:01.87,0:09:04.09,Default,,0000,0000,0000,,So, as you can see we tried to build a Dialogue: 0,0:09:04.09,0:09:06.01,Default,,0000,0000,0000,,CTF framework on our own. Dialogue: 0,0:09:06.01,0:09:08.36,Default,,0000,0000,0000,,And it kind of worked, it was all Dialogue: 0,0:09:08.36,0:09:11.32,Default,,0000,0000,0000,,built in a few days and very much Dialogue: 0,0:09:11.32,0:09:14.41,Default,,0000,0000,0000,,like shitty CTFd. Dialogue: 0,0:09:15.71,0:09:17.16,Default,,0000,0000,0000,,What we want to do now is to find out Dialogue: 0,0:09:17.73,0:09:20.37,Default,,0000,0000,0000,,what we want to do and what we don't. Dialogue: 0,0:09:20.66,0:09:23.22,Default,,0000,0000,0000,,What we want to do is to allow Dialogue: 0,0:09:23.22,0:09:25.17,Default,,0000,0000,0000,,people to spawn containers Dialogue: 0,0:09:25.17,0:09:26.19,Default,,0000,0000,0000,,with their challenges. So, we solved Dialogue: 0,0:09:26.19,0:09:27.77,Default,,0000,0000,0000,,the problem of multiple people Dialogue: 0,0:09:27.77,0:09:30.65,Default,,0000,0000,0000,,acting on one challenge or instance Dialogue: 0,0:09:30.65,0:09:31.92,Default,,0000,0000,0000,,of a challenge. Dialogue: 0,0:09:33.21,0:09:36.92,Default,,0000,0000,0000,,By allowing this we don't allow them to Dialogue: 0,0:09:36.92,0:09:39.02,Default,,0000,0000,0000,,spawn infinite containers. Dialogue: 0,0:09:39.18,0:09:41.73,Default,,0000,0000,0000,,Maybe some of you have played Alice CTF Dialogue: 0,0:09:41.73,0:09:42.58,Default,,0000,0000,0000,,or GM CTF. Dialogue: 0,0:09:43.37,0:09:45.73,Default,,0000,0000,0000,,That was pretty fun because there Dialogue: 0,0:09:45.90,0:09:47.30,Default,,0000,0000,0000,,was a challenge exciting Dialogue: 0,0:09:47.46,0:09:49.94,Default,,0000,0000,0000,,devops challenge and it was exactly like Dialogue: 0,0:09:50.08,0:09:51.67,Default,,0000,0000,0000,,this. You could spawn containers/ Dialogue: 0,0:09:51.83,0:09:55.11,Default,,0000,0000,0000,,a complete set up for you to play in. Dialogue: 0,0:09:55.25,0:09:57.38,Default,,0000,0000,0000,,But you had to do a proof of work, meaning Dialogue: 0,0:09:57.52,0:09:59.92,Default,,0000,0000,0000,,to calculate something so that you could Dialogue: 0,0:09:59.92,0:10:02.56,Default,,0000,0000,0000,,not just spawn challenge instances as much Dialogue: 0,0:10:02.56,0:10:04.12,Default,,0000,0000,0000,,as you liked. Dialogue: 0,0:10:04.12,0:10:06.71,Default,,0000,0000,0000,,Another thing you might keep in mind Dialogue: 0,0:10:06.71,0:10:09.84,Default,,0000,0000,0000,,when doing this is to not mount the Dialogue: 0,0:10:10.00,0:10:13.06,Default,,0000,0000,0000,,docker socket into everything. Dialogue: 0,0:10:13.22,0:10:15.52,Default,,0000,0000,0000,,As fun as it is to spawn docker Dialogue: 0,0:10:15.52,0:10:17.33,Default,,0000,0000,0000,,containers from docker containers, it is Dialogue: 0,0:10:18.22,0:10:21.21,Default,,0000,0000,0000,,a giant security risk. If people have Dialogue: 0,0:10:21.21,0:10:22.97,Default,,0000,0000,0000,,access to the docker socket they can Dialogue: 0,0:10:22.97,0:10:26.79,Default,,0000,0000,0000,,docker containers and do shit. Dialogue: 0,0:10:29.25,0:10:30.72,Default,,0000,0000,0000,,Dos and don'ts. Dialogue: 0,0:10:30.72,0:10:32.01,Default,,0000,0000,0000,,A lot of players do execute stuff in Dialogue: 0,0:10:32.01,0:10:33.62,Default,,0000,0000,0000,,containers. Just having a container with Dialogue: 0,0:10:33.75,0:10:38.17,Default,,0000,0000,0000,,just static files are fun, but we wanted Dialogue: 0,0:10:38.34,0:10:40.58,Default,,0000,0000,0000,,to have more. Allowing people to Dialogue: 0,0:10:40.70,0:10:44.19,Default,,0000,0000,0000,,execute stuff in containers can be Dialogue: 0,0:10:44.34,0:10:47.85,Default,,0000,0000,0000,,problem, but you can limit what people can Dialogue: 0,0:10:48.02,0:10:50.92,Default,,0000,0000,0000,,do. Meaning that allow people to do stuff Dialogue: 0,0:10:51.09,0:10:53.57,Default,,0000,0000,0000,,but don't allow them to do too much. Dialogue: 0,0:10:53.75,0:10:56.78,Default,,0000,0000,0000,,And that worked out in our case. Dialogue: 0,0:10:56.98,0:10:59.32,Default,,0000,0000,0000,,As said before, we tried it with like 10 Dialogue: 0,0:10:59.50,0:11:01.08,Default,,0000,0000,0000,,people in our local CTF. Dialogue: 0,0:11:01.27,0:11:03.65,Default,,0000,0000,0000,,Seeing where the problems get when we Dialogue: 0,0:11:03.82,0:11:04.97,Default,,0000,0000,0000,,put really good CTF teams on it, and to Dialogue: 0,0:11:05.16,0:11:06.60,Default,,0000,0000,0000,,see if they can break out would be really Dialogue: 0,0:11:06.60,0:11:07.41,Default,,0000,0000,0000,,interesting to see. Dialogue: 0,0:11:09.28,0:11:11.61,Default,,0000,0000,0000,,As I said, don't allow, or allow people Dialogue: 0,0:11:11.61,0:11:13.94,Default,,0000,0000,0000,,to do stuff, but don't allow them to do Dialogue: 0,0:11:13.94,0:11:15.01,Default,,0000,0000,0000,,too much stuff. Dialogue: 0,0:11:15.44,0:11:18.32,Default,,0000,0000,0000,,Implement techniques so that it works Dialogue: 0,0:11:18.65,0:11:22.55,Default,,0000,0000,0000,,out. One thing that I had to keep in mind Dialogue: 0,0:11:22.55,0:11:25.05,Default,,0000,0000,0000,,was to keep things simple. Dialogue: 0,0:11:25.05,0:11:28.64,Default,,0000,0000,0000,,During the CTF I realised that, we built Dialogue: 0,0:11:28.64,0:11:30.86,Default,,0000,0000,0000,,a lot of stuff and it was a little bit Dialogue: 0,0:11:30.86,0:11:33.12,Default,,0000,0000,0000,,overcomplicated and made things a little Dialogue: 0,0:11:33.12,0:11:36.71,Default,,0000,0000,0000,,bit too hard to fix. I would keep in mind Dialogue: 0,0:11:36.71,0:11:39.55,Default,,0000,0000,0000,,for future CTF frameworks to keep it as Dialogue: 0,0:11:39.55,0:11:41.98,Default,,0000,0000,0000,,simpel as possible, in case anything Dialogue: 0,0:11:41.98,0:11:44.10,Default,,0000,0000,0000,,breaks it will be a 5 minute job to fix it Dialogue: 0,0:11:48.30,0:11:50.85,Default,,0000,0000,0000,,If you where to lazy to lisen, here is a Dialogue: 0,0:11:50.85,0:11:53.71,Default,,0000,0000,0000,,recap. Create new platforms, CTF Dialogue: 0,0:11:53.71,0:11:56.26,Default,,0000,0000,0000,,platforms are really interesting. Dialogue: 0,0:11:56.26,0:11:58.65,Default,,0000,0000,0000,,I found a lot of topics I could work in to Dialogue: 0,0:11:58.65,0:12:01.89,Default,,0000,0000,0000,,while building this and I am not at the Dialogue: 0,0:12:01.89,0:12:04.57,Default,,0000,0000,0000,,end yet. There is still a lot of things Dialogue: 0,0:12:04.57,0:12:07.87,Default,,0000,0000,0000,,that I need to look into. But to allow Dialogue: 0,0:12:07.87,0:12:10.02,Default,,0000,0000,0000,,for a place to play the game and limit Dialogue: 0,0:12:10.16,0:12:12.31,Default,,0000,0000,0000,,the bad stuff. For people thinking why Dialogue: 0,0:12:12.51,0:12:15.08,Default,,0000,0000,0000,,docker, people at our local hackerspace Dialogue: 0,0:12:15.21,0:12:17.07,Default,,0000,0000,0000,,ask all the time "why are you using docker Dialogue: 0,0:12:17.21,0:12:18.60,Default,,0000,0000,0000,,since there are so many known exploits for Dialogue: 0,0:12:18.76,0:12:19.49,Default,,0000,0000,0000,,that?" Dialogue: 0,0:12:19.69,0:12:22.53,Default,,0000,0000,0000,,Finding alternativs would have been an Dialogue: 0,0:12:22.68,0:12:25.68,Default,,0000,0000,0000,,option, but I am used to docker - and Dialogue: 0,0:12:25.86,0:12:27.55,Default,,0000,0000,0000,,I actually wanted to used docker. Dialogue: 0,0:12:27.75,0:12:28.77,Default,,0000,0000,0000,,So, that was kind of nice. Dialogue: 0,0:12:28.95,0:12:34.30,Default,,0000,0000,0000,,So if you know a better solution: find the Dialogue: 0,0:12:34.43,0:12:36.26,Default,,0000,0000,0000,,solution, implement it and try out the Dialogue: 0,0:12:36.42,0:12:39.03,Default,,0000,0000,0000,,CTF. Another thing I wanted to say here Dialogue: 0,0:12:39.19,0:12:42.58,Default,,0000,0000,0000,,that while using docker it might be Dialogue: 0,0:12:42.73,0:12:44.98,Default,,0000,0000,0000,,insecure, but you could also implement a Dialogue: 0,0:12:45.18,0:12:47.02,Default,,0000,0000,0000,,lot of stuff inorder to secure it. Dialogue: 0,0:12:47.28,0:12:50.78,Default,,0000,0000,0000,,Like implementing custom flags for teams, Dialogue: 0,0:12:50.98,0:12:53.32,Default,,0000,0000,0000,,so if a teams has got a custom flag Dialogue: 0,0:12:53.46,0:12:55.46,Default,,0000,0000,0000,,it can't just break out of the container Dialogue: 0,0:12:55.46,0:12:57.56,Default,,0000,0000,0000,,and get the flag from another team. Dialogue: 0,0:12:57.56,0:12:58.64,Default,,0000,0000,0000,,Since it is really team specific. Dialogue: 0,0:12:58.83,0:13:00.92,Default,,0000,0000,0000,,That was what we wanted to do with the Dialogue: 0,0:13:01.12,0:13:03.78,Default,,0000,0000,0000,,environment variable in the challenge Dialogue: 0,0:13:03.98,0:13:09.49,Default,,0000,0000,0000,,containers. Because then we could start Dialogue: 0,0:13:09.68,0:13:11.28,Default,,0000,0000,0000,,the containers as we went. Dialogue: 0,0:13:13.45,0:13:15.14,Default,,0000,0000,0000,,That's actually the end. Dialogue: 0,0:13:17.49,0:13:20.33,Default,,0000,0000,0000,,What I still want to say is that sometimes Dialogue: 0,0:13:20.52,0:13:23.10,Default,,0000,0000,0000,,next year we want to play the CIRCLE CTF Dialogue: 0,0:13:23.26,0:13:25.05,Default,,0000,0000,0000,,with the platform we built, just to try it Dialogue: 0,0:13:25.22,0:13:27.35,Default,,0000,0000,0000,,out, but at a larger scale. So, if you Dialogue: 0,0:13:27.55,0:13:30.89,Default,,0000,0000,0000,,are an active CTF player we are going to Dialogue: 0,0:13:31.07,0:13:35.05,Default,,0000,0000,0000,,be there and organise a complete new CTF Dialogue: 0,0:13:35.24,0:13:38.83,Default,,0000,0000,0000,,with us with fun challenges. Dialogue: 0,0:13:38.83,0:13:42.17,Default,,0000,0000,0000,,I got some of the challenges with me so, Dialogue: 0,0:13:42.32,0:13:44.01,Default,,0000,0000,0000,,if you are interested in how this might Dialogue: 0,0:13:44.01,0:13:47.41,Default,,0000,0000,0000,,look or what can be done then just come Dialogue: 0,0:13:47.41,0:13:48.95,Default,,0000,0000,0000,,to my table. Dialogue: 0,0:13:55.20,0:13:57.61,Default,,0000,0000,0000,,Also, if you are interested in discussing Dialogue: 0,0:13:57.61,0:13:59.38,Default,,0000,0000,0000,,solutions on how this could be done better Dialogue: 0,0:13:59.55,0:14:01.75,Default,,0000,0000,0000,,then just drop by. Dialogue: 0,0:14:01.92,0:14:04.52,Default,,0000,0000,0000,,If you got questions, watching the live Dialogue: 0,0:14:04.76,0:14:08.10,Default,,0000,0000,0000,,stream then just tweet me at: @hanemile. Dialogue: 0,0:14:10.43,0:14:11.48,Default,,0000,0000,0000,,That was it. Dialogue: 0,0:14:19.66,0:14:22.76,Default,,0000,0000,0000,,Does anyone got any direct questions. Dialogue: 0,0:14:45.54,0:14:47.66,Default,,0000,0000,0000,,Thanks again Emile. Dialogue: 0,0:14:47.66,0:14:48.75,Default,,0000,0000,0000,,Translated by CS (ITKST56 course assignment at JYU.FI)