start	end	text
0	6280	I'm going to get Maxim going here fairly quickly because he was asking me about the timer very quickly, which means he has a lot to cover.
6500	12580	And it's a super important topic about supply chain attacks, because if the robots don't get us, this shit will.
13380	15020	Have a wonderful time.
15020	15820	Thank you.
16120	18740	Let's give him a big round of applause and a big welcome.
19220	20200	Thank you.
26590	37170	Imagine one sunny morning, you read the news, a crypto war disrupts operations of hundreds of companies around the world and government networks of 25 countries.
37170	48130	The war is spreading and the initial blast radius is estimated to be around 28,000 machines and now likely affecting much more computers around the planet.
48150	52330	Security industries struggle to understand how did this happen?
52330	54910	There is no one source of compromise.
55110	62330	Eventually, a security researcher with support from cloud providers connect all the dots and find the source.
62330	70030	All backdoor software were pulled from cloud buckets that were abandoned in the past and reclaimed by the threat actor.
70030	76050	The risk many researchers have raised in the past materialized on the truly gigantic scale.
76050	83610	The buckets are taken down by the cloud provider with estimates suggesting like about 5,000 buckets being affected.
85030	95870	This is not a real incident, it was me who claimed 5,000 buckets and those are images of a fake news channel generated with LLM.
95870	105590	But the risk is very real and today I want to invite you on a journey to dissect the anatomy of such an attack and talk about root cause remediation.
107050	113730	My name is Max, I am security researcher and engineer at Big Tech, mostly doing Red Team in these days.
113730	115970	I have a PhD in computer security.
115970	126910	I presented at this stage twice in the past and I open sourced a couple of projects for fuzzing, for software analysis, and for GCP scanning.
127830	131570	So the talk will be logically divided into five parts.
131570	137850	We're going to try to understand the motivation of supply chain attack via S3 buckets.
137890	150590	We will discuss how an attacker equipped with modern elements of big data analysis and LLMs can bring those attacks on a really giant scale.
150590	157070	We're going to walk through nine case studies and then we're going to talk about root cause remediation here.
157270	162730	Before we start I need to say that I'm presenting on my own behalf.
162970	167470	This presentation does not reflect opinion of any of my past or current employers.
168670	173330	So why do we want a supply chain attack in the first place?
173350	178990	So if you've ever done Red Team on pen test, you know that perimeter penetration might be really hard.
178990	188390	And then as an attacker you might notice, right, that attack costs grow as long as you want a higher efficiency.
188530	193050	And you kind of want to invert this game, right, in your advantage.
193170	196410	And in my opinion supply chain attack gives you that advantage.
196410	199790	The attack surface usually grows with the size of the company.
200370	206090	Depending on the software you can actually end up in privileged parts of network or even in prod, right.
206090	210550	And the obvious disadvantage is precision, right.
210550	219570	You have to target something that's used by your target or maybe you don't care or maybe you compromise something that's used by anyone.
219570	220890	So there's benefit.
221150	223990	How does it work in practice in case of cloud buckets?
223990	231090	So let's say you have something that's running on a potential weakness machine and pull executable code from a cloud bucket.
231090	237330	It can be an automated job or users just follow some instruction, let's say curl and pipe it in the bash.
237730	240610	What's going to happen if bucket is deleted?
240850	247010	Well, users will get 404 from AWS, but the bucket namespace is available.
247010	258730	So someone with bad intent can claim the bucket, put malware into it, make it public and well, everyone who rely on that bucket will get infected, right.
259650	262510	Same is actually applicable to malware.
262710	267870	Imagine you have a host compromised with stage one that's pulling stage two from S3 bucket.
268030	275810	Someone sends abuse report to cloud provider, the bucket is taken down and at some point recycled back to consumers.
275810	289730	An attacker who is not affiliated with the original malware can claim this bucket and again, put malware into it, enable public access to it and well, infect all the victims of that malware.
289730	295690	And in general, this risk is not something that's unknown to the industry, right.
295830	301990	Real threat actors and security researchers have been abusing and show this risk in the past.
301990	315410	For example, backdooring Python packages, targeting AWS S3 buckets, expired domains, popular NPM packages and even top level domains of a sovereign state, right.
315410	317990	And it was also presented at this stage at DEF CON.
317990	326430	People were hacking software and two years ago, Thomas Johansson presented the danger of expired TLD domain, well, to pwn internet.
326430	328030	So there's a risk.
328230	332350	And as for malware, this Watchtower research is quite cool.
332690	341890	They showed that it's possible to hijack a lot of expired domains in web shells with backdoors, where backdoor phones back to those expired domains.
341890	343750	So check it out, it's quite cool.
343750	352530	And the closest work to this one is this another great Watchtower research where they claimed 150 buckets and also showed the risk, right.
352610	357550	They published that when I was wrapping up the first bunch of my research here.
357950	363490	But still, we have still a lot of remaining unknowns here, right?
363490	365290	What is the real scale of the attack?
365290	368210	What if we claim a lot of buckets, right?
368310	369650	What would be impact?
369650	372510	Can we actually simulate it and see how it works?
372510	381310	Because, well, in theory, everything works, it was true in this research.
381310	385210	I had a lot of buckets that I initially thought are exploitable, they were not.
385390	387230	And, well, what about data?
387950	390030	We will have a lot of data, right?
390170	393330	You will see, and how do you navigate this data?
393330	394950	What is the true cost of attack?
394950	397650	And actually no one talked about root cause remediation here.
397650	399630	We're going to close these gaps today.
400330	402390	We also have to be very careful.
402390	404390	There are certain rules of engagement here.
404390	407430	First of all, buckets always has to stay private, right?
407430	409330	We always return 403.
409330	411410	We don't want to compromise actual people.
411410	415390	If we want to test anything, we test it on a clone of the bucket.
415390	416710	We respect user privacy.
416710	420330	We don't attribute to individual IPs, individual organization.
420330	423890	I want to show you the scale and the big picture here.
423890	428590	And we also responsibly disclose the findings later about that.
428690	430750	And our approach is quite simple.
430750	432050	We search for buckets.
432070	433990	We check if it's available.
433990	434830	We claim it.
434830	436870	We enable logs for five days.
436890	439710	We triage logs to find sensitive stuff.
439710	441650	We evaluate security impact.
441750	443350	And, well, I guess profit.
443890	446890	Let's move to the part where we search for the buckets.
447070	450450	And the best place to store your code these days is GitHub, right?
450450	453890	It's petabytes of data, millions of repositories.
453890	459490	And unfortunately they don't kind of allow you to search through all the code, right?
459490	460670	You cannot just query.
460670	465290	What enabled this nice tool called source graph, search engine.
465290	469330	It allows you to search GitHub just in seconds, right?
469330	476430	And now all you need to do is to search for S3.Amazon.AWS.com or S3, right?
476430	477590	And you get everything.
477590	481970	And then you expect bucket names with this like ugly regular expression.
482350	483310	And that's it.
483350	488670	And you can say apply same for Maven and PyPy where you have millions of files.
489230	493590	You need to list and fetch repos from repo one or PyPy.
493870	495670	You like download package.
495670	496970	You extract it in memory.
496970	498610	You apply the three gaps.
498610	499650	And, well, you have buckets.
499650	502850	The only difference here that in case of GitHub it was seconds.
503230	510570	In Maven and PyPy it was one and a half months running on like machine on my wife's computer.
510570	511650	It was super noisy.
511650	512550	A lot of CPUs.
512550	513810	Eventually it lost power.
513810	514930	So I gave up.
514930	517170	Like, okay, I don't want to run it anymore.
517930	524890	But eventually, like, I think I managed to crawl through like 45% of everything there.
525050	528910	Anyway, for malware it's even more challenging, right?
529270	531870	You cannot just get all malware.
531870	538210	And I was pretending to be a lazy and, well, since lazy and poor hacker in this research.
538210	543030	So it was impossible for me to get all the samples.
543030	546370	And even if I would get them, there was still a problem, right?
546370	549170	Malware is usually packed and obfuscated.
550310	556070	You need to probably run it in sandbox and it opens another layer of problems, right?
556070	564830	But then this nice resource called URL host, I found it and, yeah, it was relatively straightforward.
564830	570850	They allow you to get all links to Amazon AWS, right?
570850	572470	So it was perfect for me.
572590	573030	Okay.
573030	575550	I'm pretty sure you are interested in what I got.
575790	586290	I registered 480 buckets, 255 received traffic, 4.5 million requests and 3.5 gigabyte of logs.
586490	588490	This is a geography of requests, right?
588490	592430	15,000 hosts, 129 countries.
592490	600090	For malware I got like 188 buckets , 175 received traffic, 2 million requests, almost 4 gigabytes of logs.
600090	602470	And this is a geography.
602470	612210	So it's 20,000 hosts from 142 countries and they were mostly pulling executables and JavaScript, right?
612410	623030	As for GitHub, there we got 4.5,000 buckets, 1.5 received traffic, almost 4 million requests and 19 gigabytes of logs.
623030	624790	So it was quite a lot.
624790	626610	And this is a geography.
626610	633650	So it's 243,000 hosts, all countries except probably North Korea, right?
633650	637810	But keep in mind that most of those requests are not sensitive.
637810	640390	They might not be dangerous in the first place, right?
640390	643730	So how do we find dangers out of this noise?
643750	645250	And, well, let me show you.
645250	655930	This is an example of a log query to AWS, a lot of fields, but what we really care about is bucket name, IP address, request type, object URL referrer and user agent, right?
656150	659290	This data allow you to get the context around requests.
659290	664270	But still, we had 26 gigabytes of logs and 11 million requests.
664270	665610	So it's a lot, right?
665610	667470	And I needed to navigate through it.
667510	676910	But a lot of those requests are coming to pull non-sensitive stuff such as pictures, videos, some text files, like training data and so on.
676910	678570	You can just remove it, right?
678570	687310	We can also filter out like bots, scanners, you know, a lot of bots these days that try to scrape everything for LLM training.
687530	689310	You can like remove it.
689310	691710	You can also aggregate unique IP, right?
691710	693710	Is someone pulling something in the loop?
693710	696130	We counted this on one host, right?
696170	699690	And still, I had a lot of requests.
700190	703870	Probably three years ago, I would just give up or look through them manually.
703870	708450	But these days, we have LLM agents that can help to do the classification for you.
708450	713350	So I leveraged the custom LLM agents to classify requests.
713530	723310	And I got like, I guess, time saving from like a month to a couple of days from like gigabytes of logs to a few megabytes with 500 sensitive buckets .
723310	727290	Of course, I had like hallucinations and like when LLMs was simply wrong.
727290	729210	But still, it kind of worked.
729710	732830	If you're curious about LLM, this is architecture, right?
732830	736190	You have three components working together.
736550	741390	One element is a planner, aggregator, classifier.
741390	747570	I give tools like internet search and GitHub search for the agent and I save answers to the database, right?
747570	749430	And so this is like the prompt, right?
749430	759370	You provide the bucket name, you provide actual requests, it like construct a plan, then in the aggregator with the tools, right?
759370	761850	It actually query and all the content.
762470	766550	And then with all this context, the classifier makes the final decision.
766590	768210	This is how it looks in practice, right?
768210	769450	That ugly little page, right?
769450	771350	With a lot of context.
771350	789490	And this is an example of LLM like telling me that, well, something is trying to pull minecraft-py from assets.minecraft.net, unpacking it and well, classification is executable because I know that on the website they ask users to execute it.
789490	792030	So, yeah, a big time saver.
792710	795450	All right, so let's talk about results.
795890	801770	Before we show examples, those are the sensitive types that I came up with.
801770	813130	So it's executables, ML models, archived executables, PyPy packages, I had dynamic web content, static sensitive files, configs and data write attempts.
813130	816990	So let's start with examples on executables, right?
816990	826070	So statistics were dominated by PyTorch and Microsoft executables and archives as executables.
826490	832090	For SN, statistics, mostly ISPs, so like end users, right?
832090	838050	I had requests from like universities, maybe students on campus, maybe administrative network, you never know.
838050	844070	And I had a lot of like business entities, like small, medium business and a large stock trading company.
844410	859470	A canonical example would be this large network equipment company who used to surf installation binary from three buckets, they changed the distribution policy, made an announcement and deleted the bucket.
859470	870050	But unfortunately, the link was still used by a lot of clients not affiliated to the original tool owner, right?
870050	875510	Like this one, like a partial script where they pull and execute a binary from the bucket.
875510	883250	And in this case, it's 162 hosts who would execute our malicious code.
883730	885950	And another example is Minecraft, right?
885950	906810	It can be played on Raspberry Pi and you need to download the website with reference in the package that you need to download and unpack and execute from, again, an S3 bucket, an S3 bucket was abandoned, and well, again, this gives us a very straightforward to get code execution on a lot of hosts.
908130	914830	I also had a lot of requests to pull Vagrants.box VMs, right, from abandoned S3 buckets.
915630	921610	You can obviously put backdoor in VM, but escaping VM is not an easy job, right?
921610	923930	And how about executing code on the host?
923930	925310	And it's also possible.
925310	936650	Because Vagrants allow you to put like system command in the config and any time user like download the box and edit, not like execute, even add, you can execute your code.
936650	940890	So a very straightforward way to get code execution, right?
940970	943810	Now, PyTorch models.
944070	949570	A quarter of requests came to pull PyTorch models, right?
949570	957850	And they allow arbitrary code execution because they support like PyTorch relies on pickle deserialization to load models, right?
957930	963710	And well, it's pickle deserialization allow you arbitrary code execution by design, right?
963710	969450	They put some controls in place, but not everyone rely on them, right?
969450	972710	And let me show how it works in practice.
972710	974730	Hopefully the demo will work.
974730	975070	Okay.
975070	977570	So we have this open source project, right?
977570	978830	Super gradients.
978830	980770	4,000 stars.
981010	988490	They used to serve prebuilt models from like S3 buckets, right?
988950	991410	And then they change it.
991410	994410	But people who rely on the old ones still were vulnerable.
994410	998210	And you can see like one example.
998210	1002410	We are going to use this one in this demonstration, so we go back.
1002990	1007190	This is just a simple script on how to load this model, right?
1008110	1009630	Or does it load it?
1009630	1018030	And if we execute it, right, you will see 403 with the attempt to pull it from the bucket.
1018030	1020510	So this is 403, right?
1020510	1027150	If you scroll it up, you see the attempt to download it from the bucket.
1027210	1030170	And this is the package, right?
1030170	1032310	The old version to show in the demo.
1032310	1034270	It's like two years ago, right?
1034270	1035950	I need to apply patch.
1035950	1040630	As you remember, we don't want to run it on like actual bucket.
1040630	1041710	We want the clone.
1041710	1045090	So this is the only way you can simulate it safely, right?
1045090	1047370	So this is the change.
1047370	1051490	Like just two places where this random string to the bucket name, right?
1051490	1052850	And claim the bucket.
1052970	1056450	And we can scroll down, and that's basically another one.
1057030	1062310	So we patch it, and now we can go back.
1063030	1074650	If you run it again, just to validate, right, you're going to see the attempt to pull the model from the copy of the bucket, right?
1075310	1075930	Okay.
1075930	1080550	So now let's poison the model, right?
1080550	1084330	We're going to rely on this code snippet from Snook, right?
1084330	1087670	It's a minimal implementation to inject code in PyTorch.
1088110	1089810	Relatively straightforward.
1090330	1093910	Just import the system calculator.
1094050	1095510	So that's basically it.
1095510	1097990	And we save it in the PTH file, right?
1098570	1099070	All right.
1099070	1102070	So let's close it.
1102350	1112430	So we're going to poison this model, right, that I downloaded from their new place.
1112670	1113030	Okay.
1113030	1114850	So we have the model.
1114850	1122390	Now we need to reconstruct the folder structure, the tool expect, right, the open source supergradients.
1122530	1125250	And now we are ready to upload it to S3 bucket, right?
1125250	1128650	So this is the name of the bucket, right?
1128650	1131250	So we upload it.
1131250	1133750	We need to upload folder, not file.
1134390	1134970	All right.
1134970	1136410	So we go back.
1138090	1139390	We upload it.
1139390	1143010	So the model is 34 megabytes, right?
1143450	1147230	And all you need is just to enable access to it, right?
1147230	1149630	Well, world access.
1150430	1150990	Okay.
1150990	1152310	So we upload it.
1161060	1165840	And now we can pull the model, like just rerun the script, right?
1165840	1167640	And we will get the calculator.
1170190	1171870	So the model is loading.
1171870	1175370	And we got this ugly full screen calculator.
1175370	1175870	Okay.
1175870	1177830	Now let's move to another example.
1177830	1183510	I had even bigger open source project with 33,000 stars.
1183510	1185710	Again, same problem there, right?
1186050	1189810	People who rely on our bucket got compromised, right?
1189830	1199030	And in this case, you can, again, poison PyTorch model and get code execution when people load their, like, their buckets, right?
1199330	1200270	All right.
1200270	1203050	So let's go to Maven and PyPy packages.
1203050	1207930	Out of hundreds of buckets, I actually got only nine sensitive buckets, right?
1207930	1213190	Still like 3.8 thousand IPs, JavaScript, and executables.
1214150	1216290	I want to show you one example.
1216290	1219710	It's not so pretty, I think.
1220230	1227590	The old version is vulnerable because it tries to pull a pre-built binary from an S3 bucket, right?
1227590	1230310	Now it returns 403.
1230310	1232990	Well, 403 because we control it right now.
1232990	1245270	And the plea is basically a wrapper around a native binary that will be installed on your machine from that S3 bucket, right?
1245270	1248070	And we can just modify that library.
1248070	1256170	We can add our code every time the library is loaded and, well, get code execution on the machine.
1256170	1258310	And let me show how it works in practice, right?
1258310	1266190	So, again, so if we execute this not so plea package, right?
1266190	1270670	So an old version is probably like five years old.
1270670	1273530	You see the attempt 403.
1273610	1273970	Yep.
1273970	1280250	So it's trying to pull that archive and extract it on the machine, right?
1280250	1281790	So this is the name, basically.
1281790	1288830	And I have a version of it slightly, like, newer just to make it easier to compile.
1288830	1290930	But it's basically the same package, right?
1290930	1292710	And vulnerable to the same problem.
1292710	1300390	So let's change, again, the reference to the bucket to something without active clients.
1300390	1307890	So we add just additional string, right?
1307930	1315870	And now I already compiled the library and put it in the bucket to make it faster.
1316930	1321810	All we need now is to basically execute the package, right?
1321810	1331390	So if we execute it, so it tries to fetch a bunch of stuff.
1331570	1336210	But at some point, it will fetch the prebuilt library and install it on the machine, right?
1336210	1339970	So, okay, now at this point, the backdoor library is there.
1339970	1344630	And if we execute the binary, we get arbitrary code execution.
1345010	1345770	So, yeah.
1345850	1347230	Pretty nice.
1349590	1350670	Thank you.
1352750	1355530	And the impact of this would be quite interesting.
1355530	1371310	It would lead to installation of a backdoor library on five Fortune 500 companies, like, including three largest banks in the world, AV vendor, a global telecom company, and a huge retail company, right?
1371310	1375030	And there's another example called kuva-dev.
1375030	1383890	This one is interesting because it references an additional host repository for this package that I have never heard about.
1383890	1393290	But in the log, I found, like, 288 hosts pulling thousands of packages from that repository.
1393290	1394990	This is an example of logs.
1394990	1397150	And this would be also quite dangerous.
1397150	1408710	It would lead to, again, installation of backdoor packages on five government entities in Europe and South America, global investment fund, and two major, like, tech and telecom companies.
1408710	1414990	And we have limited time, so I cannot go through all examples of sensitive request types.
1414990	1419410	I just want to quickly mention that I had a lot of requests to PHP and JavaScript.
1419530	1423650	I also had requests to static, like, sensitive files and webpages.
1423890	1428770	And most of them, like, PDF docs and, well, Microsoft formats.
1429190	1433490	You might be thinking, okay, Max, what's the problem with the static file format?
1433490	1439890	Well, it's a good social engineering vector because you already have established trust with a potential victim, right?
1439890	1455750	So they come and download something on the website, and you can, well, it wouldn't be super odd to ask them to run some command, let's say, in the PDF, like, a manual, or in case of this weird engineering calculator, ask them to enable macros, right?
1455750	1466010	And in this particular case, it would be, like, three state-level agencies in, like, in Europe and in South America, and, like, integration design firms, right?
1466010	1468130	So it's a relatively interesting vector.
1468730	1471730	And what's funny, I had, like, data write attempts.
1471730	1476470	So I created a bucket, and I see people trying to put logs in my buckets, right?
1476750	1479170	Which is quite funny, in my opinion.
1479170	1480510	But obviously, I didn't enable.
1480510	1486910	I don't know what they wanted to put into my buckets because it might be sensitive, right?
1487130	1487590	Okay.
1487590	1492130	Let's go to the most, like, funny part, which is the malware.
1492630	1495550	Let's start with some statistics.
1496090	1501950	We can see the stats are dominated by two families, RK and Linker.
1502990	1507650	Basically, they represent a huge chunk of all of the malware.
1507650	1513770	But Linker is a malicious Chrome extension masquerading as a benign application in the web store.
1513770	1517710	For example, a playlist on the screenshot on the slide.
1517910	1526490	And when a victim visits some interesting websites, Linker pulled JavaScript from S3 and injected it into the victim's browser, right?
1526490	1528810	And the main purpose is to show ads.
1528810	1531430	It was active, like, three, four years ago.
1531590	1538710	But since then, it was taken down from Chrome web store, and the author eventually abandoned it.
1539070	1542650	But in the logs, you can still see a lot of requests for those buckets.
1543590	1544950	Requests, name.
1545410	1547830	What's important for us is refer, right?
1547830	1555750	It actually tells us the context in which, like, website this JavaScript will be executed, right?
1555750	1559010	And there is even public research on that sample.
1559010	1563210	And the extension just pulled config from this FlashPlaylist.com, right?
1563210	1571550	And the website should return this mixed panel variable with the link to the bucket and JavaScript, right?
1571650	1572710	Name.
1574530	1587370	And the code is obfuscated, but all it does is basically install it in the Chrome local storage, and then this variable is used to pull the script any time a user visits a web page, right?
1587370	1591530	And, well, since we control S3 bucket, we can put any JavaScript we want.
1591650	1594170	Let me show you how it works in practice.
1594170	1612030	So, again, a clone of the S3 bucket with no active clients, malicious JavaScript, and this bucket, just to show you, well, some data can be exfiltrated from the JavaScript, and this is a malicious extension installed in the browser, right?
1612430	1617050	Let's just visit some websites to show how it works.
1617050	1622750	Gmail, Twitter, Instagram, Facebook, LinkedIn, right?
1622750	1629810	And you can see, our JavaScript got executed on all of those websites, right?
1630510	1644230	And you can take a look at logs, right, and see that there's actual attempt to pull the JavaScript from the bucket we control, right?
1644230	1650570	And let me show that, well, it's possible to weaponize it in some context, right?
1650570	1658090	So, for example, on TikTok, well, you can actually exfiltrate some data.
1658090	1662150	Well, Amazon is allowed in CSP policy on TikTok, so it's quite easy, right?
1662150	1671590	So, in the JavaScript, we take everything that's available to our JavaScript in the context and put it into the bucket, right?
1671590	1683370	So, obviously, you cannot, like, steal HTTP-only cookies and probably not all the data, but still, I mean, this is a question on how to weaponize XSS on all of those resources for the attacker, right?
1683370	1686570	You can see, like, cookies, you can see page data.
1687850	1689970	I want to rant about this capture.
1689970	1691410	It's just crazy.
1691410	1703890	So, I wanted to show you a test account from Microsoft, and I tried to register an account, and, like, I spent a decent amount of time, probably the hardest challenge within the whole research, and it's crazy.
1703890	1705090	This capture is crazy.
1705090	1705890	I couldn't.
1705890	1707290	So, no Microsoft demo for you.
1707290	1710150	Like, I didn't know how to move the person to the right place.
1711190	1712610	I don't know.
1712990	1714610	Well, this is impact, right?
1714610	1721250	So, thousands of users on, like, many, many websites, like Google, YouTube, and Facebook, and so on.
1721250	1723570	But, obviously, there's nothing wrong with those websites.
1723570	1728070	It's basically malicious Chrome extension that injects JavaScript.
1728070	1740130	It has control over the browser, and I hope that, naturally, this extension will die, right, because of introduction of manifest v3, and the extension depends on manifest v2.
1740130	1741150	We'll see.
1741270	1743370	What about sensitive users?
1743410	1744770	We have a lot of them.
1744770	1753750	Again, a lot of people visiting, like, government websites in certain countries, and , actually, people from government networks visiting government websites.
1753750	1755630	So, yeah, quite risky.
1757450	1758130	RK.
1758130	1763810	RK is malware pretending to be useful, like, executable.
1763810	1765010	It tries to steal your data.
1765010	1767010	It was active, like, four years ago.
1767470	1770190	It was forked by other families.
1770670	1772510	That's how it looks in the logs, right?
1772510	1777410	A machine-generated bucket name, and the request to pull executable.
1777450	1783070	And there are a bunch of old sandbox reports indicating, okay, that actually happened.
1783670	1800210	The problem is replicating this malware is quite challenging, because you actually need to find the executable who would, like, pull from the bucket, and it was hard, because, first of all, anti-VM, anti-debugging, and, second, well, malware is not active anymore.
1800210	1805850	Part of its infrastructure is dead, so you cannot reproduce it in any way.
1805850	1811830	But for you, I found the sample after, like, a really long search, so RK Stealer.
1811910	1814510	So we are in Windows VM.
1814510	1815470	We have Wireshark.
1815470	1819450	Installer is actually our malware, and we have FakeNetNG.
1819450	1821490	I'll tell you why we need it.
1821510	1829210	So let's start Wireshark just to see what's going on, like, on the wire, right?
1831250	1833650	So then we run installer.
1834050	1835350	We see some traffic, right?
1835350	1836790	At this point, you are infected.
1836790	1839910	Don't, this is fake.
1840530	1844290	We can see the actual request, right?
1844290	1849630	And it's HTTP, obviously, because, well, malware doesn't care about your security at all, right?
1849630	1853330	So it tries to pull the executable over HTTP, right?
1853330	1855150	This is the actual executable.
1855150	1863070	And what you can do, actually, you can spin up FakeNetNG that will respond with executable to every request that malware makes, right?
1863070	1866070	So it's like a fake server for malware.
1866210	1869010	And in our case, we're going to serve it calculator.
1869010	1870970	So now see what's going to happen.
1870970	1876110	So we run malware, and we have our calculator, right?
1876390	1882090	So now in FakeNetNG, you can see the actual request, right?
1882090	1889690	It tries to probe whether the bucket is available and the executable is there, and then just download it over HTTP, right?
1889690	1892510	And we, like, just give it calculator, right?
1892510	1894250	And it executes it blindly.
1894430	1894890	All right.
1894890	1897130	So that was RK.
1897670	1901030	Now let's move towards total impact.
1901030	1907710	This is the overall map of the users that I verified would have been compromised from this attack, right?
1907710	1916190	It's 28,000 users, 158 countries, 134 organizations, and 25 government networks, right?
1916190	1920050	And you might be thinking, well, Max, we saw, like, bigger attacks, right?
1920050	1924490	But I want to remind you it's just five days of monitoring logs, right?
1924990	1927770	God knows what would happen if I would look for two months.
1927770	1928950	Again, lazy hacker.
1929210	1932330	Anyway, country statistics.
1932330	1936570	US, Russia, China, Germany, and other European countries, right?
1937410	1940490	$20 the cost of attack.
1940490	1947250	You can likely do it in, like, zero budget that I spent on, like, log storage, right?
1947270	1949370	And this is attacker profiles.
1949370	1964790	As you can see from impact, that would be interesting from anyone, from hacktivist for fun to cyber crime for, well, cause financial damage, ransomware and stuff like that, to APT groups for sabotage and espionage purposes, right?
1964830	1967950	And responsible disclosure is quite interesting here.
1967950	1972070	As one person who helped me with this research pointed out, there's a paradox here.
1972070	1976290	In order to find vulnerability, you have to fix vulnerability.
1976290	1981350	Because once you claim the bucket, it's not any more vulnerability because the bucket is claimed, right?
1981350	1987470	So, but still, I didn't want to sit on all of those buckets because, well, it's quite dangerous, right?
1987470	2000810	So eventually I collaborated with AWS on a mediation campaign and they seemed to hold all the buckets that were identified as sensitive, right?
2001930	2007150	Yeah, it was a positive collaboration with them.
2007190	2011370	But I want to highlight that this is likely a tip of an iceberg here, right?
2011370	2016170	A sizable tip, but what about other package repository?
2016370	2018590	What about GitHub commit history?
2018590	2021950	Because source graph doesn't allow you to search in the commit history.
2021950	2023610	What about proprietary code?
2023610	2026310	And what about other cloud providers, right?
2026310	2031990	AWS is just one example because of its size, I picked it, but there are others.
2032310	2035990	And S3 buckets is just one problem, right?
2035990	2045590	There are other type of abundant resources that an attacker can exploit like domain IP and domains and other stuff.
2045590	2046790	So, yeah.
2047050	2062670	And if we ask any cloud provider, they would point out that it's basically customer's responsibility for, well, don't forget your code and references to dangling buckets, right?
2062670	2065650	And unfortunately, I think they're right.
2065650	2068650	We should not forget about the code, right?
2068650	2074350	We should not forget about the references to the buckets that doesn't exist, that represent risk.
2074350	2090070	And through the course of collaboration with AWS, they also wanted to share that it's also possible to rely on machine generated bucket names in certain cases or make them less predictable to reduce the risk here.
2090070	2097950	And also, they rolled out recently a higher cap for amount of buckets you can have, so per account.
2097950	2101730	So per account, you can now have like 10,000 buckets.
2101830	2103190	And, well, it's a lot.
2103310	2109690	You probably, like, it would probably incentivize people to, well, not delete buckets.
2109690	2110950	Like, why do we need to delete it?
2110950	2112630	Keep it, right?
2112630	2117770	Yeah, so those are the references, if you want to look deeper into that.
2118590	2121790	And, like, blaming engineers is nice, right?
2121790	2123670	But it's not productive.
2123670	2125110	I would say it's counterproductive.
2125110	2130010	And I would believe, I believe that in general, as a security industry, we can do better, right?
2130010	2146430	So if you work on, like, static source code analysis or you're a code storage provider or you're just within a security team within the organization, look for dangling buckets that reference to something that doesn't exist and, well, remove it.
2146850	2148050	It's not that hard.
2148050	2152950	And I wanted to release a tool to do it, but eventually I found a bunch of tools that already exist for that.
2152950	2157550	So just use one of them and they're pretty decent and much better than I would write them.
2157610	2165090	And the real root cause fix here would involve secure by default cloud, right?
2165090	2170310	So it's either bucket namespace to be project scoped, right?
2170310	2174130	So you have project name and bucket name, where project name is immutable.
2174130	2176770	You cannot, like, delete and someone else reclaim it.
2176770	2181490	Or even better, like, just make bucket names non-recyclable at all.
2181490	2184530	So it's not possible to reclaim them, right?
2185430	2191370	It's possible, probably there are some caveats with abuse potential, right?
2191370	2195230	Or general people claiming all cool buckets.
2195550	2197190	Maybe, maybe not.
2197510	2201830	It requires some research on critical user journeys, right?
2202290	2207630	And as for buckets used by malware, I think the best path forward is just keep them always private.
2207630	2215350	There's even, like, this shadow server initiative that's in whole domains used by malware.
2215350	2221310	So we can, well, cloud providers, I think, can apply the same strategy for buckets, right?
2222130	2222910	All right.
2222910	2228730	I hope I convinced you that abundant cloud buckets is a serious problem, right?
2228730	2231710	You can run the attack with relatively low cost.
2232330	2240050	And LLMs and elements of big data analysis can really bring this on, like, gigantic scale, right?
2240170	2243830	And, well, help attack reduce the time and effort required here.
2243870	2258050	I would like to thank Electronic Frontier Foundation for help here and a lot of amazing people who made this talk possible, as well as James Erickson and overall Amazon security for very positive collaboration.
2258650	2266370	They wanted to share that they are always welcome to collaborate with security researchers to make, like, the cloud and their customers more secure.
2267630	2269090	Those are the references.
2269450	2271310	And, well, basically, that's it.
2271310	2272230	Thank you.
2272230	2273690	And I'll be near the stage.
