WEBVTT

00:00.000 --> 00:01.900
And we're doing the 11 o'clock talk.

00:02.220 --> 00:03.640
It's you guys right here.

00:04.280 --> 00:06.540
And the talk is basically...

00:06.540 --> 00:07.360
Oops.

00:07.500 --> 00:13.520
Inside Look at a Chinese Operational Relay Network with MTU and Earl.

00:13.520 --> 00:15.220
All right, guys, kick it off.

00:15.680 --> 00:16.440
Thanks.

00:22.090 --> 00:23.270
All right.

00:23.630 --> 00:24.310
Hello, everyone.

00:24.310 --> 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.

00:33.190 --> 00:34.850
A quick overview.

00:34.870 --> 00:37.350
We're going to obviously introduce ourselves and what we did.

00:37.350 --> 00:42.410
We're going to talk about some secrets discovery in Docker, which was the source of all of our stuff.

00:42.470 --> 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.

00:50.970 --> 00:56.810
How they made their infrastructure work and what their infrastructure was made to provide to their users.

00:57.750 --> 01:03.670
By way of introduction, I'm Michael Torres, also known as MTU, and I am just another dude...

01:07.010 --> 01:09.070
You're working on it, or do you need me to do something?

01:10.070 --> 01:11.390
Do you need me to do something?

01:14.300 --> 01:14.980
Okay.

01:14.980 --> 01:16.440
As long as you get it fixed.

01:17.900 --> 01:18.920
I guess I'm...

01:20.160 --> 01:21.380
The slides are not up.

01:21.380 --> 01:22.780
Just keep on talking, I guess.

01:22.780 --> 01:24.700
Well, I'm going to try to restart the show.

01:24.820 --> 01:28.360
Slide it over to the right.

01:28.360 --> 01:29.500
Go back to regular view.

01:30.140 --> 01:31.700
Maybe slide it over that way.

01:32.780 --> 01:33.460
No?

01:33.620 --> 01:33.900
No?

01:33.900 --> 01:36.160
All right.

01:36.160 --> 01:36.860
That's right.

01:38.320 --> 01:40.660
I'm going to have a duplicate, yeah.

01:41.020 --> 01:42.280
With a view.

01:45.700 --> 01:47.240
This is not ideal.

01:48.300 --> 01:49.400
Let me try.

01:49.780 --> 01:51.180
Sorry about that.

01:55.360 --> 01:57.520
We'll go quick for...

01:57.520 --> 01:58.200
Just...

01:58.200 --> 01:58.720
Yeah.

01:59.520 --> 02:01.240
All right, sounds good.

02:01.900 --> 02:03.680
So yeah, Michael, another dude.

02:04.840 --> 02:05.920
Hi, and I'm Zane.

02:05.920 --> 02:06.900
I'm a dude.

02:09.240 --> 02:11.780
I will apologize about my voice.

02:12.080 --> 02:13.760
It is gone.

02:14.380 --> 02:15.500
How does this work?

02:17.660 --> 02:18.380
Cool.

02:18.380 --> 02:20.300
So I'm going to talk about kind of the...

02:20.300 --> 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.

02:30.700 --> 02:37.980
So originally this research was kind of thought about at DEF CON 32.

02:37.980 --> 02:47.140
We watched a demo for the Docker exploitation framework, which showed that you can identify whiteouted files in container images.

02:47.140 --> 02:54.600
Which is basically if you delete a file from your image, it still exists in the full image tarball.

02:54.600 --> 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.

03:04.980 --> 03:11.160
So, you know, things like the .env, passwords, SSH keys, and the like.

03:11.520 --> 03:13.640
The display's not working, so it's okay.

03:14.060 --> 03:15.500
I need to see the next slide.

03:26.060 --> 03:29.100
So yeah, sorry, we don't have the slides up here either.

03:29.100 --> 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.

03:44.800 --> 03:46.400
I need to see.

03:47.320 --> 03:49.200
Sorry about this, guys.

03:49.200 --> 03:50.040
It's all good?

03:50.100 --> 03:51.240
No, I don't know.

03:51.240 --> 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.

04:02.860 --> 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.

04:11.340 --> 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.

04:28.200 --> 04:31.800
So we started to get a lot of... yeah, sorry.

04:31.800 --> 04:34.080
We started to get a lot of data.

04:34.080 --> 04:42.920
At the bottom, if you can see the slides now, we had 240,000 total Elasticsearch indexes for our found data.

04:42.920 --> 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.

04:48.680 --> 04:50.160
But it's just the two of us.

04:50.160 --> 04:52.020
We have short attention span.

04:57.050 --> 04:58.310
Hi, everybody.

04:59.210 --> 05:01.270
Sorry about the technical difficulties.

05:02.250 --> 05:05.530
Video in this kind of a format is a real pain in the butt.

05:05.530 --> 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?

05:14.430 --> 05:15.770
Video is hard.

05:16.570 --> 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.

05:21.630 --> 05:23.930
I got confidence that we're going to be good.

05:24.110 --> 05:27.190
These gentlemen got a little bit off their game.

05:27.870 --> 05:29.610
Let's give them a big welcome.

05:29.610 --> 05:33.110
Let's have them start again and relax.

05:33.110 --> 05:33.970
Yeah.

05:38.750 --> 05:39.370
Awesome.

05:39.370 --> 05:41.170
Are we going back to the intro slide?

05:41.170 --> 05:42.830
Start wherever you want to.

05:42.830 --> 05:43.970
Your slides work.

05:43.970 --> 05:45.070
Get back on your game.

05:45.070 --> 05:45.910
Give your best shit.

05:45.910 --> 05:46.790
Have a good time, all right?

05:46.790 --> 05:47.290
Yeah.

05:48.130 --> 05:49.490
Do you want me to start again?

05:49.490 --> 05:49.990
Yeah.

05:49.990 --> 05:51.030
I mean, sure.

05:51.230 --> 05:52.450
You can introduce yourself.

05:52.450 --> 05:52.970
All right.

05:52.970 --> 05:54.150
So let's try this again.

05:54.150 --> 05:58.250
So like I mentioned, inside look at a PRC operational relay network.

05:58.250 --> 05:59.530
My name is Michael Torres.

05:59.530 --> 06:00.910
I'm just another dude.

06:00.910 --> 06:06.170
We're going to go over the research we started on how to find secrets in Docker Hub images.

06:06.170 --> 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.

06:17.730 --> 06:18.690
Cool.

06:18.970 --> 06:21.110
Yeah, and once again, I am a dude.

06:21.810 --> 06:28.390
So yeah, I was inspired by the Docker exploitation framework from DEF CON last year.

06:28.390 --> 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.

06:39.810 --> 06:46.170
And so we wanted to start scanning at the biggest scale we could to identify whiteouted data.

06:46.170 --> 06:53.510
So data that people had in their container images that they thought they had deleted and it's still there.

06:53.950 --> 06:57.630
So we started in our hotel room scanning at scale.

06:57.630 --> 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.

07:04.770 --> 07:07.230
Unfortunately, we didn't get that many findings.

07:07.230 --> 07:10.750
I think we got like a total of five while we were at DEF CON.

07:10.750 --> 07:17.270
So we quickly pivoted to looking for more broad API keys, SSH keys, passwords, and the like.

07:17.850 --> 07:19.570
And we were getting a lot of data.

07:19.570 --> 07:22.850
At the bottom, 240,000 total findings.

07:22.850 --> 07:27.650
A lot of that's going to be false positives, so example keys and stuff like that.

07:27.930 --> 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.

07:40.250 --> 07:41.530
So that was kind of cool.

07:43.150 --> 07:46.210
We have a short attention span that's allotted out a lot of false positives.

07:46.210 --> 07:49.650
We're not going to look through 240,000 total findings by ourselves.

07:49.650 --> 07:56.150
So we start looking into optimizing our tools so we can get less false positives.

07:56.490 --> 07:58.270
But that's a lot of work.

07:58.270 --> 08:00.630
We were seeing a lot of the same stuff over and over again.

08:00.630 --> 08:07.030
And it's only so exciting seeing the same crypto trading bots for the 10th time that morning.

08:08.470 --> 08:13.570
In the middle of our testing, we were pulling I think 5,000 containers a day.

08:13.570 --> 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.

08:22.550 --> 08:24.370
And we were hitting a lot more than that.

08:24.570 --> 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.

08:33.110 --> 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.

08:42.330 --> 08:45.870
Which coincidentally was about what we were hitting.

08:45.870 --> 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.

08:52.370 --> 08:54.910
So yeah, that was just a fun little slide.

08:54.910 --> 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.

08:59.510 --> 09:05.790
I had previously done some work identifying publicly accessible private Git repositories.

09:05.790 --> 09:09.190
So a lot of the times, it's like a Google dork.

09:09.190 --> 09:15.790
You can look for a .git on a website and you'll go to mycoolwebsite.com forward slash .git.

09:15.790 --> 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.

09:28.790 --> 09:30.930
I'm not sure how people are messing that up.

09:30.930 --> 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.

09:39.450 --> 09:47.350
But we wanted to start, instead of looking at the broad like regex scale, start looking for .git slash config.

09:47.350 --> 09:53.730
So then we could identify if there was like a private repository inside of this container.

09:54.290 --> 10:00.570
So a little background on how to containerize an application if somebody here has never containerized an app.

10:00.570 --> 10:06.930
If you Google search how to containerize an application, Docker provides a nice little workshop.

10:07.110 --> 10:12.030
And the TLDR of it is that they want you to do a Git clone from your repository.

10:12.450 --> 10:14.270
You'll create a Docker file.

10:14.350 --> 10:18.770
Inside your Docker file, you'll base it off of, you know, a normal image, so like from Ubuntu.

10:18.870 --> 10:20.970
And then do a copy dot dot.

10:21.330 --> 10:25.010
Copy dot dot is really cool because it will pull in everything.

10:25.010 --> 10:25.770
It makes sense.

10:25.770 --> 10:27.690
That's exactly what you're telling it to do.

10:27.690 --> 10:31.550
But it will also pull in hidden files and directories.

10:31.790 --> 10:35.130
So that's how people are putting their .envs inside of their containers.

10:35.310 --> 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.

10:44.210 --> 10:49.350
So, you know, like the CI pipeline would do a build push job.

10:49.350 --> 10:50.790
It's going to clone your repository.

10:50.790 --> 10:56.310
It's going to build your container, copy in everything, including your repository, and then push it to Docker Hub.

10:56.310 --> 11:03.790
So if you have a private repo and then you're pushing to a public Docker image, that's no good.

11:04.210 --> 11:06.450
There's some other interesting things in here.

11:06.450 --> 11:09.290
In the .git config, like I said, it will have the remote URL.

11:09.290 --> 11:13.270
So you can query that to identify if it's a private repository or not.

11:14.410 --> 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.

11:23.370 --> 11:26.590
Those are short-lived for the length of the job.

11:27.230 --> 11:31.510
And then generally, you know, it would also need write permissions to do anything fun with.

11:32.050 --> 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.

11:43.030 --> 11:44.530
So we have a demo.

11:45.270 --> 11:47.070
I'm not sure if it'll play on here.

11:47.070 --> 11:48.090
Can you help me?

11:49.990 --> 11:51.130
So, yeah.

11:52.030 --> 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.

12:06.190 --> 12:08.090
Oh, that's wrong screen.

12:08.090 --> 12:09.110
Sorry about that.

12:09.190 --> 12:10.050
Just keep talking.

12:10.050 --> 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,

12:28.110 --> 12:33.930
you know, have your code that you've pushed to their repo inside of their public Docker image.

12:33.930 --> 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.

12:40.690 --> 12:45.370
So right here, we're just, you know, scanning for the change in Docker Hub.

12:45.450 --> 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.

12:51.750 --> 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.

13:02.090 --> 13:03.070
Start talking.

13:03.210 --> 13:04.550
I don't know what slide it is.

13:04.610 --> 13:08.910
So on this slide, we're going to go over some of the metrics.

13:08.910 --> 13:15.650
So in total, we pulled a little over 80,000 containers during this three-month time period starting last August.

13:15.650 --> 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.

13:28.630 --> 13:32.010
That's basically anything that wasn't returning a status code 200.

13:32.650 --> 13:34.810
So we're looking for 404s on GitHub.

13:34.810 --> 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.

13:41.030 --> 13:45.210
We also got some redirects for like Git at company name.com.

13:45.210 --> 13:54.710
So some companies, their private internal Gits were being pushed to their public container images, which was also fun.

13:55.110 --> 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.

14:05.050 --> 14:10.650
A Russian dash cam manufacturer and a security vendor's private detection rules.

14:10.890 --> 14:14.370
We had reported as much as we could for all of these findings.

14:14.370 --> 14:15.990
Unfortunately, nobody ever responded.

14:15.990 --> 14:20.810
And we even emailed the, like, last commit author from the Git log.

14:20.810 --> 14:23.010
So it was super easy to report.

14:23.530 --> 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.

14:31.830 --> 14:35.270
We have the very top one is actually a personal access token.

14:35.270 --> 14:39.870
So going back a few slides for that demo of the CI job to push to Docker Hub.

14:39.870 --> 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.

14:46.870 --> 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.

14:58.370 --> 15:00.010
So just a cool metric.

15:01.090 --> 15:02.850
All right, we're going to start talking.

15:02.850 --> 15:07.890
That was the background on the research we did, how we did it, and how we got to finding Mac.

15:08.890 --> 15:14.150
There was one Docker Hub user that was pushing multiple containers a day.

15:14.150 --> 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.

15:21.150 --> 15:25.010
So our automated tooling would alert us that we got new findings.

15:25.870 --> 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.

15:36.970 --> 15:42.530
They had a boatload of data labeled like backups that they were just pushing.

15:43.030 --> 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.

15:48.850 --> 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.

16:02.230 --> 16:06.090
There was hundreds of image tags per container.

16:06.490 --> 16:08.550
So a couple gigs per container.

16:08.550 --> 16:11.390
You know, you got a couple hundred tags per container.

16:11.390 --> 16:13.610
It's a lot of data for us to look through.

16:13.610 --> 16:18.350
So we saw it, and we thought it was kind of neat, but didn't look too far into it.

16:18.350 --> 16:19.690
Here's a Discord message.

16:19.690 --> 16:23.350
I like to go to bed pretty early, so Michael was up at 10.40 p.m.

16:23.350 --> 16:25.570
I'd probably been asleep for a few hours.

16:25.910 --> 16:30.270
But he had taken another look at these containers because we just kept getting hits on them.

16:30.330 --> 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.

16:44.530 --> 16:47.910
So that piqued our interest almost immediately.

16:47.910 --> 16:49.170
It was super interesting.

16:49.170 --> 16:53.590
So we wanted to look more into these containers and see what we could learn about their infrastructure.

16:54.930 --> 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.

17:03.370 --> 17:07.170
Starting on the left, they have a couple different providers that they use for storage.

17:07.170 --> 17:10.930
So Docker Hub is not the only free cloud storage you can use.

17:10.930 --> 17:15.950
They were also using Mega and GitHub repos actually to store data.

17:16.570 --> 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.

17:21.610 --> 17:25.910
But they have like traditional VMs and then more like serverless compute.

17:25.910 --> 17:27.950
So they were using stuff like GitHub Actions.

17:28.430 --> 17:30.830
We have the databases on the right-hand side as well.

17:30.830 --> 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.

17:36.690 --> 17:41.490
But we're going to go over first what we found and what we believe it is.

17:41.810 --> 17:47.990
So with a somewhat high confidence, we believe it to be a PRC-based operational relay box network.

17:48.370 --> 17:53.750
And that's basically a bunch of stuff proxying for bad actors.

17:53.750 --> 18:01.630
There's a Google link for Chinese Nexus actors using similar networks to do malicious things on the internet.

18:01.630 --> 18:04.450
So you can read that if you would like.

18:04.830 --> 18:09.770
We believe there's more than one person involved in the development and operations of this infrastructure.

18:09.770 --> 18:15.950
We observed messages in their database backups in these containers between multiple personas.

18:16.310 --> 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.

18:25.030 --> 18:28.290
So we would actually love if anybody knows what it is.

18:29.150 --> 18:31.850
And it's been in development since 2022.

18:32.270 --> 18:36.790
Last year, like I said, they were updating almost daily, several times a day.

18:36.790 --> 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.

18:43.790 --> 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.

18:53.890 --> 18:58.630
They also have some tooling to create and manage the social media accounts, pointing us to that.

18:59.210 --> 19:00.450
Low confidence.

19:00.450 --> 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.

19:09.050 --> 19:14.550
But we did see they have tooling and proof that they had one malicious PyPy package.

19:14.550 --> 19:16.930
That is a virus total link to the package.

19:16.930 --> 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.

19:24.370 --> 19:30.310
It looked like it was more for a test, but shows that the infrastructure was in place to use those things.

19:32.070 --> 19:39.170
So the network tunneling protocols that they were using, they used NPS for their node hub C2 infrastructure.

19:39.250 --> 19:44.330
And then on the bottom right, we have a little screen grab of them modifying the FRP fingerprint.

19:44.390 --> 19:47.350
They changed all the key names on that.

19:47.450 --> 19:53.650
And then they used a couple of different providers to obscure their C2 destination IPs.

19:55.110 --> 20:03.970
And then they also, yeah, they had the full VMs for, you know, serverless and full VM access.

20:05.830 --> 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.

20:13.670 --> 20:16.890
So the top three are their main, like, hub domains.

20:17.050 --> 20:19.870
We've defanged them, but those are them.

20:20.150 --> 20:23.970
The bottom one, or the middle one, sorry, the private services are a little interesting.

20:24.290 --> 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.

20:42.710 --> 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.

20:51.110 --> 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.

20:56.830 --> 20:59.730
The top one being, you know, Cracked Cobalt Strike.

20:59.730 --> 21:05.790
So, pointing to them using this infrastructure for more nefarious things, but...

21:09.750 --> 21:16.710
As far as data persistence, Zane mentioned earlier, they have a lot of different cloud services they were saving data to.

21:16.710 --> 21:19.210
Probably the largest by volume was TerraCloud.

21:19.210 --> 21:21.610
They had a WebDAV share set up there.

21:21.610 --> 21:24.990
Obviously, Docker Hub Images, that's how we got our initial access.

21:24.990 --> 21:27.370
They were all about uploading data there.

21:27.490 --> 21:33.290
GitHub repositories, Hugging Face Spaces, Backblaze Buckets, and one instance of a OneDrive.

21:33.450 --> 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.

21:43.870 --> 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.

21:54.150 --> 21:55.710
So we went ahead and did that.

21:55.710 --> 22:02.390
That bottom left screenshot has an email address that ends, like the host name is host.ac.cn.

22:02.490 --> 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.

22:08.150 --> 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.

22:13.870 --> 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.

22:22.150 --> 22:25.470
I want to say it went back to China Telecom or something like that.

22:28.780 --> 22:32.640
The most exciting part for us was access to these credentials.

22:32.640 --> 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.

22:41.620 --> 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.

22:47.580 --> 22:49.480
So great security practices there.

22:49.480 --> 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.

22:56.360 --> 23:01.280
So we were able to figure out that they followed a pretty standard template for all of their passwords.

23:01.780 --> 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.

23:09.980 --> 23:14.000
So for the user temp0230, the letter was a T.

23:14.000 --> 23:17.280
For coral86, it was a capital C and a capital O.

23:17.900 --> 23:18.800
There's a hash there.

23:18.800 --> 23:20.300
It has a special little salt.

23:20.300 --> 23:23.460
If you want to try to crack it, then you'll have their actual passwords.

23:23.760 --> 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.

23:32.680 --> 23:34.740
That was how they were generating their passwords.

23:37.950 --> 23:38.890
That wasn't it.

23:38.890 --> 23:43.950
They also had just plain text API keys all throughout their notes and through their code.

23:43.950 --> 23:47.170
You can see the top players there are definitely Heroku and GitHub.

23:47.490 --> 23:52.530
Heroku for running their exit nodes, if you want to call them that, for their network.

23:52.570 --> 23:57.730
GitHub for cloning all these things into GitHub repositories for more data backups.

23:57.930 --> 24:02.290
Sort of of interest at the bottom there, you can see they had a grok key and an xai key.

24:02.630 --> 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?

24:11.370 --> 24:14.970
But if you're in the People's Republic of China, a lot of those systems are blocked.

24:14.970 --> 24:18.030
So they were using their own network to do that kind of thing.

24:20.390 --> 24:21.370
Emails.

24:21.370 --> 24:23.710
Like I said earlier, they had a lot of emails.

24:23.710 --> 24:26.150
Definitely at least 50, probably more.

24:26.510 --> 24:27.690
There were a lot.

24:27.690 --> 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.

24:35.410 --> 24:39.330
So finding out all of the email addresses we saw was a hard challenge.

24:39.450 --> 24:44.190
But those ones on the slide are definitely the most frequent that we saw throughout.

24:44.190 --> 24:51.390
They also had tooling to create new email addresses on common free email service providers, so Outlook and Gmail.

24:51.670 --> 24:53.690
They also had social media accounts.

24:53.690 --> 24:55.830
They had two Twitter accounts, two Facebook accounts.

24:55.830 --> 25:00.250
On the slide, you can see a screenshot of Coral86's Twitter account.

25:00.250 --> 25:06.470
That is the only activity on his Twitter account, so I guess they're just all about Pokemon.

25:09.650 --> 25:13.170
That still isn't the total story of all of their credentials.

25:13.170 --> 25:20.010
They also had an API to serve credentials to either themselves or their users, depending on how they architected their system.

25:20.010 --> 25:22.610
You can see the list of things they provided for there.

25:22.730 --> 25:26.850
One note of interest is they don't just have API keys in there.

25:26.850 --> 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.

25:34.850 --> 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.

25:56.100 --> 25:59.700
More on the services they offered to the users of this network.

25:59.700 --> 26:03.100
They organized those services into what they called workgroups.

26:03.100 --> 26:06.160
The big ones were the social workgroup, which is Headless Chrome.

26:06.160 --> 26:09.740
We suspect it was used to manage their social media accounts.

26:09.740 --> 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.

26:17.220 --> 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.

26:30.980 --> 26:36.240
And then all nodes would run SSH and VNC, presumably for administrative purposes.

26:38.940 --> 26:44.480
So the way that they would access these nodes is their central hub server would do a reverse port forward .

26:44.480 --> 26:49.240
So the pattern would be that you'd have your three-digit node ID, so, you know, node 1, 2, 3.

26:49.260 --> 26:53.620
And then the last two numbers on the port would be the service you're going to.

26:53.620 --> 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.

27:00.520 --> 27:02.280
You can see the list of services there.

27:02.280 --> 27:05.540
The sort of interesting callout is port 90 down there.

27:05.540 --> 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.

27:12.960 --> 27:17.320
It's probably an actual service, but I couldn't tell you what it is because I can't access it.

27:21.480 --> 27:23.120
More on node numbering.

27:23.120 --> 27:28.440
They had in their notes for us nice documentation on how they assign those numbers to nodes.

27:28.440 --> 27:33.020
It looks like they break them down by the type of runner, the type of cloud provider they're running on.

27:33.020 --> 27:35.900
So, like, HuggingFace is 42X.

27:35.940 --> 27:39.700
On the left there, you can see the config for one of their HuggingFace nodes.

27:39.700 --> 27:45.800
You can see their HuggingFace API key, the repo they're running, and a couple other bits of information about it.

27:46.160 --> 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.

27:55.920 --> 28:02.560
So the HuggingFace node, for example, is always in the Chrome workgroup, not anything else.

28:04.700 --> 28:11.460
As Zane mentioned previously, we did discover that they had one malicious PIP package that they'd upload called PTMPL.

28:11.460 --> 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.

28:17.400 --> 28:20.740
So, good old-fashioned malicious PIP package, nothing too fancy there.

28:20.860 --> 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.

28:28.920 --> 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.

28:35.980 --> 28:39.320
And then when we looked at it more, he did say, yeah, no, that's real bad.

28:42.980 --> 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.

28:53.100 --> 28:55.560
So we did a little vulnerability research on that.

28:55.560 --> 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.

29:09.060 --> 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.

29:15.300 --> 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.

29:26.600 --> 29:28.500
That one is still not patched as of July.

29:28.500 --> 29:31.480
It might be patched now, I don't know, I haven't checked since then.

29:32.040 --> 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.

29:42.160 --> 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.

29:54.520 --> 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.

30:07.120 --> 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.

30:12.220 --> 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.

30:25.150 --> 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.

30:32.470 --> 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.

30:44.390 --> 30:48.470
Part of the cool part for them, I guess, is because they'd already built parts of the network.

30:48.470 --> 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.

30:59.870 --> 31:03.130
Some of those logs are in simplified Chinese, which we just threw in Google Translate.

31:03.130 --> 31:06.290
I can't read simplified Chinese, and some were in English.

31:06.350 --> 31:12.170
And there's low amounts of evidence, one piece of evidence suggesting that they were using Cursor specifically for their development.

31:13.990 --> 31:15.810
Here's some screenshots of their chat logs.

31:15.810 --> 31:18.830
I hope it's big enough that you can see it, but I sort of doubt it.

31:18.830 --> 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.

31:26.070 --> 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.

31:33.230 --> 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.

31:39.550 --> 31:42.130
So, some kind of amusing bits there.

31:44.470 --> 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.

31:51.530 --> 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.

31:59.530 --> 32:05.050
So that was cool for us that we'd gotten in early enough to make their encryption worthless.

32:05.110 --> 32:08.010
It did include new Git repos and some new email addresses.

32:08.310 --> 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.

32:18.690 --> 32:24.490
Git files, like we mentioned, we found a bunch of API keys, so many crypto trading bots, so, so many.

32:24.650 --> 32:29.510
We did report that to Docker with the recommendation of have a default Docker ignore, I think.

32:30.270 --> 32:32.170
They never really responded.

32:32.170 --> 32:35.690
They confirmed receipt, and then we didn't hear from them until we told them we were presenting.

32:37.630 --> 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.

32:50.890 --> 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.

32:58.450 --> 33:02.490
And then the final takeaway is, like, the cloud's not just for good guys.

33:02.490 --> 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.

33:18.480 --> 33:20.700
And that's all we got.

33:20.820 --> 33:25.640
We'll be available for questions or comments or just to chat off to the side.

33:26.500 --> 33:28.140
Thank you all for coming.

