1 00:00:00,000 --> 00:00:01,900 And we're doing the 11 o'clock talk. 2 00:00:02,220 --> 00:00:03,640 It's you guys right here. 3 00:00:04,280 --> 00:00:06,540 And the talk is basically... 4 00:00:06,540 --> 00:00:07,360 Oops. 5 00:00:07,500 --> 00:00:13,520 Inside Look at a Chinese Operational Relay Network with MTU and Earl. 6 00:00:13,520 --> 00:00:15,220 All right, guys, kick it off. 7 00:00:15,680 --> 00:00:16,440 Thanks. 8 00:00:22,090 --> 00:00:23,270 All right. 9 00:00:23,630 --> 00:00:24,310 Hello, everyone. 10 00:00:24,310 --> 00:00:32,650 As he just said, we're going to be going over what we call Meeting Mac, or the longer name, an inside look at a PRC-based operational relay network. 11 00:00:33,190 --> 00:00:34,850 A quick overview. 12 00:00:34,870 --> 00:00:37,350 We're going to obviously introduce ourselves and what we did. 13 00:00:37,350 --> 00:00:42,410 We're going to talk about some secrets discovery in Docker, which was the source of all of our stuff. 14 00:00:42,470 --> 00:00:50,970 We're going to talk about the finding that we found super interesting, go through all of their databases, access keys, passwords, all that good stuff. 15 00:00:50,970 --> 00:00:56,810 How they made their infrastructure work and what their infrastructure was made to provide to their users. 16 00:00:57,750 --> 00:01:03,670 By way of introduction, I'm Michael Torres, also known as MTU, and I am just another dude... 17 00:01:07,010 --> 00:01:09,070 You're working on it, or do you need me to do something? 18 00:01:10,070 --> 00:01:11,390 Do you need me to do something? 19 00:01:14,300 --> 00:01:14,980 Okay. 20 00:01:14,980 --> 00:01:16,440 As long as you get it fixed. 21 00:01:17,900 --> 00:01:18,920 I guess I'm... 22 00:01:20,160 --> 00:01:21,380 The slides are not up. 23 00:01:21,380 --> 00:01:22,780 Just keep on talking, I guess. 24 00:01:22,780 --> 00:01:24,700 Well, I'm going to try to restart the show. 25 00:01:24,820 --> 00:01:28,360 Slide it over to the right. 26 00:01:28,360 --> 00:01:29,500 Go back to regular view. 27 00:01:30,140 --> 00:01:31,700 Maybe slide it over that way. 28 00:01:32,780 --> 00:01:33,460 No? 29 00:01:33,620 --> 00:01:33,900 No? 30 00:01:33,900 --> 00:01:36,160 All right. 31 00:01:36,160 --> 00:01:36,860 That's right. 32 00:01:38,320 --> 00:01:40,660 I'm going to have a duplicate, yeah. 33 00:01:41,020 --> 00:01:42,280 With a view. 34 00:01:45,700 --> 00:01:47,240 This is not ideal. 35 00:01:48,300 --> 00:01:49,400 Let me try. 36 00:01:49,780 --> 00:01:51,180 Sorry about that. 37 00:01:55,360 --> 00:01:57,520 We'll go quick for... 38 00:01:57,520 --> 00:01:58,200 Just... 39 00:01:58,200 --> 00:01:58,720 Yeah. 40 00:01:59,520 --> 00:02:01,240 All right, sounds good. 41 00:02:01,900 --> 00:02:03,680 So yeah, Michael, another dude. 42 00:02:04,840 --> 00:02:05,920 Hi, and I'm Zane. 43 00:02:05,920 --> 00:02:06,900 I'm a dude. 44 00:02:09,240 --> 00:02:11,780 I will apologize about my voice. 45 00:02:12,080 --> 00:02:13,760 It is gone. 46 00:02:14,380 --> 00:02:15,500 How does this work? 47 00:02:17,660 --> 00:02:18,380 Cool. 48 00:02:18,380 --> 00:02:20,300 So I'm going to talk about kind of the... 49 00:02:20,300 --> 00:02:30,700 I'm going to talk a little bit about the research we did and kind of how we got from where we were to meeting Mac, as Michael kind of hinted at. 50 00:02:30,700 --> 00:02:37,980 So originally this research was kind of thought about at DEF CON 32. 51 00:02:37,980 --> 00:02:47,140 We watched a demo for the Docker exploitation framework, which showed that you can identify whiteouted files in container images. 52 00:02:47,140 --> 00:02:54,600 Which is basically if you delete a file from your image, it still exists in the full image tarball. 53 00:02:54,600 --> 00:03:03,660 I thought that'd be super interesting to look into and find what kind of secrets people are publishing to Docker Hub inside of their containers. 54 00:03:04,980 --> 00:03:11,160 So, you know, things like the .env, passwords, SSH keys, and the like. 55 00:03:11,520 --> 00:03:13,640 The display's not working, so it's okay. 56 00:03:14,060 --> 00:03:15,500 I need to see the next slide. 57 00:03:26,060 --> 00:03:29,100 So yeah, sorry, we don't have the slides up here either. 58 00:03:29,100 --> 00:03:43,720 So starting off with scanning at scale, we were actually in our hotel room at DEF CON last year and we wrote like the world's worst version of Truffle Hog to try to identify these secrets in Docker containers. 59 00:03:44,800 --> 00:03:46,400 I need to see. 60 00:03:47,320 --> 00:03:49,200 Sorry about this, guys. 61 00:03:49,200 --> 00:03:50,040 It's all good? 62 00:03:50,100 --> 00:03:51,240 No, I don't know. 63 00:03:51,240 --> 00:04:02,540 So yeah, we started basically regexing through all of these containers with our crappy version of Truffle Hog, downloading as many copies of images as we could. 64 00:04:02,860 --> 00:04:11,340 We started to get a lot of things like cloud provider API keys, Binance keys, databases, which was kind of an interesting one. 65 00:04:11,340 --> 00:04:25,100 People would have database backups in their Docker containers, which was super fun to look at, as well as the credentials to reach their production SQL containers. 66 00:04:28,200 --> 00:04:31,800 So we started to get a lot of... yeah, sorry. 67 00:04:31,800 --> 00:04:34,080 We started to get a lot of data. 68 00:04:34,080 --> 00:04:42,920 At the bottom, if you can see the slides now, we had 240,000 total Elasticsearch indexes for our found data. 69 00:04:42,920 --> 00:04:48,680 A lot of that is going to be like false positives and it's going to be like example keys and stuff like that. 70 00:04:48,680 --> 00:04:50,160 But it's just the two of us. 71 00:04:50,160 --> 00:04:52,020 We have short attention span. 72 00:04:57,050 --> 00:04:58,310 Hi, everybody. 73 00:04:59,210 --> 00:05:01,270 Sorry about the technical difficulties. 74 00:05:02,250 --> 00:05:05,530 Video in this kind of a format is a real pain in the butt. 75 00:05:05,530 --> 00:05:13,650 Did anybody come when DEF CON was at Caesars a number of years ago, the year that it was a really good time with the video? 76 00:05:14,430 --> 00:05:15,770 Video is hard. 77 00:05:16,570 --> 00:05:21,630 New place, we've got a great staff that's working their butt off to make sure that we don't have these kinds of issues this year. 78 00:05:21,630 --> 00:05:23,930 I got confidence that we're going to be good. 79 00:05:24,110 --> 00:05:27,190 These gentlemen got a little bit off their game. 80 00:05:27,870 --> 00:05:29,610 Let's give them a big welcome. 81 00:05:29,610 --> 00:05:33,110 Let's have them start again and relax. 82 00:05:33,110 --> 00:05:33,970 Yeah. 83 00:05:38,750 --> 00:05:39,370 Awesome. 84 00:05:39,370 --> 00:05:41,170 Are we going back to the intro slide? 85 00:05:41,170 --> 00:05:42,830 Start wherever you want to. 86 00:05:42,830 --> 00:05:43,970 Your slides work. 87 00:05:43,970 --> 00:05:45,070 Get back on your game. 88 00:05:45,070 --> 00:05:45,910 Give your best shit. 89 00:05:45,910 --> 00:05:46,790 Have a good time, all right? 90 00:05:46,790 --> 00:05:47,290 Yeah. 91 00:05:48,130 --> 00:05:49,490 Do you want me to start again? 92 00:05:49,490 --> 00:05:49,990 Yeah. 93 00:05:49,990 --> 00:05:51,030 I mean, sure. 94 00:05:51,230 --> 00:05:52,450 You can introduce yourself. 95 00:05:52,450 --> 00:05:52,970 All right. 96 00:05:52,970 --> 00:05:54,150 So let's try this again. 97 00:05:54,150 --> 00:05:58,250 So like I mentioned, inside look at a PRC operational relay network. 98 00:05:58,250 --> 00:05:59,530 My name is Michael Torres. 99 00:05:59,530 --> 00:06:00,910 I'm just another dude. 100 00:06:00,910 --> 00:06:06,170 We're going to go over the research we started on how to find secrets in Docker Hub images. 101 00:06:06,170 --> 00:06:17,050 We're going to talk about the relay network we discovered, including credentials, the cloud providers they were abusing, their domain names, IP addresses, email addresses, all that fun stuff. 102 00:06:17,730 --> 00:06:18,690 Cool. 103 00:06:18,970 --> 00:06:21,110 Yeah, and once again, I am a dude. 104 00:06:21,810 --> 00:06:28,390 So yeah, I was inspired by the Docker exploitation framework from DEF CON last year. 105 00:06:28,390 --> 00:06:39,390 They gave a demo on this cool tool that they made, but the most interesting thing that we saw was the ability to check for whiteouted data in the container overlay FS image. 106 00:06:39,810 --> 00:06:46,170 And so we wanted to start scanning at the biggest scale we could to identify whiteouted data. 107 00:06:46,170 --> 00:06:53,510 So data that people had in their container images that they thought they had deleted and it's still there. 108 00:06:53,950 --> 00:06:57,630 So we started in our hotel room scanning at scale. 109 00:06:57,630 --> 00:07:04,250 We wrote, like I said, a terrible version of Truffle Hog that's just going to regex for this whiteouted data in the images. 110 00:07:04,770 --> 00:07:07,230 Unfortunately, we didn't get that many findings. 111 00:07:07,230 --> 00:07:10,750 I think we got like a total of five while we were at DEF CON. 112 00:07:10,750 --> 00:07:17,270 So we quickly pivoted to looking for more broad API keys, SSH keys, passwords, and the like. 113 00:07:17,850 --> 00:07:19,570 And we were getting a lot of data. 114 00:07:19,570 --> 00:07:22,850 At the bottom, 240,000 total findings. 115 00:07:22,850 --> 00:07:27,650 A lot of that's going to be false positives, so example keys and stuff like that. 116 00:07:27,930 --> 00:07:40,250 And we were getting a lot of interesting info like database backups to include a production SQL server owned by an online casino with the credentials for it. 117 00:07:40,250 --> 00:07:41,530 So that was kind of cool. 118 00:07:43,150 --> 00:07:46,210 We have a short attention span that's allotted out a lot of false positives. 119 00:07:46,210 --> 00:07:49,650 We're not going to look through 240,000 total findings by ourselves. 120 00:07:49,650 --> 00:07:56,150 So we start looking into optimizing our tools so we can get less false positives. 121 00:07:56,490 --> 00:07:58,270 But that's a lot of work. 122 00:07:58,270 --> 00:08:00,630 We were seeing a lot of the same stuff over and over again. 123 00:08:00,630 --> 00:08:07,030 And it's only so exciting seeing the same crypto trading bots for the 10th time that morning. 124 00:08:08,470 --> 00:08:13,570 In the middle of our testing, we were pulling I think 5,000 containers a day. 125 00:08:13,570 --> 00:08:22,550 So we quickly had to get the Docker premium accounts to not be rate limited to I think the free tier is like 200 image pulls a day. 126 00:08:22,550 --> 00:08:24,370 And we were hitting a lot more than that. 127 00:08:24,570 --> 00:08:32,330 You can see in the middle of our scanning, this is about the three month period that we were pulling a boatload of containers from Docker Hub. 128 00:08:33,110 --> 00:08:42,330 They announced, and we have a link to the article, they announced that they're going to be rate limiting the premium tier accounts to I think it was 50,000 pulls a month. 129 00:08:42,330 --> 00:08:45,870 Which coincidentally was about what we were hitting. 130 00:08:45,870 --> 00:08:50,710 We have no idea if that was because of us, but we like to think we may have played a little part in it. 131 00:08:52,370 --> 00:08:54,910 So yeah, that was just a fun little slide. 132 00:08:54,910 --> 00:08:59,470 But we're still getting a bunch of data that we don't know what to do with because it's just too much. 133 00:08:59,510 --> 00:09:05,790 I had previously done some work identifying publicly accessible private Git repositories. 134 00:09:05,790 --> 00:09:09,190 So a lot of the times, it's like a Google dork. 135 00:09:09,190 --> 00:09:15,790 You can look for a .git on a website and you'll go to mycoolwebsite.com forward slash .git. 136 00:09:15,790 --> 00:09:28,650 You can wgit tech R that and 12 hours later because you just downloaded a bunch of tiny files, you can do a Git restore and you have their private Git repository that is publicly accessible. 137 00:09:28,790 --> 00:09:30,930 I'm not sure how people are messing that up. 138 00:09:30,930 --> 00:09:39,330 I'm thinking it's like small businesses that hire a developer to make them a website and then they just, you know, Git clone and then deploy it. 139 00:09:39,450 --> 00:09:47,350 But we wanted to start, instead of looking at the broad like regex scale, start looking for .git slash config. 140 00:09:47,350 --> 00:09:53,730 So then we could identify if there was like a private repository inside of this container. 141 00:09:54,290 --> 00:10:00,570 So a little background on how to containerize an application if somebody here has never containerized an app. 142 00:10:00,570 --> 00:10:06,930 If you Google search how to containerize an application, Docker provides a nice little workshop. 143 00:10:07,110 --> 00:10:12,030 And the TLDR of it is that they want you to do a Git clone from your repository. 144 00:10:12,450 --> 00:10:14,270 You'll create a Docker file. 145 00:10:14,350 --> 00:10:18,770 Inside your Docker file, you'll base it off of, you know, a normal image, so like from Ubuntu. 146 00:10:18,870 --> 00:10:20,970 And then do a copy dot dot. 147 00:10:21,330 --> 00:10:25,010 Copy dot dot is really cool because it will pull in everything. 148 00:10:25,010 --> 00:10:25,770 It makes sense. 149 00:10:25,770 --> 00:10:27,690 That's exactly what you're telling it to do. 150 00:10:27,690 --> 00:10:31,550 But it will also pull in hidden files and directories. 151 00:10:31,790 --> 00:10:35,130 So that's how people are putting their .envs inside of their containers. 152 00:10:35,310 --> 00:10:43,990 But for what we're looking at, it's pulling in the .git folder directory structure from that previous Git clone that they did. 153 00:10:44,210 --> 00:10:49,350 So, you know, like the CI pipeline would do a build push job. 154 00:10:49,350 --> 00:10:50,790 It's going to clone your repository. 155 00:10:50,790 --> 00:10:56,310 It's going to build your container, copy in everything, including your repository, and then push it to Docker Hub. 156 00:10:56,310 --> 00:11:03,790 So if you have a private repo and then you're pushing to a public Docker image, that's no good. 157 00:11:04,210 --> 00:11:06,450 There's some other interesting things in here. 158 00:11:06,450 --> 00:11:09,290 In the .git config, like I said, it will have the remote URL. 159 00:11:09,290 --> 00:11:13,270 So you can query that to identify if it's a private repository or not. 160 00:11:14,410 --> 00:11:23,370 But inside of that, you can also identify the CI job token that was used to push to Docker Hub and to do your CI job. 161 00:11:23,370 --> 00:11:26,590 Those are short-lived for the length of the job. 162 00:11:27,230 --> 00:11:31,510 And then generally, you know, it would also need write permissions to do anything fun with. 163 00:11:32,050 --> 00:11:43,030 But some users are using their personal access tokens with rewrite permissions to do their CI pipelines, which would then push their credentials to their private repo to their public Docker image. 164 00:11:43,030 --> 00:11:44,530 So we have a demo. 165 00:11:45,270 --> 00:11:47,070 I'm not sure if it'll play on here. 166 00:11:47,070 --> 00:11:48,090 Can you help me? 167 00:11:49,990 --> 00:11:51,130 So, yeah. 168 00:11:52,030 --> 00:12:05,830 While he gets that up, we have a demo showing basically if you know a container is going to be updated, you can scan that container on Docker Hub, wait for an update to happen, grab the credentials. 169 00:12:06,190 --> 00:12:08,090 Oh, that's wrong screen. 170 00:12:08,090 --> 00:12:09,110 Sorry about that. 171 00:12:09,190 --> 00:12:10,050 Just keep talking. 172 00:12:10,050 --> 00:12:28,110 Then you can grab the credentials and if they're using their personal access token, you actually then have write permission to their private repository, which will have the added benefit of once you push to that private repository, it'll kick off another CI job that you can then, 173 00:12:28,110 --> 00:12:33,930 you know, have your code that you've pushed to their repo inside of their public Docker image. 174 00:12:33,930 --> 00:12:40,690 So depending on, you know, how important their code base is or how popular that image is, that could be pretty nasty. 175 00:12:40,690 --> 00:12:45,370 So right here, we're just, you know, scanning for the change in Docker Hub. 176 00:12:45,450 --> 00:12:51,570 And then we're, I think, just going to write to the README file that, you know, we have write access to the repo. 177 00:12:51,750 --> 00:12:59,270 So that was just a cool thing that we had seen while trying to identify like vulnerabilities or anything that we could do with all of this data. 178 00:13:02,090 --> 00:13:03,070 Start talking. 179 00:13:03,210 --> 00:13:04,550 I don't know what slide it is. 180 00:13:04,610 --> 00:13:08,910 So on this slide, we're going to go over some of the metrics. 181 00:13:08,910 --> 00:13:15,650 So in total, we pulled a little over 80,000 containers during this three-month time period starting last August. 182 00:13:15,650 --> 00:13:28,630 Once we started looking just for the private Git repositories, about 15,000 of them contained Git metadata and 1,500 of those were for non-public Git repos. 183 00:13:28,630 --> 00:13:32,010 That's basically anything that wasn't returning a status code 200. 184 00:13:32,650 --> 00:13:34,810 So we're looking for 404s on GitHub. 185 00:13:34,810 --> 00:13:41,030 If it's a private repo, it will, you know, if it's private, it will show that it's just a 404. 186 00:13:41,030 --> 00:13:45,210 We also got some redirects for like Git at company name.com. 187 00:13:45,210 --> 00:13:54,710 So some companies, their private internal Gits were being pushed to their public container images, which was also fun. 188 00:13:55,110 --> 00:14:05,050 Some of the more notable stuff that we saw was there was an enterprise branch of an Apache open source project that had their private repository stored in their public container. 189 00:14:05,050 --> 00:14:10,650 A Russian dash cam manufacturer and a security vendor's private detection rules. 190 00:14:10,890 --> 00:14:14,370 We had reported as much as we could for all of these findings. 191 00:14:14,370 --> 00:14:15,990 Unfortunately, nobody ever responded. 192 00:14:15,990 --> 00:14:20,810 And we even emailed the, like, last commit author from the Git log. 193 00:14:20,810 --> 00:14:23,010 So it was super easy to report. 194 00:14:23,530 --> 00:14:31,010 I don't know if you'll be able to see it on this slide as it's being presented, but on the left-hand side is just some of our Elasticsearch findings. 195 00:14:31,830 --> 00:14:35,270 We have the very top one is actually a personal access token. 196 00:14:35,270 --> 00:14:39,870 So going back a few slides for that demo of the CI job to push to Docker Hub. 197 00:14:39,870 --> 00:14:46,510 If they're using their personal access tokens for that job, in theory, then you would have write access to the repository. 198 00:14:46,870 --> 00:14:58,350 On the right-hand side, those are all of the status codes and the percentage of the total findings for the containers containing private or non-public Git repositories. 199 00:14:58,370 --> 00:15:00,010 So just a cool metric. 200 00:15:01,090 --> 00:15:02,850 All right, we're going to start talking. 201 00:15:02,850 --> 00:15:07,890 That was the background on the research we did, how we did it, and how we got to finding Mac. 202 00:15:08,890 --> 00:15:14,150 There was one Docker Hub user that was pushing multiple containers a day. 203 00:15:14,150 --> 00:15:21,150 They were doing a lot of updates, and we kept getting flags for it because they had private Git repositories in it. 204 00:15:21,150 --> 00:15:25,010 So our automated tooling would alert us that we got new findings. 205 00:15:25,870 --> 00:15:36,730 And from our initial look at these container images, it looked like this user was actually just using Docker containers as free cloud storage, which is a cool idea. 206 00:15:36,970 --> 00:15:42,530 They had a boatload of data labeled like backups that they were just pushing. 207 00:15:43,030 --> 00:15:48,850 So we started looking into it a little bit more because I thought it was a funny idea to use Docker as free cloud storage. 208 00:15:48,850 --> 00:16:02,210 It led us to identifying three other Docker users that were doing similar things and kind of tied them all together, spanning across 38 total repositories, meaning like container images on those accounts. 209 00:16:02,230 --> 00:16:06,090 There was hundreds of image tags per container. 210 00:16:06,490 --> 00:16:08,550 So a couple gigs per container. 211 00:16:08,550 --> 00:16:11,390 You know, you got a couple hundred tags per container. 212 00:16:11,390 --> 00:16:13,610 It's a lot of data for us to look through. 213 00:16:13,610 --> 00:16:18,350 So we saw it, and we thought it was kind of neat, but didn't look too far into it. 214 00:16:18,350 --> 00:16:19,690 Here's a Discord message. 215 00:16:19,690 --> 00:16:23,350 I like to go to bed pretty early, so Michael was up at 10.40 p.m. 216 00:16:23,350 --> 00:16:25,570 I'd probably been asleep for a few hours. 217 00:16:25,910 --> 00:16:30,270 But he had taken another look at these containers because we just kept getting hits on them. 218 00:16:30,330 --> 00:16:44,530 And it looked like they were using the data in the containers, pointed to them using this to spin up and down some cloud infrastructure to proxy traffic, and it was redirecting to the great firewall. 219 00:16:44,530 --> 00:16:47,910 So that piqued our interest almost immediately. 220 00:16:47,910 --> 00:16:49,170 It was super interesting. 221 00:16:49,170 --> 00:16:53,590 So we wanted to look more into these containers and see what we could learn about their infrastructure. 222 00:16:54,930 --> 00:17:03,190 Here is kind of a high-level view of what we think their infrastructure looks like after several months of research on all of this data. 223 00:17:03,370 --> 00:17:07,170 Starting on the left, they have a couple different providers that they use for storage. 224 00:17:07,170 --> 00:17:10,930 So Docker Hub is not the only free cloud storage you can use. 225 00:17:10,930 --> 00:17:15,950 They were also using Mega and GitHub repos actually to store data. 226 00:17:16,570 --> 00:17:21,610 Then in the middle, we are kind of going to go over the compute that they're using in a few slides. 227 00:17:21,610 --> 00:17:25,910 But they have like traditional VMs and then more like serverless compute. 228 00:17:25,910 --> 00:17:27,950 So they were using stuff like GitHub Actions. 229 00:17:28,430 --> 00:17:30,830 We have the databases on the right-hand side as well. 230 00:17:30,830 --> 00:17:35,470 And then we're going to go a little bit more in depth on all of these services and how they were used. 231 00:17:36,690 --> 00:17:41,490 But we're going to go over first what we found and what we believe it is. 232 00:17:41,810 --> 00:17:47,990 So with a somewhat high confidence, we believe it to be a PRC-based operational relay box network. 233 00:17:48,370 --> 00:17:53,750 And that's basically a bunch of stuff proxying for bad actors. 234 00:17:53,750 --> 00:18:01,630 There's a Google link for Chinese Nexus actors using similar networks to do malicious things on the internet. 235 00:18:01,630 --> 00:18:04,450 So you can read that if you would like. 236 00:18:04,830 --> 00:18:09,770 We believe there's more than one person involved in the development and operations of this infrastructure. 237 00:18:09,770 --> 00:18:15,950 We observed messages in their database backups in these containers between multiple personas. 238 00:18:16,310 --> 00:18:25,030 They're using this weird .rec file format that we couldn't figure out what the note-taking app or whatever was creating them. 239 00:18:25,030 --> 00:18:28,290 So we would actually love if anybody knows what it is. 240 00:18:29,150 --> 00:18:31,850 And it's been in development since 2022. 241 00:18:32,270 --> 00:18:36,790 Last year, like I said, they were updating almost daily, several times a day. 242 00:18:36,790 --> 00:18:42,810 The last update that we saw was in June of this year, so that's the last time we've looked at any of this data. 243 00:18:43,790 --> 00:18:53,530 With a medium confidence, it's used to proxy web traffic, manage social media accounts, and otherwise do sort of anonymous browsing. 244 00:18:53,890 --> 00:18:58,630 They also have some tooling to create and manage the social media accounts, pointing us to that. 245 00:18:59,210 --> 00:19:00,450 Low confidence. 246 00:19:00,450 --> 00:19:08,810 Unfortunately, these guys aren't in their database or in their backups putting proof that they're doing malicious things, which would have been really cool for us. 247 00:19:09,050 --> 00:19:14,550 But we did see they have tooling and proof that they had one malicious PyPy package. 248 00:19:14,550 --> 00:19:16,930 That is a virus total link to the package. 249 00:19:16,930 --> 00:19:24,370 It is no longer on PyPy, but you can still go and analyze that package, as well as a Cobalt Strike listener log. 250 00:19:24,370 --> 00:19:30,310 It looked like it was more for a test, but shows that the infrastructure was in place to use those things. 251 00:19:32,070 --> 00:19:39,170 So the network tunneling protocols that they were using, they used NPS for their node hub C2 infrastructure. 252 00:19:39,250 --> 00:19:44,330 And then on the bottom right, we have a little screen grab of them modifying the FRP fingerprint. 253 00:19:44,390 --> 00:19:47,350 They changed all the key names on that. 254 00:19:47,450 --> 00:19:53,650 And then they used a couple of different providers to obscure their C2 destination IPs. 255 00:19:55,110 --> 00:20:03,970 And then they also, yeah, they had the full VMs for, you know, serverless and full VM access. 256 00:20:05,830 --> 00:20:13,490 And then, as promised, we're going to start going over some of the domains and other juicy tidbits that we got from their data dumps. 257 00:20:13,670 --> 00:20:16,890 So the top three are their main, like, hub domains. 258 00:20:17,050 --> 00:20:19,870 We've defanged them, but those are them. 259 00:20:20,150 --> 00:20:23,970 The bottom one, or the middle one, sorry, the private services are a little interesting. 260 00:20:24,290 --> 00:20:42,290 They have this GitHub repo access domain where if you know their private repositories, because they've made them public, and you know the directory structure of them, you can actually browse that domain and get the files from their Git repos, which is kind of interesting. 261 00:20:42,710 --> 00:20:51,110 And then they had their own file hosting for tooling and scripts that they would pull down when setting up infrastructure, as well as the workstations. 262 00:20:51,110 --> 00:20:56,830 The bottom ones are the, like, miscellaneous that we didn't see a lot of information about, but they were sort of interesting. 263 00:20:56,830 --> 00:20:59,730 The top one being, you know, Cracked Cobalt Strike. 264 00:20:59,730 --> 00:21:05,790 So, pointing to them using this infrastructure for more nefarious things, but... 265 00:21:09,750 --> 00:21:16,710 As far as data persistence, Zane mentioned earlier, they have a lot of different cloud services they were saving data to. 266 00:21:16,710 --> 00:21:19,210 Probably the largest by volume was TerraCloud. 267 00:21:19,210 --> 00:21:21,610 They had a WebDAV share set up there. 268 00:21:21,610 --> 00:21:24,990 Obviously, Docker Hub Images, that's how we got our initial access. 269 00:21:24,990 --> 00:21:27,370 They were all about uploading data there. 270 00:21:27,490 --> 00:21:33,290 GitHub repositories, Hugging Face Spaces, Backblaze Buckets, and one instance of a OneDrive. 271 00:21:33,450 --> 00:21:41,790 And then the screenshots here are their configs and things like that for those services, so you can kind of see how they pieced it together and how they thought about their data backup strategy. 272 00:21:43,870 --> 00:21:54,150 Just as a little tidbit off of that, if you didn't know, OneDrive authentication tokens are JSON web tokens, which means you can decode them and get a little bit of additional information out of them. 273 00:21:54,150 --> 00:21:55,710 So we went ahead and did that. 274 00:21:55,710 --> 00:22:02,390 That bottom left screenshot has an email address that ends, like the host name is host.ac.cn. 275 00:22:02,490 --> 00:22:08,150 A little bit of Googling says that that's a shared domain for a lot of university systems in the People's Republic of China. 276 00:22:08,150 --> 00:22:13,870 So I'm not sure that that's a real email address that can tie back to a person, but it's still kind of interesting. 277 00:22:13,870 --> 00:22:22,150 And then on the right side of the slide, you can see an IP address that is probably a legitimate home IP address based on the ASN. 278 00:22:22,150 --> 00:22:25,470 I want to say it went back to China Telecom or something like that. 279 00:22:28,780 --> 00:22:32,640 The most exciting part for us was access to these credentials. 280 00:22:32,640 --> 00:22:41,620 On the right there, you can see that they were nice enough to give us an SSH config that included the path to the SSH key to use to access their nodes as the root user. 281 00:22:41,620 --> 00:22:47,260 They also had that SSH key, so if we wanted to, we could have logged in to all of their things as root. 282 00:22:47,580 --> 00:22:49,480 So great security practices there. 283 00:22:49,480 --> 00:22:56,360 Even if we didn't have their SSH key, they also lettered passwords all throughout their code and their notes and all of that. 284 00:22:56,360 --> 00:23:01,280 So we were able to figure out that they followed a pretty standard template for all of their passwords. 285 00:23:01,780 --> 00:23:09,860 You can see it there, but A, B, some characters that we're not going to tell you, an at sign, and then a letter corresponding to the username. 286 00:23:09,980 --> 00:23:14,000 So for the user temp0230, the letter was a T. 287 00:23:14,000 --> 00:23:17,280 For coral86, it was a capital C and a capital O. 288 00:23:17,900 --> 00:23:18,800 There's a hash there. 289 00:23:18,800 --> 00:23:20,300 It has a special little salt. 290 00:23:20,300 --> 00:23:23,460 If you want to try to crack it, then you'll have their actual passwords. 291 00:23:23,760 --> 00:23:32,680 Like I said earlier, that password is used for emails, their domain management accounts, their social media, basically just everywhere that you can put a password in. 292 00:23:32,680 --> 00:23:34,740 That was how they were generating their passwords. 293 00:23:37,950 --> 00:23:38,890 That wasn't it. 294 00:23:38,890 --> 00:23:43,950 They also had just plain text API keys all throughout their notes and through their code. 295 00:23:43,950 --> 00:23:47,170 You can see the top players there are definitely Heroku and GitHub. 296 00:23:47,490 --> 00:23:52,530 Heroku for running their exit nodes, if you want to call them that, for their network. 297 00:23:52,570 --> 00:23:57,730 GitHub for cloning all these things into GitHub repositories for more data backups. 298 00:23:57,930 --> 00:24:02,290 Sort of of interest at the bottom there, you can see they had a grok key and an xai key. 299 00:24:02,630 --> 00:24:11,370 They were using those to, as we'll talk about later, help them develop this service, because who doesn't love a little AI-assisted development? 300 00:24:11,370 --> 00:24:14,970 But if you're in the People's Republic of China, a lot of those systems are blocked. 301 00:24:14,970 --> 00:24:18,030 So they were using their own network to do that kind of thing. 302 00:24:20,390 --> 00:24:21,370 Emails. 303 00:24:21,370 --> 00:24:23,710 Like I said earlier, they had a lot of emails. 304 00:24:23,710 --> 00:24:26,150 Definitely at least 50, probably more. 305 00:24:26,510 --> 00:24:27,690 There were a lot. 306 00:24:27,690 --> 00:24:35,410 And as Zane mentioned, our note-taking system is roughly Discord, a Google Doc, and also Notepad on one of our computers. 307 00:24:35,410 --> 00:24:39,330 So finding out all of the email addresses we saw was a hard challenge. 308 00:24:39,450 --> 00:24:44,190 But those ones on the slide are definitely the most frequent that we saw throughout. 309 00:24:44,190 --> 00:24:51,390 They also had tooling to create new email addresses on common free email service providers, so Outlook and Gmail. 310 00:24:51,670 --> 00:24:53,690 They also had social media accounts. 311 00:24:53,690 --> 00:24:55,830 They had two Twitter accounts, two Facebook accounts. 312 00:24:55,830 --> 00:25:00,250 On the slide, you can see a screenshot of Coral86's Twitter account. 313 00:25:00,250 --> 00:25:06,470 That is the only activity on his Twitter account, so I guess they're just all about Pokemon. 314 00:25:09,650 --> 00:25:13,170 That still isn't the total story of all of their credentials. 315 00:25:13,170 --> 00:25:20,010 They also had an API to serve credentials to either themselves or their users, depending on how they architected their system. 316 00:25:20,010 --> 00:25:22,610 You can see the list of things they provided for there. 317 00:25:22,730 --> 00:25:26,850 One note of interest is they don't just have API keys in there. 318 00:25:26,850 --> 00:25:34,850 You can also see they have browser cookies and browser fingerprints, so they don't stop at just put a session ID in there and use the session cookie. 319 00:25:34,850 --> 00:25:52,430 They actually persist what the browser fingerprint should be so they don't get detected either by malicious account detections for the infrastructure they're spinning up, or if they stole a session ID from a user, they can impersonate the fingerprint of that browser as well in a sort of automated fashion. 320 00:25:56,100 --> 00:25:59,700 More on the services they offered to the users of this network. 321 00:25:59,700 --> 00:26:03,100 They organized those services into what they called workgroups. 322 00:26:03,100 --> 00:26:06,160 The big ones were the social workgroup, which is Headless Chrome. 323 00:26:06,160 --> 00:26:09,740 We suspect it was used to manage their social media accounts. 324 00:26:09,740 --> 00:26:17,220 Their op stations, which had Visual Studio Code Web and TTYD, which is just a website that is a terminal on the target box. 325 00:26:17,220 --> 00:26:30,980 They had a scraper workgroup, which via calling third -party APIs and just using its own exit would scrape a website and give you back , I want to say, both the contents in raw form and also take screenshots if you asked it to. 326 00:26:30,980 --> 00:26:36,240 And then all nodes would run SSH and VNC, presumably for administrative purposes. 327 00:26:38,940 --> 00:26:44,480 So the way that they would access these nodes is their central hub server would do a reverse port forward . 328 00:26:44,480 --> 00:26:49,240 So the pattern would be that you'd have your three-digit node ID, so, you know, node 1, 2, 3. 329 00:26:49,260 --> 00:26:53,620 And then the last two numbers on the port would be the service you're going to. 330 00:26:53,620 --> 00:26:59,980 So port 22, SSH, that's kind of an obvious one, so 1, 2, 3, 22 would let you SSH to node 1, 2, 3. 331 00:27:00,520 --> 00:27:02,280 You can see the list of services there. 332 00:27:02,280 --> 00:27:05,540 The sort of interesting callout is port 90 down there. 333 00:27:05,540 --> 00:27:12,920 If you go to it, you'd get a bounce from the great firewall basically saying, like, this website isn't registered, you're not allowed to go to it. 334 00:27:12,960 --> 00:27:17,320 It's probably an actual service, but I couldn't tell you what it is because I can't access it. 335 00:27:21,480 --> 00:27:23,120 More on node numbering. 336 00:27:23,120 --> 00:27:28,440 They had in their notes for us nice documentation on how they assign those numbers to nodes. 337 00:27:28,440 --> 00:27:33,020 It looks like they break them down by the type of runner, the type of cloud provider they're running on. 338 00:27:33,020 --> 00:27:35,900 So, like, HuggingFace is 42X. 339 00:27:35,940 --> 00:27:39,700 On the left there, you can see the config for one of their HuggingFace nodes. 340 00:27:39,700 --> 00:27:45,800 You can see their HuggingFace API key, the repo they're running, and a couple other bits of information about it. 341 00:27:46,160 --> 00:27:55,920 You can also see in the bottom right screenshot, if it's big enough, I don't know if it is for you guys, but the workgroups that were assigned to nodes were also specific to where they were running. 342 00:27:55,920 --> 00:28:02,560 So the HuggingFace node, for example, is always in the Chrome workgroup, not anything else. 343 00:28:04,700 --> 00:28:11,460 As Zane mentioned previously, we did discover that they had one malicious PIP package that they'd upload called PTMPL. 344 00:28:11,460 --> 00:28:17,400 It downloaded a script from one of their domains, which is how we were able to find it on VirusTotal, and just executed it. 345 00:28:17,400 --> 00:28:20,740 So, good old-fashioned malicious PIP package, nothing too fancy there. 346 00:28:20,860 --> 00:28:28,160 It also had this post install hook that's up on the slide of, again, just download something from the internet and run it as a Python script. 347 00:28:28,920 --> 00:28:35,360 You can see on the bottom there, me sharing it with Zane and him looking at it on his phone and saying, I don't know, it's just Python, man. 348 00:28:35,980 --> 00:28:39,320 And then when we looked at it more, he did say, yeah, no, that's real bad. 349 00:28:42,980 --> 00:28:52,980 As a treat, we also found out that they were running something called BTPanel, which is sort of a People's Republic of China native cPanel equivalent. 350 00:28:53,100 --> 00:28:55,560 So we did a little vulnerability research on that. 351 00:28:55,560 --> 00:29:09,060 It is a Python Flask web app, and we were able to find two instances where if you were man-in-the-middle, you could get a remote code execution as root, one of which is patched, that first one, where they would download a PAM module, a pluggable authentication module over plain text. 352 00:29:09,060 --> 00:29:14,600 So you could just give them a malicious PAM module, and that will execute as root the next time someone tries to log into the system. 353 00:29:15,300 --> 00:29:26,040 And then their update and install script also fetches some RPMs and some tarballs over HTTP, and it's an update or install script, so it runs as root, so you can, again, get code execution through that. 354 00:29:26,600 --> 00:29:28,500 That one is still not patched as of July. 355 00:29:28,500 --> 00:29:31,480 It might be patched now, I don't know, I haven't checked since then. 356 00:29:32,040 --> 00:29:41,600 And then the third class of vulnerabilities, because it's really two, is that they implemented multi-factor auth, just that, well, they didn't implement multi-factor auth, I think is the key there. 357 00:29:42,160 --> 00:29:54,320 They used the same time-based one-time password key for all users, so if you registered with their panel, you could just sign up your authenticator, and then you know the authentication code for every user of that panel. 358 00:29:54,520 --> 00:30:06,440 And then their one-time password for SSH access is actually just a static credential, so if you get it once, it'll be valid until the heat death of the universe, I suppose, or a bit before the flip on the computer. 359 00:30:07,120 --> 00:30:12,220 And then there is a lot of weird memory safety stuff that just looks hinky, but we didn't decide to look into more. 360 00:30:12,220 --> 00:30:21,540 If you want more details on BT panel and what it looks like from a security standpoint, I did a blog post in collaboration with SSD Disclosure with the link at the bottom there. 361 00:30:25,150 --> 00:30:32,230 So I hinted at this earlier, turns out vibe coding also is alive and well for people trying to spin up infrastructure like this. 362 00:30:32,470 --> 00:30:43,690 In their backups, they had database logs and just chat logs with large language models for assistance in trying to dev out this network, the system they built. 363 00:30:44,390 --> 00:30:48,470 Part of the cool part for them, I guess, is because they'd already built parts of the network. 364 00:30:48,470 --> 00:30:59,810 They could use it to access models and APIs that are not available within the People's Republic of China, so like open AI models, they could access those even though there's an IP block if you're in the People's Republic of China. 365 00:30:59,870 --> 00:31:03,130 Some of those logs are in simplified Chinese, which we just threw in Google Translate. 366 00:31:03,130 --> 00:31:06,290 I can't read simplified Chinese, and some were in English. 367 00:31:06,350 --> 00:31:12,170 And there's low amounts of evidence, one piece of evidence suggesting that they were using Cursor specifically for their development. 368 00:31:13,990 --> 00:31:15,810 Here's some screenshots of their chat logs. 369 00:31:15,810 --> 00:31:18,830 I hope it's big enough that you can see it, but I sort of doubt it. 370 00:31:18,830 --> 00:31:26,070 If you pull up the slide later, you can see on the left, they're asking for help developing a new feature for their network. 371 00:31:26,070 --> 00:31:33,030 In the middle there, they're asking the chatbot how to set up their directory so Cursor can best help them develop new services. 372 00:31:33,230 --> 00:31:39,490 And then on the right, I want to say they were talking through new ideas of services to offer through their infrastructure. 373 00:31:39,550 --> 00:31:42,130 So, some kind of amusing bits there. 374 00:31:44,470 --> 00:31:51,310 Summing it all up, Zane mentioned earlier the last update we saw to a Mac container was on the 20th of June. 375 00:31:51,530 --> 00:31:59,530 They did implement encryption finally for their data, but because we already knew their password generation scheme, we could just decrypt it and access it again. 376 00:31:59,530 --> 00:32:05,050 So that was cool for us that we'd gotten in early enough to make their encryption worthless. 377 00:32:05,110 --> 00:32:08,010 It did include new Git repos and some new email addresses. 378 00:32:08,310 --> 00:32:18,290 And as far as takeaways, if you're publishing to Docker, you probably want to make sure that they're not public containers because a lot of Docker containers contain information that is meant to be secret. 379 00:32:18,690 --> 00:32:24,490 Git files, like we mentioned, we found a bunch of API keys, so many crypto trading bots, so, so many. 380 00:32:24,650 --> 00:32:29,510 We did report that to Docker with the recommendation of have a default Docker ignore, I think. 381 00:32:30,270 --> 00:32:32,170 They never really responded. 382 00:32:32,170 --> 00:32:35,690 They confirmed receipt, and then we didn't hear from them until we told them we were presenting. 383 00:32:37,630 --> 00:32:50,450 We also reported to GitHub and GitLab, as Zane mentioned, that they include the credentials in the .git config by default, and it'd be great if they could implement a change to not have a plain text credential on the file system. 384 00:32:50,890 --> 00:32:57,770 They also never responded, or said that they didn't view it as an issue because it's a configuration problem, which it is. 385 00:32:58,450 --> 00:33:02,490 And then the final takeaway is, like, the cloud's not just for good guys. 386 00:33:02,490 --> 00:33:15,990 People are using cloud platforms, including free tiers, to build out infrastructure that will be used to attack or even just do weird social media stuff on the internet, like that Pokemon tweet. 387 00:33:18,480 --> 00:33:20,700 And that's all we got. 388 00:33:20,820 --> 00:33:25,640 We'll be available for questions or comments or just to chat off to the side. 389 00:33:26,500 --> 00:33:28,140 Thank you all for coming.