start	end	text
0	7040	So I'm happy to introduce Ronnie Carta and talk about practical exploitation in denial of service
7040	18180	and bug bounties. Ronnie, thanks. Hi everyone, I'm really happy to be there today. This is the first
18180	24620	ever Bug Bounty Village and it's a true honor to do the first talk ever, well with some technical
24620	31060	difficulties of not having an HDMI cable, but no worries, we are there now. So the talk is about
31060	35700	practical exploitation of denial of service in bug bounty program. So first of all, my name is
35700	40680	Ronnie, I go by the nickname Lupin, I'm the co-founder of Lupin Homes, we are a security
40680	46220	research and development company, and I'm coming from the best city in the world, Grenoble, it's
46220	53280	in the French Alps, a lot of skiing, beautiful place. I love denial of service. I love denial of
53280	58800	service because you can actually try to slow down or considerably take down an entire product
58800	64960	environment. And so the goal of denial of service in bug bounties is to basically try to find the
64960	70900	most business impact. Imagine like a website not having traffic anymore, that will be a huge
70900	79120	bummer for the company. And so denial of service, and like the difference between denial of service and DDoS
79120	85000	is basically denial of service is from one single machine, but DDoS, the additional D is for
85000	90280	distributed, of course, so it means that we require a series of different machines to be able to take down our
90280	96440	target. This is basically all about the resource that you have on your machine against the resources
96440	103520	that you have on your target. So if the attacker has more resources on its machine, then it can
103520	110340	basically take down the target, but in a DDoS, you might have amplification or multiplicating
110340	115160	factor in order to be able to completely take down the machine. So that's what we're going to
115160	122880	talk about today. A little bit of definition debates here. Basically, there is a whole debate about
122880	128860	denial of service being an availability or integrity impact. So basically, the impact of
128860	135740	like the DDoS is not a vulnerability class, but more like an impact, I will say. And we can say
135740	142420	that deleting a resource is in a sense denied, but the CVSS documentation says that the deletion of a
142420	148340	resource is integrity and not availability at all. So that whole blob of documentation, if you want to
148340	154840	read it, is what the CVSS says. So basically, it says that availability is the performance and
154840	160520	operation of the service itself and not the availability of the data. For those who have been
160520	166140	doing bug bounty hunting, you know that you are debating a lot about CVSS and you need to read
166140	171920	all the documentation. So be mindful of that if you want to argue with CVSS programs.
173280	180180	So when DDoS is relevant? Basically, it is relevant for every feature where there is a
180180	186080	strong dependency. This means that it's a feature that a lot of users are going to use or maybe
186080	192040	there's a dependency on the machines that you are targeting. For instance, if you can take
192040	196560	that entire EKS cluster in production, well, that might be super impactful.
197900	202780	But yeah, I know what you are going to say. DDoS is totally out of scope. Actually,
202780	209440	on HackerOne default templates for program, it's marked as out of scope by default. And there's a
209440	216060	reason for that, because companies in usual do not like DDoS. Not because of the low impact of
216060	223180	security, but because actually, if you let all your bug hunters completely take down your website,
223180	231200	it might be a huge problem for them. So basically, it's not because DDoS has low impact,
231200	237400	but because sometimes that's too much impact. But we can test DDoS responsibly and actually make
238260	244720	a few bucks with it. In order to test DDoS responsibly, you need to find the gadget
244720	250640	of the problem to fully exploit it. So this means that, for instance, if you have a request that
250640	257060	takes more than 10 seconds, this may be a cool gadget in order to take down the entire environment.
257060	262080	But you do not need to actually take it down to just see that one request takes more than 10 seconds.
262220	267920	And also, if you are allowed, you can still try to take down the non-production environment,
267920	273640	so staging, integration, sandbox, et cetera. But if there is something to know about this
273640	279520	entire talk, please, always ask the programs before even searching for their services.
279840	284760	Because programs need to be aware of what kind of tests you are going to do in order for them
284760	290200	to monitor. And if everything is going to fire, they need to identify that you are the one doing
290200	297180	the test and just call you and say, hey, I think there is a problem here. And DDoS service is all
297180	304720	about program's maturity, right? Some companies do not care about, you know, services risk,
304720	309540	because they, I don't know, they don't have, like, user traffic or stuff like that.
309720	314960	But actually, some programs will allow you to completely take down their product environment.
315500	320500	And I'm serious. They are completely allowing to take down their dub-dub-dub environment. So,
320500	325100	this is amazing. Before starting going on all the different techniques, I need to
325100	332020	thanks Rezo, Zack, Ixo, Snorlax, Befed, BonsoirD, and DoomerHunter. Those are amazing hunters.
332080	337880	We did all this research together on the span of two years. So, I needed to quickly show that to
337880	345380	them. Amazing people to follow, too. Okay. Let's start with a quick vulnerability. This one
345960	351180	is really fun. So, one evening, we were hacking with Snorlax. And there was this application
351740	358280	that was sending service to send chat messages. And so, with Snorlax, when we're hunting together,
358280	365260	we have this game where the goal is to basically try to XSS the other one. So, we were contacting
365260	371320	one another, sending messages, and we're, like, the first that got XSS wins it. But at some point,
371320	377020	we were doing a test, and my page completely goes blank. And I was, like, maybe I lost internet.
377020	381080	But I was still hearing Snorlax on Discord, and I was, like, there's something weird, right?
381180	390620	Until he tells me, hey, Lupin, is your page blank, too? So, those are the payloads that we sent at
390620	396620	this moment. So, try to think about which one did manage to make the page entirely blank.
396920	406100	Do you have it? Yeah. This is the one. And so, to understand why this payload made the page
406100	413200	blank, you need to understand that the service was using a library called sanitize HTML. So,
413200	420360	basically, it's some kind of DOM purify that will try to sanitize every XSS that you are going to
420360	427760	send. And this library actually tried to sanitize every href attribute in your frontend. So,
427760	433420	for instance, if you have a JavaScript schema, it will try to remove it from the href.
433420	439800	However, in this payload, where is the href? There's a problem here. And so, the library
439800	446780	actually called the function href and take an argument href and do a dot replace on it. However,
446780	453660	when it's undefined, it completely crashed the entire frontend. Okay. That was a pretty cool one.
454040	460280	And so, for every kind of client-side service, I would say that the impact is not that huge.
460280	468020	It's all depending on the target. Overall, with this specific technique of malformed data,
468020	476240	HTML, we did $350 bounty. But that's just the start. If you want to actually search for more
477980	483360	malformed data in the frontend, you can... there was a cool vulnerability where we had, like,
483600	489140	a post request and we could send any invalid JSON. That was validated by the backend, but
489140	495180	it was a completely malformed JSON. And so, when the frontend was using it, it will also
495180	504220	completely crash. And so, the malformed JSON was really simple. It was using two back quotes at
504220	509620	the same time. Two escape back quotes. And so, it was somehow accepted by the backend. But when you
509620	516960	were doing a JSON.parse on the frontend, it would completely crash. And so, this technique actually
516960	523480	worked on TikTok and we got paid for that. So, that was a cool one. But there's some cooler
523480	531140	techniques now. Okay. So, that guy here is one of the biggest problems for all developers.
531860	539520	The N plus one problem. Basically, this technique... I actually knew about it because my
539520	545220	brother, who is a backend developer, told me about... like, we were talking about services
545220	549520	and how I was trying to exploit them. And he was like, do you know what's an N plus one problem?
549520	554120	And I was like, no. And he told me that, basically, an N plus one problem was a database
554120	562240	when one query leads to N additional queries, causing inefficient data retrieval.
562960	569400	So, basically, an attacker can exploit N plus one queries to trigger numerous calls to the database
569400	576000	and potentially overwhelm the system. And the impact of an N plus one query often scales with
576000	582200	the data size. So, the more data that you have, the more DOS capability you can have on your target.
583140	587360	So, how do you detect an N plus one query? Basically, you find an endpoint that creates
587360	593260	data in the API. You find a request that gets all the data at the same time. So, usually a get
593260	597580	request. And if there is pagination, try to increase the limit. For instance, you have some
597580	604640	request that is page equal 10. Try to put 10,000 and see what's going to happen. And if the more
604640	610360	data you add in the backend, the more time delay there is in the response, then you have an N plus
610360	617660	one error. I also created a BURP extension that I'm going to release right after this talk.
617860	624040	That's called Tridos. And basically, it's going to search in your proxy passively all the requests
624040	630840	that takes more than X seconds, where X is a threshold that you set yourself. I personally put
630840	637160	it to three seconds. And this is a good way to actually identify queries that might take a lot
637160	644920	of time on the backend and that you can actually use for your exploitation. So, let's take an
644920	652660	example of an N plus one problem. There was an app that could accept to get as many objects as we
652660	658500	wanted. The JSON blob was something like that, where you had a list of users. And then on each
658500	665200	user, you can create... on each array of the list, you can create a new user. And then there was
665200	671180	another sub object with another array with new objects. So, that's basically an N plus one
671180	678440	problem, when one request can create as many sub objects as you want. And so, how did we exploit
678440	684560	that? Well, we sent the request to create all those objects and we created approximately 10,000
684560	692980	objects in the backend. And then our get request to retrieve all the objects took 10 seconds per
692980	699180	request. So, that's a really, really good sign that you have an N plus one problem. We took
699180	705280	that request, we put it into an intruder on Burp, and we set it with no payloads,
705280	711120	concurrent requests, and we basically set it to run indefinitely. And the result...
714300	721560	complete crash. Overall, this technique, not only single-vulnerability, but overall, we did 46,000
721560	729320	dollars in bounty. There was an LHE this week, so we can add 10,000 more to this slide. I think that
729320	737140	30k of this was Snorlax alone, because he's so good at just taking one technique and spreading it.
737140	743880	I think he did 15k per vulnerability, so in two vulnerabilities, 30k. That guy is insane.
745100	751720	Okay, let's talk about network-based denial of services. Have you ever been in that situation
751720	757460	where you have a blind SSRF and you don't know what to do with it? And that you are desperate
757460	763020	for a technique that will help you transform this sometimes informative vulnerability into a higher
763020	771480	crit? Well, we have a technique for you. Basically, do you guys know something called, like, slow
771480	777280	low-risk attack? Well, basically, we are going to try to do something really similar where we are
777280	783380	going to try to make the bucket hang on the network level as much as possible. We can do it
783380	791020	with several ways. You can make your server hang and just time out after 10 seconds, or you can
791020	797880	create a request loop. So what do I mean by request loop? Well, you have your server that has a path
797880	805180	that will reject 301 on path 2, and then the path 2 will reject again on path 1, so we create, like,
805180	812760	an infinite loop of redirects. And the goal is to make the server time out as much as possible.
812760	820320	So we have that kind of schema happening. And the goal of that technique is actually to fill
820320	827320	all the available sockets of the server so it couldn't actually treat the next request.
828580	834080	Until we have this bottleneck happening and there is no available sockets anymore.
836820	844540	For this technique, I think it was on two separate vulnerabilities, we made 15k. So it's actually a
844540	850320	great technique to transform blind SSRF into a critical. Again, every time that we take down
850320	855740	product environments, we always ask for the programs. Really be mindful of that. But that's a
855740	863340	pretty cool one if you're ever stuck. Okay. Let's go to sign-in denial of services.
864520	871460	This one was really cool because we had a target with an employee web page. And basically when we
871460	876740	see an employee web page, we try password stuffing or brute forcing, we see proclamation,
876740	882420	injection, et cetera, et cetera. But why this target was particularly interesting for us is
882420	888700	it was a target with more than 1,000 employees, there was no rate limiting on the login,
888700	894120	no 2FA at all, and they were using first name dot last name for the user. So we could pull
894120	901260	everything on LinkedIn and we had a great world list to work with. So what do we do? We managed
901260	908740	to automate the attack, no rate limiting at all, and then no login found. Wait. No login found?
908740	916520	But we still got a crit. Okay. Guess what protection they implemented for brute forcing
916520	923920	attack? Is it A, delay the next attempt? B, capture? C, ban the IP address? Or D,
923920	933550	ban the employee account? There is actual documentation on the internet that says that
933550	939970	this is the right thing to do. So, yeah. What happened? 600 accounts locked.
940530	946530	They had integration with the ID, so active directory completely down,
946530	953910	no access to the VPN anymore. Completely take down of the internet environment. So funny.
954470	961490	I would say that the impact of this technique is actually like a three out of five, but it's
961490	966630	because the presence in the world is also reduced. I don't think that a lot of companies are doing
966630	974710	that anymore. But pretty cool bug. Okay. Let's go to another type of DOS.
974810	980870	Disconception DOS. So, this story is quite cool. It started because I read this asset node research.
980870	986610	If you guys don't know asset nodes, you should read every blog post of them. It's amazing.
986610	992290	And there was this blog post from 2019 called discovering a zero day and getting code execution
992290	998250	on modular AWS network. So, how did asset node achieve that? Basically, there was an instance
998250	1003890	called web page test. And it was completely open source. So, they read the code. And there was
1003890	1009330	like this piece of code where you could extract a zip file that was given by the user. And then
1009330	1015010	with some kind of quick race condition, you could actually call a PHP file.
1015070	1021310	And so, for this race condition to work, you needed to set up an intruder and just run as
1021310	1028790	many requests as possible. What happened when I tried it? The backend didn't have enough
1028790	1033770	inodes to take the charge of requests. So, every time it was creating a zip file and trying to
1033770	1041590	extract it, it was allocating inodes. And so, the disk was full in like maybe two, three seconds.
1041730	1047570	So, yeah. I took down the instance. And I thought that this instance wasn't used by anyone until
1047570	1052630	someone told me, hey, all the pipelines are down. And so, every time they were running a pipeline,
1052630	1059970	they were going to that instance. That's cool. So, total crash of the server. No access to the
1059970	1065430	disk. They needed to clean everything, wipe out, restart the server. That was a cool one.
1065490	1070750	I would say that, again, the impact is reduced because of the presence in the world. So,
1070750	1082730	it's a three out of five. Cache poisoning. That's a good one. So, one day, we were developing a new
1082730	1088850	feature for our tool in research mode. Research mode for us is when we want to test an idea and
1088850	1096950	spread it to see if it should be incorporated into our tool for our customers. And so, the idea was,
1096950	1102330	what if registries, when you install a dependency and have two factories, used by the clients
1102330	1108250	were vulnerable to cache poisoning in our service? It's a good thing to try. So, we developed a proof
1108250	1115870	concept. And on the first run, we managed to get a hit on registry.npmjs.org. And I was like,
1115870	1124110	no. That didn't happen. Like, no way. So, we thought it was a fault positive. And lo and behold,
1124110	1133980	it worked. So, what is CPDOS? CPDOS is a web attack technique described by Paul Truger.
1134750	1139710	Paul Truger actually made it really, really famous. Again, if you didn't read in your life
1139870	1145650	a James Kettle research, you should do it. This guy is amazing. Always breaking the internet.
1145930	1153290	And basically, it's in the web caching system in order to deliver malicious content to the users.
1154110	1162050	So, the methodology is to first understand how the cache keys of our target is working. And then
1162050	1169050	understand how the output of the request is linked to your HTTP input. So, for instance,
1169050	1176270	is the cache key inside the path? The headers? Or maybe the post requests? Once you identify the
1176270	1181650	cache key, try to understand how you can manipulate it in order to catch unwanted content.
1181650	1187610	So, it could be a malicious content like an XSS payload or it could just take down the page for
1187610	1196150	all the users. So, the case of registry.mpmjs.org was pretty cool. Basically, my assumption is that
1196150	1204810	the cache key was actually the full path. And when we added our malicious header, it will create
1205530	1211110	a fall for error. However, the cache key is still remaining the same. And so, it will just
1211110	1220850	override the cache key with a 404. So, at this point, we called deny packages. That's a screenshot
1220850	1226810	of my script running in the back and I'm trying to do an npm install and then that's it. We got
1226950	1232710	a 404 in production environment. So, that was kind of cool. Don't worry, I did it on the package
1232710	1240350	that I created myself. I didn't take down anything, hopefully. And so, the impact was a complete
1240350	1247530	denial of any npm package in the world. Imagine experts as 30 million plus downloads per week.
1248110	1254450	Actually, there was a lot of mitigation in place on GitHub and npm side. But
1255530	1264830	what's quite cool about VT. And so, first, they awarded a $500 informative. But then,
1264830	1271290	they actually did an awesome work to reconsider the severity and they added a $10,000 bounty
1272060	1280990	for this npm crash. So, I was so happy. Especially for something that we didn't do on purpose, again.
1281970	1288460	Okay. Let's go to another cool attack vector for denial of services. Everything related to GraphQL.
1289030	1294960	So, why are we talking about GraphQL today? Because it has a huge adoption in the last few
1294960	1301020	years. And there is so many denial of services in the default configuration. But when I say
1301020	1311160	so many, I say so many. First case of denial of services on GraphQL is a circular definition.
1311160	1319600	Basically, a circular definition occurs when an object references itself directly or indirectly.
1319600	1326820	For instance, here we have a type user that has a best friend user. But imagine if your best friend
1326820	1331400	is also best friend with you. You are basically referencing yourself. So, we have a circular
1331400	1337680	definition here. But no need to check for the introspection and actually understand the structure
1337680	1343620	of your target. GraphQL is vulnerable by default in the introspection schema. So, you can just do
1343620	1348280	an introspection and actually DOS your target without understanding their data structure.
1348640	1356580	That's insane. And so, there's another kind of technique called GraphQL batching that is
1356580	1363580	pretty cool. Basically, the goal is to compile a lot of different requests in the same HTTP request.
1363580	1369780	Again, this could be used to actually DOS your target. We're going to talk about this a little
1369780	1375340	bit later. Something really similar to GraphQL batching, there is aliases where basically you
1375340	1382960	can use different aliases for the same request, but also use different arguments. So, that also
1382960	1390340	could be a huge attack vector for denial of service. So, quick tip for batching and aliases
1390340	1396880	is to actually try to find gadget. What I call gadget, if it's the right definition,
1396880	1402640	but what I call gadget for this specific vulnerability is to find a query in the
1402640	1408440	structure of a target that takes already 200 milliseconds up to 500 milliseconds. Sometimes
1408440	1417120	more. When you don't optimize anything, I guess. And use this specific query in every batching
1417120	1423200	request that you do, or in every aliases. And this will allow you to send a lot of requests to
1423200	1429160	maybe the disk operation that it does, the memory. It really depends on how the backend implemented
1429160	1436640	it. But this could take you like a batching that takes five seconds per request up to five minutes
1436640	1446200	per request. So, this is a good way to multiply and amplify your DOS. And there is this one.
1446200	1453480	The GraphQL directives. So, what's a directive? It's a way for GraphQL to decorate a part of the
1453480	1461280	schema and actually to do an operation on top of it or additional configuration. And there is a
1461280	1467300	technique called GraphQL directive overloading, where basically you can just make that payload,
1467300	1474890	repeat the at eight as many times as you like, and it will totally crash the server somehow.
1475600	1484820	But we had a cool story on the Google console with evolving that. So, let's imagine that a
1484820	1491280	directive could be used for, again, our type user. And you can query every user with the
1491820	1498820	admin or user. So, that's the way that normally we could use a directive.
1499660	1505800	But then Google was using the directive in a very, very strange way. Basically,
1505800	1512600	you add the query list operation, for instance, and then you see that we have a directive at
1512600	1520820	signature with bytes inside. And what they were doing, they were actually signing the body of the
1520820	1528360	request from within the GraphQL request. And every time that we wanted to modify any variables
1528360	1534440	or anything in the schema, we will get an error. So, you know, when we're trying to
1534440	1539780	attack a backend, we really want to modify the request in our proxy. So, that was a huge
1539780	1545240	bummer because it means that everything was totally signed. So, we tried to see if we could
1545240	1552000	sign out our requests. But the problem is that they were outcoding everything in the JavaScript.
1552000	1556800	So, generating everything on the build and putting this in the JavaScript. And so,
1556800	1563640	they actually told us that they were using a secret that was a passphrase. And it was also
1563640	1569680	outcoded inside the codebase. So, they awarded $1,000 for that. But that was a fun one. But
1569680	1577280	nothing related to DOS. But there is something interesting. How they can sign the body and put
1577280	1583940	the signature inside the body. This means that there is something in the GraphQL that is not
1583940	1589740	being checked correctly, right? That is not inside the signature. And normally, it's just the
1589740	1596420	signature itself. So, this means that we can add as many signatures as possible. And every time
1596420	1601940	we had a signature, they were running the check of the entire body all over again.
1602400	1609680	So, we wrote a script where we will add 10 directives, 500, 1,000, up to a million. And
1609680	1618800	check the request every time. What happened? The first 10 directives, 0.9 seconds to answer.
1618800	1625740	500 directives, one second. We had 5,000 directives, 2.7. 10,000, 2.6. Don't know
1625740	1634840	what happened here. 50,000, 6.5, and then up to 1,109,000 seconds. So, we had 1 minute 40
1634840	1646180	per request, which is huge. This was found with Rezo and Google gave us a 6K for that. And I
1646180	1654420	think that compared to the presence in the world, the impact is really high for that kind of stuff.
1654420	1662080	And overall, for all the GraphQL DOS that we did in the back... oh, sorry. Pro tips. Yeah,
1662080	1669400	this one is important. GraphQL exposes WebSockets, depending on the configuration and on the backend.
1669860	1677260	But this WebSocket server usually do not have any WAF or any check, and people often forget that
1677260	1683400	it exists. So, if you have rate limiting in place and you want to exploit any GraphQL DOS, you can
1683400	1691360	just go to the WebSocket and there is no security anymore. And if you like actually GraphQL hunting,
1691360	1698600	if you go to the WebSocket, you can also have introspection and other GraphQL configurations. So,
1698600	1703840	it might actually give you a lot more attack surface. So, that's another GraphQL pro tip.
1703840	1712420	And overall, with all the GraphQL services, we made 70K bounty. So, every time you see GraphQL,
1712420	1719640	just say to yourself, we can take it down. Okay. I had to rush a little bit this presentation
1719640	1725520	because we were having this HTML problem. So, let's go to the conclusion. Let's talk about
1725520	1732480	the timeline of this entire dinner of service research. The first dinner of service that we
1732480	1741920	found with Snorlax was in 2022. And the last one that we found was last week. But the main focus
1741920	1747820	of the entire research was doing eight months last year. So, most of the bounties were made
1747820	1755600	in a span of eight months. And so, how much bounty overall we made with this entire research?
1756840	1767720	We made almost $150,000 in bounty, which is a lot. I would say for a technique that is out of scope.
1767720	1774100	And something that is actually quite interesting is that I think that this could be a main
1774100	1779720	vulnerability for a lot of bug hunters, but I would say it's better to use it as a side
1779720	1785520	golden goose. So, for instance, if you like to find a lot of vulnerabilities and then at one point
1785520	1791420	you have no ideas anymore, just look for a DOS, you'll find one, send it, make a quick bug out of
1791420	1799300	it. I think it's a good way to do it. Before finishing this presentation, I needed to do a
1799300	1806380	huge shoutout to Idnama. She's our graphical designer. When I asked her, hey, can you do this
1806380	1811840	entire presentation for DEF CON, she was like, what do you want me to do again? 2,000 memes,
1811840	1817560	a lot of reference, a lot of things. I think she did an amazing job. So, huge shoutout to her.
1818280	1822880	Thanks a lot, everyone, for attending this presentation. I hope you liked it.
1822880	1827940	And if you have any questions later, I will be happy to answer them.
