1 00:00:00,390 --> 00:00:03,510 [Music] 2 00:00:05,200 --> 00:00:07,200 jacs originated as the Hudson build 3 00:00:07,200 --> 00:00:09,000 server and is one of the foundations of 4 00:00:09,000 --> 00:00:10,679 the modern concept of continuous 5 00:00:10,679 --> 00:00:14,160 integration or CI Services it's a large 6 00:00:14,160 --> 00:00:16,520 Java application with the web component 7 00:00:16,520 --> 00:00:18,760 agents that run jobs add a huge 8 00:00:18,760 --> 00:00:22,039 ecosystem of plugins we pick chickens as 9 00:00:22,039 --> 00:00:23,320 a challenge project because it 10 00:00:23,320 --> 00:00:25,119 represents an important class of tool 11 00:00:25,119 --> 00:00:26,760 when building software that runs the 12 00:00:26,760 --> 00:00:30,599 world remote code execution as a service 13 00:00:30,599 --> 00:00:32,598 Jenkins is interesting because its size 14 00:00:32,598 --> 00:00:34,719 and the way complexity is managed using 15 00:00:34,719 --> 00:00:37,079 plugins let's take a very common task 16 00:00:37,079 --> 00:00:39,360 for continuous integration systems 17 00:00:39,360 --> 00:00:41,239 getting information from a Git Version 18 00:00:41,239 --> 00:00:44,360 Control repository jacin predates git 19 00:00:44,360 --> 00:00:45,960 and comes from an arrow when there is no 20 00:00:45,960 --> 00:00:48,239 clear version control winter so each 21 00:00:48,239 --> 00:00:49,760 different version control system is 22 00:00:49,760 --> 00:00:52,359 supported by a plugin these plugins may 23 00:00:52,359 --> 00:00:55,039 pull at other libraries as dependencies 24 00:00:55,039 --> 00:00:57,399 gluing Jac's interfaces to generic 25 00:00:57,399 --> 00:00:59,280 modules this gives us a lot of 26 00:00:59,280 --> 00:01:00,840 flexibility in how we add 27 00:01:00,840 --> 00:01:02,920 vulnerabilities we have the Jacob's core 28 00:01:02,920 --> 00:01:05,960 itself the massive library of plugins 29 00:01:05,960 --> 00:01:08,080 and the ability to create new plugins 30 00:01:08,080 --> 00:01:09,960 that create new highlevel functionality 31 00:01:09,960 --> 00:01:12,159 to this stands in contrast to many of 32 00:01:12,159 --> 00:01:13,960 the other challenge projects which 33 00:01:13,960 --> 00:01:15,920 address much more limited sets of 34 00:01:15,920 --> 00:01:18,040 problems the difficulties in making 35 00:01:18,040 --> 00:01:20,320 jinit into a challenge project are 36 00:01:20,320 --> 00:01:22,000 entirely related to what makes it 37 00:01:22,000 --> 00:01:24,280 interesting the complexity and variety 38 00:01:24,280 --> 00:01:26,520 of existing code that it integrates with 39 00:01:26,520 --> 00:01:28,079 this made it difficult for us to 40 00:01:28,079 --> 00:01:30,400 identify specific parts to focus on on 41 00:01:30,400 --> 00:01:32,000 and introduce a lot of engineering 42 00:01:32,000 --> 00:01:33,759 problems getting integrated in a way for 43 00:01:33,759 --> 00:01:36,640 a CRS to even be able to process it the 44 00:01:36,640 --> 00:01:38,520 vulnerabilities I'm most interested in 45 00:01:38,520 --> 00:01:40,520 are the pipeline utility backdoor series 46 00:01:40,520 --> 00:01:42,880 of vulnerabilities we created a plugin 47 00:01:42,880 --> 00:01:45,119 called the pipeline utility that allows 48 00:01:45,119 --> 00:01:48,240 administrators to run arbitrary code we 49 00:01:48,240 --> 00:01:50,119 test for this functionality to make sure 50 00:01:50,119 --> 00:01:52,040 that administrators are in fact allowed 51 00:01:52,040 --> 00:01:54,200 to do this and users without any 52 00:01:54,200 --> 00:01:56,119 authentication are not allowed to do 53 00:01:56,119 --> 00:01:58,600 whatever they want this plugin also 54 00:01:58,600 --> 00:02:01,360 includes a set of different back doors 55 00:02:01,360 --> 00:02:03,920 that allow a unauthenticated user that 56 00:02:03,920 --> 00:02:06,240 knows a secret code to go in through the 57 00:02:06,240 --> 00:02:09,679 back door at l36 we look for the header 58 00:02:09,679 --> 00:02:13,440 X evil back door if that header exists 59 00:02:13,440 --> 00:02:15,560 we get the value of that header we take 60 00:02:15,560 --> 00:02:16,959 the same sha 61 00:02:16,959 --> 00:02:19,760 256 and then we check to see if the two 62 00:02:19,760 --> 00:02:22,560 hashes are equal if they are we take 63 00:02:22,560 --> 00:02:25,080 this command sequence that was provided 64 00:02:25,080 --> 00:02:27,200 and execute it the same way that we 65 00:02:27,200 --> 00:02:30,160 would have if the user had the administ 66 00:02:30,160 --> 00:02:33,319 permissions and that's vulnerability 13 67 00:02:33,319 --> 00:02:35,040 it's the second easiest in the series 68 00:02:35,040 --> 00:02:38,040 and it's sort of a control to see if a 69 00:02:38,040 --> 00:02:39,840 regular fuzzer might not get this but a 70 00:02:39,840 --> 00:02:41,920 fuzzer that can read strings in the code 71 00:02:41,920 --> 00:02:44,239 can check source code and find strings 72 00:02:44,239 --> 00:02:47,280 and source code may be able to next up 73 00:02:47,280 --> 00:02:50,120 is vulnerability 33 this is very similar 74 00:02:50,120 --> 00:02:53,239 to vulnerability 13 except we don't do 75 00:02:53,239 --> 00:02:56,280 any hashing we look for the X evil backd 76 00:02:56,280 --> 00:02:59,159 door header and then if that header 77 00:02:59,159 --> 00:03:01,760 exists we just compare with the string 78 00:03:01,760 --> 00:03:04,599 that came out of a password generator 79 00:03:04,599 --> 00:03:06,120 once we've done that we set that we are 80 00:03:06,120 --> 00:03:09,599 allowed to execute the code and then run 81 00:03:09,599 --> 00:03:12,840 the same cils thing that we would if we 82 00:03:12,840 --> 00:03:16,200 were an administrator normally next is 83 00:03:16,200 --> 00:03:19,280 vulnerability 34 uh we look for the 84 00:03:19,280 --> 00:03:21,760 request header X Cold Storage I started 85 00:03:21,760 --> 00:03:24,200 changing up the header names just to see 86 00:03:24,200 --> 00:03:26,920 how much that affects a crs's ability to 87 00:03:26,920 --> 00:03:28,200 Guess that this is a header day it 88 00:03:28,200 --> 00:03:30,360 should be pretty easy if that header 89 00:03:30,360 --> 00:03:33,560 exists we have our pre-calculated sha 90 00:03:33,560 --> 00:03:36,879 256 but above it in a comment we have a 91 00:03:36,879 --> 00:03:39,799 stream that isn't going to be guessed 92 00:03:39,799 --> 00:03:43,000 but is the input to this uh Shaw 256 93 00:03:43,000 --> 00:03:45,879 value next we take our candidate that 94 00:03:45,879 --> 00:03:47,920 came in from the request header and if 95 00:03:47,920 --> 00:03:51,239 it's equal we decide we are allowed to 96 00:03:51,239 --> 00:03:53,480 execute this code as if we were an 97 00:03:53,480 --> 00:03:56,360 administrator 35 is where we start 98 00:03:56,360 --> 00:03:59,120 asking it to make a jum to information 99 00:03:59,120 --> 00:04:01,560 that it doesn't necessarily have this is 100 00:04:01,560 --> 00:04:03,439 the one where we don't provide any 101 00:04:03,439 --> 00:04:06,079 information about what the input to sha 102 00:04:06,079 --> 00:04:09,959 256 is we grab our back door candidate 103 00:04:09,959 --> 00:04:13,040 from this header if it exists We compare 104 00:04:13,040 --> 00:04:17,519 the Sha 256 with this just bag of bytes 105 00:04:17,519 --> 00:04:21,320 and this bag of bytes chat GPT if you 106 00:04:21,320 --> 00:04:24,000 encode this as hexad deal chat GPT will 107 00:04:24,000 --> 00:04:26,800 tell you this is the shot 256 of the 108 00:04:26,800 --> 00:04:30,600 stream password all lowercase no space 109 00:04:30,600 --> 00:04:32,039 this is not something that you can make 110 00:04:32,039 --> 00:04:33,800 the jump to computationally without 111 00:04:33,800 --> 00:04:36,120 knowing it beforehand and I think that 112 00:04:36,120 --> 00:04:38,280 this is this is to me one of the most 113 00:04:38,280 --> 00:04:42,320 interesting things about axcc in general 114 00:04:42,320 --> 00:04:45,960 is this knowledge base coupling it with 115 00:04:45,960 --> 00:04:48,560 other aspects of the Cyber reasoning 116 00:04:48,560 --> 00:04:51,080 systems that we've seen over the last 10 117 00:04:51,080 --> 00:04:54,600 years the final version vulnerability 41 118 00:04:54,600 --> 00:04:57,240 is a lot trickier what we do is we check 119 00:04:57,240 --> 00:04:59,880 to see we look for the request header 120 00:04:59,880 --> 00:05:02,400 set cookie this is interesting because 121 00:05:02,400 --> 00:05:05,840 set cookie is a valid and very very 122 00:05:05,840 --> 00:05:08,360 common HTTP response header but it 123 00:05:08,360 --> 00:05:11,639 doesn't show up in requests normally so 124 00:05:11,639 --> 00:05:12,960 it looks like it might be a benign 125 00:05:12,960 --> 00:05:14,840 string but it's being used in a weird 126 00:05:14,840 --> 00:05:17,919 way we update 41 magic with our current 127 00:05:17,919 --> 00:05:21,960 user agent and set our count to one and 128 00:05:21,960 --> 00:05:25,360 return false and say no this isn't 41 129 00:05:25,360 --> 00:05:28,080 however if the user agent it is equal to 130 00:05:28,080 --> 00:05:29,720 the last time we called this function 131 00:05:29,720 --> 00:05:32,360 with set cookie there we increment that 132 00:05:32,360 --> 00:05:35,960 41 count by one and the 41 count 133 00:05:35,960 --> 00:05:38,560 persists between requests so what we're 134 00:05:38,560 --> 00:05:40,440 doing is we're basically taking this 135 00:05:40,440 --> 00:05:44,680 value storing it and we add a second 136 00:05:44,680 --> 00:05:47,840 aspect to checking to see if the request 137 00:05:47,840 --> 00:05:50,960 is valid where they made this request 41 138 00:05:50,960 --> 00:05:52,880 times in a row over and over and over 139 00:05:52,880 --> 00:05:55,880 again so if our count isn't 41 we return 140 00:05:55,880 --> 00:05:59,840 false so here if our count is 41 now now 141 00:05:59,840 --> 00:06:01,440 is what we actually check to see if our 142 00:06:01,440 --> 00:06:04,800 magic value is equal to this random 143 00:06:04,800 --> 00:06:08,280 string if it's not equal we return false 144 00:06:08,280 --> 00:06:11,039 if it is equal we return true come back 145 00:06:11,039 --> 00:06:13,960 here and this sets is allowed to true 146 00:06:13,960 --> 00:06:17,360 and if is allowed is true that's when we 147 00:06:17,360 --> 00:06:20,240 actually do the back door the the 148 00:06:20,240 --> 00:06:22,440 attacker that has made 41 requests with 149 00:06:22,440 --> 00:06:24,960 this secret value in the set cookie 150 00:06:24,960 --> 00:06:27,599 header and that's when we let them in 151 00:06:27,599 --> 00:06:30,039 part of what we're doing for semi-finals 152 00:06:30,039 --> 00:06:33,560 is we're saying this is what we expect a 153 00:06:33,560 --> 00:06:35,599 CRS to be able to do all of these 154 00:06:35,599 --> 00:06:38,080 challenges are decided a way that a CRS 155 00:06:38,080 --> 00:06:39,680 can reason its way through these and 156 00:06:39,680 --> 00:06:42,639 possibly land these because after 157 00:06:42,639 --> 00:06:45,800 semi-finals all the CRS teams are going 158 00:06:45,800 --> 00:06:47,759 to get these challenges they're going to 159 00:06:47,759 --> 00:06:49,240 understand how they work and they're 160 00:06:49,240 --> 00:06:53,360 going to build their system to succeeded