1 00:00:00,000 --> 00:00:10,240 I'm hoping I pronounced this correctly, Abhishek and us, and I'm all joy of presenting, breaking 2 00:00:10,240 --> 00:00:19,440 and defending cloud infrastructure, red team evasion tactics and access control solutions. 3 00:00:19,440 --> 00:00:25,600 Abhishek X is a security engineer at Flipkart with primary research focus in application 4 00:00:25,600 --> 00:00:32,640 security and red teaming. He's a staff of adversary village at DEFCON and an executive 5 00:00:32,640 --> 00:00:41,360 member of DC0471 group. He has been a speaker for, God, I can't read all of a sudden, let me fix this. 6 00:00:46,480 --> 00:00:50,080 What was I hearing? He's a speaker for various conferences like 7 00:00:50,800 --> 00:00:58,800 Cocon23 and BlackheadMEA23 with over four years of experience playing CTFs and hunting for 8 00:00:58,800 --> 00:01:04,720 vulnerabilities in various VDP programs. He's listed in hall of fames of Google, Facebook, 9 00:01:04,720 --> 00:01:10,800 Microsoft and 40 plus organizations for finding their security vulnerabilities. He's about four 10 00:01:10,800 --> 00:01:21,360 CVEs from various organizations such as Android, Tenable, Strap, STR, APR, CMS, etc. Currently 11 00:01:21,360 --> 00:01:31,440 holds various certifications such as OSCP, BSCP, CRTP, GAC, GFACT, etc. Other than the 12 00:01:31,440 --> 00:01:35,440 technical side, he loves to travel around the world and is an automotive enthusiast. 13 00:01:36,400 --> 00:01:42,720 We have that in common because I'm a recovering gearhead myself. Amal Joy is a security engineer 14 00:01:42,720 --> 00:01:47,280 at high radius. His area of research falls into infrastructure security, 15 00:01:47,280 --> 00:01:52,240 red teaming in multi-cloud environments and corporate networks. He also loves spending 16 00:01:52,240 --> 00:02:01,920 leisure time on malware development. Wow, that is really cool. He is an executive member of DC0471 17 00:02:01,920 --> 00:02:07,760 DEFCON group. He has over three years of experience playing CTFs and also hosted 18 00:02:07,760 --> 00:02:14,080 many hiring multi-cloud adversary CTFs and reputed conferences like CSIDE22 19 00:02:14,080 --> 00:02:19,840 with strong focus on multi-cloud and active directory. He currently holds various certifications 20 00:02:19,840 --> 00:02:29,280 like CRTP, MCRTA, CCRTA and EJPT. So I'd like to welcome both of our speakers to the stage and 21 00:02:29,280 --> 00:02:33,120 please take it away. Thank you, EJPT. 22 00:02:59,920 --> 00:03:13,760 Hello, folks. So our presentation is on the topic breaking and defending cloud infrastructure 23 00:03:13,760 --> 00:03:21,920 at the immigration tactics and access control solutions. Before we start, let me introduce 24 00:03:21,920 --> 00:03:27,680 myself. I am Abhishek, a security engineer at Flipkart, a Walmart company and a staff 25 00:03:27,680 --> 00:03:36,240 at the adversary village at the Continental 232. And with me, it's Amal Joy, honey budget, 26 00:03:36,240 --> 00:03:38,960 who is a security engineer at the leading flint tech. 27 00:03:42,080 --> 00:03:46,320 So the agenda of the talk would be to cover 28 00:03:49,760 --> 00:03:54,000 introduction to cloud routine and services we can target for strengths, 29 00:03:54,560 --> 00:04:01,360 evasion techniques that can be applied in cloud environments like AWS and GCP. 30 00:04:01,360 --> 00:04:06,960 Then we would also discuss about some defensive strategies and access control mechanisms 31 00:04:06,960 --> 00:04:12,080 that you could implement in those environments. And a case study. 32 00:04:16,400 --> 00:04:19,200 Over to Amal Joy for the free introduction, Jeff. 33 00:04:19,520 --> 00:04:30,240 Sure. Yeah. So, yeah. So the pre introduction is nothing but we are just giving a heads up 34 00:04:30,240 --> 00:04:38,000 regarding why this presentation, what the presentation is up to you guys. And yeah, 35 00:04:38,000 --> 00:04:44,800 think of a situation where your company with your multi-million dollar worth of enterprise 36 00:04:44,800 --> 00:04:49,840 security control software to compute the instance is compromised. And that I got into the multi-cloud 37 00:04:49,840 --> 00:04:54,400 environment laterally moved across different services, manipulated your logging service, 38 00:04:54,400 --> 00:05:00,720 exultated gigs of data. And all this happens in a matter of 45 minutes. And still your blue team 39 00:05:00,720 --> 00:05:10,800 is still glueless. So yeah, that's what currently our experience goes into. And now before jumping 40 00:05:10,800 --> 00:05:17,840 into the introductory part, we just want to know that we just want to showcase what this 41 00:05:17,840 --> 00:05:25,440 particular slides and presentation will be giving you. So it will be going in an introductory 42 00:05:25,440 --> 00:05:32,320 mode rather than talking in detail about, okay, the various evasion techniques. So we will be 43 00:05:32,320 --> 00:05:38,240 going in an introductory mode about the law hanging fruits. So let's start about introduction 44 00:05:38,240 --> 00:05:44,480 to cloud routine. So you can see here. So what cloud routine it is, in simple, we can say it's 45 00:05:44,480 --> 00:05:49,440 like simulating real well attacks in areas on cloud environments to test and improve security 46 00:05:50,640 --> 00:05:57,040 defenses. So it mainly targets the security controls, that means that is being placed 47 00:05:57,040 --> 00:06:03,280 to understand, okay, if a cloud based attack is happened, how will you defend it? So do we have 48 00:06:03,280 --> 00:06:07,760 cloud based solutions such as ACP policies, where we'll be discussed by Abhishek on the 49 00:06:07,760 --> 00:06:14,800 last slides, and also regarding the, what are the other security controls like 50 00:06:15,680 --> 00:06:22,720 sim to like actual Sentinel, secure on X, etc, which can, which can give a critical part on 51 00:06:22,720 --> 00:06:28,720 this particular case, right? So what actually, how does a routine in cloud infrastructure 52 00:06:28,720 --> 00:06:34,640 differ from other like, which is on corporate network, it's based on encore line, it's based 53 00:06:34,720 --> 00:06:40,480 on permission of users, right? So that's a difference mainly. So maybe some of your companies might 54 00:06:40,480 --> 00:06:45,600 have your company might be telling like, okay, your end call is to export something from S3. 55 00:06:45,600 --> 00:06:51,120 But at some point, some company might say like, okay, your end call is to get maximum privilege, 56 00:06:51,120 --> 00:06:57,040 right? How you can do. So yeah, we will be discussing some of the techniques regarding AWS and GCP 57 00:06:57,440 --> 00:07:06,320 Yeah, Abhishek, over to the next slide. So this is services targeted for us. So yeah, mostly, 58 00:07:06,320 --> 00:07:15,280 as we talked, there are the law hanging fruits are really important when we are performing cloud 59 00:07:15,280 --> 00:07:21,680 routine, right? So some of the services, some of the services, how you can abuse, it plays a vital 60 00:07:21,680 --> 00:07:28,160 role on how you will be in a stealth mode when you're doing cloud routine, particularly in AWS 61 00:07:28,160 --> 00:07:39,440 and GCP, right? So here are, here there are one of the four main services, which might be targeted 62 00:07:39,440 --> 00:07:45,040 by attackers for that they can have a stealth mode on when they are targeting certain services 63 00:07:45,040 --> 00:07:49,440 on the multi cloud infrastructure. One is AWS cloud trial API calls, of course, you know, 64 00:07:50,000 --> 00:07:56,800 and there is IAM API calls are there. Also cloud logging is three packet API calls, which of course 65 00:07:56,800 --> 00:08:01,600 will be pointing to the cloud trial API calls. Then for the GCP, the IAM service account API 66 00:08:01,600 --> 00:08:12,000 calls. So we will discussing like how an attacker can abuse this particular API calls and make sure 67 00:08:12,000 --> 00:08:17,200 that okay, your SIM or your access control policies that you are implemented on the organizational 68 00:08:17,200 --> 00:08:24,160 level will not be, won't be of no use, like at least we can move on in a stealth mode, right? So 69 00:08:24,160 --> 00:08:31,360 we are making sure that always the law hanging fruits does matters. Okay, yeah, I'm sure you 70 00:08:31,360 --> 00:08:41,120 go on to the next page. So AWS techniques in AWS, yeah. So one of the important point while we 71 00:08:41,120 --> 00:08:48,160 were doing red team engagements where rather than going to admin access, think of a situation when 72 00:08:48,160 --> 00:08:53,440 you are the SOC team, when they were asked about an attack scenario, they were not able to fetch 73 00:08:53,440 --> 00:08:58,800 certain logs in order to prove that, okay, what all was lost from their multi cloud infrastructure. 74 00:08:58,800 --> 00:09:03,920 So one of the important API call is put even selectors API calls on the cloud trial. So 75 00:09:04,000 --> 00:09:13,120 what this API calls to, when for example, you can tell the particular cloud trial to include 76 00:09:13,120 --> 00:09:17,760 okay, which all services from which you can, okay, what all logs should be fetched from which 77 00:09:17,760 --> 00:09:23,360 all services. So if an attacker gain control of this put even selectors API calls, for example, 78 00:09:23,360 --> 00:09:29,040 if an attacker gain control of your certain automation role, or maybe your instance is 79 00:09:29,040 --> 00:09:34,400 compromised and that attacker fetch the instance profile role and that role is more privileged. 80 00:09:34,400 --> 00:09:39,840 So one of the important point rather than getting into administrator access is whatever 81 00:09:39,840 --> 00:09:45,840 he does with the privilege he has, at least we need to make sure that we are in line with what 82 00:09:45,840 --> 00:09:50,640 he is doing, right? The blue team knows that what he is doing, think of a situation where the put 83 00:09:50,640 --> 00:09:57,120 even selectors API calls, he has a permission for for example, maybe certain privilege on the cloud 84 00:09:57,120 --> 00:10:01,600 trial, and he was able to manipulate the put even selectors to make sure that certain services that 85 00:10:01,600 --> 00:10:10,640 the logs are being pointed out, he was able to manipulate. And what happens now is the excluded 86 00:10:10,640 --> 00:10:18,400 services, which are added on the put even selectors will not be logged. That means maybe your cloud 87 00:10:18,400 --> 00:10:24,160 trial is being pointed to your sim, and it won't be able to fetch the details from there. So what 88 00:10:24,240 --> 00:10:28,400 will happen, what our exfiltration techniques you have done. So in our team engagements, 89 00:10:28,400 --> 00:10:33,040 we were able to laterally move privilege, escalate everything. But when we have pulled 90 00:10:33,040 --> 00:10:38,000 on this put even selectors and abuse this put even selectors and do our exfiltration techniques, 91 00:10:38,000 --> 00:10:43,200 what happened was when we reached for purple team activities for the SOC team, they were not able to 92 00:10:43,200 --> 00:10:49,760 see what we have done. So that brings a real question that okay, what all was exfiltrated from the 93 00:10:50,080 --> 00:10:53,440 multi cloud infrastructure or the cloud infrastructure. The second part was, 94 00:10:55,120 --> 00:11:01,680 this includes two things. On most of, as I said, it is conditional because we need a certain 95 00:11:01,680 --> 00:11:07,600 condition that your organization has deployed honey tokens on your AWS services, AWS infrastructures, 96 00:11:07,600 --> 00:11:11,920 and how we are able to bypass the honey tokens, right, there will be dummy user that will be 97 00:11:11,920 --> 00:11:15,920 created, which is there, there will be no privilege. So what will happen if an attacker gain access to 98 00:11:15,920 --> 00:11:23,040 that particular key or a role or whatever it is, what will happen, it will provide an explicit 99 00:11:23,040 --> 00:11:27,920 daily because there won't be any permission. So this error log will be tracked from crowd to your 100 00:11:27,920 --> 00:11:34,560 simple or whatever it is, then the SOC team will be alerted. But in AWS, there are certain services 101 00:11:34,560 --> 00:11:41,120 where counter integration can't be possible. AWS import certain VPC specific policies. So 102 00:11:41,120 --> 00:11:45,760 what will happen if an attacker for example, for basic enumeration itself, if you want to get 103 00:11:46,720 --> 00:11:51,360 the, if you want to, if you want to get the basic information regarding your 104 00:11:52,240 --> 00:11:58,000 account ID, your user ID, et cetera, hitting the STS endpoint, everything basic enumeration 105 00:11:58,000 --> 00:12:04,800 without getting logged into the cloud trail, he can try to hit that particular API endpoints, 106 00:12:04,800 --> 00:12:09,840 even if it is an error that is being fetched, it will give, okay, this particular account ID is 107 00:12:09,840 --> 00:12:15,280 not able to access this particular thing. So the basic information is being given coming to the 108 00:12:15,280 --> 00:12:20,960 point that honey tokens, okay, that particular account is being created as a honey account. 109 00:12:20,960 --> 00:12:26,400 But that trial, because we hit it on a particular service, which is not being supported to 110 00:12:26,400 --> 00:12:32,320 cloud trial log integration. So what will happen? It won't be going into SIM as, okay, this guy 111 00:12:32,320 --> 00:12:38,400 hit it, this particular honey user. So we can detect that, okay, this particular using this 112 00:12:38,400 --> 00:12:42,160 technique by proxying through the service that has not supported by cloud trial, we can detect 113 00:12:42,240 --> 00:12:47,440 that, okay, this particular user is being used by honey token, used as a honey user. 114 00:12:47,440 --> 00:12:51,920 So that's one more, one thing. And the next thing was the crucial point, as I told, 115 00:12:53,120 --> 00:12:58,240 stop log, I mean, law hanging fruits are really important. We won't, we won't, we will be surprised 116 00:12:58,240 --> 00:13:04,720 that at some point of time, even you have some implementation for the purple teaming, many of 117 00:13:04,720 --> 00:13:10,400 the organization, what they felt is, okay, if a stop log API, like that's a basic thing, right, 118 00:13:10,480 --> 00:13:19,360 if a stop log API calls a hit on a trial, maybe it's a multi trial setup that is being 119 00:13:19,360 --> 00:13:25,520 on your AWS account. And maybe when you hit one trial, that what I faced in a red team engagement 120 00:13:25,520 --> 00:13:30,800 was when you hit that trial, I didn't expect that trial to go down. I expect that particular 121 00:13:30,800 --> 00:13:37,760 saw team to respond as soon as possible. But what happened was, by hitting one stop log API 122 00:13:38,320 --> 00:13:45,280 on a trial, on a region, the entire, the entire trial on every region went down. And the SOC was 123 00:13:45,280 --> 00:13:51,360 not identified because they have difficulty in, they were facing difficulty in properly 124 00:13:52,000 --> 00:13:57,040 integrating the stop log API calls into the same. Yeah, so that is one of the important 125 00:13:57,040 --> 00:14:02,560 point where if the law hanging fruits regarding the stop log API, I'm saying, if that is not 126 00:14:02,560 --> 00:14:08,480 being detected, that means our, the ball attack scenario won't be detected. So it is really rare 127 00:14:08,480 --> 00:14:13,520 that stop log API calls are not being properly configured on the same, but still, we can detect 128 00:14:13,520 --> 00:14:18,400 also using like, we can also give a block using SAP policies, which will be discussed by Abishai. 129 00:14:18,400 --> 00:14:27,200 Yeah, Abishai next. Okay, the next point was compromising the AWS role. And if an attacker 130 00:14:27,200 --> 00:14:32,400 was able to proxy that AWS role at the trust relationship to an externally controlled attacker. 131 00:14:33,520 --> 00:14:39,440 At a controlled account. So what will happen now is, here, the external account, right, 132 00:14:39,440 --> 00:14:44,800 whatever we are trying to abuse, like we will just create a role, give them random name, 133 00:14:44,800 --> 00:14:49,760 and make sure that this role can be assumed from external account. So what will happen now is, 134 00:14:50,480 --> 00:14:56,160 the organization has a limitation. It all comes with a certain offensive assessment we have. 135 00:14:56,640 --> 00:15:03,600 The organization has an issue where maybe they have a dependency on like, maybe they're 136 00:15:03,600 --> 00:15:07,920 one parent account and they have child accounts will be there. And they're one child from one 137 00:15:07,920 --> 00:15:13,360 child account, they should be able to assume a particular role from another account. So they 138 00:15:13,360 --> 00:15:19,920 can't restrict trust relationship there. So what sim can do here is to make sure that, okay, 139 00:15:20,080 --> 00:15:26,320 our organization has this much account IDs, if any use attacker does this particular 140 00:15:27,440 --> 00:15:33,280 attack by using any account ID other than our particular account IDs, our organizational 141 00:15:33,280 --> 00:15:38,560 account ID, they can block. But our experience was, when we were trying to give the external 142 00:15:38,560 --> 00:15:45,040 account ID, the attack was not detected until and even famous, like we are not pointing out the names 143 00:15:45,040 --> 00:15:51,520 of certain tools, certain tools was giving the critical because the role can assume administrative 144 00:15:51,520 --> 00:15:58,080 access indirectly. So the certain CSPM tools and cloud security rules was giving them us a 145 00:15:58,080 --> 00:16:03,440 medium priority, because the external account was able to assume certain roles. So what will 146 00:16:03,440 --> 00:16:09,520 happen the SOC team might feel like, okay, this is just an assumed role that being assumed a one 147 00:16:09,600 --> 00:16:16,400 of our account IDs. So we shouldn't be able to, we shouldn't be taking it as it is serious because, 148 00:16:16,400 --> 00:16:23,760 yeah, this particular technique was of greater importance for us because using these techniques, 149 00:16:23,760 --> 00:16:29,600 we were able to, and this technique and the 41 selectors technique, combined with combining 150 00:16:29,600 --> 00:16:35,680 this particular technique to put even the selectors technique. Most of the organization where we 151 00:16:35,680 --> 00:16:43,120 have done offensive assessment, we were able to at least get hold of their services for at least 152 00:16:43,120 --> 00:16:53,040 for a few hours without being getting detected. Yeah, Abhishek, next. So yeah, the evasion techniques 153 00:16:53,040 --> 00:17:02,000 in GCP, which will be discussed by Abhishek now, over to you Abhishek. Yeah, so Amal has already 154 00:17:02,000 --> 00:17:07,840 went through the evasion techniques for AWS platform. Now let's check out the techniques for GCP. 155 00:17:08,960 --> 00:17:16,000 One of the key techniques would be by leveraging service account impersonation. This would be done 156 00:17:16,000 --> 00:17:22,960 by abusing the particular role that is called IAN service account token creator. The attacker 157 00:17:22,960 --> 00:17:30,400 will be able to abuse this by sharing out activities using a highly privileged service 158 00:17:30,640 --> 00:17:38,880 account identity. If this type of role is being abused, then it would make it really challenging 159 00:17:38,880 --> 00:17:45,920 for the security tools and SIEM systems to actively malicious activity because from the 160 00:17:45,920 --> 00:17:52,800 point of view of a soft team or SIEM systems, it would more look like the actions were done 161 00:17:52,880 --> 00:18:02,640 using a genuine service account. Now let's move over to the different strategies and 162 00:18:02,640 --> 00:18:14,000 access controls for both AWS and GCP. One of the key defense mechanisms that we can implement here 163 00:18:14,000 --> 00:18:19,840 would be the service control policies. Service control policies that we can implement at the 164 00:18:19,840 --> 00:18:27,600 organization level would prevent abuse of specific API calls that can be used by threat actors for 165 00:18:27,600 --> 00:18:34,240 malicious purposes or out of the box purposes than it's intended to abuse it. Amal has already 166 00:18:34,240 --> 00:18:41,520 discussed about some of the API calls like put even selectors or stop logging that could be abused 167 00:18:41,520 --> 00:18:50,080 by a threat actor if he is able to call those APIs in your cloud environment. So as a measure 168 00:18:50,080 --> 00:18:56,720 to defend against that, you can stick to service control policies in the OU level which would 169 00:18:56,720 --> 00:19:02,560 restrict to at all specific API calls can be triggered by the components in your OU. 170 00:19:03,200 --> 00:19:11,280 This is a powerful different strategy against such API call abuses and another method would be to 171 00:19:11,280 --> 00:19:19,840 focus on IEM standardization. By having a standardized set of identity and access management 172 00:19:19,840 --> 00:19:26,880 policies and procedure set for managing the permissions and identities, it will be a more 173 00:19:27,840 --> 00:19:37,680 defensive approach where it would be hard for attackers to abuse certain extra permissions 174 00:19:37,680 --> 00:19:43,360 that are being assigned or API calls that can be used to abuse. 175 00:19:46,080 --> 00:19:53,840 And another different strategy that we can perform in AWS is one of the key security features 176 00:19:53,840 --> 00:20:01,360 that's AWS permission boundary. This is a feature that would help you to define what would be the 177 00:20:01,360 --> 00:20:09,680 maximum permission that a role or an IEM user can do in case of roles. It would be the maximum 178 00:20:09,680 --> 00:20:18,960 permission that the particular user who can assume the role can perform after assumption of the role. 179 00:20:18,960 --> 00:20:24,880 So if the permission boundaries are set even if some extra and issues permissions are set by 180 00:20:26,160 --> 00:20:33,440 another entity to that particular IEM user overall, it won't be able to do actions that 181 00:20:33,440 --> 00:20:40,160 it is not capable of because the permission boundary will make it to stick to the 182 00:20:42,000 --> 00:20:47,920 restrictions that are set in the boundary. So only the maximum level of permissions that is 183 00:20:47,920 --> 00:20:52,800 defined in the boundary would be what the IEM user overall can have. 184 00:20:55,200 --> 00:21:00,880 Another feature would be service account segmentation. So by implementing service account 185 00:21:00,880 --> 00:21:08,880 segmentation and principles of loose privilege, we will be able to make sure that service account 186 00:21:08,880 --> 00:21:15,120 related abuses are prevented. This can be done by segmenting service accounts properly and 187 00:21:15,120 --> 00:21:21,200 only assigning them necessary permissions that are required for the specific task. We generally 188 00:21:21,200 --> 00:21:28,080 use service accounts for automation. So when we are creating service accounts, we should make sure 189 00:21:28,080 --> 00:21:36,080 that the permissions are aligned up and only the permissions for specific tasks or the business 190 00:21:36,080 --> 00:21:42,560 use case should be assigned to the service account. By following the principle of loose privilege, 191 00:21:43,120 --> 00:21:50,880 this segmentation can be done. And another method would be purple teaming. As you all are aware, 192 00:21:52,960 --> 00:21:57,680 when the red team and blue team are combining the working, the red team would simulate the 193 00:21:57,680 --> 00:22:03,360 realistic attacks on the cloud environment and the corresponding blue team of your organization 194 00:22:03,360 --> 00:22:10,320 can work to detect and respond to these threats. This would give both the teams a great idea on 195 00:22:11,280 --> 00:22:18,640 who is really ahead in the chart, like what all are the controls we are lacking or 196 00:22:18,640 --> 00:22:25,040 what all are the controls in place that can be bypassed, etc. This would be testing your security 197 00:22:25,040 --> 00:22:33,120 posture and this will give you a future roadmap on how the security posture can be improved by 198 00:22:33,760 --> 00:22:40,000 making the security controls currently in place strong also by bringing in new controls that 199 00:22:40,000 --> 00:22:46,640 are necessary. Since the red team would be simulating the actions of a real attacker, 200 00:22:46,640 --> 00:22:55,600 it would help to understand how or what would be the actions that the real attacker would 201 00:22:55,600 --> 00:23:01,360 perform in your environment after he or she gets access to your cloud environment. 202 00:23:02,320 --> 00:23:09,040 This would also test the effectiveness of the FIEM rules that the SOP team is having 203 00:23:09,040 --> 00:23:14,240 and would also significantly improve incident response capabilities over time. 204 00:23:15,600 --> 00:23:23,600 That's all about the defense part. Now let's move over to the case study. We know it's getting late, 205 00:23:23,920 --> 00:23:25,200 so let's move over to Amal Joy. 206 00:23:26,800 --> 00:23:30,160 Yeah, so yeah, without a case study, I think our 207 00:23:33,040 --> 00:23:41,040 won't be able to finish. So I'm sure, yeah, over to it. Can you take the next slide? 208 00:23:43,920 --> 00:23:51,440 Yeah, so in case study, we are just trying to make up a particular scenario that we faced 209 00:23:51,440 --> 00:23:57,600 and we compromised when we were doing certain routine engagements. So one of the scenarios, 210 00:23:57,600 --> 00:24:06,160 we are just making it front of you. So what happened to us, we were able to, the initial access, 211 00:24:06,160 --> 00:24:12,800 we were the end goal of the engagement was to exultrate certain sense of information 212 00:24:12,800 --> 00:24:19,920 and to move as long as we can. And most probably, and also we have to check the 213 00:24:19,920 --> 00:24:24,640 enterprise security controls capability that the organization has and the access controls 214 00:24:24,640 --> 00:24:29,840 the organization involvement on the cloud level. So what happens here was on the initial access, 215 00:24:29,840 --> 00:24:36,560 we were not given anything. So what we did was we enumerated externally to make sure that, okay, 216 00:24:37,440 --> 00:24:42,960 what all things are publicly exposed on the organization. So on the initial part, we were 217 00:24:42,960 --> 00:24:49,520 able to find some applications which were not of any use, but for our surprise, that organization 218 00:24:49,520 --> 00:24:56,240 was using one of the enterprise security controls, there was a DLP. So I'm not specifically saying 219 00:24:56,240 --> 00:25:03,600 which was our particular DLP owner. So we were able to find DLP based remote code execution there. 220 00:25:03,600 --> 00:25:11,040 So and using the remote code execution, what we were able to do, we were able to get into that 221 00:25:11,040 --> 00:25:19,280 particular DLP based externally for the DLP server. And where the most beautiful part was 222 00:25:19,280 --> 00:25:26,480 that instance was, as usual, we expected as a cloud security researcher and offensive security 223 00:25:26,480 --> 00:25:32,320 engineer, we were able to try, okay, it's a cloud engagement, it's not a talk based engagement. 224 00:25:32,320 --> 00:25:37,360 So we want to stick to the cloud service. So what we did, okay, let's try to fetch if there is any 225 00:25:37,440 --> 00:25:44,000 web identity there, and using that web identity, are we able to use that web identity to assume a 226 00:25:44,000 --> 00:25:49,120 role, which is being attached to that particular instance. So we found a web identity, which we 227 00:25:49,120 --> 00:25:58,000 used to get the role, which was being attached to this particular instance, and we were able to 228 00:25:58,000 --> 00:26:03,920 be able to fetch the instance profile role credentials, and we get into this particular 229 00:26:04,000 --> 00:26:11,200 AWS account, it was there, the DLP instance was hosted on the one of their AWS instance, 230 00:26:11,200 --> 00:26:19,040 and we were able to fetch the role credentials using the web identity, which they were using as a 231 00:26:19,040 --> 00:26:26,240 basic restriction, where web identity was plugged into their cognitive. And what happened after 232 00:26:26,240 --> 00:26:32,000 assuming the role was, we were able to get the role credentials, and we started enumerating the 233 00:26:32,000 --> 00:26:37,440 role credentials, and we were sure that as it is a DLP based instance and the instance profile role 234 00:26:37,440 --> 00:26:43,360 attached to us for an enterprise security control, which was managed by security professionals, 235 00:26:43,360 --> 00:26:49,920 we expect that, okay, security professionals will take everything on for granted at some point, 236 00:26:49,920 --> 00:26:56,160 because we never expect attacks on us, attack on us, right. So there are so many blogs also in 237 00:26:56,320 --> 00:27:02,400 the sometimes like when 100 got 100. So it was that case where we just got the role credentials, 238 00:27:02,400 --> 00:27:08,800 and we tried to get, okay, what are the privileges, we were having low privilege one, but one of the 239 00:27:08,800 --> 00:27:16,240 API, which was being abused, one of the IIM API, which was being abused to escalate our privilege, 240 00:27:16,240 --> 00:27:21,920 but what we have done instead of maximizing our privilege was, we just attached a certain role 241 00:27:21,920 --> 00:27:28,320 for cloud trial, so that, okay, let's abuse cloud trial. Then after that, let's attach certain 242 00:27:28,320 --> 00:27:33,200 or privilege like for example, I am full access or maybe admin access or maybe certain service we 243 00:27:33,200 --> 00:27:40,320 need. So we attached certain abuse in my cloud trial API permissions. And what we did was, 244 00:27:40,320 --> 00:27:47,120 we have used here, we have asked our priorities to secure the organization, we tried to make sure 245 00:27:47,120 --> 00:27:54,240 that, okay, what, how this particular SOC team will, or their SOC team will respond. So we used 246 00:27:54,240 --> 00:28:02,960 the putty when selectors API abuse, and also the stop log API abuse. And for our lack, both 247 00:28:02,960 --> 00:28:12,480 was successful. And stopping one of the trails on one region stopped trials on every region. And 248 00:28:12,480 --> 00:28:20,080 that was unexpected. And this was not being added as an SAP policy as Abhishek said, the SAP policy 249 00:28:20,080 --> 00:28:26,080 was not properly configured so that the users, other than certain infrastructure engineers who 250 00:28:26,080 --> 00:28:32,000 are capable of starting and stopping logs, shouldn't be able to touch or stop certain services, 251 00:28:32,000 --> 00:28:37,520 especially the sensitive API calls like putty when selectors API and stop log API. And we were 252 00:28:37,520 --> 00:28:44,080 successful. And keep in mind that our strong focus is to secure the organization. We came to 253 00:28:44,080 --> 00:28:49,360 the conclusion that, of course, we need to make sure that business is not being impacted. We have 254 00:28:49,360 --> 00:28:55,600 to make sure that at least it should be stopped for at least 15 to 20 minutes or 30 minutes. We 255 00:28:55,600 --> 00:29:01,360 have to fasten our process so that any other issues that being that is being happened on 256 00:29:01,360 --> 00:29:05,920 their multi cloud infrastructure shouldn't be affected because we are stopping the logs here. 257 00:29:05,920 --> 00:29:11,600 But considering the other part, we have to understand that is their sock team 258 00:29:12,560 --> 00:29:18,000 will be able to identify that time because we have to make sure that, okay, rather than 259 00:29:18,000 --> 00:29:22,320 an organization getting affected with the 30 minute or 45 minutes routine engagement, 260 00:29:22,880 --> 00:29:28,000 think of the situation this top log API part is not being properly configured or the putty 261 00:29:28,000 --> 00:29:32,560 when selectors API part is not being properly configured and attacker used to this for maybe 262 00:29:33,200 --> 00:29:39,600 or one week or 48 hours. And still the sock team is not able to know what is going on. It's better 263 00:29:40,240 --> 00:29:47,120 than getting the two weeks, like, okay, there are no logs, what is happening to my trail? 264 00:29:47,120 --> 00:29:54,240 What happened now? Who has done what? So rather than guessing or waiting for attack to happen, 265 00:29:54,240 --> 00:29:59,280 what we have done? Okay, we have to let them know that if an attacker having 30, 45 minutes, 266 00:29:59,280 --> 00:30:04,480 what he can do? So what we have done after using the cloud trial API, next what we have done is, 267 00:30:04,480 --> 00:30:12,240 okay, now we are in control means none of the logs will be going to the sim tool, maybe Securonix, 268 00:30:12,240 --> 00:30:16,480 maybe Azure Sentinel, they are doing what we will do because from the cloud trial, they will be 269 00:30:16,480 --> 00:30:22,640 pushing the logs to S3, then pointing that to the sim tool, right? So there is no logs that 270 00:30:22,640 --> 00:30:28,160 is being going to the sim now. So what we have done now, an external rollback or for the persistence, 271 00:30:28,160 --> 00:30:37,120 we have again emulated a scenario where from our own personal account, we have created an user 272 00:30:37,120 --> 00:30:43,920 which can assume certain role that is being created on the target organization, right? So 273 00:30:43,920 --> 00:30:49,360 what we have done then, okay, we have created the backdoor there and we assumed the role from there 274 00:30:49,360 --> 00:30:56,800 from our account, we were able to assume a role from the target organization. Then we attached 275 00:30:56,960 --> 00:31:00,640 a particular page, maybe we can attach any privilege like admin privilege, 276 00:31:00,640 --> 00:31:05,760 which is of great noise, I will say, but what is the scenario here that is important because 277 00:31:05,760 --> 00:31:14,000 now we are not getting detected. So adding administrator access or any access after 278 00:31:16,320 --> 00:31:22,800 manipulating the cloud trial API logs, that the sim makes any noise now because the SOC team is not 279 00:31:22,800 --> 00:31:29,600 able to get what you are doing, right? So our thinking skills remains, manual thinking skills 280 00:31:29,600 --> 00:31:34,000 is really important when you are performing routine engagement. So after putting the external rollback 281 00:31:34,000 --> 00:31:38,560 door with high privilege, we try to now laterally move across different services, 282 00:31:38,560 --> 00:31:45,200 exfiltrate sensitive information from certain services, security, secret manager, S3, everything 283 00:31:45,200 --> 00:31:52,320 and the most important part was they were storing, we exfiltrated secret from secret manager, 284 00:31:52,320 --> 00:31:58,560 everything and they were storing a certain GCP service account key on one of their services 285 00:31:58,560 --> 00:32:06,000 and that was a cruel point from us because we don't want that to be compromised there and what 286 00:32:06,000 --> 00:32:10,720 happened next was the service account which was compromised and we got access and now it's a cloud 287 00:32:10,720 --> 00:32:18,160 to cloud lateral movement. From AWS, we were able to move into their GCP account and everyone 288 00:32:18,160 --> 00:32:24,560 knows that for GCP, like AWS has their boundary across account IDs, right? Different accounts 289 00:32:24,560 --> 00:32:31,360 is their boundary and GCP that is in project level, right? Different projects marks the permission, 290 00:32:31,360 --> 00:32:39,360 the boundary of, boundary like for example, you shouldn't be able to access a production project 291 00:32:39,360 --> 00:32:44,160 from a non-prod project, right? For example, you shouldn't be able to, the restriction should be 292 00:32:44,160 --> 00:32:49,200 there. You shouldn't be able to jump from one AWS account to another AWS account. So on the 293 00:32:49,200 --> 00:32:53,280 account level, we have security or security boundary here on the project level, GCP will be 294 00:32:53,280 --> 00:32:58,720 implementing the security boundary but after we have enumerated the service account, we were not 295 00:32:58,720 --> 00:33:06,640 able to get some access but the most important point was I think for automation for certain 296 00:33:06,640 --> 00:33:15,920 third party vendor based, they have created the service account on a non-prod environment 297 00:33:15,920 --> 00:33:23,200 and that service account were having token impersonation privilege and that was crucial for us 298 00:33:23,200 --> 00:33:30,080 and the best part was they were creating a particular service account and that service 299 00:33:30,080 --> 00:33:34,160 account was a common service account because when we enumerated the service account, we 300 00:33:36,800 --> 00:33:43,040 found so many services and what happened now was one of the service account on our non-prod 301 00:33:43,040 --> 00:33:49,680 project, they have created as a common service account and this service account is having access 302 00:33:49,680 --> 00:33:57,120 to pod project also. So we impersonated one of the service account and that service account was 303 00:33:57,200 --> 00:34:01,760 common for the non-prod project and the production project. We impersonated the 304 00:34:01,760 --> 00:34:07,120 production, that particular service account upon enumeration or the token, we just jumped 305 00:34:07,120 --> 00:34:13,520 from non-prod to prod production service account, I mean project there. So what happened was 306 00:34:13,520 --> 00:34:21,120 we were not having any honor roll on that non-prod project but the beautiful part of GCP was 307 00:34:22,000 --> 00:34:29,040 and the company which gives us this offensive assessment was they were using in-build rolls 308 00:34:29,040 --> 00:34:36,000 for GCP which is of no surprise because of course we don't want like it's a difficult task right 309 00:34:36,000 --> 00:34:43,680 at some point like we have to create custom rolls for certain people but here the fate was against 310 00:34:43,680 --> 00:34:48,960 them the issue was we were the particular account which was compromised was having 311 00:34:48,960 --> 00:34:56,240 editor roll access on the non-prod project and also editor roll access on the production project. 312 00:34:56,240 --> 00:35:02,640 So the big issue was we were not able to impersonate the token but the editor roll has 313 00:35:03,920 --> 00:35:11,040 a particular roll called user creation that means there is no impersonation happened, 314 00:35:11,040 --> 00:35:18,240 we can create a key for the user. So what happens when you don't have impersonation but 315 00:35:18,240 --> 00:35:23,760 you have an extra key you can create an extra key for any user in your account which it's again a 316 00:35:23,760 --> 00:35:29,200 huge privilege they have restricted the impersonation token impersonation privilege on the editor roll 317 00:35:29,200 --> 00:35:36,560 but there is token creation where key creation sorry the JSON key creation you can create any 318 00:35:36,560 --> 00:35:43,040 additional key for a service account on that particular place so token impersonation is different 319 00:35:43,040 --> 00:35:48,160 key creation is different again it acts as a backdoor as well the extra key we are giving 320 00:35:48,160 --> 00:35:53,040 that any user who creates that particular service account will be having one key on their hand but 321 00:35:53,040 --> 00:35:59,600 we also have another key on our hand that means the people who is who is the owner of that particular 322 00:35:59,600 --> 00:36:03,600 service account will be authenticating using that key and we would be using our backdoor to key 323 00:36:03,600 --> 00:36:08,480 but using this privilege even though we have edited the roll we were able to add it to the 324 00:36:09,280 --> 00:36:15,280 a service account which have which has honor privilege on the particular roll and what happened 325 00:36:15,280 --> 00:36:23,040 their production entire production project was compromised because of that and after that we 326 00:36:23,040 --> 00:36:31,760 stealthily exfiltrated secrets from there and the beauty of this was on this particular thing 327 00:36:31,760 --> 00:36:37,840 as we defended the cloud trial I mean we abuse the cloud trial API calls there's logs from that 328 00:36:37,840 --> 00:36:43,840 pad remains as a mystery like okay what happened they have to reach to us to make sure that okay 329 00:36:43,840 --> 00:36:49,200 what all we have to we have done of course we have we have shared some the reports they have 330 00:36:49,200 --> 00:36:54,400 we have made sure that okay purple deeming is done properly to make sure that organization is 331 00:36:54,400 --> 00:37:01,200 well capable now and because of this empty exploration it has from an attacker who has 332 00:37:01,280 --> 00:37:10,000 access to nothing has now compromised with their ad up and their production gcb project too 333 00:37:10,000 --> 00:37:17,280 so it was a multi cloud attack which was done from nowhere and resulted in critical exfiltration 334 00:37:17,280 --> 00:37:24,240 without getting detected even though some part of the gcb exfiltration was detected but as it is 335 00:37:24,880 --> 00:37:30,640 service account impersonation it's more of like a as abhishek said it's more of like a property 336 00:37:30,640 --> 00:37:37,840 what happened was they were thinking like okay it's a legitimate account so it is being trying to 337 00:37:37,840 --> 00:37:44,560 attend things on the practical part on doing assessment using cli and console comes here 338 00:37:44,560 --> 00:37:50,000 because when you are opening cli at the same time you are hitting thousands of apk calls right so 339 00:37:50,000 --> 00:37:55,840 that itself is being at some point when there's a shock of like not that much 340 00:37:57,280 --> 00:38:01,360 big quality or if they don't know that much big picture of red team assessment they might feel 341 00:38:01,360 --> 00:38:06,080 like okay a user with console access he's trying there's so many apk calls are being said but when 342 00:38:06,080 --> 00:38:12,240 you are trying to authenticate with like you are specifically hitting certain apk calls early and 343 00:38:12,240 --> 00:38:17,440 that too you are abusing clouter and making particular impersonation that they will think like 344 00:38:17,440 --> 00:38:23,760 okay there is not much apk and this is boxing going on so in order to detect it as abhishek said 345 00:38:23,760 --> 00:38:30,400 there are so many methods like segmentation and scp policies which is of really really 346 00:38:31,360 --> 00:38:37,680 and for example we can build certain architecture solutions for trying to 347 00:38:38,640 --> 00:38:45,600 defend against cloud exfiltration like maybe some dlp solution or dlp exfiltration yeah 348 00:38:46,320 --> 00:38:54,560 that's it from our end yeah if anybody have any queries like can answer it 349 00:39:01,680 --> 00:39:06,080 thank you for listening any one got any questions or query 350 00:39:16,320 --> 00:39:16,820 you 351 00:39:21,280 --> 00:39:25,760 okay i'm just not familiar with the subject enough to have any like constructive questions 352 00:39:25,760 --> 00:39:30,320 i need to do some more learning but it was clear to me i could follow you on everything 353 00:39:31,040 --> 00:39:41,280 so thanks a lot thank you bandwidth thank you bandwidth yeah 354 00:39:45,600 --> 00:39:52,960 i have left out uh linglin uh you are also from 355 00:39:54,160 --> 00:40:09,280 both of us in dchat in case any of us or any of you want to come and go 356 00:40:15,600 --> 00:40:27,280 don't be shy if anybody has any questions bring them up now 357 00:40:33,840 --> 00:40:40,240 well thank you abhishek and amal that was an excellent presentation all the way from india 358 00:40:40,240 --> 00:40:53,920 thank you yeah thank thank you x-ray thank you now they're they're from uh dc 0471 in trivandrum india