Our next talk is going to be starting now. So the next talk is by Anthony Roussel, who's going to be talking about Bug Bounty Recon, bypassing geographic DNS, and Ensembl. He's a professional .NET developer, hobbyist, hardware dev, published over 50 Windows phone apps, spoken at a lot of conferences, so let's give him a round of applause and get started. Over to you. Thank you so much. Alright, wow, what a great introduction. Yeah, so this talk is geo-distributed Bug Bounty Recon, bypassing things like geographic DNS, and more with this new free open-source tool called Ensembl. This is me. My name is Anthony Roussel. I go by the handle .NET Roussel. I'm a professional software engineer. I've been an engineer for about 11 years. I've worked on various systems, lots of boring stuff, but mostly in C-sharp and F-sharp, lots of Python, which I'm sure most of you are familiar with. If you're interested in more about what I do and what I've done, you can check out my blog, dotnetroussel.com. If you want to reach out to me personally, you can hit me up on Twitter, at dotnetroussel. And all of the code that I'm going to be presenting today, I won't actually show you code, so don't worry. No boring code. But if you're interested in the tool itself, it can be found on my GitHub, which is forward slash dotnetroussel. And the tool is called Ensembl. All right, so before I get into the tool, I want to briefly talk about kind of the hacker journey. You know, like how I got here, how I wrote this tool, why I wrote this tool. And I hope that it resonates with some of you, because I think a lot of us take similar paths. So early on, when I started engineering, you know, there were a lot of people that enjoyed security, but no one really took it serious. Can I get just a quick show of hands? How many people here are engineers? Professionally, yeah. So we got a lot of engineers in here. Do your companies take security serious? I mean, hopefully you guys do, because you're here, or you people do, right? Okay, so for the people watching later on, nobody raised their hand that their companies took security serious. So, like a lot of you, you know, I take security very serious. I take it serious in my day-to-day job, but the companies that I've worked for in the past have not always taken it serious. Thankfully, I'm at a place now that does take it serious. But yeah, when I was getting started, I was confused why these companies didn't take it more serious. And I started doing some reading, things like 24 deadly sins. I actually didn't read that one. I think it was 10 deadly web sins, or something like that, when I first started. And I started poking holes in the applications that I was working on professionally. And, man, companies get really mad when you start rooting their applications and, like, finding, you know, all types of stuff, like Stack Overflow. Yeah, so I started branching out and getting away from what I was working on and started doing things like getting into bug bounties and virtual, like, bone hub, things like that, hack the box. But as far as the books that I used to get into it, I started with the deadly sins and these hacking books like this, like Violent Python. And I also did a lot of... I read a lot of the penetration testing book and the open source intelligence techniques. Have you guys... has anybody read any of these? A lot of these should look familiar. These are pretty big in the community. I also, you know, I wasn't going to add these, but, you know, obviously Kevin Mitnick just passed away. Unfortunately, a huge loss to the community. My first DEF CON, DEF CON 22, I didn't know him personally, but I did have an opportunity to meet him. I got him to sign a copy of one of my books. I was so fortunate. I still have it. And I have one of those cool laser-cut lockpicks, lockpick key cards that he had. So if you don't know who Kevin Mitnick is, I highly recommend you learn about him. Learn about his story. He was a huge loss to the community. But, yeah, those are two great books by him. He has a bunch of books out. Those are my favorites. And then, does anybody know what Stuxnet is? Yeah, a lot of us. We should all know what Stuxnet is. Countdown to Zero Day. That one, I'm pretty sure that's about Stuxnet. And if you're doing any type of bug bounty or red teaming, you should definitely have the Hacker Playbook in your arsenal. I had number two and number three. And I tell you, every single time, I'm doing anything. That's the first book that comes out. And it doesn't matter how many times I've done it, I'm definitely not an expert. I don't want to come across as an expert. But every single time I start to do a vulnerable virtual machine, hack the box, a bug bounty, it doesn't matter. Hacker Playbook comes out and I start going through the tools and going through the motions. Because a lot of what we do is a methodology. A lot of what we do is repetitive. That's going to make sense here in a second. So here are the tools that we're using. These should all look familiar to you. We have Kali Linux, Parrot, then obviously the platforms, Bugcrown and HackerOne, Hack the Box, Vault and Hub. These should all be familiar. If not, dig into these tools. These are going to be your bread and butter. So that's the story of how you get into this, how I got into this stuff. Now I want to talk about you and how you're interacting with bug bounties. So the bug bounty hunter story. So the first thing we do when we're looking for a bug bounty is we head over to something like Bugcrown or HackerOne. And you find your favorite flavor of whatever bug bounty program you want. And you pick it and you start reading their description. You start going through what they want you to find, what domains they want you to look at, the scope. The scope of your program that you're going to work on. So today we're going to look at the Twitter bug bounty. Has anybody here taken part in the Twitter bug bounty? Okay, so we've got a few people. Great. I'd definitely be interested in speaking to you after and hearing about your experience and seeing if it aligns with this at all. So if we look at the Twitter bug bounty, they give us a scope of these domains here. I think there's seven there. Now, are we just going to start digging into these seven? Are you just going to go to Twitter.com and start hammering on it? Raise your hand. Who's going to do that? Okay, good. I'm happy nobody raised their hand. That's probably the least effective way to take part in a bug bounty program. We have a lot of engineers in here. Everybody knows that engineers, when we're developing something, we're developing a golden path. Even if we don't know we're developing a golden path, we develop a golden path. A path that we expect all of our users to take. And the engineers at Twitter, I don't know any of them, but I guarantee they expect you're going to type in Twitter.com and that's going to take you to their landing page. And then you're going to go to the login or to the sign-up. And then you're going to end up on your Twitter profile. There's a golden path they expect you to go through. And I promise you that they have spent millions and millions of dollars hardening that attack surface. If you go to Twitter.com today and you get in with admin-admin or any SQL injection, I will give you my next paycheck. That is not going to happen, okay? Those are hardened targets. We don't want those targets. What do we want? Does anybody know? Shout it out if you know. What do we want? All right, that's okay. We want the side door, the window that's unlocked and open. We want the thing that they forgot about. I want the SSH server that has default credentials. I want the FTP server that has anonymous login. I want the dev environment that some intern set up six weeks ago and nobody noticed that it's public-facing and that it has some critical flaw in it. Those are the things I want. A lot of people think those don't exist. They do. I promise you, these things exist. I recently found... Obviously, if you take part in Buck Binders, you know you can't name names. I recently found an SSH server on a non-standard port with default credentials for a major ISP. It happens. This is recently. It just happened. I encourage you to not take the golden path. That's really the key to being successful with this stuff. This is where the struggle begins. Trying to get off the beaten path. We want to first figure out what our subdomains are. Actually, there's a CTF going on next door for the Recon Village for doing subdomain enumeration. I encourage you to try it out. You'll be using things... This is not a comprehensive list. There's probably a lot of tools in here, but there's a few tools that you probably use to do subdomain enumeration. You've got SubFinder, SubLister, Amass. We're going to take those seven domains that they gave us for our scope, and we're going to put them in there. We're going to see how many results we get back. I have the actual number. I did this. I want to know, except for the people that actually did this program. Does anybody know how many subdomains I found just off those seven? Throw out a number. Anybody. Any guesses? 200? Anybody else? 5,000? I don't want to hear that guy. I know him. So I actually did this, and I found... It took a second for it to load, because there are so many. 1,449 subdomains. It's a ridiculous amount. Now, what's the problem? Can anybody tell me what the problem is with this number? Reminder, I did not do anything. I just found the subdomains. So what's the problem with this? Anybody? They're not all active. That's right. You nailed it. That's exactly it. They are not all active. So we have to enumerate this massive list now and find which hosts are actually up and active. Because if we don't, we're going to be running scans against things that are totally dead, and it's going to be just wasting time, burning time. So yeah, we need to figure out what hosts are active. Then we're going to start, after we have our up list, we've got to do our port scans and figure out what services are running on those hosts. Then you're really going to start getting nitty-gritty. You're going to start doing your script scanning with Nmap. You're going to run your NIC2 against their web servers. WP scan, everything, right? And then, obviously, that bullet on there, the Telnet, WebDev, FTP. I found, once again, it's another bug bounty, so I can't say exactly who, but there was a government site that actually takes part here at DEF CON quite frequently. They had an insecure WebDev server, and I was able to start manipulating files on their server. So this stuff definitely exists. Get off the golden path. I can't say that enough. That's really important. So, yeah, this is going to turn into thousands and thousands of requests that we have to make in order to fully map the attack surface, because that's what we're trying to do with our recon. We're not actually breaking in anything with recon. A lot of this is passive until we start getting into actual scanning. But we're trying to map out the attack surface and figure out where the weakest points are so that we can start poking at those points and try and win a bounty. That's what we're here for. The less time you can spend doing this, the more money you're going to make. That's really what it comes down to. I think everybody should know that. So one final thing that you're going to run into as a bug bounty hunter is this thing called GeoDNS. This is not a trick question. Does anybody know what GeoDNS is? It's in the name. You know what it is. If you don't know what it is, that's fine. It's not a security mechanism by any means. GeoDNS improves the user experience in some cases. It'll help if you're in Germany or you're in Australia and you're trying to pull up Google.com. You don't want to have to connect to San Francisco. You want a server that's close to you to resolve. That way your experience is fast. There's also some other reasons for GeoDNS, like laws, where data can be stored and can't be stored, things like that. There's a lot of reasons for GeoDNS. It's great for everybody. There's nothing wrong with GeoDNS. It's great for everybody. You as a bug bounty hunter, however, this is horrible because this means you're missing everything else. If there's a company that has GeoDNS enabled and you're in Alberta or Illinois or whatever, and you're making requests, you're going to get the servers here in North America. You're not going to get the ones in Germany. You're not going to get the ones in France. You're not going to get the ones in Sweden or Australia or Africa. You're going to get the ones here, and your whole bug bounty is going to be against the American servers, which I promise you are probably pretty hard. So we want to see those other servers. We want to get around GeoDNS. And that's kind of what this diagram right here is what I ripped off from Microsoft. I'm pretty sure this is like the Azure GeoDNS system, what they have set up. It's not important. So how do we do that? There are lots of ways that we can get around GeoDNS. I'm going to show you the ways that exist, and then I'm going to show you the way that I created, and I'm hoping that you like it. So we adapt and overcome. Very simple. VPNs and proxies. That would be our way to get around it. The problem with VPNs and proxies, though, especially when you're talking about a global company, one that has servers all over the world, is that you're going to have to maintain a VPN in every region, and you're going to have to maintain proxies in every region. You're going to have to have these set up, and then you're going to have to manually switch between them, unless you're good enough to script switching between them. And then you're going to have to manually rerun all these commands in every region. And as a lot of your engineers, we know when you have to do things repetitively by hand, it is error-prone. Constantly, you're going to have bugs. You're going to miss things. It's very repetitive. You're spending a lot of time at the keyboard instead of getting outside and enjoying the sun. I know a lot of us don't enjoy the sun, but for those of you that like to get outside and enjoy the sun, you're missing out on that because you're spending it at the keyboard. And that's where Ensembl comes in. Ensembl is a new tool. It's a new platform that I created. I spent about a year and a half writing it. If you look at the code and you know Python, it'll be apparent that I crammed it out in a year and a half. But it's a new tool. It's open source. It's totally free. And what it does is it allows you to set up a globally distributed cluster of machines, of agents, that report back to a web portal, a masternode, that you can distribute commands across. It's very easy. This program will let you take... so for example, I'm doing the bug bounty next door for the subdomains. There was like... is anybody else doing that CTF? The subdomain CTF for the Recon Village? Okay, so since you're not doing it, I'll tell you. There's 15,000 domains in a Word file that they're giving out. And you have to figure out how many subdomains you can find, right? And whoever comes up with the most wins. I'm pretty sure those are the rules, right? Something like that? So everyone over there is over there hammering on their keyboards right now, trying to crank out as many subdomains as they can. I opened up... I actually have a cluster running right now. I opened it up. I took those 15,000 subdomains. I dropped it in here. It distributed it across my cluster. And I'm actually competing in the CTF right now while I'm giving this talk. And it's not doing it one at a time. It's doing all of them at once. Simultaneously. And all I'll have to do, when it's done, when the jobs are done, it'll pop up a notification. It'll say, hey, your work is done. I go into the job output. Grab all the results. And I'll probably run them through a unique filter, like a sort unique or something like that. Make sure I don't waste your guys' time having to dig through finding unique ones. But I'm going to find a lot of them. I'm probably going to get a place pretty high on the list. I'm hoping. We'll see. But that's essentially the long and short of what Ensembl is. It allows you to take commands, take huge amounts of targets, and distribute this workload evenly across your cluster. It also allows you to bypass things like geodns. That's what this diagram is here. On the far left here, this is you. You're the user. And you have a command you want to run and some targets you want to run it against. You issue that command to the director, which is your masternode. You do that through the web portal here. And the masternode says, OK, how do we want to do this? Do we want to do it in a load-balanced fashion, which is what I'm doing with the subdomains over there? I said, do it in a load-balanced fashion, which means it's going to take all the targets and break them up across my cluster. Or you can do it in a way where it runs the same exact command against the same exact targets in every region, which is how you bypass things like geodns. And that's what this diagram is showing here. So in this diagram, we're running a command. The director issues it across the entire cluster. And each of these agents in the cluster are going to reach out to the geodns traffic manager, which we don't control. That's somebody else that's controlling that. Each of these agents are going to reach out to the geodns traffic manager, and they're going to say, hey, resolve this domain for me. And the traffic manager is going to say, OK, well, if you're in North America, South America, or Central America, you guys are all going to go to this server over here, right? However, if you're in Asia or Europe or Africa, you actually each get your own server that you're going to. And it's going to run these commands against each of these servers. Now, if you're a bug bounty hunter and you're not doing this, you're only going to get that one server in your region, and you're going to miss the rest of them. So this is opening up the attack surface for you to find more things. And I guarantee you that there are servers out there in other regions that are part of bug bounty programs that nobody has seen. I guarantee you. So here's an example of the workspaces. So I have it set up so you can actually run multiple bug bounty programs at once. I actually have a couple of bug bounty programs in my live cluster right now, and the CTF is not interfering with them because I have it in a different workspace. So if you're running a Twitter bug bounty and a SpaceX bug bounty and a Google bug bounty, you can do all of those, have all of the results separated, and be able to parse through them easily. So that's what the workspaces are. Here's an example of the... and don't worry if you can't read this. I actually have a video that I'm going to show at the end. It's a very short three-minute video of it actually working. This is the agents page. It shows you your active agents and their health status, the last time they checked in, how many jobs they're running. You can drill into the agents. That map in the front was actually where the agents are positioned. So this is actually my cluster right here. I have one in southern Australia, one in southern India, I think that's Germany, or yeah, I don't know, one of those European countries, and then one in Toronto. But you can have as many nodes on the cluster as you want. It's up to you. Ideally, you would have one in every region of the world, on every continent, maybe a couple countries. But yeah, so that's what this is. This is the agents that are alive. And then you can drill into it and see their health status, their CPU usage, their memory consumption. You can restart the agent, all types of stuff. So it gets better. I feel like I'm selling this to you, but it gets better. Not only do you have all the capabilities that I've talked about, but you also have the ability to schedule these jobs. So another big problem that bug bounty hunters run into is they do all their recon at the beginning, and then they spend the rest of the bug bounty doing what? Trying to poke at it, right? They never run their recon again. They run it once. However, companies don't exist in a vacuum. There's always going to be intern schmuckatelli out there who's setting up some stupid service that's public facing that gives you access behind their application firewall. There's always going to be that way. So if you only run your recon one time, you're going to miss when he does that or she does that. What you can do with Ensemble is you can schedule these jobs to run daily, weekly, monthly. You can also schedule them to run at a specific date and time. So if you are working hand in hand with a company and you don't want to blast their environment during peak hours, you can set your scans up to run at 2 a.m. And then you can go to bed, your scans will run, and the results will be there in the morning when you wake up and you can do your analysis. So that's one feature I really love. I use this quite a bit. It's really nice. This is an example of how we create a job. And you'll see this in the video once again. Don't worry if you can't read it. I have some command templates built in. You're able to add your own command templates if there's commands that you like to run frequently. But you have the ability to put your own commands in here. You don't even need a template. You can just fill in the command however you want. And then you can schedule it to run however you want, daily, weekly, monthly. You can decide if you want it to be load balanced or however. And then down here you put in your... down at the bottom you put in whatever targets you want. So what I did was I ran SubFinder. I'm sure you guys have heard of SubFinder. That's a subdomain enumeration tool. I put SubFinder in there as my command. I said run it as a load balanced command. And then I took those 15,000 domains that they have in their CTF and I dropped it in the target list and I hit go. And then I came in here to give this talk. And now that is running and I don't have to do anything. I can get away from the keyboard. Well, this is supposed to be a video. I have a video I'll show you here in a second. I can get away from the keyboard and not have to worry. Alright, so let's take a look at the video here. I have it already queued up. So, everything is secure. Oh, hang on. At DEF CON, don't want to say that. I, to the best of my ability, everything is secure. So... We'll just start with that. So, when you start your Ensemble Director, a new certificate and key, PEM, are all generated specifically to your environment. So, there's no shared certificates or anything. As well as a symmetric key. So, even the symmetric key is generated. So, the cluster is encrypted. The traffic between the Director and all of your nodes is encrypted with a shared key. And you'll see that here in a second. So, let's go ahead and log into the site. Super secret credentials there. And then, here's the dashboard. And the dashboard shows where your agents are in the world, where they're distributed. And when they go offline, the dots will disappear. And when they come online, they'll appear. Here's where you can set up your workspace. It's very easy to switch between workspaces. Here's your active agents and drilling into it. You can also see what processes are running. So, if something's hanging, you can go in and issue a command to kill it. So, this is the jobs page. This is the scheduled jobs. I'm going to slow down a little bit. Okay, so here's the scheduled job. This is the scheduled job that ran. Oh, I buried the lead. I didn't even tell you the best part. So, the scheduled jobs. It's great that we can schedule these jobs to run daily, weekly, monthly. But, what good is it if I have an output of like 10,000 lines? This will actually tell you if lines change between scans. So, if you run a scan daily and a new service, a new port opens up or whatever, it's going to show up in your output. And I think I have an example of that coming up here in a second. So, yeah, you can see it's actually saying, hey, look, right here. It's probably hard for you to see, but it'll put where the lines have changed. Where there's IPs that have changed or new ports that have opened up. It's really great. I love working with this tool. So, this is an example of creating a new command. It's just a simple ping. We're going to ping twitter.com. I have four agents in this cluster, so you'll see four notifications pop up that the jobs have started. And then you'll see the trickle in that the jobs have completed. It's all asynchronous. One thing I want to get working, a feature that I plan on implementing later this year, is I want push notifications. So, if you have it on your phone, it'll just buzz. There's the jobs. Good question. So, what you would do is you would find your favorite flavor of VPS provider, Azure AWS. I'm using DigitalOcean in this case. And you would create your server with them. And then you just pull down my repo, and there's one command you run. And it just sets it up for you. All the installation instructions... So, if you don't have Python installed, I have all the instructions to get Python configured. And all that stuff is in there, going from nothing, plain vanilla Linux environment to having it running. But I think it's like six commands total to get it up and running. Good question. I do have a Dockerfile in there. Do not use it. It's not ready yet. I accidentally checked it in. It's not done yet. But ideally, that's what I want. I want to have a Dockerfile for the director and a Dockerfile for the agents. So, all you have to do is literally just give the Dockerfile to your VPS and be like, Go set this machine up for me. And it does it. I just ran out of time, honestly. So, I'll have the Dockerfile up here shortly. Or, it is open source. I'm encouraging people to give me a hand with it. If you want to take part in this project, feel free to create your own Dockerfile and create a pull request. I'll add it in. No problem. Almost done. This is the event stream here. I know it kind of looks like ish. A lot of this I crammed in at the last minute. But this is the stream of events that have happened on the server. So, if you're kind of confused of if an agent goes offline or if a command is run or not, you can come in here and view it. And then, what do we have left here? That's going to show how to schedule a job. We'll skip past that. It's pretty simple to schedule a job. You just come in here and select when you want it to run. This one is actually supposed to run now, seven minutes ago. So, my cluster probably just ran this. I set it up to run on the 11th of August at 5.40 p.m. against Twitter. So, that one actually should have just executed. And then, what do we have? There it is right there. It shows that it's scheduled. And then, finally, these are the settings. So, up here, I'll show you up here at the top of the settings when it gets there. So, up here at the top of the settings, when you start your Ensemble Director, it will generate your private shared key for you here. And this is actually the command you're going to run on your agent machine. So, you pull down the code on your agent machine. You run this command in the directory. Everything gets hooked up automatically for you. You don't have to do anything else. It's pretty straightforward. Not a ton of settings in here. You have the ability to change your password and stuff. But down here, this is where you would edit your command templates. So, if you have your own favorite tools and your own favorite commands that you want to run, you can easily add them in here. And then, they'll be available in your create job. And you can just blast them off whenever you want. Or if you don't like the ones I put in here, you can delete them. That's pretty much it for the demo. Everything, like I said, is available on my github, dotnetrussell.com. The tool is called Ensembl. It's free and open source and available now. And I encourage, like I said, anybody that wants to take part in helping me develop this, please do. I'm happy to have you as a contributor. And that's all I got. Thank you. Thank you.