WEBVTT

00:00.820 --> 00:05.820
Okay, coming up, we have Willis Van De Wanter.

00:06.080 --> 00:12.140
He works as a Senior Staff Security Researcher at SP Rocket Security.

00:12.860 --> 00:19.200
Willis is very passionate about speaking in conferences and had presented at Hack Miami recently.

00:19.460 --> 00:25.640
He and his team contributed towards additional checks for Burp Suite's bchecks plugin.

00:25.640 --> 00:32.940
His topic this time is bypassing Whois rate limiting and alerting on fresh enterprise domains.

00:32.940 --> 00:41.700
We all know what Whois is, if in case we wanted to get information with respect to an IP address or with respect to a domain name, we'd simply go ahead and do a Whois.

00:42.000 --> 00:51.800
So, with Whois, Whois data is prime resource for identifying APEX domains owned by some specific company.

00:51.800 --> 01:00.700
Unfortunately, that data is typically locked up behind rate limiting systems, third party APIs, or expensive purchases.

01:01.120 --> 01:10.940
What Willis did is that Willis made use of a cloud environment, serverless cloud environment, and had random IP addresses to go ahead and bypass such kind of a scenario.

01:11.300 --> 01:17.280
So, Willis is going to go ahead and give us a demo of what he did and how he was able to bypass such kind of a situation.

01:17.280 --> 01:18.500
Give it up for Willis.

01:22.320 --> 01:23.560
All right.

01:23.760 --> 01:25.100
Everybody hear me okay?

01:25.100 --> 01:25.900
Good?

01:25.900 --> 01:26.700
All right.

01:26.700 --> 01:28.220
So, this is a tools demo.

01:28.220 --> 01:31.280
It's a little shorter than the average 25-minute presentation.

01:31.640 --> 01:34.180
The title of the tool is Whois Watcher.

01:34.780 --> 01:37.240
And to get started, this is the GitHub link for it.

01:37.240 --> 01:39.000
It'll be throughout the presentation.

01:39.940 --> 01:46.360
I feel like I should lay a foundation real quick as to why we would care about doing reverse Whois.

01:46.360 --> 01:50.540
So, I think probably most people in this room have registered a domain before.

01:50.700 --> 01:53.800
And when you register a domain, you provide ownership information.

01:53.800 --> 01:59.040
So, first name, last name, phone number, email address, that sort of thing.

01:59.060 --> 02:03.520
Most modern registrars, you can enable privacy as part of the feature set.

02:03.700 --> 02:06.140
And that's optional.

02:06.180 --> 02:12.580
If you choose not to enable that, then if somebody does a Whois lookup on the domain, they get back this information.

02:12.580 --> 02:14.680
So, they get back the ownership information.

02:14.680 --> 02:19.440
If you do enable it, it should usually get back, like, redacted for privacy.

02:19.440 --> 02:24.120
And there's a URL, you fill out a captcha, and you can get that ownership information back.

02:26.640 --> 02:31.080
This is really often used as part of the reconnaissance process in offensive security.

02:31.080 --> 02:35.100
And again, I'm sure you guys are familiar with this, but just to sort of level set a little bit.

02:35.600 --> 02:43.320
So, for example, you go to your terminal right now, you type in whoisbankofamerica.com, and you'll get back the ownership information.

02:43.320 --> 02:46.280
So, the name, the address, that sort of thing.

02:46.460 --> 02:49.500
At the bottom, I've highlighted the email address.

02:49.500 --> 02:53.040
So, it's very common to use, like, one piece of information.

02:53.040 --> 02:57.220
Usually the email address or the name, and do a reverse lookup.

02:57.220 --> 03:07.340
So, we're saying, what other domains have been registered by domain.administrativebankofamerica.com or whatever the focused APEX domain is.

03:07.340 --> 03:12.940
So , if you do this in, like, Woxie, which is up here, you'll get back 400,000 domains.

03:13.020 --> 03:16.020
So, that's quite a lot, but there's a couple things to keep in mind.

03:16.220 --> 03:18.420
One, that's a historic record.

03:18.420 --> 03:24.020
So, that's any domain ever registered with that email address going back as far as they have the data.

03:24.380 --> 03:27.440
And two, as a pen tester, we'll need to do some validation.

03:27.600 --> 03:34.040
So, we'll need to pick out domains from here that we think are really owned by Bank of America, and then we go after those.

03:34.040 --> 03:41.620
And as a red team or as a pen tester, those are often domains that maybe not quite as taken care of, depending on the company.

03:41.880 --> 03:45.480
But either way, it really quickly expands the attack surface map.

03:45.480 --> 03:51.860
So, we're going from one single APEX domain to other APEX domains and kicking off subdomain brute forcing, right?

03:51.860 --> 03:55.000
The pipeline of reconnaissance is sort of going off after that.

03:55.000 --> 03:59.000
I mean, to use an example, in the past six months, we had an assessment.

03:59.000 --> 04:10.180
They gave us one APEX domain, did reverse whois, found additional APEX domains, performed scanning, brute forcing, identified an environment JSON file that had been left by DevOps.

04:10.180 --> 04:19.300
That had Azure creds in it, and that got us into the environment because the other APEX domains are often hosted within either the same cloud or the same environment.

04:19.300 --> 04:25.980
So, hopefully that lays it down a little bit as to why you might care about reverse whois when it comes to recon.

04:28.080 --> 04:29.540
I like this quote a lot.

04:29.540 --> 04:30.820
I think it sums it up super well.

04:30.820 --> 04:32.500
I think Jason is around right now.

04:32.600 --> 04:37.720
For every new APEX domain we find, we 4X our chance of hacking a target.

04:37.720 --> 04:41.740
So, we get a multiplicative effect by adding an APEX domain.

04:41.740 --> 04:44.980
And in my mind, it's almost like a tree, right?

04:44.980 --> 04:50.060
Like, we find another APEX domain, and all of these things branch out from that APEX domain.

04:50.060 --> 04:54.740
It's this additional ability to keep on testing against the customer.

04:54.740 --> 04:59.620
So, again, the full pipeline of subdomain brute forcing, port scanning, services.

05:00.420 --> 05:04.740
All right, everybody following along so long, and most people have heard of this before, right?

05:04.740 --> 05:06.140
If you have, yeah.

05:06.160 --> 05:07.060
All right, cool.

05:07.900 --> 05:15.310
So, there's a lot of tools around doing reverse whois lookups, but we had kind of a need.

05:15.860 --> 05:21.160
Like, 50,000 to 400,000 domains are registered every 24 hours.

05:21.160 --> 05:27.740
So, if we're using API keys to look up historic records, we're essentially missing out on almost every single day.

05:27.740 --> 05:31.140
That's a lot of potential domains that we could be missing out on.

05:31.140 --> 05:38.020
So, the idea was, like, all right, how do we focus on not just historic domains, but how do we continuously test for reverse whois?

05:38.020 --> 05:43.840
And that was part of the background for this, along with we built out a recon platform around whois.

05:45.500 --> 05:51.380
So, we needed a tool that can process whois lookups up to 400 domains every 24 hours.

05:51.380 --> 05:53.540
You can't just use, like, a residential IP.

05:53.540 --> 05:55.780
There's IP rate limiting in place.

05:55.780 --> 05:57.700
There's various reasons you can't do that.

05:57.700 --> 06:02.080
We need machine-readable data, and I'll come back to this point in a minute.

06:02.240 --> 06:04.300
So, we really wanted JSON as output.

06:04.540 --> 06:10.740
And we wanted to be alerted if a potential domain owned by a target is recently registered.

06:10.800 --> 06:14.800
So, again, I'll come back to this in a little bit, but it plays back into the reverse whois lookup.

06:17.120 --> 06:24.200
I don't know if you guys are familiar with whoisds.com, but they will provide newly registered domains for the past 24 hours.

06:24.200 --> 06:25.660
So, you can sign up for the service.

06:25.660 --> 06:26.680
You can download it.

06:26.680 --> 06:33.280
And every 24 hours, you get a zip file with a text that has all the domains that were registered in the past 24 hours.

06:33.660 --> 06:36.320
So, one of the first things they did was built into the tool.

06:36.340 --> 06:44.300
So, if you are running whois watcher and you do dash dash nrd, every day it will download all of the previous day's domains.

06:44.340 --> 06:49.220
So, you set it on a cron job, and you wake up to fresh domains essentially every day.

06:49.480 --> 06:52.100
So, that's one of the first features put in place.

06:54.220 --> 07:00.000
That might be kind of hard to read, but I guess who's worked with whois a little bit?

07:00.000 --> 07:01.560
Who's played around with whois?

07:02.300 --> 07:06.340
Alright, you'll notice sort of quickly that it's human readable.

07:06.340 --> 07:12.600
You type in whois for a domain, and it's delimited by new lines, and it's actually completely up to the registrar.

07:12.600 --> 07:17.920
So, here's four different domains, and they all look completely different in their output.

07:18.200 --> 07:20.680
That's really hard to work with if you're doing it at scale.

07:21.560 --> 07:22.940
It's too much.

07:24.280 --> 07:29.980
So, another thing whois watcher does is whenever you do a whois lookup, it'll return as json.

07:29.980 --> 07:33.840
Because then... am I like yelling into the mic?

07:33.840 --> 07:34.780
Shit.

07:36.680 --> 07:37.980
There we go.

07:38.980 --> 07:43.620
So, it'll return as json, and then you can parse based off of that.

07:43.620 --> 07:44.860
It's pretty helpful.

07:44.900 --> 07:49.940
It uses a standard whois library... excuse me, standard Go library to do that.

07:52.040 --> 07:52.880
Okay.

07:53.120 --> 07:55.900
So, we're pulling in domains every 24 hours.

07:55.900 --> 07:57.700
We are getting json output.

07:57.760 --> 08:01.920
Now we need a way to look up domains at large scales.

08:01.920 --> 08:04.660
So, there's two ways that whois watcher will do that.

08:04.660 --> 08:07.320
The first is through ipv6 proxying.

08:07.420 --> 08:17.220
And I wasn't aware of this until about a year ago, but if you create a VPS and you enable ipv6 in it, you'll get more than one ipv6 address.

08:17.220 --> 08:19.940
So, you actually get a net block of ipv6 addresses.

08:20.020 --> 08:22.460
So, for like DigitalOcean, you'll get about 15.

08:22.460 --> 08:33.620
If you do Linode's $5 a month VPS, you'll get a slash 64, which is a sextillion number of addresses that you can use on your single device.

08:34.700 --> 08:41.040
So, there's a great tool called TrevorProxy, and I think... I saw Tegramancer earlier.

08:41.180 --> 08:44.540
He wrote that, and it sets up a local SOCKS proxy.

08:44.540 --> 08:56.020
So, every request you make into the SOCKS proxy, it modifies your source ipv6 address, essentially to bypass rate limiting, because you come out with a new ipv6 address with every single request.

08:56.320 --> 09:01.760
So, if you're doing it this way, you'll complete about 100,000 to 200,000 whois lookups for 24 hours.

09:01.960 --> 09:03.780
I still think that number can be tweaked.

09:03.780 --> 09:10.620
I think we could do a little bit better with that, but the big downside is not all registrars support ipv6.

09:10.620 --> 09:17.780
So, for many of them, you'll be able to do it, but you're going to occasionally have domains that you just can't look up with ipv6 proxy.

09:19.780 --> 09:20.720
Everybody follow?

09:20.720 --> 09:22.180
Is that making sense?

09:22.760 --> 09:23.420
Cool.

09:24.780 --> 09:25.520
All right.

09:25.820 --> 09:29.220
So, the best way I've seen to do this is with serverless cloud.

09:29.340 --> 09:34.500
So, whois watchers go is go, so you can cross-compile it, push it into Lambda.

09:34.760 --> 09:36.860
You can use AWS CDK to do it.

09:36.860 --> 09:38.580
That's how I did it for a long time.

09:38.580 --> 09:40.820
But recently, Lemma came out.

09:40.820 --> 09:43.560
So, I guess, how many people have heard of Lemma before?

09:43.560 --> 09:44.620
Raise your hand.

09:44.720 --> 09:45.820
A couple there.

09:45.920 --> 09:47.160
It's a great utility.

09:47.160 --> 09:48.720
It's written by Def Per Am.

09:48.720 --> 09:53.500
And the idea is you can take a Go binary and push it into a Lambda function.

09:53.500 --> 10:00.140
It'll give you a Lambda function URL, and you can just call that to distribute workloads at scale really well.

10:00.900 --> 10:09.220
So, if you add whois watcher, the link from GitHub, into tools-install-tools.sh, it'll just push it into Lambda.

10:09.220 --> 10:10.920
So, there's no other work to be done.

10:10.920 --> 10:12.560
It's now completely in Lambda.

10:14.300 --> 10:15.700
And so, here would be an example.

10:15.700 --> 10:17.060
You could do cat domains.

10:17.060 --> 10:18.140
You pipe it to Lemma.

10:18.740 --> 10:22.260
With 400 concurrent invocations, which is not a lot.

10:22.260 --> 10:30.140
Like , most people's accounts have about 1,000.

10:30.140 --> 10:32.140
Holy shit.

10:32.500 --> 10:33.600
Is it me?

10:35.320 --> 10:38.620
So, I should just push through this feedback?

10:38.620 --> 10:39.340
Just keep talking?

10:39.340 --> 10:39.880
Okay.

10:41.440 --> 10:42.400
All right.

10:42.480 --> 10:43.080
So, yeah.

10:43.080 --> 10:44.640
Most people's accounts have about 1,000.

10:44.640 --> 10:46.720
So, 400 is a very small number.

10:46.720 --> 10:48.100
It's a single region.

10:48.500 --> 10:54.520
And with 400 concurrent invocations, you'll finish about 1,000,000 to 1,500,000 per 24 hours.

10:54.520 --> 11:05.780
So, if you want to go beyond just the last 24 hours, you can build out an entire recon platform, and we did it, just by pulling in lots of domains and running them through Lambda functions.

11:06.540 --> 11:08.840
One thing I would call out...

11:08.840 --> 11:11.380
Oh, so, whois watcher does respect IP limits.

11:11.380 --> 11:19.080
So, if a registrar says, hey, you need to back off, you've made too many requests, it'll drop off as to not violate terms of service.

11:19.380 --> 11:22.640
Second one, a guy on our team has called this out.

11:22.640 --> 11:24.260
Great finding.

11:24.580 --> 11:41.740
If you use AWS EventBridge to make a modification to the function URL, so you can set it on a crontab for every single minute, and it doesn't need to do much, you can just make a slight modification to the function, AWS will redeploy you into Lambda, so you'll get a new IP address every minute.

11:41.780 --> 11:50.560
So, every single minute, you get a new IP address with 400 concurrent invocations, so you get this massive scale to pull down the data itself.

11:52.640 --> 11:53.860
Any questions so far?

11:53.860 --> 11:56.020
I feel like I'm ripping through this.

11:56.200 --> 11:59.060
I have a question section at the end, but... makes sense?

11:59.740 --> 12:00.620
Is that cool?

12:00.700 --> 12:01.380
Useful?

12:01.380 --> 12:02.100
Hopefully?

12:02.360 --> 12:03.040
All right.

12:04.620 --> 12:15.140
All right, so, now we have domains every 24 hours, we're getting it in JSON, we're doing large, large lookups to a million to a million and a half every 24 hours.

12:15.560 --> 12:24.920
Now we need to do what we really came here to do, which is, if a new domain registered by a company we care about is registered, we want to know about that.

12:24.920 --> 12:27.730
That could be red teaming, continuous, bug bounty.

12:28.340 --> 12:32.460
So, WhoisWatcher has a YAML file that you can set things of interest.

12:32.960 --> 12:38.080
So, I have, like, an email contains bankofamerica.com, that's in my watch list.

12:38.820 --> 12:49.860
And if I take in the domains, the results from the domains, run it through WhoisWatcher, it'll identify, from those results, any domains, and we get alerted on it.

12:49.860 --> 12:51.400
Does that make sense?

12:51.860 --> 12:52.580
Cool.

12:55.380 --> 12:57.160
So, I put a video in here.

12:57.860 --> 12:59.560
Try and walk through this real quick.

13:00.740 --> 13:03.040
So, we have a list of domains.

13:03.040 --> 13:06.640
I think there's going to be, yeah, there's 400 domains in here, so it's not a big list.

13:07.260 --> 13:09.620
We're going to run it through Lemma, like I was talking about.

13:09.620 --> 13:12.020
We'll use 400 concurrent invocations.

13:12.480 --> 13:20.300
So, in this step, it's just going to push all of those domains out to Lambda function URLs, pull in the results, and store them as a file.

13:21.340 --> 13:24.020
It should take around 10 seconds to run these.

13:24.020 --> 13:29.060
You can get much better scale by modifying your timeouts and doing small tweaks.

13:30.460 --> 13:32.760
So, it's all pushing them out, doing it live.

13:33.000 --> 13:36.280
Right, so, sorry, 13 seconds to get all of the results.

13:38.480 --> 13:40.780
Sort of verify that all the results are in there.

13:40.780 --> 13:42.140
They're now in there as JSON.

13:42.540 --> 13:44.820
We can do whatever we want with it.

13:44.920 --> 13:47.940
In this case, we're going to run a watch list to identify another domain.

13:47.960 --> 13:51.580
Owned by Bank of America that was in that domain set of 400.

13:52.180 --> 13:55.660
So, our watch list is for an email that contains Bank of America.

13:59.880 --> 14:05.480
So, again, we're providing the watch list and using the results.json that we got in the previous step.

14:06.020 --> 14:12.900
And there we go, there's a minpaychange.com that we now found out about that was from that domain set.

14:12.900 --> 14:17.180
So , that would be an example of using the tool, sort of beginning to end.

14:19.540 --> 14:20.340
Right.

14:23.360 --> 14:32.040
Another thing that's in there, and I've never seen this in a data broker before, is you can look up multiple reverse lookup points.

14:32.080 --> 14:35.300
So, typically, when you do a reverse whois, you pick out one data point.

14:35.300 --> 14:39.860
So, I want to reverse whois on the email, or I want to reverse whois on the company name.

14:40.580 --> 14:43.440
When you own the data, you can do it on multiple points, right?

14:43.440 --> 14:50.580
So, in this case, the watch list contains a combination of Tesla and a registrar of DNS Station.

14:50.680 --> 14:56.960
And the reason we would do that, and it's kind of hard to see on the left, but Tesla redacts all their whois information.

14:57.660 --> 15:01.360
But they often use the same registrar, because most enterprises do that.

15:01.360 --> 15:03.580
They don't want multiple registrars.

15:03.580 --> 15:07.860
You don't want AWS and then also DNS Station or Namecheap.

15:07.880 --> 15:12.820
So, we can sort of filter on the idea that they're likely to register with the same registrar.

15:13.980 --> 15:18.420
So, here would be an example of two domains found that I haven't seen before.

15:19.460 --> 15:20.900
teslanunionfree.com.

15:20.900 --> 15:24.260
And basically, all that is, is we're looking at a massive set.

15:24.260 --> 15:29.320
We're saying anything with the word Tesla in it, and a registrar of DNS Station alert me.

15:29.480 --> 15:43.240
And I can give an example in the past six months of using this technique to discover a domain that we didn't know about before, simply by focusing on the registrar, even with redaction in place, because the customer always kept using the same registrar.

15:43.440 --> 15:44.980
It was sort of easy to predict.

15:46.540 --> 15:47.820
Make sense?

15:51.220 --> 15:52.980
So, I mentioned this a second ago.

15:52.980 --> 15:58.360
I would highly recommend to store the results in a JSON file and then analyze them later.

15:58.440 --> 16:03.480
So, you can run it through Lemma, store it as a JSON file, come back later.

16:03.480 --> 16:08.300
And the other reason you might want to do this is you can modify your watch list as time goes on.

16:08.620 --> 16:12.840
So, you can, let's say you have a new customer or you're in bug bounty, you have a new domain.

16:13.440 --> 16:14.380
You're updating your watch list.

16:14.380 --> 16:18.440
You're still analyzing from your previous results at sort of no cost.

16:18.440 --> 16:20.680
You're not burning an API key to do it.

16:24.240 --> 16:27.000
All right, I'm getting pretty close to closing up here.

16:27.920 --> 16:32.380
One thing I want to add in is some sort of like an almost in a domain.

16:32.620 --> 16:44.720
So, like for domain typosquatting or cases where a customer does a domain that's almost their name, I would love to have like the Levenstein distance as part of the watch list in order to get alerted on domains in that way.

16:45.760 --> 16:47.820
Probably needs better error response handling.

16:47.820 --> 16:52.640
Like , one of the worst problems with Whois is it completely depends on the registrar.

16:52.640 --> 17:00.760
So, you can look up a .de and get a completely different error than if you look up a .bank or some other specific TLD.

17:00.800 --> 17:07.320
So, that probably needs to be worked on and then better international TLD support, again, due to registrar constraints.

17:10.310 --> 17:17.210
All right, so, I added like a, as I've been going along through the research, as I mentioned, we did an entire platform around this.

17:17.230 --> 17:20.890
I added some examples into awesome Whois resources.

17:20.910 --> 17:22.490
Probably add a few more.

17:22.970 --> 17:24.730
That's the tool there.

17:26.090 --> 17:28.550
So, yeah, I mean, that's all I have.

17:28.550 --> 17:31.130
Hopefully, anybody have any questions?

17:34.640 --> 17:35.920
Appreciate it.

17:38.240 --> 17:39.340
All right.

17:39.340 --> 17:40.760
Thank you so much, everyone.

