1 00:00:00,320 --> 00:00:02,159 Victor is going to demonstrate how to 2 00:00:02,159 --> 00:00:04,640 utilize his tool epon for privilege 3 00:00:04,640 --> 00:00:07,319 escalation and lateral movement within 4 00:00:07,319 --> 00:00:11,719 devops environment please welcome 5 00:00:11,810 --> 00:00:15,690 [Applause] 6 00:00:15,690 --> 00:00:17,680 [Music] 7 00:00:17,680 --> 00:00:23,080 Victor okay uh let's go um okay so a 8 00:00:23,080 --> 00:00:25,720 little bit about myself uh my name is 9 00:00:25,720 --> 00:00:30,160 Victor Pas I'm from fala in Brazil uh I 10 00:00:30,160 --> 00:00:32,360 have been working with security for 13 11 00:00:32,360 --> 00:00:35,160 years already I'm mostly doing pin test 12 00:00:35,160 --> 00:00:37,960 and red teaming I'm one of the founders 13 00:00:37,960 --> 00:00:40,200 of red wolves I'm also a college 14 00:00:40,200 --> 00:00:42,520 professor I've been giving classes for 15 00:00:42,520 --> 00:00:46,000 12 years and I'm one of the leaders of 16 00:00:46,000 --> 00:00:49,320 the fortalesa oasp uh 17 00:00:49,320 --> 00:00:51,719 chapter okay so this is going to be the 18 00:00:51,719 --> 00:00:54,239 agenda for today I'm going to start with 19 00:00:54,239 --> 00:00:56,600 the motivation behind the tool behind 20 00:00:56,600 --> 00:00:58,920 atum uh after that I'm going to talk 21 00:00:58,920 --> 00:01:03,199 about atum features and uh the different 22 00:01:03,199 --> 00:01:06,799 modules to show some demos uh I'm going 23 00:01:06,799 --> 00:01:09,880 to end with some uh 24 00:01:09,880 --> 00:01:13,320 conclusions okay so uh about AUM epion 25 00:01:13,320 --> 00:01:16,560 is actually not a a new project of mine 26 00:01:16,560 --> 00:01:19,880 it's uh it's a old project but it it 27 00:01:19,880 --> 00:01:23,119 began as a internal project it all 28 00:01:23,119 --> 00:01:25,640 started around 2020 back at that time I 29 00:01:25,640 --> 00:01:27,400 was doing a lot of red team engagements 30 00:01:27,400 --> 00:01:30,799 for different clients and I was 31 00:01:30,799 --> 00:01:33,000 uh getting access to a lot of devop 32 00:01:33,000 --> 00:01:36,119 systems but back in 2020 I didn't know 33 00:01:36,119 --> 00:01:38,880 much I only knew a little bit about 34 00:01:38,880 --> 00:01:41,720 devops and I started studying about 35 00:01:41,720 --> 00:01:45,360 devops and uh cicd pipelines and I had a 36 00:01:45,360 --> 00:01:48,320 few challenges uh a few problems in the 37 00:01:48,320 --> 00:01:51,280 beginning most of the tools back in 38 00:01:51,280 --> 00:01:54,280 2020 and and the material that I found 39 00:01:54,280 --> 00:01:57,240 were about attacking things like cabetes 40 00:01:57,240 --> 00:02:01,280 and maybe also Jenkins but I didn't find 41 00:02:01,280 --> 00:02:03,640 any material about attacking other types 42 00:02:03,640 --> 00:02:07,439 of systems like Sonic Cube uh Nexus or 43 00:02:07,439 --> 00:02:10,679 even asro devops so I started making my 44 00:02:10,679 --> 00:02:14,120 own scripts uh I had a bunch of small 45 00:02:14,120 --> 00:02:16,480 Python scripts and each script was for 46 00:02:16,480 --> 00:02:19,959 attacking a different type of uh system 47 00:02:19,959 --> 00:02:22,720 and I had U some initial goals too uh my 48 00:02:22,720 --> 00:02:25,800 first goal was actually to combine all 49 00:02:25,800 --> 00:02:27,840 the scripts that I had into one single 50 00:02:27,840 --> 00:02:30,680 tool and that's uh 51 00:02:30,680 --> 00:02:32,519 and I wanted to create this tool to 52 00:02:32,519 --> 00:02:35,640 attack the vs and also share uh with my 53 00:02:35,640 --> 00:02:38,879 team members back back then and also use 54 00:02:38,879 --> 00:02:41,040 the tool to teach them how to attack 55 00:02:41,040 --> 00:02:43,080 their 56 00:02:43,080 --> 00:02:46,080 VES okay I had some initial concerns 57 00:02:46,080 --> 00:02:49,200 about the Tool uh first uh the use of 58 00:02:49,200 --> 00:02:52,319 the official apis uh in my opinion it's 59 00:02:52,319 --> 00:02:55,159 just easier to use the official apis to 60 00:02:55,159 --> 00:02:57,840 do the attacks uh most of the tools 61 00:02:57,840 --> 00:03:01,480 inside cicd pipeline that they have apis 62 00:03:01,480 --> 00:03:04,319 so uh I think it's just easier to use 63 00:03:04,319 --> 00:03:07,519 the official apis uh uh number two the 64 00:03:07,519 --> 00:03:10,440 multiple targets uh usually uh inside 65 00:03:10,440 --> 00:03:13,920 devops there's like a uh different types 66 00:03:13,920 --> 00:03:18,599 of of systems so the tool it also needs 67 00:03:18,599 --> 00:03:21,120 to be able to attack different types of 68 00:03:21,120 --> 00:03:25,040 targets inside the pipeline and for 69 00:03:25,040 --> 00:03:26,440 third 70 00:03:26,440 --> 00:03:29,400 uh the tool needs to be able to to 71 00:03:29,400 --> 00:03:32,040 handle large volumes of data uh I put 72 00:03:32,040 --> 00:03:34,319 this here because usually when I'm pin 73 00:03:34,319 --> 00:03:37,519 testing a cicd pipeline you get access 74 00:03:37,519 --> 00:03:40,599 to a lot of information you usually get 75 00:03:40,599 --> 00:03:42,599 access to things like source code 76 00:03:42,599 --> 00:03:44,560 container images and a lot of 77 00:03:44,560 --> 00:03:48,120 credentials so is usually a a very large 78 00:03:48,120 --> 00:03:51,159 volume of data especially if you do this 79 00:03:51,159 --> 00:03:53,879 on a real devops environment so this 80 00:03:53,879 --> 00:03:56,599 were my initial concerns about 81 00:03:56,599 --> 00:04:00,959 epion okay uh so epion it's a TW uh Army 82 00:04:00,959 --> 00:04:04,159 knif for pesting devops uh it's all open 83 00:04:04,159 --> 00:04:08,280 source it's a goink tool uh right now it 84 00:04:08,280 --> 00:04:11,040 has uh 10 different modules each module 85 00:04:11,040 --> 00:04:14,120 is for attacking a different type of uh 86 00:04:14,120 --> 00:04:16,759 develop system it also has some 87 00:04:16,759 --> 00:04:19,440 integration off with other tools like it 88 00:04:19,440 --> 00:04:21,040 leaks and trah 89 00:04:21,040 --> 00:04:24,199 hug uh there's the address uh my my 90 00:04:24,199 --> 00:04:26,080 personal uh GitHub where you can 91 00:04:26,080 --> 00:04:26,790 download 92 00:04:26,790 --> 00:04:27,919 [Music] 93 00:04:27,919 --> 00:04:30,320 thatum uh this is the list of the 94 00:04:30,320 --> 00:04:33,199 current modules so we have 10 modules we 95 00:04:33,199 --> 00:04:36,960 have uh it's it's based on 96 00:04:36,960 --> 00:04:39,800 the the most common tools that I found 97 00:04:39,800 --> 00:04:42,120 during uh uh pin test for different 98 00:04:42,120 --> 00:04:44,960 clients so we have the gitlab module 99 00:04:44,960 --> 00:04:47,840 GitHub and the GitHub also works for 100 00:04:47,840 --> 00:04:50,960 GitHub Enterprise uh Jenkins Azure 101 00:04:50,960 --> 00:04:56,639 devops uh Nexus do HRI son Cube uh Gia 102 00:04:56,639 --> 00:04:59,120 uh J frog after Factory and the latest 103 00:04:59,120 --> 00:05:01,960 one with which is terraform cloud or 104 00:05:01,960 --> 00:05:06,400 terraform Enterprise for on premise 105 00:05:06,400 --> 00:05:09,880 terraform okay so uh for the first step 106 00:05:09,880 --> 00:05:12,120 if you want to start using neum you have 107 00:05:12,120 --> 00:05:14,680 two options you can download one of the 108 00:05:14,680 --> 00:05:17,440 binaries from GitHub from the official 109 00:05:17,440 --> 00:05:20,160 releases or you can just uh build from 110 00:05:20,160 --> 00:05:22,560 Source it's really easy you just need to 111 00:05:22,560 --> 00:05:27,120 do a a simple get clone and a go build 112 00:05:27,120 --> 00:05:30,639 command uh and also you need to create a 113 00:05:30,639 --> 00:05:34,400 config file uh on the repo on GitHub 114 00:05:34,400 --> 00:05:36,720 there's a config example file that you 115 00:05:36,720 --> 00:05:39,600 can use it as a template so the config 116 00:05:39,600 --> 00:05:41,160 file is going to have all the global 117 00:05:41,160 --> 00:05:43,400 variables and if you want to change any 118 00:05:43,400 --> 00:05:47,318 of the global parameters you can do 119 00:05:47,440 --> 00:05:51,280 that uh for the demos uh this is 120 00:05:51,280 --> 00:05:53,319 actually based on real life engagements 121 00:05:53,319 --> 00:05:55,479 so everything that I'm going to show you 122 00:05:55,479 --> 00:05:58,560 in the videos is usually things that I 123 00:05:58,560 --> 00:06:02,440 do when I'm pay testing a cicd 124 00:06:02,440 --> 00:06:06,000 pipeline and it's some common things 125 00:06:06,000 --> 00:06:09,639 that I usually find on these types of 126 00:06:09,639 --> 00:06:13,160 engagements uh I created a fake company 127 00:06:13,160 --> 00:06:16,240 called VCH so we're going to see a 128 00:06:16,240 --> 00:06:19,160 little bit of this fake company on the 129 00:06:19,160 --> 00:06:22,520 videos uh the demo is going to be 130 00:06:22,520 --> 00:06:24,639 divided in three parts uh the first part 131 00:06:24,639 --> 00:06:28,039 is about getting initial access in the 132 00:06:28,039 --> 00:06:31,000 cicd pipeline the second part is about 133 00:06:31,000 --> 00:06:33,039 doing lateral movement and a little bit 134 00:06:33,039 --> 00:06:34,280 of privilege 135 00:06:34,280 --> 00:06:37,080 escalation and the third part it's also 136 00:06:37,080 --> 00:06:39,680 about uh leral movement but this time 137 00:06:39,680 --> 00:06:43,319 we're going to uh terraform Cloud so 138 00:06:43,319 --> 00:06:46,840 we're going to access some cloud 139 00:06:46,880 --> 00:06:49,840 services okay so this is going to be our 140 00:06:49,840 --> 00:06:54,680 Target uh cicd pipeline uh I have seen 141 00:06:54,680 --> 00:06:56,879 the same configuration like in a dozen 142 00:06:56,879 --> 00:06:59,000 different clients so this is actually 143 00:06:59,000 --> 00:07:01,840 pretty Comm back in Brazil so that's why 144 00:07:01,840 --> 00:07:04,919 I choose this for for the demos and 145 00:07:04,919 --> 00:07:08,280 there's like some common uh develops uh 146 00:07:08,280 --> 00:07:12,240 systems like a gitlab Jenkins uh Nexus 147 00:07:12,240 --> 00:07:16,280 they in the bottom uh do hry tform uh 148 00:07:16,280 --> 00:07:17,960 cloud and 149 00:07:17,960 --> 00:07:22,000 cetes so I have seen this same type or 150 00:07:22,000 --> 00:07:25,240 very similar configuration in a like in 151 00:07:25,240 --> 00:07:27,360 in a dozen different 152 00:07:27,360 --> 00:07:30,400 clients okay uh so the for the first 153 00:07:30,400 --> 00:07:33,280 part uh the initial access uh the first 154 00:07:33,280 --> 00:07:35,800 Target is going to be Nexus if you don't 155 00:07:35,800 --> 00:07:38,720 know Nexus Nexus is artifact repository 156 00:07:38,720 --> 00:07:41,120 server it's actually very popular in 157 00:07:41,120 --> 00:07:43,159 Brazil a lot of Brazilian companies use 158 00:07:43,159 --> 00:07:46,639 it uh in the videos there is also a uh 159 00:07:46,639 --> 00:07:50,319 Docker hry running on Port 5000 and for 160 00:07:50,319 --> 00:07:54,039 the demos I'm assum um assuming that I 161 00:07:54,039 --> 00:07:57,960 have at least read only access to the Hy 162 00:07:57,960 --> 00:08:00,400 API and that's actually very common I 163 00:08:00,400 --> 00:08:03,240 have seen this like in a lot of 164 00:08:03,240 --> 00:08:05,240 different uh 165 00:08:05,240 --> 00:08:08,120 pentests okay so uh I hope you guys can 166 00:08:08,120 --> 00:08:09,280 see the 167 00:08:09,280 --> 00:08:12,390 video uh let me let me go 168 00:08:12,390 --> 00:08:14,199 [Music] 169 00:08:14,199 --> 00:08:18,120 here okay so um 170 00:08:18,120 --> 00:08:22,759 oops sorry let's go 171 00:08:22,800 --> 00:08:25,800 back uh 172 00:08:25,800 --> 00:08:30,039 okay um it's better this way okay uh so 173 00:08:30,039 --> 00:08:34,360 I'm going to begin with the Nexus module 174 00:08:34,360 --> 00:08:37,200 and I'm going to list all the 175 00:08:37,200 --> 00:08:39,839 repositories and uh let me just go back 176 00:08:39,839 --> 00:08:42,479 a little bit and the important thing 177 00:08:42,479 --> 00:08:44,959 here is that there is a Docker prod uh 178 00:08:44,959 --> 00:08:47,120 header street right there in the middle 179 00:08:47,120 --> 00:08:49,279 and that is going to be our Target for 180 00:08:49,279 --> 00:08:52,600 the demo so we start by using the Nexus 181 00:08:52,600 --> 00:08:55,640 module and list all the 182 00:08:55,640 --> 00:08:58,440 repositories okay 183 00:08:58,440 --> 00:09:02,360 now we're going to switch for the haer 184 00:09:02,360 --> 00:09:05,160 stream uh 185 00:09:06,200 --> 00:09:09,320 module going to change the the 186 00:09:09,320 --> 00:09:11,640 port now I'm going to use the Heder 187 00:09:11,640 --> 00:09:14,360 stream module and I'm going to do the 188 00:09:14,360 --> 00:09:17,160 list images 189 00:09:18,720 --> 00:09:22,800 command now we can see all the images 190 00:09:22,800 --> 00:09:26,079 uh I have to say something that uh in 191 00:09:26,079 --> 00:09:28,360 this demo there are actually just a few 192 00:09:28,360 --> 00:09:30,399 uh images but when when you do this on a 193 00:09:30,399 --> 00:09:32,880 real environment you get you see like 194 00:09:32,880 --> 00:09:37,480 hundreds or even thousands of different 195 00:09:40,040 --> 00:09:43,240 images okay so now we going to do the 196 00:09:43,240 --> 00:09:46,800 the ha Street uh history command and 197 00:09:46,800 --> 00:09:49,040 it's going to download all the docker 198 00:09:49,040 --> 00:09:51,920 file history for each 199 00:09:51,920 --> 00:09:55,320 image and it's going to save on a local 200 00:09:55,320 --> 00:09:56,760 [Music] 201 00:09:56,760 --> 00:10:01,720 folder so it's downloading all the the 202 00:10:04,240 --> 00:10:07,040 history okay 203 00:10:07,040 --> 00:10:10,800 so it saves on a a local folder so 204 00:10:10,800 --> 00:10:14,880 there's a a folder for each 205 00:10:15,120 --> 00:10:19,240 image and just going to show an 206 00:10:19,240 --> 00:10:23,040 example of the the the history data from 207 00:10:23,040 --> 00:10:25,200 the doer 208 00:10:25,200 --> 00:10:28,040 file so you get all the time stamps and 209 00:10:28,040 --> 00:10:30,200 all the commands 210 00:10:30,200 --> 00:10:32,760 of when the each command was added to 211 00:10:32,760 --> 00:10:34,200 that 212 00:10:34,200 --> 00:10:38,360 image and that's just a an 213 00:10:38,360 --> 00:10:41,680 example uh now I'm going to use uh the 214 00:10:41,680 --> 00:10:45,440 trop hog uh module so I'm going to look 215 00:10:45,440 --> 00:10:48,399 for credentials in the history in the 216 00:10:48,399 --> 00:10:51,680 docker file history from those images 217 00:10:51,680 --> 00:10:53,279 that I just 218 00:10:53,279 --> 00:10:57,760 downloaded so take this takes a little 219 00:10:57,760 --> 00:11:01,000 bit um one thing that it's important to 220 00:11:01,000 --> 00:11:03,839 mention is that truffle hog is not able 221 00:11:03,839 --> 00:11:07,279 to to find all the credentials so we 222 00:11:07,279 --> 00:11:10,800 still have to do a little bit of manual 223 00:11:10,800 --> 00:11:13,480 search so we start we're going to start 224 00:11:13,480 --> 00:11:16,480 seeing some credentials like oh so this 225 00:11:16,480 --> 00:11:18,639 is our first 226 00:11:18,639 --> 00:11:21,120 credential okay so we have a little bit 227 00:11:21,120 --> 00:11:23,000 more 228 00:11:23,000 --> 00:11:26,159 [Music] 229 00:11:30,360 --> 00:11:32,480 I'm going to choose uh one of these 230 00:11:32,480 --> 00:11:36,040 files from the uh doer file history 231 00:11:36,040 --> 00:11:38,800 going to see the 232 00:11:39,600 --> 00:11:42,279 content and we're going to start uh 233 00:11:42,279 --> 00:11:44,760 seeing the first credentials uh at the 234 00:11:44,760 --> 00:11:47,480 bottom of the 235 00:11:47,480 --> 00:11:51,000 file so there's actually some uh 236 00:11:51,000 --> 00:11:52,120 database 237 00:11:52,120 --> 00:11:55,000 credentials and there's a also a proxy 238 00:11:55,000 --> 00:11:57,399 credential so we can see some Secrets 239 00:11:57,399 --> 00:12:01,720 over here we can see some uh uh post uh 240 00:12:01,720 --> 00:12:03,000 database 241 00:12:03,000 --> 00:12:05,760 credentials some passwords and the the 242 00:12:05,760 --> 00:12:08,399 important one it's a aoxy 243 00:12:08,399 --> 00:12:11,079 credential and this we're going to use 244 00:12:11,079 --> 00:12:15,359 on the the next part the next 245 00:12:15,519 --> 00:12:18,320 video okay so that was the first part 246 00:12:18,320 --> 00:12:20,720 getting initial access uh so now we're 247 00:12:20,720 --> 00:12:22,639 going to do the for the second part 248 00:12:22,639 --> 00:12:23,839 we're going to do a little bit of 249 00:12:23,839 --> 00:12:26,160 lateral movement this time we're going 250 00:12:26,160 --> 00:12:29,800 to try an access gitlab with that uh 251 00:12:29,800 --> 00:12:32,839 proxy credential and see what uh we're 252 00:12:32,839 --> 00:12:36,160 able to get okay 253 00:12:36,160 --> 00:12:39,399 so I'm going to start the video doing uh 254 00:12:39,399 --> 00:12:41,240 I'm going to switch for the gitlab 255 00:12:41,240 --> 00:12:43,560 module and I'm going to do a little bit 256 00:12:43,560 --> 00:12:44,480 of 257 00:12:44,480 --> 00:12:48,120 reconnaissance and try to see who am I 258 00:12:48,120 --> 00:12:51,160 and what kind of access I 259 00:12:51,160 --> 00:12:54,240 have so okay so it's this account 260 00:12:54,240 --> 00:12:56,480 belongs to 261 00:12:56,480 --> 00:12:59,560 Charles uh he's a regular user now we're 262 00:12:59,560 --> 00:13:02,639 going to try and list the the groups 263 00:13:02,639 --> 00:13:07,000 that uh that user is uh the user groups 264 00:13:07,000 --> 00:13:09,839 and I can see that uh that account it's 265 00:13:09,839 --> 00:13:13,399 in the devops group now I'm going to do 266 00:13:13,399 --> 00:13:15,480 a little bit more of reconnaissance I'm 267 00:13:15,480 --> 00:13:19,079 going to uh list all the users on 268 00:13:19,079 --> 00:13:23,480 gitlab so we have uh the the whole list 269 00:13:23,480 --> 00:13:26,199 and uh at this point uh I could do a 270 00:13:26,199 --> 00:13:28,959 password spray there is also a different 271 00:13:28,959 --> 00:13:31,519 uh in the same module the gitlab module 272 00:13:31,519 --> 00:13:33,240 there is a function for doing password 273 00:13:33,240 --> 00:13:36,639 spray so I could do that with the list 274 00:13:36,639 --> 00:13:39,040 I'm going to list the 275 00:13:39,040 --> 00:13:42,000 projects uh there's one important thing 276 00:13:42,000 --> 00:13:44,360 here is that this is not the full list 277 00:13:44,360 --> 00:13:47,120 of projects it's only the list that this 278 00:13:47,120 --> 00:13:52,680 user has access to so it's not the full 279 00:13:53,720 --> 00:13:57,720 list oops 280 00:13:59,360 --> 00:14:02,160 let forward a little 281 00:14:02,160 --> 00:14:06,399 bit uh listing users okay listing 282 00:14:06,399 --> 00:14:09,040 projects and I could also download the 283 00:14:09,040 --> 00:14:12,880 projects at this point and also use trah 284 00:14:12,880 --> 00:14:15,880 hog or git LS to search for 285 00:14:15,880 --> 00:14:18,240 credentials uh this time I'm going to 286 00:14:18,240 --> 00:14:21,519 list uh the group 287 00:14:21,720 --> 00:14:24,000 variables and there's 288 00:14:24,000 --> 00:14:27,680 a there's a token uh on gitlab uh 289 00:14:27,680 --> 00:14:30,079 there's three different typ of cicd 290 00:14:30,079 --> 00:14:32,920 variables you can have project variables 291 00:14:32,920 --> 00:14:34,920 you can have group variables or you can 292 00:14:34,920 --> 00:14:38,560 have instance variables so in this case 293 00:14:38,560 --> 00:14:42,560 uh this user uh he is able to to see he 294 00:14:42,560 --> 00:14:44,519 uh the group variables and we can see 295 00:14:44,519 --> 00:14:47,720 that there's a develop service token and 296 00:14:47,720 --> 00:14:50,399 that's the the token so that's the uh 297 00:14:50,399 --> 00:14:52,600 the token that we're going to use on the 298 00:14:52,600 --> 00:14:53,800 on the next 299 00:14:53,800 --> 00:14:56,959 video okay so now we're going to try and 300 00:14:56,959 --> 00:14:59,680 use that service uh account token and 301 00:14:59,680 --> 00:15:03,758 see what type of access we 302 00:15:04,440 --> 00:15:08,279 have so okay so now going to just export 303 00:15:08,279 --> 00:15:09,120 the 304 00:15:09,120 --> 00:15:12,160 token and I'm also going to do again a 305 00:15:12,160 --> 00:15:13,839 little bit of 306 00:15:13,839 --> 00:15:16,040 reconnaissance but this time using the 307 00:15:16,040 --> 00:15:18,199 token and now I can see that the token 308 00:15:18,199 --> 00:15:21,079 belongs to the Jenkins account and the 309 00:15:21,079 --> 00:15:24,480 Jenkins it's admin on gitlab so now we 310 00:15:24,480 --> 00:15:27,240 can uh list and get the full list of 311 00:15:27,240 --> 00:15:30,240 projects 312 00:15:32,480 --> 00:15:34,839 so there's a bigger 313 00:15:34,839 --> 00:15:37,160 list 314 00:15:37,160 --> 00:15:39,759 okay we at this point we could download 315 00:15:39,759 --> 00:15:40,800 all the 316 00:15:40,800 --> 00:15:43,800 projects but this time we're going to uh 317 00:15:43,800 --> 00:15:47,880 try and list the SD variables for each 318 00:15:47,880 --> 00:15:50,279 project so this time it's like raining 319 00:15:50,279 --> 00:15:53,600 credentials and when you do this on uh 320 00:15:53,600 --> 00:15:57,880 on a real life uh cicd pipelines it's so 321 00:15:57,880 --> 00:15:59,480 many credentials 322 00:15:59,480 --> 00:16:01,759 like you get access to almost uh 323 00:16:01,759 --> 00:16:03,839 everything so you have all types of 324 00:16:03,839 --> 00:16:06,680 credentials database 325 00:16:06,680 --> 00:16:09,639 credentials tokens for other types of 326 00:16:09,639 --> 00:16:14,600 systems son Cube uh gitlab soner again 327 00:16:14,600 --> 00:16:17,720 uh some Amazon this is all fake this is 328 00:16:17,720 --> 00:16:20,000 all fake 329 00:16:20,000 --> 00:16:22,639 data 330 00:16:22,639 --> 00:16:24,240 uh 331 00:16:24,240 --> 00:16:28,959 okay and since uh the the server account 332 00:16:28,959 --> 00:16:32,560 is global admin I can list the instance 333 00:16:32,560 --> 00:16:35,639 variables so you can only do this if if 334 00:16:35,639 --> 00:16:38,079 you are Global admin on 335 00:16:38,079 --> 00:16:42,759 gitlab so now I get more tokens uh and 336 00:16:42,759 --> 00:16:46,959 here I have the on the top we have a a 337 00:16:46,959 --> 00:16:49,199 token for Sonic Cube and on the on the 338 00:16:49,199 --> 00:16:53,040 bottom a TF token is terraform token so 339 00:16:53,040 --> 00:16:56,360 I'm going to do uh lateral movement once 340 00:16:56,360 --> 00:16:58,399 again but this time I'm going to reach 341 00:16:58,399 --> 00:17:01,880 the Cube and use that token over 342 00:17:01,880 --> 00:17:04,880 there so I'm going just I'm just listing 343 00:17:04,880 --> 00:17:08,079 the users to check if the token is valid 344 00:17:08,079 --> 00:17:10,400 but by using the Sonic Cube module I 345 00:17:10,400 --> 00:17:13,119 could also try and download all the all 346 00:17:13,119 --> 00:17:15,359 the projects from Sonic 347 00:17:15,359 --> 00:17:19,160 Cube uh but uh now I'm going to use the 348 00:17:19,160 --> 00:17:21,119 the last token which is the terraform 349 00:17:21,119 --> 00:17:25,119 token on the third part of the 350 00:17:25,119 --> 00:17:29,960 demo uh we we also had a the the token 351 00:17:29,960 --> 00:17:32,240 the admin oh at least the admin password 352 00:17:32,240 --> 00:17:35,200 for the for the 353 00:17:36,720 --> 00:17:40,880 Nexus oops okay so now for the third 354 00:17:40,880 --> 00:17:43,440 part we're going to breach uh tform 355 00:17:43,440 --> 00:17:46,520 Cloud so we're we're going to begin by 356 00:17:46,520 --> 00:17:49,280 validating the the token that we found 357 00:17:49,280 --> 00:17:51,960 at the end of the the second video and 358 00:17:51,960 --> 00:17:54,720 we're going to search for more secrets 359 00:17:54,720 --> 00:17:59,320 on terraform workspace variables 360 00:17:59,559 --> 00:18:02,919 okay so uh I'm going to use the token 361 00:18:02,919 --> 00:18:05,720 but I'm going to begin by listing the 362 00:18:05,720 --> 00:18:10,159 organizations in terraform uh Cloud that 363 00:18:10,159 --> 00:18:13,400 that token has access to 364 00:18:13,400 --> 00:18:17,640 you okay so we can see the vadis uh 365 00:18:17,640 --> 00:18:19,159 organization 366 00:18:19,159 --> 00:18:24,159 okay now we're going to list all the 367 00:18:26,080 --> 00:18:28,919 workspaces and again it's only a few 368 00:18:28,919 --> 00:18:31,520 workspaces but when you do this on a a 369 00:18:31,520 --> 00:18:33,960 real devops environment it's like 370 00:18:33,960 --> 00:18:35,679 hundreds of 371 00:18:35,679 --> 00:18:38,600 workspaces uh and now I'm going to list 372 00:18:38,600 --> 00:18:40,840 all the workspace 373 00:18:40,840 --> 00:18:43,840 variables 374 00:18:43,880 --> 00:18:47,760 and tokens uh and one important thing to 375 00:18:47,760 --> 00:18:50,400 mention here is that 376 00:18:50,400 --> 00:18:53,320 uh when you do this on a a real 377 00:18:53,320 --> 00:18:56,600 environment U let me pause the video 378 00:18:56,600 --> 00:18:59,559 here what happens usually is that you 379 00:18:59,559 --> 00:19:02,000 get at least one or two workspaces on 380 00:19:02,000 --> 00:19:06,400 terraform Cloud that the the terraform 381 00:19:06,400 --> 00:19:09,520 admins or who was responsible uh 382 00:19:09,520 --> 00:19:12,520 responsible for this they leave uh the 383 00:19:12,520 --> 00:19:15,799 some of the the tokens as in the the 384 00:19:15,799 --> 00:19:18,000 clear text so you can still see the 385 00:19:18,000 --> 00:19:22,200 value so they forgot to put the the 386 00:19:22,200 --> 00:19:26,159 sensitive uh parameter here to true so 387 00:19:26,159 --> 00:19:28,159 you can still see the value so you 388 00:19:28,159 --> 00:19:30,520 usually see at least one or two Works 389 00:19:30,520 --> 00:19:33,200 spaces that you can still that someone 390 00:19:33,200 --> 00:19:36,039 forgot to put that so you still you are 391 00:19:36,039 --> 00:19:39,450 able to get uh more 392 00:19:39,450 --> 00:19:42,640 [Music] 393 00:19:42,640 --> 00:19:46,159 tokens so at at this point you already 394 00:19:46,159 --> 00:19:48,600 have like all the credentials and all 395 00:19:48,600 --> 00:19:53,200 the access keys to for basically doing 396 00:19:53,200 --> 00:19:54,880 [Music] 397 00:19:54,880 --> 00:19:58,280 everything uh okay okay so these were 398 00:19:58,280 --> 00:20:03,360 the D most uh so I'm for the conclusions 399 00:20:03,360 --> 00:20:05,520 these are the modules that I'm working 400 00:20:05,520 --> 00:20:08,799 at this moment uh the go CD module the 401 00:20:08,799 --> 00:20:11,280 harbor module and the son Cloud module 402 00:20:11,280 --> 00:20:14,039 these are the the new ones that I'm 403 00:20:14,039 --> 00:20:15,760 working right 404 00:20:15,760 --> 00:20:20,120 now uh so uh for the conclusions 405 00:20:20,120 --> 00:20:23,480 uh uh in my opinion if you want to 406 00:20:23,480 --> 00:20:25,960 compromise the cloud the fastest way is 407 00:20:25,960 --> 00:20:28,799 through devops all the crown jewels are 408 00:20:28,799 --> 00:20:32,919 now in devops and it's just a new low 409 00:20:32,919 --> 00:20:36,799 hanging fruit for attackers and uh from 410 00:20:36,799 --> 00:20:38,840 uh from real engagements some of the 411 00:20:38,840 --> 00:20:41,360 Lessons Learned is that most blue teams 412 00:20:41,360 --> 00:20:44,840 are not even looking at devops you know 413 00:20:44,840 --> 00:20:47,200 so there's like to a total lack of 414 00:20:47,200 --> 00:20:50,720 monitoring so you you can do like even a 415 00:20:50,720 --> 00:20:54,679 lot of noise and like there's no one 416 00:20:54,679 --> 00:20:56,440 looking at this 417 00:20:56,440 --> 00:20:59,760 so uh it's a it's a it's a good it's a 418 00:20:59,760 --> 00:21:03,440 great attack Vector now for for red 419 00:21:03,440 --> 00:21:07,630 teams and that's all 420 00:21:07,630 --> 00:21:12,840 [Applause] 421 00:21:12,840 --> 00:21:16,720 thanks any questions or so you can try 422 00:21:16,720 --> 00:21:19,480 uh that's a QR code for the for the 423 00:21:19,480 --> 00:21:21,679 GitHub if you want to try the tool and 424 00:21:21,679 --> 00:21:24,919 play a little bit with 425 00:21:25,000 --> 00:21:31,000 it so any questions or oh