WEBVTT

00:02.420 --> 00:04.840
Well, thank you for waiting.

00:05.160 --> 00:08.980
It was, uh, quite intense from the, the stage.

00:08.980 --> 00:09.840
All right.

00:10.380 --> 00:13.280
So, thank you very much for attending this talk.

00:13.320 --> 00:16.580
Uh, I hope you will find it, uh, enjoyable.

00:16.580 --> 00:22.920
It's, uh, it's a, it's a cool story to tell and there is a lot to cover, so buckle up.

00:27.220 --> 00:37.120
So over the past, uh, few years, the security industry, uh, you know, investigated a lot of different security incidents.

00:37.220 --> 00:45.720
But only a few of them were truly sophisticated, meaning something that was really different than what we used to be.

00:45.920 --> 00:57.680
We can talk about, for example, the SolarWinds case, the Lopetia attack, or even the 3CX, uh, supply chain attack last year.

00:58.000 --> 01:06.580
But today I want to talk about, um, another attack which surpasses even the most sophisticated we've seen before.

01:06.580 --> 01:21.920
This is, uh, an undercover operation that lasted almost three years, which is very impressive in terms of technical details, but also the social engineering aspect is very impressive as well.

01:22.180 --> 01:29.640
So I'm going to talk about the XE backdoor story, the undercover operation that set the internet on fire.

01:29.640 --> 01:39.620
And I'm pretty sure that by the end of this presentation, your definition of what is a sophisticated, uh, a sophisticated attacker is will be changed.

01:40.420 --> 01:45.080
So I'm Thomas Rocha, I'm a senior threat researcher at Microsoft.

01:45.080 --> 01:55.940
I've been working on the XE campaign when it came out by, uh, uh, Andres Freund, which is, uh, a colleague of mine, and we, we, we discovered the, the backdoor itself.

01:55.940 --> 02:03.580
I'm French, as you probably may have heard, and I'm living in Australia, so I'm, I'm good with the jet lag now because it's been a week in, uh, in Vegas already.

02:03.820 --> 02:11.220
Uh, if you want to learn more about my work, you can visit my website, securitybreak.io, or you can, you can also follow me on Twitter.

02:12.820 --> 02:17.440
What I will cover in this presentation, first, how the backdoor was found.

02:17.440 --> 02:22.020
Then I will talk about the long term operation and the timeline itself.

02:22.500 --> 02:27.620
I will then deep dive into the technical details, and we will discuss about some assumptions.

02:27.900 --> 02:33.720
And finally, I want to conclude this presentation of what it means for us, for the security industry.

02:35.540 --> 02:51.860
Okay, this story began on Friday, 29th of March, at exactly 851 minutes, and it was uh, a message sent by Andres Froon to the OSS security DL list.

02:51.860 --> 03:00.860
With the, the subject, backdoor in upstream exit, Libel ZMA leading to SSH server compromise.

03:01.480 --> 03:12.720
So that's pretty much around that time, when I saw the, the email and read the investigation, that I started to investigate more about the backdoor itself and how it was working.

03:14.060 --> 03:19.160
But before, I want to talk a little bit about Andres and how he found the, the backdoor.

03:19.160 --> 03:32.960
Because on the internet, there was a kind of a legend where everyone was saying that the backdoor was discovered because of a 500 millisecond and uh, for, from Andres that triggered the investigation.

03:33.260 --> 03:35.640
The reality is a bit different.

03:35.920 --> 03:48.000
Actually, what triggered the investigation from Andres was that he found that the SSH login in some of the tested, the testing he was doing was actually failing.

03:48.000 --> 03:56.360
So he decided to investigate a little bit more to try to understand why the SSH was, the SSH logins were actually failing.

03:56.740 --> 04:11.580
And he discovered that there was a substantial CPU usage during the SSH and he found out the 500 millisecond delay which he identified, identified later in the new package uh, XE.

04:13.820 --> 04:18.120
And he said that, he said itself, it was a bunch of coincidences.

04:18.120 --> 04:27.440
So if we, if we have a look to how he discovered the backdoor, first, he saw that there was some issue with the SSH uh, login.

04:27.500 --> 04:36.440
Then he decided to investigate and then he found uh, a little bit of uh, amount of CPU uh, using by the SSH process.

04:37.200 --> 04:46.000
So he decided to investigate a little more and he found out that this amount of CPU usage was used by the Libel ZMA.

04:46.620 --> 04:58.980
But then, that's now which is becoming a little bit crazy because he actually used some specific setup which led him to find the backdoor .

04:58.980 --> 05:09.680
First, he decided to choose a Debian unstable which at the time of the release of the, the backdoor uh, only this kind of Linux version was affected by the backdoor.

05:10.040 --> 05:12.200
Then he chose to use a specific flag.

05:12.200 --> 05:28.120
And without the flag, this flag, he wouldn't have found uh, the, the backdoor because he was actually tracing the process using Valgrind and Valgrind complaining, complained about uh, the, the processes because of the flag he was setting up before.

05:28.740 --> 05:40.780
So that's super crazy because thanks to that, he was able to investigate and to find out the high CPU usage was in the SSHD processes below get CPU ID.

05:40.860 --> 05:46.460
Keep that information in mind because it will be interesting and important for the next part of the presentation.

05:52.510 --> 05:58.150
But you may wondering, what the fuck is uh, exe, exe-utils package?

05:58.550 --> 06:10.370
So, the exe, the exe-utils package is a free software, an open source software which is dedicated for lossless data compression through SDMA algorithm and exe.

06:10.370 --> 06:20.370
It, it, it is maintained by Lasikolin which is the main maintainer of the backdoor of the, sorry, of the, of the package since more than a, than a decade .

06:20.430 --> 06:28.130
The backdoor has been found in Libel ZMA in the version of exe-560 and 561.

06:28.130 --> 06:34.430
And it was introduced by a mysterious user called Jiatan in February 2024.

06:34.830 --> 06:44.650
The, the package, uh, and the backdoor affected mostly uh, development version so it was not widely deployed when Andres found the backdoor itself.

06:44.650 --> 06:50.690
And Red Hat assigned the vulnerability CVE 2024-30-94.

06:51.290 --> 07:05.030
There is something interesting here because you may wondering as well, why the exe-utils package has in, uh, has in any relation with uh, SSH?

07:05.030 --> 07:06.350
Well, I'm glad you ask.

07:06.350 --> 07:20.870
Because actually, the exe-util uh, uh, backdoor uh, package is widely used in many Linux uh, distribution and it's a trusted open source component for pro- for compression uh, and any kind of uh, optimization.

07:22.150 --> 07:36.910
The exe-util is, has been used in the open source industry for years and which is interesting is that open SSH is using the exe-compression to reduce the size of transfer data when you are doing a connection.

07:37.930 --> 07:41.510
So, quite interesting target for an attacker.

07:43.270 --> 07:46.010
Okay, I want now to talk about the timeline.

07:46.010 --> 07:47.750
And it's a bit uh, heavy.

07:47.750 --> 07:53.570
So, what I did, I actually split the timeline into five different phases.

07:53.910 --> 08:03.250
The first phase, the first phase which I called initial involvement of GATAN from October 29, 2021 to June 2021.

08:03.270 --> 08:04.930
June 29, 2022.

08:05.730 --> 08:16.090
So, during this phase, the user GATAN started to get, started to gain trust into the exe uh, project and started to do some commit and to work a little bit more.

08:16.090 --> 08:31.950
Which is interesting is um, during that phase as well, there was, there were additional persona that was part of a kind of a pressure campaign against Lassie Collin, the main maintainer of the exe package.

08:32.430 --> 08:38.090
To move the member, the um, the maintainership to another user.

08:38.390 --> 08:48.510
So, some additional personnel, persona such as Jigar Kumar and Dennis Hance have been part of this pressure campaign to put the pressure on Lassie Collin.

08:48.790 --> 08:57.190
And in June 29 of 2022, Lassie Collin started to mention GATAN as a co-maintainer already.

08:57.530 --> 09:07.490
Then in phase two, which I call transition of mentorship from September 27 of 2022 to March 18 uh, 2023.

09:07.830 --> 09:18.590
During this time, GATAN continued to contribute to the project to gain trust with uh, with the, the main maintainer and to the project itself.

09:18.670 --> 09:29.270
On October 2022, GATAN was added to the Tukeni organization on GitHub, which is the organization uh, that released the exe package.

09:29.270 --> 09:33.130
So, and then additional event as well during this time.

09:33.130 --> 09:41.930
Then during phase three, which I call preparation for the attack from March 2023 to January 19, 2024.

09:42.190 --> 09:46.290
During this time, a bunch of information happened as well.

09:46.290 --> 09:52.690
First, GATAN uh, updates the Google OSS first to send bugs to his own email.

09:52.930 --> 10:02.110
Then, another persona, Hans Jensen, sends patches for GNU indirect uh, function features, which is quite important as well.

10:03.190 --> 10:14.690
And uh, and GATAN also disables uh, iPhone support during the OSS first build, which is quite important because it's a kind of uh, evading some, some security protections.

10:15.190 --> 10:25.450
And then during phase four, which I call backdoor insertion and distribution from February 23 uh, to March 28 of 2024.

10:25.830 --> 10:29.410
This is where GATAN started to release the backdoor.

10:29.410 --> 10:39.210
So, in February 24, GATAN merged hidden backdoor binary code in kind of test files, which are actually fake text, test files.

10:39.670 --> 10:49.010
And then he released the version 5.6.0 with an additional file that was not present in the GitHub repository itself.

10:50.190 --> 11:01.470
And in March 9, uh, GATAN committed uh, an update of the backdoor because there was a bug and then he released the version 5.6.1, which was backdoored as well.

11:01.550 --> 11:21.150
And then on the last phase, phase uh, phase number 5, which I call discovery and response from March 28 to March 30, this is where Andres found the backdoor, started to alert and to send the email with his own investigation and this is where internet was on fire as well.

11:22.750 --> 11:24.650
But there is something which is interesting.

11:24.650 --> 11:26.250
I talk about the pressure campaign.

11:26.250 --> 11:29.270
So let me give you a little bit more detail about that.

11:29.770 --> 11:34.030
Cause this is quite interesting from the social engineering aspect.

11:34.030 --> 11:44.790
So first, I mentioned that some additional personas were part of this pressure campaign to move the mentorship of the, of the backdoor to someone else.

11:45.090 --> 11:50.450
So in March, uh, in April 2022, Jigar Kumar sent a message.

11:50.570 --> 11:52.290
Patches spend years.

11:53.210 --> 12:02.650
In May 2022, Dennis Hance, the, the other persona, sent another message as well and said, I asked a question here a week ago and I have not heard back.

12:02.650 --> 12:04.890
It has not updated in over a year.

12:04.890 --> 12:07.030
Is there a plan for this thing in the future?

12:07.330 --> 12:13.350
Lassie Colleen, which at the time was getting all these messages from these personas and so on.

12:13.510 --> 12:16.670
Jiatan has helped me at least with exe-utils.

12:16.850 --> 12:20.230
And he might have a bigger role in the future.

12:20.850 --> 12:24.050
It's clear that my resources are too limited.

12:26.070 --> 12:29.090
In May 2022, Jigar Kumar and so on.

12:29.550 --> 12:31.750
Over a month and no closer to being merged.

12:31.750 --> 12:33.010
Not a surprise.

12:33.650 --> 12:35.590
Jigar Kumar sent another message.

12:35.590 --> 12:39.130
Progress will not happen until there is a new maintainer.

12:39.230 --> 12:42.850
The current maintainer lost interest or doesn't care to maintain anymore.

12:42.990 --> 12:44.250
Quite aggressive.

12:45.490 --> 12:48.950
Then on June 2022, Lassie Colleen and so on.

12:48.950 --> 12:55.870
My ability to care has been fairly limited, mostly due to long term mental health, but also due to some other things.

12:55.890 --> 12:59.770
Jiatan may have a bigger role in the future.

12:59.890 --> 13:09.790
And he mentioned also, and I think this is quite important in this case, he mentioned it's also good to keep in mind that this is a non-paid OB project.

13:11.090 --> 13:14.750
In June 2022, Jigar Kumar sent another message.

13:14.750 --> 13:16.510
Right now you shock your repo.

13:16.510 --> 13:19.510
Why wait until 5 4 0 to change maintainer?

13:19.510 --> 13:21.570
Why delay what your repo needs?

13:22.290 --> 13:24.110
Dennis Ant sends a message.

13:24.110 --> 13:29.190
Why not pass on mentorship for exe for C so you can give exe for Java more attention?

13:30.250 --> 13:32.610
And then Jigar Kumar sent another message.

13:32.610 --> 13:36.390
Jia, this is the first time he actually talked to Jia.

13:36.550 --> 13:39.030
Jia, I see you have recent commits.

13:39.030 --> 13:41.210
Why can't you commit this yourself?

13:41.390 --> 13:47.050
And then Lassie Colleen replied on June 2022, on the day 29.

13:47.730 --> 13:49.790
Jiatan may have a bigger role.

13:49.990 --> 13:52.930
He is practically a co-maintainer already.

13:53.870 --> 13:57.410
Some change in mentorship is already in progress.

13:57.950 --> 13:59.970
Mission accomplished.

14:00.650 --> 14:05.950
Jiatan is no part of the project and he has a lot of more right to contribute.

14:06.370 --> 14:13.290
Alright, so now I want to talk about the technical details and how the backdoor was deploying and how the backdoor works as well.

14:13.570 --> 14:19.270
So remember, I mentioned that the user Jiatan deployed two different test files.

14:19.270 --> 14:29.710
The first one was bad3corrupt underscore lzma2 dot exe and the second one was goodlarge underscore compressed dot lzma.

14:29.710 --> 14:44.090
And additionally, when he released the latest version, version 5.6.0 of the exe package, he shipped the version with an additional file called build2host dot m4.

14:44.090 --> 14:51.790
If you are not familiar with m4 files, it's a kind of macro file used for configuration during the compilation process.

14:51.790 --> 14:56.210
And this file was present in the release but not in the repository.

14:58.170 --> 15:03.250
So let me talk a little bit more about the build2host dot m4 file.

15:03.570 --> 15:07.530
And I will focus here on the version 5.6.0.

15:07.650 --> 15:23.010
So what you see on the screen is just the malicious part of this file, just to focus on what it is exactly doing, but imagine that this file is super big with a lot of different configuration and a lot of legitimate actions.

15:23.510 --> 15:28.450
So the ones that you saw, you see on the screens, are only the malicious part.

15:28.770 --> 15:46.590
So first, you can see there is a variable called glam config make, with a grep, which actually looks for one of the malicious test files that have been released, and specifically the bad3corrup underscore lzma2 dot exe.

15:46.830 --> 15:50.790
Then we have, in number two, two additional variables.

15:50.790 --> 16:05.710
The first one, which is the trtool, trtool translate which is basically doing a kind of a substitution algorithm for part of the backdoor, of the file itself, the bad3.

16:05.710 --> 16:20.970
And the second one is actually showing the file, the test file, and making a sed to retrieve the extension of this file, exe, which will later be used as a common line.

16:21.210 --> 16:28.630
And as you can see, the translation of this piece of screen is the cat at the end of the presentation.

16:28.630 --> 16:42.350
So basically, transforming the file itself and decompressing using exe, the file which has been deobfuscated kind of using tr.

16:45.800 --> 16:57.940
So here you have a look of what was the original bad3corrup lzma2 file before the decryption, the, the, the, the, the substitution and the, the decompression using exe.

16:57.940 --> 17:02.280
And you have the malicious script on your right.

17:02.500 --> 17:06.760
So if you have a look to this malicious script, there is some interesting information here.

17:06.760 --> 17:13.380
So first, I, I like to comment, which is actually an exact decimal string.

17:13.520 --> 17:24.040
So today, we still don't know what is exactly this string, but I believe, because in version 5.6.1, this exact decimal string was not the same.

17:24.120 --> 17:28.780
So I believe this string was potentially related to a kind of a versioning number.

17:29.540 --> 17:35.300
Then we have a bunch of, uh, head command which are used to manipulate input data stream.

17:35.380 --> 17:54.580
And at the end, we have the stash3 and backdoor extraction because in the bad3corrupt, uh, uh, in the, in the bad3corrupt lzma and the second file, the goodlargecompressed lzma, there is the next part of the, of the, the release of the backdoor and also the decompression of an object.

17:54.580 --> 17:56.080
I will come to it later.

17:56.480 --> 18:04.840
I just give me, let, let me give you a look, a deeper look of what the file, what the script is doing to release the next part.

18:05.140 --> 18:08.760
So first, is decompress the second malicious file.

18:08.760 --> 18:13.720
Remember, the second test file, goodlarge underscore compressed dot lzma.

18:13.720 --> 18:19.320
That cons, contains the stash3 and the binary backdoor.

18:19.480 --> 18:25.280
It remove a, a, a bunch of junk data and unus byte, cause the file is a bit obfuscated.

18:25.280 --> 18:29.000
There is again a custom substitution cipher using TR.

18:29.260 --> 18:35.500
And then, all the, the deciphered data are decompressed again using Xs.

18:35.680 --> 18:45.480
Which lead to the stash3, which is another script, which is doing a bunch of checking during the compilation process.

18:45.480 --> 18:49.700
So let me walk through some of the checking this stash3 is doing.

18:49.800 --> 18:52.900
First, it's checked for the iPhone support.

18:52.920 --> 18:55.260
Remember, previous commit, we discussed about it.

18:55.260 --> 18:57.560
Keep that in mind for the, for the next part.

18:57.640 --> 19:05.780
Then it verify CRC source file, CRC64 underscore fast C, and CRC32 underscore fast C.

19:05.780 --> 19:10.080
For require iPhone code, because the backdoor require this feature.

19:10.600 --> 19:12.520
There is a bunch of multiple checks.

19:12.520 --> 19:24.500
It verify the version of the Linux system, uh, validate the GCC comp, compiler, check for the previous two test file, because if the two test file are not present, there is no need to continue to deploy the backdoor.

19:24.500 --> 19:26.040
So it's a kind of protection.

19:26.040 --> 19:30.140
It ensures position independent code.

19:30.500 --> 19:37.280
And also, it extract the backdoor from the, the test file, good large compressed dot LZMA.

19:38.680 --> 19:51.680
And this backdoor, ex, uh, extracted from this file will be embedded into the, the object file, libLZMA LA dash CRC64 dash fast dot O.

19:51.860 --> 20:10.760
Then, there is a modification of a function, isArchExtensionSupported in CRCXX86CLMUL dot H, and it replaces getCPUID with two underscore, with getCPUID with one underscore.

20:11.820 --> 20:20.860
Remember getCPUID was where address trust the execution of the backdoor and the amount of CPU usage.

20:27.800 --> 20:34.580
So I want to talk a little bit about the backdoor extraction itself, because it's quite interesting how the attacker did it as well.

20:34.720 --> 20:58.140
So in the code, there is a, a piece which is using the AWK func, um, tools from Linux, and this is actually doing like a kind of a RC4 like algorithm to decrypt the payload itself that will be later stored into the libLZMA LA CRC64.

20:59.260 --> 21:01.520
So quite interesting to see that as well.

21:03.480 --> 21:10.020
So, to recapitulate a little bit the compilation process, because I know it could be quite uh, quite complex.

21:10.020 --> 21:19.160
So first we have the execution of the macro file, the build to host dot info, which is executed and subsequent scripts are also executed.

21:19.680 --> 21:25.560
It run all the checks, and it create the make file if previous conditions are met.

21:25.560 --> 21:31.400
Because there was a bunch of information, if all the conditions are not met, then the backdoor is not released.

21:31.740 --> 21:42.040
Then during the make process, there is a backup of the original file, which has been backdoor, and libLZMA LA CRC64 fast dot O.

21:42.040 --> 21:55.560
There is a backup because if something, something goes wrong, the backdoor itself, I mean the, the code itself can push back the original file and so there is no track into the final release of the exe util package.

21:55.900 --> 21:58.800
There is also some specific compilation flags.

21:58.880 --> 22:02.580
I think, I think resolvers run at startup.

22:02.980 --> 22:09.360
Modification of the file CRC64 fast dot C and CRC32 fast dot C.

22:09.360 --> 22:23.580
And then finally, compilation, linking stage, manipulation and cleanup because the attacker did well, they also have a bunch of clean, cleaning up to avoid any forensic investigation or further, further investigation.

22:23.680 --> 22:32.640
And then at this point, we are here, malicious libLZMA is incorporated into the compiled libLZMA.

22:34.360 --> 22:39.340
So now I want to talk a little bit more about the backdoor itself and some of the functionalities.

22:39.340 --> 22:50.940
So first it's using the iFunc feature, which allows for dynamic resolution of function implementation during the run time, meaning it can load some specific feature at the run time.

22:50.980 --> 23:02.300
And actually the backdoor hijacks the iFunc resolver to allow the modification of the global offset table, which, which is a kind of a table with address to some specific functions.

23:02.900 --> 23:13.600
And here on the screen, what you can see is actually the malicious get CPU ID that will trigger the backdoor and continue the execution to the global offset table hijack.

23:15.400 --> 23:27.240
Another interesting feature about the backdoor is the usage of DL audit to set up the hook and to bypass Railroad and to intercept also redirect function, function call.

23:27.240 --> 23:36.880
If you are not familiar with Railroad, it's a kind of a memory protection space to avoid, uh, to avoid to have some, some space that could be vulnerable for some vulnerability exploitation.

23:37.000 --> 23:47.000
So what it is doing here, so first it's checking that the loaded target process is SSHD, because remember, it is our target here.

23:47.580 --> 23:57.440
And verify that the share library, and specifically Libel ZMA, because this is the, the, the, this is where the backdoor is loaded, is already present.

23:57.900 --> 24:02.520
Then it set up the DL audit structure to start the audit mechanism.

24:02.780 --> 24:09.640
And during the dynamic linking, so think about all these steps, uh, doing, doing the, the loading.

24:10.100 --> 24:12.200
It resolve and bind symbols.

24:12.200 --> 24:19.900
And then, the DL audit symbol function is called by the linker whenever a symbol needs binding.

24:19.900 --> 24:31.660
And if all the conditions are met, then it set the backdoor to the install hook function to install the, the hooking function that the payload will need later.

24:33.860 --> 24:42.120
There is also the global offset table, uh, redirect, which I mentioned is a kind of a table with a function address.

24:42.400 --> 24:53.600
And in that case, at the run time, the backdoor will manipulate this pointer into the global offset table to redirect codes to the main malware function.

24:56.000 --> 25:09.340
And if you have a look to the investigation, if you have a look to the, to the running at this time, everything will look like it's been called through the CPU ID functions.

25:12.450 --> 25:17.570
On top of that, there is additional evasion mechanisms and kind of obfuscation.

25:17.570 --> 25:20.270
First, there is a string obfuscation.

25:20.310 --> 25:26.030
In that case, what the backdoor is doing is looking for a tree structure.

25:26.510 --> 25:33.350
A tree structure is basically, uh, a corresponding reference between a string and a number .

25:33.350 --> 25:41.090
And what the backdoor is doing is looking for a specific number to retrieve the strings it needs for the execution of the payload.

25:42.430 --> 25:52.570
So if you, it's kind of a, if you are familiar, it's kind of API, API hashing, where you are retrieving the function code, uh, based on a specific hash.

25:52.630 --> 26:06.630
And in that case, the sample, the payload is, is looking for some specific string and for example, 0x1d0 is for RSA public decrypt, which is one of the function.

26:06.670 --> 26:14.050
Or for example, for 0x300 for the ELF header, which is used for the deployment mechanism as well.

26:14.290 --> 26:21.490
And you have some of the strings that was extracted by the backdoor and needed for the rest of the execution.

26:23.970 --> 26:31.970
So as I said, there is function hook that have been added by the, by the, by the payload itself.

26:31.970 --> 26:49.510
So first, what it is, what it, what it is doing, it's actually retrieving obfuscated string from the tree structure and one of the string which is important here are the RSA public decrypt function, which is a hook and the RSA get zero key function, which is also a hook.

26:50.030 --> 27:00.470
These two function are used in the latest SSH server version and are called when an RSA certificate is configured, is using for the authentication.

27:00.470 --> 27:02.570
Remember that because this is important.

27:02.790 --> 27:18.070
And the last function which have been hooked is the EVP PK set one RSA, which it's a little bit weird because it's not used in the latest SSH version, but probably that it has been set up for compatibility or probably for a specific environment.

27:20.910 --> 27:26.450
There is a bunch of other checks and evasion used by the sample, uh, by the payload.

27:26.610 --> 27:28.090
Here, there is an overview.

27:28.090 --> 27:39.030
So first, as we saw, it's, it's checks that the current process is well SSHG because there is no need to deploy the backdoor if we, if we are not running, uh, if SSHG is not running.

27:39.370 --> 27:42.030
It check for a potential kill switch.

27:42.030 --> 27:43.890
So this one is not very clear.

27:43.950 --> 27:52.450
This is a string that was present into the malware itself, the payload, but it's not very clear what's the goal, what was the goal of this string.

27:52.450 --> 27:55.810
Some researcher are thinking that it could be like a kind of a kill switch.

27:55.810 --> 28:03.810
If the backdoor see the, this, uh, strings into the, the environment, the memory, then it will not run.

28:03.810 --> 28:05.430
Potentially a kill switch.

28:05.470 --> 28:12.930
It also abuses the legit LZMA alloc function for memory allocation, which is required by the payload at some point.

28:12.970 --> 28:28.830
And there is also, it is, the backdoor is also hooking the logging function, meaning for every authentication through the backdoor, nothing will be logged into the, into the log of the machine.

28:29.990 --> 28:35.250
So that means it's also more difficult for forensic investigation and incident response.

28:35.250 --> 28:45.350
And there is a bunch of other advanced functionality such as encryption, anti-replay, it also embeds its own tiny embedded disassembler which is required at some point as well.

28:47.530 --> 28:50.790
But how the, how does the backdoor works really?

28:51.310 --> 28:55.510
So remember I said there is, uh, three main function that have been hooked.

28:55.510 --> 29:01.550
And which is interesting as well, is that the backdoor embeds three main function to be triggered.

29:01.550 --> 29:20.450
To trigger this function, there is kind of magic number, actually three magic number, and there is an operation which is used by the backdoor itself, which is magic one multiplied by magic two, plus magic two, which, which will give us the common number that will be triggered by the payload itself and the backdoor.

29:21.050 --> 29:29.810
So the first one, command zero and command one, is actually an SSH authentication bypass using root login.

29:29.930 --> 29:35.010
Second one is a remote code execution via systemd, cmd2.

29:35.010 --> 29:42.270
And the third one is, uh, cleaning a closed pre-authentication that have been previously opened.

29:42.410 --> 30:02.050
And if you pay attention to the, to the diagram below, to trigger this specific, uh, command, the attacker have to embed the payload into an RSA certificate that will be read by the, by the backdoor server during the authentication.

30:02.050 --> 30:04.050
And then there is a bunch of decryption.

30:04.050 --> 30:20.390
Of course, to exploit this specific backdoor, there is an upcoded certificate used, so that means only the attacker itself can login to the compromise server because he already have the private key.

30:22.710 --> 30:36.130
So to give you a little more details of how works the certificate payload, so you have here a kind of an overview of what is inside the certificate itself.

30:36.230 --> 30:45.990
So first, this certificate is used to the connection to the SSH, uh, to the SSH, uh, process to the backdoor server.

30:45.990 --> 30:54.450
Then there is an exchange of the public key, and this public key, there is also a SHA256 which is calculated as well.

30:54.450 --> 30:57.550
So let me give you an overview of the certificate itself.

30:57.610 --> 31:03.530
First, if you have a look, it's a normal RSA certificate, but there is some interesting information.

31:03.830 --> 31:12.070
In the IV, I call that the IV because it's used later, the, this IV is actually the magic numbers.

31:12.070 --> 31:21.690
Remember, the magic numbers are used to calculate the common number that will be interpreted by the, the server and, and the, the backdoor itself.

31:21.750 --> 31:35.270
And then, in the modulus N, uh, payload, in the, in the modulus N part of the RSA certificate, there is the payload which is encrypted in SHA20, 20, uh, SHA20, sorry.

31:35.510 --> 31:49.290
And this payload is decrypted using the outcoded ED448 public key that has been exchanged during the initiation of the connection, but only with the first 32 byte.

31:49.290 --> 31:59.970
And it's also using the IV, which are the magic numbers used, outcoded into the, the malicious RSA key, to decrypt the payload.

32:00.150 --> 32:04.150
Then, in the decryption of the payload, we have two main parts.

32:04.170 --> 32:13.990
The first, which is the signatures, which have been verified by the payload to be sure this is well, this is well the attacker that has been trying to connect.

32:14.030 --> 32:18.170
And we have the payload itself, which have been executed.

32:18.570 --> 32:25.010
And the signature is generated with the CMD value, which have been calculated.

32:25.350 --> 32:29.950
A five byte flag, which we don't know at this time what is it exactly.

32:30.150 --> 32:37.450
The payload itself, and the SHA256 that have been calculated from the ED448 signature.

32:37.610 --> 32:45.310
So a bunch of mechanisms to avoid also, uh, the replay of the certificate and to investigate a little bit more.

32:45.310 --> 32:48.510
And at this point, JITAN is in.

32:50.210 --> 32:54.650
So there is a small, um, let me show you.

32:58.470 --> 33:03.650
I did a small, uh, demonstration using, I

33:08.190 --> 33:17.770
did a small demonstration using, uh, a payload, using, uh, someone reused, um, uh, recoded, actually, the, the backdoor.

33:17.770 --> 33:18.710
So I reused this code.

33:18.710 --> 33:22.470
So on, on the right, you have the target, which is the attacker.

33:22.470 --> 33:31.890
So what I did here, uh, recompiled the backdoor itself with my own certificate, so I can reuse the code and authenticate like if I, like if I was the attacker.

33:31.890 --> 33:34.170
So you have the target on your right.

33:34.210 --> 33:52.650
On the, on the bottom you have the logs, because some researcher found that if you activate the verbose mechanism in the, in the logs and the configuration of SSH, there is a logging feature, uh, that appear and then there is some track, some trace into the,

33:52.650 --> 33:53.670
into the logs.

33:54.230 --> 34:01.270
So what I'm using here, I'm actually running the backdoor against my server, which I've been compromised.

34:01.390 --> 34:12.930
And here you can see, there is, what I did here is extracting some of the components that have been used to generate the RSA certificate used to authenticate to the compromised server.

34:13.530 --> 34:24.550
And as you can see here, you can see the OSCE, the SHA-256, the different magic number, the magic command, in that case it's number two, so I'm using the RCE, remote code execution.

34:24.870 --> 34:29.730
And then we have the certificate that have been sent to the compromised server.

34:29.730 --> 34:39.870
And if you look to the target here, I've been written a file called it's me, and that have been executed by, uh, the certificate itself.

34:39.870 --> 34:47.010
And this payload was actually part of the RSA, uh, key that are sent to the mal- to the compromised server.

34:47.770 --> 35:00.150
The second one is a, um, is a remote code execution as well, just to, uh, have, uh, a reverse shell and to be able to, uh, authenticate and to do some action onto the mali- onto the compromised server.

35:05.550 --> 35:06.310
So,

35:33.790 --> 35:35.970
okay.

35:42.780 --> 35:44.720
Okay, sorry about that.

35:45.600 --> 35:49.520
Okay, so you may wondering who is behind, uh, this attack.

35:49.600 --> 36:02.120
So, as I, as I discussed at the beginning, there was multiple personas involved into the, into the deployment of the backdoor for the pressure campaign against LaCie calling.

36:02.120 --> 36:08.340
So, remember, I talk about Jigar Kumar, Dennis Ants, and Ants Jensen, and Jiathan as well.

36:08.520 --> 36:25.140
So, what I did here, I wanted to know if, because we already had this, their, their email address, also their user name, and I wanted to understand if there is some connection or if the specific email addresses were known before or not.

36:25.200 --> 36:41.500
So, what I actually did, I look for some, uh, connection using this email address, especially for the Jiathan user, and I found out that there was only a few server, only a few website that was using this email address.

36:41.940 --> 37:05.840
What I found out as well is that for Jigar Kumar, with the ProtonMail address, I was able to recover the date of creation of this email address, which was on 2022 April, April 27, and which is interesting because this email address has been created just a day before Jigar Kumar sent the first email to the,

37:05.840 --> 37:10.640
to the Exe, uh, Utils, uh, uh, DL list and, and project.

37:11.340 --> 37:26.580
So, Jigar Kumar, Hans Jensen, and Dennis Hans was part of the first pressure campaign, and the second one, Mizo Heter and Krigorin was part of the second pressure campaign which occurred between the release of the version 5.6.0 and the release of the version 5,

37:26.580 --> 37:27.860
5.6.1.

37:28.340 --> 37:37.960
And which is interesting is that if you have a look to the structure of this email addresses, they all have the same structures.

37:38.060 --> 37:43.600
They have a username, they have a number, and they all use, used a free email service.

37:43.760 --> 37:53.400
And also, what I wanted to discover is, does this email address are using, have been, for example, known in public data leak database.

37:53.700 --> 38:00.860
And I checked for all of them, and all of them were not present in any of the public leak, leak database.

38:00.860 --> 38:21.640
And Brian Krebs, at the time of the investigation, when everyone was crazy about it, uh, said, it's super rare to have one email address which is not present in data leak databases, but it's even more rare to have multiple email address which are not present in any of the data leaks,

38:21.640 --> 38:29.340
which could give us some information about, you know, a really well-crafted, uh, operation.

38:31.100 --> 38:32.960
So, what can we do about it?

38:32.960 --> 38:41.440
Well, it's not an easy question, and I don't think I have the, the answer today, but here is some elements maybe to, you know, just to think about it.

38:42.020 --> 38:50.480
Maybe something that could be done specially on project like this one that have been widely used everywhere, would be to have like a strict contributor verification.

38:50.960 --> 38:59.260
Also to ensure that the builds are reproducible, meaning to have like the equivalent of the GitHub repository and the release of the tarball.

38:59.680 --> 39:08.580
Then hooded hooks and railroad protection, but as we saw in that case, the backdoor we are actually using, uh, bypassing for, of the railroad.

39:08.840 --> 39:14.980
And also improving dependency management could be a good way to improve issue like this one.

39:16.940 --> 39:23.920
There is also something which is important to keep in mind, which is, what does it mean for the security community and beyond?

39:23.960 --> 39:40.740
So first, I think it's important to keep in mind that the entire industry relies on open source tools, and as we saw for the XE utility package, some people are relying of a biased project such as the XE, uh, utility package.

39:40.860 --> 39:56.620
I think also the discovery of the backdoor itself was a mix of luck, coincidence and expertise because without the investigation of Andres, then we won't be able to, we probably wouldn't have been able to find the backdoor itself.

39:56.740 --> 40:00.340
So I think it's kind of important to think about it.

40:00.960 --> 40:15.160
I believe also, if you are, if you have a look to the sophistication, the mechanisms and the deep understanding of Linux operating systems, I believe it's also redefine what we call sophisticated attacker.

40:15.240 --> 40:18.120
And of course, as I said, there is no easy solution.

40:18.120 --> 40:34.000
Probably the knowledge of what I'm trying to do today, meaning explaining you how the backdoor is working and what the attacker did, is also maybe part of the solution because knowledge potentially is the key, so you are, you are well prepared for the next one.

40:35.520 --> 40:39.980
Of course, in 45 minutes, it's super difficult to give you the whole details.

40:39.980 --> 40:44.840
There is a bunch of technical, uh, details, uh, into the backdoor itself.

40:44.840 --> 40:47.340
There is a, a lot of information to cover.

40:47.480 --> 40:58.260
So I want to acknowledge, uh, all the researchers that have been working on it because they did a fantastic job and I really recommend you to have a look to the different blogs at the end if you want to learn more about it.

40:58.360 --> 41:10.940
And because, because of, uh, I mean, thanks to all their writer, we know a little bit more today how the backdoor works, but there is potentially more to discover and potentially stuff that we will never discover.

41:11.280 --> 41:25.020
And before to conclude on the presentation, I just want you to, to ask you a question to think about for potentially the, the rest of the day, the rest of the week or potentially the, the rest of your career.

41:27.300 --> 41:34.520
How many other JATAN do you think are paid, are, are paid to insert backdoors in open source project?

41:34.520 --> 41:36.760
And thank you very much for listening me today.

