WEBVTT

00:00.000 --> 00:01.320
Good morning.

00:03.380 --> 00:05.280
Everyone showed up bright and early.

00:06.200 --> 00:10.720
It's a little early for a conference, but thank you guys for coming this early and joining us.

00:11.020 --> 00:13.860
My name is Ben Sadegopour, and I have Adam here.

00:14.380 --> 00:21.980
We every year come to DEF CON and we try to do a workshop that's different, and we'll talk about the workshop today.

00:21.980 --> 00:27.620
But this is, I think, a fundamentally interesting and useful skill that I want you to take away.

00:27.620 --> 00:31.480
There is a lot of slides to go through today, so we're going to go through them as fast as we can.

00:31.480 --> 00:34.080
I think he has 190 slides or something like that.

00:34.540 --> 00:35.780
198 slides.

00:36.600 --> 00:40.260
So it's going to be very fast.

00:40.260 --> 00:43.760
It's going to be a lot of regex stuff, and then we're going to apply it to bug bounties.

00:43.760 --> 00:46.920
So tons of stuff for our schedule today.

00:46.920 --> 00:50.580
I will talk about some of the OSINT and how I apply this to bug bounties.

00:50.740 --> 00:54.480
Adam's going to cover, pretty much teaching you how to do regex.

00:54.480 --> 00:56.480
Again, if anyone here is really good at regex...

00:57.840 --> 00:59.260
Okay, I'm not either.

01:00.520 --> 01:01.320
I'm with you.

01:01.320 --> 01:02.120
Yeah, chat GPT.

01:02.120 --> 01:04.420
So yeah, we want to make sure you learn something and you can apply it.

01:04.420 --> 01:12.060
I think regex is a root cause of a lot of client-side vulnerabilities, some server-side vulnerabilities, and you can do a lot of good stuff with it on GitHub.

01:12.060 --> 01:16.480
So I'll let Adam... Actually, I'm going to introduce myself and then hand it over to Adam and I'm going to sit down.

01:16.600 --> 01:17.140
So I'm Ben.

01:17.140 --> 01:21.520
I've been doing bug bounties since 2013 or 14.

01:21.960 --> 01:24.680
I've done over 1.8 million in bounties.

01:24.680 --> 01:28.600
Majority of it since I've gone full-time since 2022 or 2023.

01:29.400 --> 01:41.600
Previously, I was the head of hacker education at HackerOne and currently Adam and I have co-founded a company called Hacking Hub, where we want to do more of these things and these workshops and courses and talks where we train the next generation of hackers.

01:42.100 --> 01:49.200
Most people have probably seen me on social media for my bug bounty stuff or content, but I also do some pen tests and content creation on the side.

01:49.200 --> 01:52.880
And you can just follow me at NahumSick on most social media platforms.

01:54.360 --> 01:55.920
Hey, I'm Adam Langley.

01:56.220 --> 02:03.600
Apologize if I have my head in the laptop, because like you heard earlier, I've got 198 slides, so there's a lot to look at and a lot to explain.

02:03.980 --> 02:06.820
So I started hacking in the late 90s.

02:06.820 --> 02:11.940
Got some interesting stories that I won't share quite on stage, but may exchange them for some drinks.

02:12.180 --> 02:19.960
Worked in web development for 20 years, then finally put both of those things together by creating CTFs and learning labs for people.

02:20.160 --> 02:27.460
You'll find some of my CTFs and educational content on Hacking Hub, HackerOne, TryHackMe, and other CTF events as well.

02:27.720 --> 02:35.200
As Ben mentioned, we run a company called Hacking Hub, where I'm the CTO there, and I build core applications, courses, labs, and learn CTFs.

02:35.200 --> 02:37.600
You can find me online at buildhacksecure.

02:39.380 --> 02:42.020
Okay, so just a brief purpose of this.

02:42.080 --> 02:46.100
Regits can always look very overwhelming, but we're here to help.

02:46.100 --> 02:47.620
We want to teach you the basics.

02:47.620 --> 02:51.740
It's not going to go through completely everything that's involved in Regits.

02:51.740 --> 03:00.800
There's different Regits packages as well, which some have some features and the other ones don't, but we're hoping to kind of give you enough information to make you dangerous.

03:02.280 --> 03:07.080
Using this will help you discover vulnerabilities and understand why they might occur.

03:07.400 --> 03:09.580
It'll help you search for things better.

03:09.800 --> 03:16.700
It'll help you discover secrets, and also I'll mention at the end some cool tools as well that you can build with it as well.

03:16.700 --> 03:24.060
So in summary, we're going to take you from this, hopefully, to Anoregits.

03:24.700 --> 03:28.180
Okay, so the first part is basic string matching.

03:28.420 --> 03:38.720
So in most programming languages, you have some functions in there which will help you work out if a string starts with, ends with, or maybe contains.

03:39.680 --> 03:43.100
So we've got Python, which it starts with, ends with, substring.

03:43.180 --> 03:45.860
JavaScript starts with, ends with, includes.

03:46.040 --> 03:49.620
You'll see a very common pattern throughout all the different languages.

03:49.640 --> 03:54.000
They all contain these things, apart from Go, which gets a bit crazy.

03:54.000 --> 03:58.320
It's got its own things with half-prefix and half-suffix, which is just a bit posh.

03:58.840 --> 04:07.460
Okay, so the first part of... so the problem with this is that it actually has limitations, so you can't always match the exact data that you want to.

04:07.460 --> 04:09.920
So let's just discuss the starts with limitations.

04:10.460 --> 04:16.520
So say if you've got a range of IP addresses and you want to see whether your client is visiting from one of those.

04:16.720 --> 04:21.800
In code, you might just have to have some horrendous if block or a switch statement to do that.

04:22.340 --> 04:28.720
With Regex, you can have this very easy to read thing to match all those patterns.

04:28.720 --> 04:31.100
Don't worry if you don't understand it, we'll break it down.

04:31.100 --> 04:36.440
There's just a few little things you need until you can have that moment where you go, I know what that means.

04:37.540 --> 04:39.040
Ends with limitations.

04:39.180 --> 04:47.200
Say if you want to check an email address to make sure it ends with a specific domain on there, or like a top-level domain, so you might have three different ones.

04:47.400 --> 04:54.020
Again, you can have an if statement or a switch statement to check for those things, or you can have a nice Regex which covers it in one go.

04:55.140 --> 04:57.080
And then it contains limitations.

04:57.240 --> 05:06.240
So imagine if you're running some kind of chat service and you want to check for any kind of dodgy input, making sure nobody's getting scammed and putting like credit card numbers in there.

05:06.240 --> 05:13.500
So obviously you can't search for every credit card in existence, you need to search for a particular pattern in there.

05:14.000 --> 05:24.620
And also that pattern can change as well, it might just not be like a straightforward bunch of numbers, there might be hyphens in there, or there might be spaces in there, which makes it very difficult to find that information.

05:27.340 --> 05:36.940
But then again, this simple Regex can actually match all those patterns, it can match for those digits, it can match for spaces, it can match for hyphens in between, just with that simple statement.

05:38.680 --> 05:40.500
So what is Regex?

05:40.500 --> 05:48.460
So Regex is a search pattern language, and it will help you find, match and extract specific parts of text from strings.

05:48.960 --> 06:02.840
Think of it like a state machine, so each of your Regex instructions, so you start at one place, if that rule matches, it moves to the next, and then it moves to the next, and then if that rule fails, it goes back to the beginning again, and it tries to match it somewhere else,

06:02.840 --> 06:05.660
until you've got all the way through, and you've finally got a match.

06:05.660 --> 06:12.740
So think of it like a flow diagram, where it asks questions, yes, no, and then kind of goes all the way down until you've found a complete match.

06:14.600 --> 06:21.920
So at first, you've got like literal matches, which is basically the same as like finding something on a page, and like hitting control F.

06:21.980 --> 06:26.180
So if you're certain, if you do a Regex, which is just hello, it'll find the string hello in there.

06:26.800 --> 06:28.140
So nice and easy.

06:28.540 --> 06:41.220
Then you've got, again, with like words, if you're searching for the word computer, we've just found, you'll notice that you'll find the word computer, but you'll also find the word supercomputer as well, which, so you've got kind of some false positives in here.

06:41.880 --> 06:44.460
This is where you can start using word boundaries as well.

06:44.460 --> 06:51.980
So you can wrap your words with this slash B, and then you can make sure that there's no characters either side of that.

06:52.180 --> 06:55.880
It does have exceptions for like punctuation marks as well.

06:56.780 --> 07:00.240
So like question marks, full stops, that works absolutely fine.

07:00.240 --> 07:03.820
But as soon as you introduce another letter in there, then that Regex will fail.

07:03.820 --> 07:05.160
It won't catch that word.

07:06.900 --> 07:09.440
Okay, and then we have anchors for starts with.

07:09.440 --> 07:23.980
So if you're receiving some strings, so say if you want to like get a website address, from an input field, but somebody randomly types in a whole string where there is a website address in there, but it's not where you think it's going to be.

07:23.980 --> 07:26.780
So in this case, you can see it's in the middle of the string.

07:26.780 --> 07:28.120
So that's no good to us.

07:28.560 --> 07:35.920
What we want is this symbol here, which is just a caret at the start, which says the string must start with HTTPS.

07:36.160 --> 07:42.280
You'll also notice as well that there's some special characters in there, like the forward slashes, which you have to put back first.

07:44.160 --> 07:46.860
So now you can see that this matches perfectly.

07:48.120 --> 07:51.940
And then on the opposite side of that, you've got anchors with the end width.

07:52.140 --> 07:54.140
And that's just a dollar sign on here.

07:54.140 --> 08:02.840
So if again, you have some simple Regex, which is example.co, you'll see again, the middle of it matches, which will pass the Regex rule.

08:02.840 --> 08:06.240
But of course, that's not correct, because you've got UK at the end.

08:07.260 --> 08:16.180
But if you pop the dollar sign at the end, you're basically saying you want example.co, and nothing else after that, not anything whatsoever.

08:16.180 --> 08:19.300
So now it's gone to blank, so it's not matching that rule.

08:20.600 --> 08:24.600
Again, you change the code back, and it's correct.

08:25.760 --> 08:31.600
One thing to note as well is the period symbol in here, which you'll see come up in the vulnerabilities.

08:31.600 --> 08:36.220
This catches so many developers out, and it leads to very interesting results.

08:36.220 --> 08:38.660
So this is actually treated like a wildcard.

08:38.660 --> 08:42.980
You'd think they'd use something like a star or something, or a percent symbol to cover this.

08:43.100 --> 08:49.740
But it's the full stop, which can basically mean any character you want, apart from a carriage return.

08:50.620 --> 09:00.000
So if you put the backslash in there to signify it must only be a period sign, you'll see the example.xco doesn't match anymore.

09:04.250 --> 09:06.350
Next is character sets.

09:06.390 --> 09:09.750
This is where you can start making some really interesting rules.

09:09.750 --> 09:13.630
So character sets, you have it per character.

09:13.630 --> 09:17.310
It checks the string, and it's each character.

09:17.310 --> 09:23.190
So the first one on this character set says it can only be the characters A, B, or C.

09:24.470 --> 09:29.210
So just in some example, if there's any bricks in here, you'll notice that these are postcodes.

09:29.210 --> 09:37.490
So what this is saying is we've got the character sign, which is saying the string must start with, and then anything that starts with M, L, or B.

09:37.490 --> 09:42.890
So you can see it's matched the two first ones, and the fourth one as well, absolutely fine.

09:42.890 --> 09:48.130
Obviously, OX and EX doesn't start with MLB, so that one doesn't get matched.

09:49.210 --> 09:53.570
You can also add a character symbol within character sets.

09:53.570 --> 09:59.130
So instead of this meaning that the string must start with, it actually inverts the rule instead.

09:59.130 --> 10:02.950
So it'll find anything that doesn't match the characters that you've put in there.

10:02.950 --> 10:06.350
So now you can see the OX and EX match absolutely fine.

10:08.690 --> 10:10.410
And then it gets even more interesting.

10:10.410 --> 10:12.310
You can have character ranges in here.

10:12.310 --> 10:17.670
So in this example, we've got any characters between A to L that will match.

10:17.670 --> 10:23.390
So of course, we've got those three postcodes that do match there within that range, but the M and the OX don't.

10:24.430 --> 10:33.250
So with ranges, you can have uppercase letters, lowercase letters, numbers, but then you can also add them together as well.

10:33.250 --> 10:39.050
So this is saying the character can match A to L, or 0 to 5.

10:39.270 --> 10:47.130
So then we can start using the information that we've learned so far to build like a basic regex, which would match postcodes.

10:47.130 --> 11:08.750
So we're saying that these postcodes, postcodes must start with a letter between A to Z, which is the capital, two digits, a space, another digit, and then two letters at the end, A to Z, and then nothing else after that.

11:08.750 --> 11:12.390
And you can see that those rules match exactly on there.

11:14.170 --> 11:16.190
Next we have quantifiers.

11:16.550 --> 11:23.530
So with this, you can have like your character sets and your rules, and then you can have kind of a rule after that.

11:23.530 --> 11:26.210
So we'll go through each one kind of so it makes sense.

11:26.510 --> 11:34.830
So the first one, again, we've got the character set of A to Z with the plus after this, and that says it must match one or more instances of characters.

11:34.990 --> 11:42.170
So we can see that the I is highlighted because we found one of those, then the comma, that's not in that character set, so that doesn't get matched.

11:42.270 --> 11:51.090
And then the rest of it, my name is, of course, those are all characters, and there's one or more instances of them in the string, so that's like matching the whole my name is.

11:51.330 --> 11:59.830
The capital A isn't matched on there because we've only done lowercase letters, and then the D-A-M, that matches absolutely fine and not the exclamation mark.

12:01.590 --> 12:07.770
Of course, then, like I mentioned before, with the character sets, you can add your capital letters in there as well, so now it's matching the A.

12:09.590 --> 12:23.370
With the starts with as well, so again, we want to match the... so now we're trying to match like URLs on there, so this first regex example is only going to match HTTP and then slash slash.

12:23.370 --> 12:28.710
You can see HTTPS or HTTPSS isn't matched in there.

12:29.830 --> 12:35.610
So if we move into HTTPS, now HTTP isn't recognized, but we want to cover both of those.

12:35.730 --> 12:44.870
So what we can have is a question mark after it, so that matches the S, and you can have either zero instances of that or just one instance of that.

12:44.870 --> 12:55.050
So of course that's matched HTTP, and HTTPS has been correct, but of course HTTPS, which I don't know, maybe super secure HTTP, doesn't match because it doesn't exist.

12:57.330 --> 13:01.870
And then the next thing we can have is the number of instances.

13:01.970 --> 13:13.030
So in this simple match, we've gone back to our credit card example, which is going to be a recurring theme throughout this, and we've got like the digits zero to nine, and we've got exactly 16 of those.

13:13.030 --> 13:18.270
So as long as there's just 16 within those, we've reintroduced the word boundaries as well.

13:18.270 --> 13:21.550
So 16 digits, it'll be fine, it'll match.

13:22.110 --> 13:27.730
But of course not all credit cards are exactly 16 numbers, you can have some which are a little bit more.

13:27.790 --> 13:36.130
So then we've got this quantifier, which is a number and then a comma, so that means at least 16, and then you can have anything over that.

13:37.310 --> 13:49.350
But then you've got a problem, because now you've got a false positive, where somebody's just sent somebody a message saying, hey, check out this binary string, and of course it's flagged it up thinking, hey, that's a credit card, because it's, you know,

13:49.350 --> 13:52.910
it's numbers, and it's at least 16 characters long.

13:53.710 --> 14:04.530
So then it introduces another quantifier for the range, so now you can say, okay, I want numbers, but only 16 to 19 digits in length, and that's it.

14:06.010 --> 14:09.470
So you can see that's matched it absolutely fine in this instance.

14:10.890 --> 14:17.090
Okay, so it gets a little bit more complicated now, because we've got to cover patterns which contain spaces as well.

14:17.130 --> 14:31.810
So we can see we've got the word boundary again, and then we've got, like, it's going to match four characters on there, and then it's going to match where we've got, like, the space after those four character sets of zero to nine, we've got a space and a star.

14:32.010 --> 14:35.870
Now, the star means zero instances or more.

14:35.870 --> 14:47.410
So just in case somebody types something in, like the first four digits, and they might hit, like, space, space, space, or they might put tabs, some kind of, like, extra spacing, extra padding in there, that'll actually cover it.

14:47.410 --> 14:56.090
As you can see, it's covered the first credit card number, which is just, you know, 16 digits, and then it's covered the next one as well, which has got the spaces in there.

14:58.310 --> 14:59.670
Okay, shortcuts.

14:59.670 --> 15:04.250
So this is where we can actually start compressing the regex to make it a little bit easier to read.

15:04.310 --> 15:11.170
So instead of doing the character sets of zero to nine, we can use the slash d instead, which just basically says any digits.

15:11.170 --> 15:21.450
So instead of us doing those four separate character sets for the first part of the credit card number, instead of doing the zero to nine, zero to nine, zero to nine, zero to nine, we could simply do that as a slash d.

15:21.510 --> 15:27.510
And as we saw in the quantifiers as well, if we put four in there, that's duplicating that pattern four times.

15:27.710 --> 15:30.370
And then again, we've got this space, which is optional.

15:33.560 --> 15:48.260
As well, like I mentioned before, in case somebody puts more than one space in there, we've got the slash s, which basically says any kind of space in there, any tabs, and we have the star after it as well, so we can have multiple ones of that.

15:49.700 --> 15:51.960
And then we've got the word character as well.

15:51.960 --> 15:59.340
So when that's matching, it matches characters a to z in upper and lower case, zero to nine, and then the underscore as well.

15:59.340 --> 16:04.520
I really wish they'd introduced the hyphen as well, just so it makes it easier matching things like domain names, things like that.

16:04.780 --> 16:06.200
But not so.

16:06.200 --> 16:09.240
So you can see it's matched like a username up there, absolutely fine.

16:09.240 --> 16:18.480
So if you wanted to, if somebody's signing up to a website, and you want to make sure that there's no strange characters in there, because you only want to have those ones, then that'll work fine.

16:18.480 --> 16:25.060
If somebody maybe put an email address in by accident instead of a username, you'll see that the at symbol hasn't been matched.

16:26.420 --> 16:30.820
And again, you can go the opposite way by doing a capital letter as well.

16:30.840 --> 16:33.820
So this searches for any non-digits in a string.

16:33.820 --> 16:40.720
So this might be some kind of validation on like a telephone number to make sure there's no like any other like strange characters in there, that shouldn't be.

16:42.000 --> 16:48.700
And again, the capital S as well, that signifies anything that isn't a white space.

16:48.700 --> 17:00.280
So in case for some stranger, I don't know if anyone's done it, but if you sign up for something and it says your password must be eight characters long, and you do eight spaces, which I don't know, maybe is a good password idea.

17:00.280 --> 17:03.020
I don't think I've seen a bunch of spaces in a word list before.

17:03.440 --> 17:05.320
And so that would match as false.

17:05.320 --> 17:08.940
So just to signify that there's no like normal characters in there.

17:11.000 --> 17:15.060
And again, the uppercase W is any non-word characters.

17:15.080 --> 17:21.500
So again , you can check on the string to see if your string contains any non-word characters, you might want to check that out.

17:22.700 --> 17:23.340
Okay.

17:23.340 --> 17:24.760
And then you've got wildcards.

17:24.760 --> 17:27.620
So these are where Regex can get dangerous.

17:27.940 --> 17:39.020
So on here, it's just basically matching any characters whatsoever between the href in the link and then anything between the two double quotes.

17:39.320 --> 17:43.100
So we'll go in a bit deeper why this is so dangerous.

17:44.680 --> 17:50.540
So what if we just want to extract the link from that, because that's matching the whole href pattern.

17:50.980 --> 17:53.080
So this introduced groups.

17:53.100 --> 18:02.160
And with groups, you can use that to repeat patterns that you've done multiple times, or you can actually use it to extract the text that you want that you're searching for.

18:02.300 --> 18:07.780
So in this example, again, it's just matching the whole href equals.

18:07.780 --> 18:16.040
So when you do this in a programming language, whichever you're using, you'll probably like be returned an array or some kind of object which matches all your results.

18:16.040 --> 18:18.480
So we can see you get this kind of result in here.

18:18.900 --> 18:21.600
It contains a href, but we don't want that information.

18:22.500 --> 18:29.720
Instead, if we wrap it in a group, for the wildcard and the star, you'll see that we've got an extra result in the array.

18:29.760 --> 18:39.260
So the first one is what actually matched it, and the second one is the groups that are in your Regex for the information that you want to actually extract out of it.

18:41.780 --> 18:47.000
So you can see with groups as well, you can make your Regexes even prettier.

18:47.000 --> 19:00.520
So again, back down to the credit card example, instead of specifying like four groups of digits over and over again, you can wrap that matching the four digits or in a space inside a group.

19:00.520 --> 19:05.500
And then you can put a quantifier after it, say you want to repeat that pattern three times.

19:05.500 --> 19:19.440
So it's like four digits and any optional space with the slash S and the star, you repeat that three times, and then any like four digits on its own, and you can see that matches it, and it's a nice, much easier to read Regex.

19:23.450 --> 19:25.550
So yeah, sorry, that's just the breakdown of it.

19:25.550 --> 19:29.570
And like I explained, so you've got the group at the start and then the iterator of the three.

19:32.030 --> 19:35.890
You can also inside groups introduce an or operator as well.

19:35.890 --> 19:43.850
So you can say, so if the credit card has spaces, and then all the pipe symbol, you can have a hyphen as well.

19:43.850 --> 19:48.190
So again, that will match the credit card numbers that are being entered with a hyphen in there.

19:49.730 --> 19:56.970
So this is where it starts getting interesting, where Regex goes wrong, and where developers start implementing it.

19:56.970 --> 19:59.650
So we're going to go through some vulnerabilities.

19:59.770 --> 20:10.930
So the kind of real world examples, this could be like a black box exercise in kind of two ways, one where you're not given any source code, or this is Regex that's going on in the background.

20:10.990 --> 20:18.250
Or white box might be where you do have source code, so you can go through and you can see the exact Regexes that are being used.

20:18.310 --> 20:23.650
Or it might be a Regex that's being used on the front end of like a website, say in JavaScript.

20:25.130 --> 20:28.790
So the first vulnerability we're going to go through is post message.

20:30.210 --> 20:40.190
So if some people aren't familiar with post message, it's a way of two browser windows or tabs communicating with each other.

20:40.350 --> 20:49.010
So say for things like, sometimes you'll open like a login prompt, so you do like log in with Google, it'll jump up with a little separate page.

20:49.010 --> 20:55.910
Once you log into there, it can actually send a message back to your original page to say, this user's logged in, here's their information.

20:56.670 --> 20:59.210
So we can see that with passing the data back.

20:59.290 --> 21:10.050
So to make that secure, when you listen, so this is a little JavaScript example, so you use event listeners to listen for any messages coming back to your browser window.

21:10.670 --> 21:27.050
And ideally, I mean, two things can happen, they don't check whatsoever where that information has been coming from, which is really dangerous, or they can implement a Regex on there to test for the browser for where that information's come from, and that comes in the origin,

21:27.050 --> 21:29.290
in the event of the message.

21:29.330 --> 21:42.910
So just in this simple example, we're checking to make sure that the window that was opened and passing the message back to the original website is supposed to be HTTPS www.trusted.com.

21:42.910 --> 21:50.810
And then just for our example, so you kind of understand it as a vulnerability, it looks for inside the JSON object that's being passed.

21:50.810 --> 21:58.830
If the event.datatype equals error, all it's going to do is fill in a div with the error message that's on there.

21:59.850 --> 22:04.670
So this is kind of an example payload, which might be passed back to the original site.

22:04.670 --> 22:21.070
So if you're familiar with cross-site scripting, all that's going to do is put an image tag on the website, it's going to try and load the source of X, which is going to fail, and then it's just going to pop an alert on there, because we've got the JavaScript in the onError event handler.

22:21.070 --> 22:28.890
I mean, don't worry about that too much, but just take it as if somebody's got postMessage, and they're putting that information on the page, it can get dangerous.

22:35.800 --> 22:42.020
So as we saw, this is the regex that's been used on here, which is just www.trusted.com.

22:42.620 --> 22:46.440
So the first thing that we're missing is an anchor at the end.

22:47.000 --> 22:58.480
So the problem with this is, if you've got the domain name attacker.com, you can just create these chains of subdomains, so you could have a website of www.trusted.com.attacker.com.

22:58.480 --> 23:07.780
If you force your victim to go there, that'll pop open the original window of the main website you're trying to hack, and then you can actually communicate between those two.

23:07.780 --> 23:23.140
So all you need to do is send a link to a user that opened up this attacker.com subdomain, and then instantly you'd be able to launch JavaScript on that original site, which of course you can then start stealing cookies, taking over accounts, things like that.

23:23.580 --> 23:27.200
So that's the first thing that we need, a dollar sign on the end.

23:27.200 --> 23:33.060
And again, going back to what we learned, that dollar sign says nothing can be after this.

23:33.060 --> 23:35.420
It's just got to be that domain name, and that's it.

23:35.480 --> 23:36.980
No other characters.

23:37.920 --> 23:40.220
And then the next one is the wildcard.

23:40.220 --> 23:42.980
This is probably the most common one that we see out there.

23:43.060 --> 23:47.340
Developers always forget to put that backslash on there to mark it as being a period.

23:47.340 --> 23:58.260
You could register the domain name www.xtrusted.com, and then that will pass the regex rules, and then you can move on from there.

24:00.660 --> 24:10.080
This is the fix for it, so we can see that we've got the dollar sign at the end, and we've also done the backslashes on the periods as well to make this one now secure.

24:11.000 --> 24:13.620
So open redirects is the next one.

24:14.080 --> 24:18.680
So again, we've just got some simple code which is basically testing the URL.

24:18.680 --> 24:31.800
So you might have a website, and there's a variable on there which you can pass in a URL, but you want to make sure that it's only domains that belong to trusted... sorry, you want to make sure it's only subdomains that belong to the trusted.com.

24:32.260 --> 24:35.640
If it does, and that passes, it will redirect to that website.

24:35.640 --> 24:37.180
Otherwise, it will fail.

24:38.140 --> 24:56.320
So again, we've got the wildcard, which is going to be quite familiar on there, and because that requires a backslash on there, then again, we can have the www.xtrusted.com, and then you can redirect people to that website.

24:56.320 --> 25:04.880
Again, that could potentially be used in like phishing engagements, so people look at the link on their email and think, oh yeah, that's a valid URL at the start.

25:04.880 --> 25:08.100
I'll click on that, but then you could get redirected somewhere else.

25:08.100 --> 25:13.420
It might trick you into putting account credentials in or downloading something like malware.

25:15.800 --> 25:19.600
Also, the subdomain part of this as well.

25:19.660 --> 25:26.200
So this wildcard on here is because they want to accept any subdomain of trusted.com.

25:26.200 --> 25:36.780
Usually, you want to restrict this a little bit, because especially with very big scopes, and you've got like kind of like engineering side where they'll do a lot of testing.

25:36.980 --> 25:41.740
There could be something like QAProd.1 or something, and you definitely don't want that being matched.

25:42.040 --> 25:47.340
It might be just some really vulnerable old code that somebody's managed to find while they've been doing some reconnaissance.

25:49.060 --> 25:54.380
Again, we've got the dollar sign at the end, so then you can add to it.

25:54.380 --> 25:57.940
So you can have the www.trusted.com.evil.com.

25:57.940 --> 26:00.860
So then you can use that to take over.

26:02.120 --> 26:15.500
And of course, at the start symbol as well, the caret at the beginning, what you could do is actually pass in a domain name and then pass in the original one as a query string instead.

26:15.500 --> 26:22.720
So again, without that caret symbol at the start, say this must start with a subdomain of trusted.com.

26:22.720 --> 26:26.340
It'll still match that part at the end, and it'll get passed through.

26:28.700 --> 26:30.720
So here's our fixed one.

26:30.940 --> 26:35.960
So it's only accepting certain subdomains between A to Z, 0 to 9.

26:35.960 --> 26:37.840
So this is just going to be like top level domains.

26:37.840 --> 26:41.800
So you can have like www.oradmin, things like that.

26:42.220 --> 26:45.460
Even better, let's actually put the domains that you're allowed on there.

26:45.460 --> 26:47.980
So again, we've got the group with the or on there.

26:47.980 --> 26:52.780
So it'll just accept admin, www, and download, and nothing else.

26:54.060 --> 26:58.680
So this is one of Ben's examples where that actually happened.

26:58.680 --> 27:05.360
So on the URL, you could put in the site name, the application name, and the path.

27:05.360 --> 27:15.760
But because the path on there wasn't checking whether it began with a slash at the beginning, you could instead just change the path to .evil.com.

27:15.760 --> 27:22.760
So it'd actually redirect to some application .redacted.com.evil.com, which would be your domain name.

27:22.760 --> 27:27.940
And in this instance, Ben used this as an open redirect, which would actually grab somebody's auth token.

27:27.940 --> 27:30.720
So it just wasn't a kind of a simple open redirect.

27:30.720 --> 27:35.480
It was actually an account takeover where you could steal somebody's cookie after logging in.

27:36.700 --> 27:39.380
And that got $14,000, I believe, Ben.

27:42.530 --> 27:44.270
Okay, calls.

27:44.270 --> 28:05.110
So when you're on a website and you're making an AJAX request to a different domain name or a different subdomain to what you're on, or even a different scheme, you have what's called a pre-flight check, where it sends an options header to the server that you're going to communicate with and say,

28:05.110 --> 28:06.750
hey, I'm coming from this website.

28:06.750 --> 28:09.050
Am I actually okay to send this information?

28:09.470 --> 28:11.850
Especially with things like credentials as well.

28:11.850 --> 28:17.710
So you might have like a second website where, say, if it's like an API.

28:17.710 --> 28:23.130
So you have like, well, in this example, we have like a slash API slash me.

28:23.130 --> 28:30.950
So if you visited that normally, it would use your cookies, and then it would show you the information in API slash me.

28:30.950 --> 28:36.890
So that would be really dangerous if any website could make a call to that and then grab that information.

28:36.930 --> 28:40.070
So this is why we have calls and those pre-flight checks.

28:40.150 --> 28:44.970
It will pass the origin, which is the website that you're currently on.

28:44.970 --> 28:59.110
And if that matches the rule on there to whether it is an allowed website, you'll get a response in there saying the action control allow origin header will be returned, and that has to match your address.

28:59.110 --> 29:02.270
So the scheme and the domain in your address bar.

29:02.410 --> 29:08.370
Also, if you can send cookies along with that request, you'll get the access control allow credentials.

29:08.590 --> 29:21.670
Interestingly, most browsers have actually removed this, because a lot of the time, passing cookies back and forth towards third party domains, it's mainly used for analytics so that people can track you all over the web.

29:21.670 --> 29:26.570
Every browser has removed this, apart from Google, surprise, surprise, with Chrome.

29:26.650 --> 29:28.370
They keep on promising to do it.

29:28.370 --> 29:30.810
They also keep on extending that data as well.

29:32.010 --> 29:36.950
So where the issue is, so we've got the calls code on the server side.

29:36.950 --> 29:43.670
Again, it's using a regex to check whether this domain is actually allowed to communicate with it.

29:43.670 --> 29:47.610
If it passes that check, it will then set those headers.

29:48.890 --> 29:59.790
So again, we've got the wildcard character, which we explained, so we can just, you know, purchase a completely different domain with an X in there, and we can bypass that regex check, and then we can start stealing information.

30:00.350 --> 30:09.490
Again, the subdomain, so we can add in a completely random domain that possibly we've taken over, something which is a little bit easier to hack into.

30:10.690 --> 30:13.350
Again, no dollar sign on the end as well.

30:13.490 --> 30:17.510
So we can add our evil.com domain on there, and we can steal the information.

30:18.310 --> 30:33.550
So this is the fixed one on there, so we only cover subdomains, like top level ones, A to Z, zero to nine, and an underscore, and then we've got the backslashes in there for the wildcards with the trusted.com, so this has made this now secure.

30:35.590 --> 30:40.070
SSRF, so I'm not going to go through every vulnerability, don't worry, because they're all pretty similar.

30:40.830 --> 30:57.210
Say if you had a website and it was going to make a PDF of your LinkedIn user page, so it's expecting for you to give a LinkedIn domain, it'll grab that, it'll convert it to a PDF, and it'll send it to you.

30:57.210 --> 31:06.810
You don't want this accepting any domain name, because you could potentially access things that are on local host or metadata if you're hosting on the cloud.

31:08.550 --> 31:27.030
So again, we've got the full stop on there, which is the wildcard, and we could create a domain, the www.xlinkedin.com, we could register that or any character, set the ADNS record to local host, and instead it'll communicate with the local host instead.

31:28.730 --> 31:43.530
And there's no slash at the end of the domain that's been put on there as well, so we could make that a subdomain of a domain that we already have control over, and again, we can control the DNS and where that goes to.

31:44.490 --> 31:50.190
And the no caret symbol at the start say the string must start with this.

31:50.190 --> 32:03.730
So if we pass in a whole URL, again, we could be hosting something which either redirects to somewhere completely different, or again, we can set that DNS record, and we can get it to create a PDF of any page we want.

32:05.490 --> 32:16.230
Also as well, don't just trust the start of it, maybe after the slash at the end, let's get the exact path in there, because what happens if we find an open redirect on LinkedIn?

32:16.470 --> 32:29.930
So it's passing all the regex, it hits the slash redirect, which is hosted on LinkedIn, goes back to your evil.com domain, which has a DNS record of 127.0.1, which will then start querying local services.

32:29.930 --> 32:32.910
Obviously, we could change that address to different things as well.

32:35.670 --> 32:37.690
So this is the fixed version.

32:38.010 --> 32:51.350
So with what we've learned is we've got the... it has to start with HTTPS, LinkedIn.com, and then slash in, slash then the word symbol, which will only accept characters A to Z, zero to nine, and underscores.

32:51.350 --> 32:54.590
So that should be safe after that with my example at the bottom.

32:58.660 --> 32:59.260
Okay.

32:59.260 --> 33:00.800
So I think now Ben's up.

33:00.800 --> 33:05.420
So he's going to go through some vulnerabilities that he's found where regex has been involved.

33:05.420 --> 33:07.800
He's going to chat about that and some refund stuff.

33:08.760 --> 33:09.820
All right.

33:13.780 --> 33:20.160
So I did a similar talk to this one somewhere else, and I talked about some vulnerabilities I got in trouble for.

33:20.340 --> 33:24.720
So I couldn't put the screenshots of the vulnerabilities on this slides.

33:24.780 --> 33:30.740
So instead, I'm going to just show you similar findings on GitHub that scored me the same bounties.

33:30.740 --> 33:33.640
I just couldn't put the specific bugs up here.

33:33.640 --> 33:39.340
But when it comes down to SSRF, the majority of the goal is internals, right?

33:39.340 --> 33:44.760
Get into the internal network or get some AWS keys or something fun, right?

33:44.760 --> 33:51.860
So we'll come back to this, but there is something beautiful about using regex on GitHub.

33:52.140 --> 33:53.500
And I use this a lot.

33:53.500 --> 34:01.800
I've gone away from using the traditional sub finder, amass, domain finder, whatever you want to name it.

34:01.800 --> 34:11.720
I've kind of stepped away from those because one, everybody else is using them on public programs and B, I wanted something new and I really wanted to drive this home for this DEF CON talk.

34:11.720 --> 34:16.460
So you can do a couple of things with regex on GitHub.

34:16.460 --> 34:19.080
You can actually use regex to look for subdomains.

34:19.120 --> 34:27.680
So let's say you have a environment on cert.sh that comes back and it says, yeah, I have a wildcard certificate here.

34:27.680 --> 34:30.640
It's something.corp.site.com.

34:30.700 --> 34:33.760
And you can't see what's behind corp because it's a wildcard.

34:33.760 --> 34:35.280
You have to brute force for it.

34:35.380 --> 34:37.280
This is a really good way to find it.

34:37.280 --> 34:41.840
Again, the regex that you see on this screen is one of many things you can try.

34:42.020 --> 34:45.400
It's something that we've came up with, so it simplifies what we're doing.

34:45.900 --> 34:52.340
And you can take that even a step further and just look for subdomains that contain specific keywords.

34:52.560 --> 34:55.600
So if you want to find APIs, you can put an API in there.

34:55.660 --> 34:58.380
If you want to look for dev sites, you can put dev in there.

34:58.380 --> 35:02.140
And the cool thing about doing that is it also gives you context.

35:02.140 --> 35:05.040
It gives you context of what people are doing on these APIs.

35:05.280 --> 35:08.080
Are these internal APIs that they have leaked data on?

35:08.080 --> 35:10.960
Have they given you their paths and things like that?

35:10.960 --> 35:22.080
So one of the really cool bugs that I found using this method was on one of the bug bounty platforms, we were hacking on a redacted program and this guy came to me on Discord.

35:22.080 --> 35:28.020
He's like, hey, I have a SSRF, but I know it's hitting something internal, but I just can't prove it.

35:28.020 --> 35:34.940
And it's not on AWS, it's not on GCP, so we don't have any access to anything that we can prove.

35:34.940 --> 35:37.760
And I just think there's something on the internal that we can find.

35:37.880 --> 35:45.120
So we went through this example and instead of putting API, we were looking for a specific keyword.site.com.

35:45.440 --> 35:49.420
And we ended up making a quick list of everything that was on GitHub.

35:49.420 --> 35:52.780
And one of those was their source code.

35:53.180 --> 35:58.820
There's a frog or whatever it's called, JFrog, that was on auth and you can just pull source code from it.

35:59.000 --> 36:09.080
And none of the databases that we went through for asset discovery, your sub finder, your cert.sh, your c99.nl, all of those didn't have data on this specific thing.

36:09.080 --> 36:16.920
But some developer unfortunately had leaked their automation on GitHub and had the instance for us that we could pull for.

36:16.920 --> 36:18.720
So we had access to all their source code.

36:18.720 --> 36:19.380
We reported it.

36:19.380 --> 36:25.060
And I think that one was a $5,000 or $6,000 bounty on a public bug bounty program.

36:25.180 --> 36:33.800
So this is a really, really good way to find assets that you can narrow your focus on what you want to hack on.

36:33.800 --> 36:35.000
I'm just going to make sure I have my notes.

36:35.000 --> 36:37.980
I don't miss anything since I don't have... I couldn't put slides.

36:37.980 --> 36:38.760
There we go.

36:39.720 --> 36:41.500
So that's one of the things that I want to do.

36:41.500 --> 36:48.180
This is the starting point for me when it comes down to looking for assets that I want to hack on.

36:48.180 --> 36:54.600
So with bug bounties, one of the number one questions I get is like, where do I pick the targets out of these thousand subdomains that I found?

36:54.820 --> 36:56.640
This could be a really good way.

36:57.080 --> 37:01.140
So you also have the content discovery part of this.

37:01.280 --> 37:13.200
You can find a lot of cool content that you probably can't brute force for if you were to find a random API that doesn't have any swagger or open API JSON on there.

37:13.200 --> 37:19.360
So again, very random, but also high level regex for it.

37:19.360 --> 37:20.740
We're using Netflix for this.

37:20.740 --> 37:29.300
We're saying anything that has Netflix, it could be netflix.com, netflix.io, netflix.net, because those are also tier two assets on Netflix's bug bounty program.

37:29.300 --> 37:33.300
And then we're hitting it with, I want it to have slash API in there.

37:33.300 --> 37:48.960
This alone on a, this is not on Netflix's bug bounty program on a private , no public program on HackerOne that's been around maybe for, I want to say over six years , have a massive scope to have massive presence online.

37:49.340 --> 37:52.540
And two cool things came out of this two types of vulnerabilities.

37:52.540 --> 38:03.420
The first one was, I just wanted to find APIs to hack on because everything for these websites that I would go to, you needed an account.

38:03.560 --> 38:08.660
So they have a domain in, let's say Netherlands.

38:08.920 --> 38:10.660
It's a .nl domain.

38:10.740 --> 38:14.020
You need to be a Dutch citizen to be able to get an account.

38:14.020 --> 38:16.660
You need to have an ID to get logged in.

38:16.660 --> 38:19.160
And then you can see their API routes to interact with it.

38:19.380 --> 38:21.580
Obviously not Dutch, don't have an ID.

38:21.620 --> 38:22.940
This was a great way to do it.

38:22.940 --> 38:29.860
So actually I found an asset on there that not only did it give me the API routes, it also gave me how the usernames were being created.

38:29.860 --> 38:35.440
So it was like a first name, initial, last name, and the year of their birth.

38:35.960 --> 38:45.560
And it's, you know, it's in, if it's a Dutch that you go to chat GPT and say, Hey, give me a top 10, most common Dutch last names, add an A through Z in the beginning.

38:45.940 --> 38:50.060
And then numbers that you think are birth years where, you know, people that I can use.

38:50.060 --> 38:52.280
So that's one, it was a $5,000 bounty.

38:52.940 --> 38:57.800
And then you can also do things like, Hey, maybe it doesn't have API in it.

38:57.800 --> 39:04.760
It could be something like app dash API, but then, you know, app name, the app name could be anything arbitrary, right?

39:04.760 --> 39:09.220
It could be a printer API dash whatever.

39:09.220 --> 39:12.740
And then there's a V1 in there and you do that and it gives you a lot of good results.

39:12.740 --> 39:21.260
And all this, honestly, all these APIs are also cool to look at, but for that one specifically, it wasn't anything with the API itself that was vulnerable.

39:21.280 --> 39:26.340
It turns out that had some very obscure path for all of their applications.

39:26.760 --> 39:28.460
It was about five dashes.

39:28.460 --> 39:36.140
And so five different words, it was like a region, app name, environment, and then a country at the end.

39:36.140 --> 39:37.880
So it was really hard to brute force.

39:37.880 --> 39:43.720
But once I found every single one of those on GitHub, every single one of those endpoints had an actuator with a heap dump.

39:43.960 --> 39:49.580
So if you're not familiar with actuator heap dumps, it's just for Java backend, you can use something like a spring boot.

39:49.580 --> 39:51.660
It gives you access to the environment variables.

39:51.660 --> 39:52.980
You can pull credentials.

39:53.060 --> 39:57.560
The heap dump is just a snapshot of the memory that has all the HTTP requests.

39:57.560 --> 40:00.260
And I will show some of those in here.

40:00.360 --> 40:14.340
And I want to say I found four of those at $3,000 a pop within just a couple of hours of just realizing like, hey, I can just go on GitHub and somebody else had leaked these paths for me to be able to look for it.

40:14.340 --> 40:23.820
So keep this in mind when you're looking at a random asset you found, you're banging your head against the wall going, what is on this API?

40:23.820 --> 40:25.600
What are the routes on this API?

40:25.640 --> 40:30.900
Somebody, I promise you has leaked it on GitHub, but you just got to be able to find it with a good regex.

40:30.900 --> 40:35.420
So those are a couple of bugs that I can talk about throughout all this.

40:35.720 --> 40:37.560
You can also use it for things like GraphQL.

40:37.560 --> 40:39.400
I just want to give you examples of things that you can look.

40:39.400 --> 40:40.560
It's not just always API.

40:40.560 --> 40:41.720
It's not always GraphQL.

40:41.720 --> 40:53.680
You could also just literally be knowing that this company has this stack that they use, technology stack or this component that they use across their environments and you want to find it.

40:53.680 --> 41:06.160
So you can just purely do for this one, we're doing every domain obviously that's on GitHub, but you can just narrow it down to something like a netflix.com or fort.com and then looking for every GraphQL instance in there.

41:07.700 --> 41:10.900
We can also use this for parsing data dumps.

41:10.900 --> 41:12.580
Do you want to take this one or maybe you could keep going?

41:13.240 --> 41:17.460
I'll take this one just because of the fact that it's, I talked about actuators and I kind of want to show what it looks like.

41:17.600 --> 41:26.520
So this is obviously a fake version of actuator that we have as a lab, but most of the time if you do, if you find actuator, this will be something that it would look like.

41:26.520 --> 41:27.960
If you're lucky, this is what it looks like.

41:27.960 --> 41:32.400
If you're unlucky, then it just shows you health, info and metrics.

41:32.420 --> 41:35.380
If you don't see those three, I'll give you a hug.

41:35.380 --> 41:36.180
It sucks.

41:36.180 --> 41:41.540
It's not fun to see those, but when you do come across an actuator, you can download the actuator heap dump.

41:41.960 --> 41:45.860
It looks a little ugly like this if you open it because it's not human readable.

41:45.900 --> 41:57.700
You can pass it to strings, for example, and you can grip for some data, but keep in mind when you're gripping for, I don't know, password, you're going to get a ton of other variables that have the word password in it or username in it or whatever it is.

41:58.080 --> 42:09.860
But we can use something like this to just pull everything that has, that ends with an equal sign, which is a parameter or even better, it could be a base 64 of a password that ends into two equal signs.

42:10.040 --> 42:16.160
And it could be a password for something or it could be something that we can use and leverage it.

42:16.160 --> 42:21.140
You can look for things like, I think Adam's going to cover these, but you can look for JWT tokens.

42:21.140 --> 42:22.720
They start in a very specific way.

42:22.720 --> 42:24.260
You can look for AWS keys.

42:24.260 --> 42:26.440
They look a very specific way that we'll cover.

42:26.740 --> 42:48.600
But this has been something that I have had to shift to because I realized after creating this course with Adam, I went through all the heap dumps that I've had on my laptop and I realized how much data I had missed by just doing a strings file and then piping into GRIP without regex because there's so much data that I couldn't go through.

42:48.700 --> 42:56.180
So I'll let Adam cover some of the other safe secrets and then we'll wrap it up with some code review and maybe take some questions at the end.

43:04.710 --> 43:08.810
Okay, so very quickly, again, using GitHub, we can look for things.

43:08.810 --> 43:26.050
So all JWT tokens quite nicely start with EYJ, which is the opening bracket on there, followed by characters A to Z, zero to nine, underscores and hyphens, and then with a dot in the middle.

43:26.050 --> 43:34.070
So if you search for this on GitHub, don't know who these poor people are, sorry, you'll find a bunch of JWT tokens which have been put on there.

43:34.630 --> 43:38.650
Again, things like AWS keys as well, that can be put on there as well.

43:38.650 --> 43:42.290
You can also combine that with like Netflix domains as well.

43:42.510 --> 43:50.250
I've found this random thing, I don't know what it is, there's some research.netflix and there's a JWT token in there as well.

43:53.910 --> 44:00.190
All right, sorry, yeah, if you put when you're searching on GitHub, where the and is, you have to put that as capital, sorry.

44:01.870 --> 44:04.650
Regex as well can be really useful for code review.

44:04.690 --> 44:09.730
So whatever your stack is that you're used to, I'm used to PHP, so I'm just going to use this as an example.

44:09.790 --> 44:20.950
So if you're searching for anything that might reflect XSS in your code, so it'll be echo and then you're just echoing out straight away any get or post requests with no validation on there whatsoever.

44:20.950 --> 44:25.310
That's a good indication that you're going to get an XSS on your website.

44:25.310 --> 44:37.190
So it's just looking for any instances where it's echoing out and then using Regex, we've managed to put the group and the author operator on there and to look for anything that's get post and then starts with the open bracket.

44:39.130 --> 44:42.370
So here's some code example that might come up on there.

44:43.450 --> 44:49.530
Anything that's potentially using the system command as well, that could be receiving some information.

44:49.530 --> 45:02.550
So any websites that are using system to actually process some code on there, you're going to want to make sure that you have a look at that, make sure it's not taking any variables that you could potentially then get RCA on the website.

45:03.410 --> 45:07.590
And you can also use a Regex to look for Regexes as well.

45:07.590 --> 45:11.950
So this checks for Regex code for PHP, JavaScript and Python.

45:11.950 --> 45:16.310
You have different packages on there which you put regular expressions into.

45:16.350 --> 45:20.410
Again, this will flag them all up in your code and then you can review them manually.

45:22.190 --> 45:26.030
Again, you can search for things like basic auth, that's in your code as well.

45:26.030 --> 45:29.830
So that's going to match any of the base 64 strings and then ends in an equals.

45:30.130 --> 45:32.510
Again, finding JWT tokens.

45:32.510 --> 45:34.530
Sorry if this is really fast, but we're running out of time.

45:35.230 --> 45:40.350
You can also do these things on not your own code, but you could also do it on GitHub as well.

45:40.350 --> 45:43.950
Again, looking for any XSS which might be in PHP.

45:46.110 --> 45:48.950
And then you can use the and command as well with WordPress.

45:48.950 --> 45:55.870
So if you're targeting particularly like WordPress plugins through like a bounty program like WordFence, you can do that.

45:56.370 --> 46:02.810
And also look for things that system commands that like either get or post has been passed into as well.

46:02.810 --> 46:05.850
So there's like user input, which is going into a system call.

46:06.850 --> 46:10.870
So like on this one that I searched for, which you can get some interesting results.

46:10.870 --> 46:13.910
This was just basically somebody's web shell that they've hosted on there.

46:13.910 --> 46:17.150
So we've got some hackers posting some stuff on there as well.

46:18.950 --> 46:25.450
One of the cool things I've really found about it is now and again, I find like building tools for the community really interesting.

46:25.570 --> 46:31.790
So one of the first ones that created was creatures of habit, which wouldn't be possible without regexes on there.

46:31.790 --> 46:36.670
So all this does is it goes, I increment through every package on GitHub.

46:36.670 --> 46:40.690
It grabs certain web extensions on there.

46:40.690 --> 46:44.970
And then it goes through every different framework that's out there.

46:44.970 --> 46:48.430
Like we've got like Python, like Flask on there.

46:48.430 --> 46:49.890
So it looks for any routes.

46:49.890 --> 46:55.730
So we can start making loads of routes and then we can use those for word lists for finding other things on other domains.

46:56.250 --> 46:58.450
And PHP with Laravel has gone there.

46:58.450 --> 47:06.350
JavaScript, Python, ASP.NET, Ruby on Rails, and Go as well on there.

47:06.350 --> 47:15.510
Another one I wanted to create word lists as well for when I'm hacking into websites, where I want to create a unique list of parameters as well.

47:15.510 --> 47:26.170
So it's great to go to GitHub, find all the parameters that developers are actually using, either in query strings or the post body or HTTP headers and methods.

47:26.230 --> 47:44.930
And again, I could cycle through pretty much most of GitHub, look for PHP pages and look for any get or post things in the code and then I'd extract the actual string in the middle and then I'd put those into a word file and then I can use that later on for reconnaissance.

47:44.930 --> 47:54.450
With parameters I've done that, with HTTP headers and with get methods as well, because they tend to get reused in web paths.

47:55.430 --> 47:56.690
So that's been pretty interesting.

47:56.690 --> 48:01.590
I've managed to make some really interesting word lists and found some very interesting things from that.

48:02.770 --> 48:04.530
I think we are finally done.

48:04.570 --> 48:06.110
Sorry if we've melted your brain.

48:06.110 --> 48:07.410
It's been a lot of information.

48:07.410 --> 48:13.250
Don't worry if you didn't grab it all, but hopefully it's kind of prompted you enough to go, yes, I will learn Regex.

48:13.350 --> 48:21.490
One more note, because for the GitHub stuff, for the code review, the reason why we have it in there, a lot of companies open source a lot of their frameworks.

48:21.490 --> 48:22.630
So keep that in mind.

48:22.630 --> 48:24.510
You can go and find vulnerabilities in those.

48:24.510 --> 48:25.470
That's why we have them on there.

48:25.470 --> 48:27.610
We just can't show you exact examples of it.

48:27.610 --> 48:35.770
But a lot of the large organization, especially if they've been around for years, all of their frameworks that they use internally for their basic applications, that code is online.

48:35.770 --> 48:36.790
You can look at it.

48:36.830 --> 48:38.950
Enterprise tools, you can launch them on your own.

48:39.190 --> 48:42.750
Go through the EC2 instance, get the code and dump it and look for vulnerabilities.

48:42.810 --> 48:43.930
Keep that in mind.

48:43.930 --> 48:44.930
That's why we have it in there.

48:44.930 --> 48:45.570
It's not a teaser.

48:45.570 --> 48:47.310
It's just get creative.

48:47.310 --> 48:49.430
Look at these things and go, what else can I do with it?

48:49.430 --> 48:51.830
How can I chain all these and apply them in a real world?

48:52.450 --> 48:55.430
With that said, I think we have only two minutes before we get kicked out of the room.

48:55.430 --> 48:57.230
If there are any questions, we would love to answer them.

48:57.250 --> 48:59.170
If not, hang out here and answer any questions.

48:59.170 --> 48:59.570
Okay?

49:17.520 --> 49:21.300
You can use tools to unpack that actuator dump.

49:21.300 --> 49:22.180
Is that what you're talking about?

49:22.180 --> 49:23.280
You can use tools.

49:23.280 --> 49:26.520
I personally don't use them with bug bounty programs because they usually don't care.

49:26.940 --> 49:30.020
I literally just run them through GRIP with regex.

49:30.020 --> 49:31.800
Look for things that I think is valuable.

49:31.800 --> 49:33.380
Look for cookie values, for example.

49:33.380 --> 49:36.360
Look for JWT tokens.

49:36.360 --> 49:38.460
Look for bearer tokens and things like that.

49:38.460 --> 49:47.500
When you see that access, you'll see the whole HTTP request on there so you can see where they're actually using that token and where sending it to or receiving it from as well.

49:50.020 --> 49:53.940
They'll be on the website with the actual workshop soon.

49:54.280 --> 49:55.660
This is a part of a bigger workshop.

49:55.660 --> 49:56.780
It's just what we could...

49:59.240 --> 50:00.300
It will be an additional one.

50:00.300 --> 50:01.220
I'll send it to you.

