start	end	text
0	10320	So, sometimes bug hunters, we find bugs, like we work really hard to find bugs, but sometimes we're lucky and bugs find us.
10600	15280	So my talk is about luck, in a way.
16300	18020	So let's start.
18840	22760	I have to admit, I grew up using PowerPoint.
22760	24700	So I'm still using PowerPoint for my slides.
24700	29180	I'm not using Google Slides or any modern application.
31160	38040	And I'm the kind of guy where black on white is perfect, but I know it's not always visually appealing.
38040	53300	So in PowerPoint, there's a feature called, I think, Design Suggestions, where it's an AI-based feature and it suggests, based on your contents, a slide, a template for you, where it's just a couple of designs.
53460	54660	So I picked one.
54660	60600	This morning, I noticed that Microsoft thinks that Canada, we live in igloos.
60960	64600	So it shows my name, based out of Montreal, Canada.
64600	65820	I don't live in an igloo.
65900	68160	They should just put a house, like, I don't know.
68240	71080	Anyway, so my name is Jasmine Landry.
71080	72160	I'm a French-Canadian.
72520	76080	In English, my name is, I guess, Jasmine, or as my friends call me, Jazz.
76660	79080	I'm currently a full-time bug bounty hunter.
79600	81740	I've been doing it for almost a year now.
82320	86500	I've been in IT and cybersecurity for, I think, 12 years.
87060	93800	Before doing a bounty full-time, I worked at NASDAQ as a senior director, information security.
93980	97780	I used to manage the AppSec team, did some...
97780	100420	My team also did the pentesting and red teaming.
100480	106440	And as a typical Canadian, I'm an avid hockey player and a hockey fan, so go Habs go.
109200	113400	So this is about when bugs show up on your doorstep.
113830	116800	It's not about like recon or crazy exploit chains.
116800	122920	I may have one that's pretty cool, like something crazy like what James Kettle did yesterday.
123160	131080	It's about those weird, funny, or chaotic bugs that are often unexpected, but as a bug hunter, they're always welcome.
131960	133580	So here's what you're in for.
133680	136800	I divided this talk in three sections.
137080	141520	The first one is luck, bugs that got dropped in my lap, pretty much.
142300	152140	WTF, bugs that kind of made no sense to me when I found them, and LOL, so bugs that are so ridiculous, it just like kind of made me laugh.
152280	154380	And then in the end, Q&A if we have time.
155300	157920	So let's start off with luck.
159480	172620	And in bug bounty, when we get lucky, it's often where it's something that is unexpected, like a blind XSS, we just like put a payload and maybe eventually it'll pop and we'll get something cool.
173100	179200	So the first two bugs on the luck side of things are both blind XSS.
179360	182300	So what was I looking at back then?
182300	185040	It was a cloud compliance application.
185340	196200	So like it was an app where we could test if our infrastructure was like SOC 2 compliant or ISO 27001, all of that.
196400	197720	It was quite hard.
197720	204960	I only had like one or two bugs, both or I don't remember if it was one or two, but low or medium, not really impactful.
205440	210400	So I decided to just like spray and pray payloads all over the place.
210940	217740	If you're not familiar with the term spray and pray, it's pretty much just like spraying payloads and praying that one will work, right?
218240	219420	So I did that.
219420	223300	And obviously one of them did work.
223460	229360	Back then I used XSS Hunter as my XSS, my XSS tool.
230060	238080	So with that tool, it captures like the URL, cookies, you can download the DOM.
238320	240380	There's also a screenshot you can get with that.
240920	247960	So the URL was this, X, Apple, QLID, UUID, and then like X, Apple, QL Magic.
247960	249540	It was like, that's pretty odd.
249540	250720	I've never seen that before.
250980	257360	And then I look at the screenshot, it's an actual CSV file, not like a webpage or HTML file.
257360	259200	That's really weird.
259380	270040	In that file, there were like org IDs, AWS account IDs, partial credit card data, and other not as sensitive data.
270720	277500	And inside the DOM that I was about to download, there was this specific string, quick look CSV.
277500	289520	So by putting all of these pieces together, I learned that the QL in the X, Apple, QLID, I guess URI scheme was actually quick look.
289520	294120	So quick look is a feature in Mac where they can preview files.
294700	297400	So what is quick look CSV?
297740	302160	Well, it's a plugin for quick look in Mac.
303160	305660	So it's specifically for CSV files.
305880	314800	Now, I'm not sure if you guys can see well, but the main.c file, the last commit or last modification was 16 years ago.
314800	317720	I was like, interesting.
317720	323040	The last actual change was eight years ago on the license file.
323380	325900	So it was pretty old.
326600	335920	So I tested it out locally and it was actually vulnerable, just like using brew install, whatever it was, and it worked.
336400	340020	So what did I, what was the result of this?
340240	347100	I'll read out what I got as a message from the program on the bug match platform.
347100	348420	That was bug road.
348640	361980	So he said, even though this isn't a vulnerability in our application per se, we are considering this a P1, additionally eligible for the bonus listed in our brief because you managed to get access to some data about our customer accounts in there.
362560	374440	What's happened is some people in our org were running a microservice, which exported data from the production environment and viewed the export on their machine using this quick look CSV vulnerable software.
374820	382280	So we want to reward you for bringing the issue where production data being transmitted outside our production environment to our intention.
382280	389600	So since there was like credit card data in there, PCI was gonna knock on the door, maybe eventually.
390860	394280	I also got a bonus for getting access to customer data.
394900	403920	And I was the only researcher that reported it despite having many other blindness payloads in that file.
404380	412860	And what's funny about that is that I remember getting the alert like on a Friday evening and took me a while to figure out what company it was.
412980	416320	And they eventually reported it two days later on Sunday.
416800	423960	So lesson learned with that on my end is when I spray payloads, make sure I can identify where the input is coming from.
424080	427500	But that was like when I started like 2018 to 19.
427940	429360	I'm not doing that anymore.
429360	432000	Now I'm more, I guess, experienced.
432000	434360	So I do identify my payloads.
435280	446080	Additionally, we previously classed several of the submissions from researchers as low priority based on how difficult it would be to guess a number of customer accounts or org IDs.
446080	448520	And I managed to get a whole dump of it.
448520	450860	It was like a thousand line file.
450860	453620	So it was like a big dump.
454300	464400	And lastly, I want to tell you that internally I received, make sure your reward is finding messages from technical lead, head of security and CTO.
464560	465980	Is that one person?
465980	466580	I don't know.
466580	467040	Is it three?
467040	469700	I'm hoping it's three, you know, it's more cool.
469960	475600	But I found that pretty cool to get that on a message in a bug bounty, I guess on a report.
476560	480580	So bug number two, what are we looking at now?
481240	483720	This is another hardened app.
483720	485580	This time was built on Rails.
485820	489060	And at first sight, it didn't seem vulnerable to XSS.
489600	491420	It was a large company.
491420	500040	So I figured maybe to have like processes in place where they would take my input and, you know, transfer it elsewhere.
500040	503120	So I figured, what do I do?
503120	504920	Sprint for your payloads again.
505460	508200	And obviously it worked out.
508200	512400	I got a second blank XSS payload, a blank XSS pop.
512820	519460	And this time, what was captured in XSS Hunter, the URL was also not something usual.
519460	522720	It was about source doc, which I was like, hmm, that's kind of odd.
523700	526500	And the screenshot showed this.
527600	535820	Let me just, actually, yeah, I can't really change it, but it looks like an email, right?
535820	541100	We can see like this sent from to one subject and the body of the email.
541100	544680	And the subject says, please investigate customer ID.
544680	547060	I was like, that's really weird.
547420	553820	But if you look at the email itself, it says, you and your friends ruined a fine experiment.
553820	555680	You should be ashamed of yourself.
555740	557400	And then my XSS payload.
557820	561400	And then it said like, it didn't apply with instructions.
561580	563060	So what happened?
563060	570120	Because of my spring of payloads, someone filed a complaint on my account.
570440	576760	And the complaint, which contained my XSS payload, popped in like an internal email system.
577440	582180	So because of that guy that filed a complaint, I got a nice four-digit bounty.
582460	590120	And funny story related to that, a couple of days after I reported it, he messaged me on Twitter.
591040	594300	I figured I had my JROC name somewhere in the application.
594720	597160	And he was like, man, you ruined my day.
597160	598440	I wish a lot of time on what you did.
598440	600260	And I was like, what did I do?
600260	603540	He was like, you did a ton of BS stuff.
603540	605940	And anyways, I was like, well, sorry, man.
606420	607660	I'm just doing bug bounty.
607660	608580	Like, here's a platform.
608580	610040	I'm authorized to do this.
610040	611680	Like, this is legit stuff.
611880	612940	I was like, oh, you do bug bounty.
612940	613760	That's pretty cool.
613860	614700	Take a look at this.
614700	615940	I was like, awesome.
615940	616980	Bring it to me, man.
617400	621540	So he was actually like telling me like places where for him it looked weird.
621540	624200	And so in the end, he was a really cool guy.
624200	626880	And I just, I guess he had a bad day and all that stuff.
626880	629060	So it's a funny, funny story.
630180	634220	So now the WTF bugs.
638870	640750	So what are we looking at?
644030	647690	I was participating in an LHE, so a live hacking event.
648190	650950	This was a really huge scope.
650990	657670	So I just picked a random application, but to log in, I had to be an employee.
657990	662850	So obviously I didn't have credentials, so I couldn't log in.
664070	675730	I tried everything that I could think of to bypass authentication, like LDAP injection or, you know, regular like odd bypasses, tricks and stuff, but nothing worked.
676230	677810	So what did I do?
678090	681970	No, I didn't just pray and pray and blindly accept all this time.
682090	693770	I did some fuzzing though, to try to see if, you know, something could happen, you know, injecting Unicode characters and anything that I could think of with fuzzing, but nothing worked.
694550	699570	However, one week later, I got an email.
700610	705250	I don't have a screenshot of the email anymore, but I'll show you what I wrote in the report.
706030	718650	I'm not exactly sure what happened, but it seemed that my research email jrockatwearehacker.com has been added in a group that received new access requests from and then redacted domain.
719230	721730	So what happened here?
722050	726070	I somehow got added in an internal distribution list.
726550	736250	So in the email, we could see like a dozen like employees in the tool field, and then in there, there was my hacker email address.
736590	743530	And in those emails, well, actually I couldn't still, I still couldn't access the application for some reason.
743670	753630	I was like an admin, but I still have a legit login, but I could most likely approve or deny users access requests.
754070	755850	What was in those emails?
755890	760890	Well, can't say much about it, but there was some PII.
760890	773870	The users had to say where they were located, so their address, other PII information, as well as other not as much information.
774390	777750	But in the end, it still had PII.
778230	781310	And this lasted about a month until they fixed it.
781330	789350	I was getting roughly four or five emails per day for roughly a month, so I thought it was pretty funny considering the target.
789350	794350	But if I tell you, you'd probably laugh as well.
794350	796330	So yeah, it was a funny bug.
797490	800070	So bug number four.
801580	804690	This was probably the most interesting one.
805520	810290	I put it in the WTF section because I wasn't expecting it at all.
810450	818250	So it was an application where we could deploy WordPress applications in an automated way.
819930	828210	It provided an API and along with many tools such as phpMyAdmin to, I guess, manage your WordPress instance.
829730	832250	So I was doing my regular hunting on it.
832730	842470	One thing that I often do is add a service type injection payload, so like double curly brackets, seven times seven, in my email address because I've had luck with that in the past.
842470	845910	So I did that for this application as well.
845910	851030	So JROC plus, and then my payload, and then, yeah.
851610	862610	So one day while looking at the tables in phpMyAdmin, I did see that my SSH API payload did render to 49.
862610	870590	That means that something was going on in the backend where it was evaluating the template.
870590	872050	Can you guys see it correctly?
872310	874090	Yeah, the sun is in front, right?
874450	876250	Anyway, so it does show 49.
876250	877850	It didn't evaluate properly.
882030	885470	So I did have a server-side template injection.
887630	892650	I played with it for a long time to try to figure out what engine was actually used.
894470	898430	And after a while I was like, man, I have no clue what's going on.
899710	904610	I know it's not phpMyAdmin, so I looked at the code and all that stuff and that wasn't it.
904610	905790	It's something else.
905790	911050	So I ended up asking the program what was going on.
911050	920570	I submitted a report to them and I knew they would reply with something because we had a relationship with them, and ended up telling me that.
921510	934790	So in the API that powers their application, obviously talks with WordPress and built on PHP, as we all know, and then it passed data in a Python serverless API.
935070	943950	I figured Python has Jinja, which is a template engine, but in this case, it doesn't make sense because it's a serverless API.
944070	945510	It has to be something else.
945670	947810	And then it passed data to Ansible.
948290	952790	So I knew what Ansible was, but never actually played with it.
952790	955010	I knew what it was for, and I was like, hmm, that's probably interesting.
955010	961090	Let me look if there's expressions, something like that, or templates inside of Ansible.
961090	966970	So I did a bit of research and stumbled on the Ansible playbooks.
967410	971930	So if we look at the docs itself,
975490	986230	all good, it actually uses Jinja, which makes sense because my double-created brackets is the same syntax as Jinja, right?
986230	989330	So there's something here, right?
989670	998170	So I just looked a bit at the documentation and saw that there were variables.
998370	1000970	So what I did next...
1015870	1022750	So I found the playbook underscore dir reserve variable, or as I called it, a magic variable.
1022750	1027630	So this is pretty much just a directory of where the playbooks are stored.
1027990	1037030	So I put that in my email address and as you guys can maybe not see, or yeah, you guys can see well, cool.
1037090	1037870	It worked.
1037870	1042510	So I knew that it was Ansible, so I confirmed it was Ansible, right?
1042990	1046370	Since I was able to extract the data from the variable.
1047290	1049590	But what can we do with it?
1050210	1052610	So I ended up playing a bit with it.
1053290	1055950	I found a way to extract all environment variables.
1056250	1065270	As I mentioned in the report, I used like the expandVars function to extract the data in the shell environment variable.
1065270	1068690	Same thing for the user and it worked.
1068970	1071670	And then they replied with, thank you.
1072250	1075530	I think this is enough to show that it's pretty bad.
1075690	1079150	You could probably extract secrets from an Ansible environment.
1079390	1084050	But if you look at the time here, it's like 12.45.
1084170	1088790	Roughly three hours later, they decreased it to P2.
1088790	1092670	I was like, shit, what can I do now?
1092670	1094290	So it's Ansible.
1094490	1096650	I can probably get an RCE here, right?
1097290	1102930	But since I didn't know what Ansible, I mean, since I had never played with it before, I didn't know how.
1102950	1111010	Especially since my injection is through like a template injection, which is probably not the same way as like declaring actual Ansible code.
1111870	1114410	So what do we know so far?
1115570	1120130	The email address needs to be RcE compliant when registering.
1120970	1130550	So when you create your account on the app, it'll like send an email to verify that, you know, like as a regular application would do to verify that you own the email address.
1131770	1144950	And Inti, which I'm not sure if it's here or not, did a talk at the ActivityCon in 2020 called You've Got Pwned Exploding Email Systems, which is a really great talk if you guys want to listen to it.
1144950	1147530	We saw YouTube and really enjoyed it.
1148070	1154910	So I kind of, since then, I've been putting like payloads in my email and it's surprising how many times it works.
1157250	1165490	But when we changed our email address, like when we went to our profile and changed our email, nothing happened.
1165570	1167550	No emails were sent to verify.
1167550	1169650	You could just put in like any characters.
1169650	1175190	It wasn't really checking whether it was RFC complied or not, but there were limitations.
1175190	1178710	I could put in a parenthesis and a comma.
1178710	1180890	So these are the only limited characters.
1180890	1181370	Why?
1181370	1184910	I don't know, but it is what it was.
1185770	1193190	So next step, by looking at the docs, I stumbled on the Lookup plugin.
1193910	1200370	And there's one in particular called Pipe or a part of the Lookup plugin, which is built in.
1200370	1202290	And it's pretty much what we want.
1202290	1209830	It reads output from a command and it's installed by default in all Ansible installations.
1210750	1217590	So here's an example of what it will look like within an Ansible YAML file.
1217590	1223930	We can see like they're using Pipe with the command date and yeah, another example in the bottom.
1224290	1228270	So can we do that on the application?
1228270	1229790	So first I tested it locally.
1230610	1232590	Here's what it looked like.
1235110	1237870	I should have put the font bigger.
1237870	1238750	Sorry, guys.
1242640	1243480	So it worked.
1243480	1247920	So I was able to run the ID command, at least locally, right?
1250120	1256720	And with like a regular payload, which contained the Lookup, Lookup and Pipe and then the command that I wanted to run.
1260830	1269350	But in my original payload, I had parenthesis and a comma, which are kind of required in the payload itself, right?
1269610	1274590	But Jinja is Python, it's Python based.
1274590	1282710	So we can use like backslash and X and then like the hex character, which worked.
1283030	1289970	So I'll just show an example of extracting its password file just for my, you know, just to make sure that it actually worked.
1289970	1293530	And then I ran the pipe command.
1319000	1321960	And by the way, that email, I don't own it.
1321960	1324700	It was just like to show that it was possible.
1324700	1329720	So if you want to send emails to jrockatgmail.com, go for it.
1332760	1335400	So we saw that it works.
1335400	1342740	So with this payload, it respected their limitations of not having parenthesis or commas.
1344180	1355600	It is not a Darcy compliant email, but since they weren't verifying that after a change, it was valid for that specific case.
1355600	1364120	So I ran that on that application, looked at the table in phpMyAdmin and I could see that it was running as root.
1364700	1369320	So that was a pretty wild bug, I'd say.
1369380	1375480	I put in a WTF because like I was expecting to inject Ansible in application like ever.
1377560	1381700	So next up, the LOL section.
1382620	1385320	So what was I looking at?
1385320	1387460	A fantasy sports application.
1388720	1391980	People could create private fantasy leagues.
1392320	1397380	The admin set up a password and they would invite their friends to join.
1398420	1400380	The WAF did a self termination.
1400380	1403220	So you can inspect the body of the post requests.
1404300	1410100	And it was really serious on blocking XSS payloads, strip the whole payload itself.
1410100	1421460	So putting like TE and then like straight through tag ST would result in TE and like a regular payload with nothing, it returned nothing.
1421580	1425860	So what did the password contain this character?
1425860	1427120	What would happen?
1428000	1433880	Well, what if users use a password that says, I love dogs?
1434080	1443300	The password would become I, which is kind of funny and easy to boot for us, right?
1444180	1449620	And randomly generated passwords such as this, the password would become T.
1450220	1454980	Or worse, if the password started with that character, there wouldn't be any passwords at all.
1455860	1465180	And the admin wouldn't even know it because she submitted the password and he doesn't know that the password that she has is not right.
1465700	1469220	So invites were sent with a password and clear text in the email.
1470080	1477760	And if the password was empty, considering the password started with that character, there was no passwords for the private leak.
1478740	1481220	And there weren't any passwords in the email itself.
1481220	1484860	So stats and results on this bug.
1485180	1490240	I could join a bit over a thousand leagues by simply reinforcing the first two characters of the password.
1490700	1492180	That was pretty funny.
1492540	1497280	56 leagues ended up not having a single password.
1499970	1504770	I could have won the prize money in the leagues and, you know, have some fun.
1505790	1510150	Our last bug here, I'm gonna do it really fast, and it's a pretty small bug.
1510910	1512870	Self-serve password reset application.
1513310	1515990	It was a new product built in 2019.
1516250	1518710	A product built on Perl.
1518810	1521690	Yes, you read that or heard that right, Perl.
1521830	1522210	Why?
1522210	1523070	I don't know.
1526110	1528310	So two screenshots required.
1528870	1537190	The first one you can see, I put the ID command in backticks and in the response, we could see the output.
1538010	1543130	So yeah, that was a really LOL bug.
1543130	1544470	So thank you.
