Let's get started. Uh, please give Gerald and Roger a very great DEF CON welcome. Hello DEF CON. Um, hello everybody. Um, today we're going to, uh, discuss the current state of, uh, DNS rebinding including attack, recent attack and prevention technique. We will discuss the DNS rebinding attack framework and how it incorporates this new, um, technique and how you can use them today. So, our contribution in the domain of DNS rebinding, uh, um, twofold. Uh, the new tool, Singularity, uh, it has everything you, you need to perform DNS rebinding. It is reliable, it is performant, it has built-in payload for, uh, command services, and can perform, uh, automatic service detection and exploitation. So, uh, uh, the second area of contribution, uh, is, uh, in the research of, uh, technique to improve the speed of DNS rebinding and how to bypass command DNS rebinding protection. So, um, our talk will be articulated around, um, uh, the new tool and the, the techniques, uh, in the corporate. And, uh, we will include a customary, um, uh, refresher on the basic of, uh, uh, DNS rebinding. We will also discuss, uh, uh, an architecture we have implemented in Singularity, which allow you to interactly, interactively browse, uh, a hooked browser, uh, internal network. So, who are we? We are Gerald Lusso and Roger Meyer. We are security consultants at NCC Group. Uh, we are attached to the San Francisco office. And, uh, we are the authors of, uh, Singularity of Origin. Roger? So, why should you care about DNS rebinding? Most developers understand that when they bind their application to all interfaces, that they expose themselves to remote access, and this is not a good idea. So, what do they do to fix this? They bind the application to their local host. They think only trusted users can access, it's a trusted environment, so, they don't need authentication. But, uh, the fact that, uh, the, uh, indication, right? And then all these DNS rebinding issues happen. The EOS cryptocurrency wallet is vulnerable. Google Home, Roku, Sonos speakers are vulnerable. The Geth Ethereum client was vulnerable. Redis, Memcached, Elasticsearch, the Kubernetes dashboard on Minikube was vulnerable to DNS rebinding allowing RCE and VM escape. The Rails web console was vulnerable. We see more and more applications exposing HTTP server on the local host, especially through the popularity of frameworks such as Electron. The rise of IOT devices exposing sensitive interfaces on internal networks without authentication will make this even worse. We would also like to clear up certain misconceptions such that DNS rebinding is slow and can be solved by out of the box DNS filtering. We would also like to clear up certain questions of DNS rebinding or DNS identityодно and ask for more answers about DNS ounge. We want to close this session by using theять website with links for more information. is under development? We would like to start with a quick refresher on how DNS rebinding works. The origin is, consists of the scheme, host and port. Two documents share the same origin if they have the identical scheme, host and port components. The same origin policy is an important security concept, implmented in browsers that dictates how two different sites with different origins can interact with each other. Certain interactions are always allowed between all origins such as form submissions, links, redirects, content embedding. But cross origin reads are typically not allowed. This is important for example if you're logged in to gmail.com and browse to an attacker controlled website, you don't want the attacker controlled code to be able to read your gmail messages. DNS rebinding permits us to bypass this same origin policy. We'd like to show you a visual walkthrough to make it easier to understand the concept. So on the left side we have the victim which is the browser. We have a target service which can be a service on the victims local host or on the internal network. We have an attacker which consists of a DNS server and a web server on this public IP. So on the right side we have the internet, on the left side we have the intranet. The victim can access the target service without authentication and the attacker cannot directly reach the target service otherwise we wouldn't need DNS rebinding. Step 1, the victim browsers to the attacker's website. Talk the internet. If the attacker is not able to access the user's host it on rebinds.it, that's our domain name. We respond with the DNS A record of the public IP address and load some Javascript which keeps running in the victim's browser and waits until the DNS record expires. Once it expired, we make another request with the same origin, this time we respond with a different IP address, the IP address of our target service 127.0.0.1. Notice that the origin rebind.it did not change, we did not violate the same origin policy. The browser will make this request and will allow the Javascript to read the response and where we can exfiltrate it back to the attacker. All of this is possible because we did not violate the same origin policy, it's still pointing to rebind.it. We only changed the IP address. This was a high level overview which omitted a lot of details. There are a lot of previous good research which you can look at if you want to know more about the details. We would like to show you a first demo on IOS using Safari where we can achieve DNS rebinding in just 5 seconds using the cache flooding technique. In this case we will be exploiting a home router on router.asus.com and we will be just reading the index page and displaying the results in a Javascript alert box for demo purposes. So this is Safari, we're going to router.asus.com, this is the target we're trying to exploit. So now we're setting up the attack, we're going to the singularity manager web interface, we're setting the target host to router.asus.com, we're leaving the target port at port 80, we're setting the attack payload to a simple fetch gap, we're using the first then second strategy, an interval of 1 second and we're enabling the cache flooding technique. We're starting the attack, this only takes about 5 seconds and we display the results. What we see here is the return of the index page which is just a redirect to the main login.asp web page but it shows that we were able to read the response from an internal system to home router. Thank you Roger. Now that we have a grasp on the basics of DNS rebinding we are going to explore how we made DNS rebinding more reliable within singularity. So let's say that you are a fan of uh horse riding and that you're trying to plan your ne- your next vacation and you found a website that just allows you to do that. Um there's nothing wrong with this website um displayed permanently uh is a Trojan horse picture. In fact uh the website was compromised and is running um a hidden high frame with singularity. So you connect to the website and you um download the malicious Javascript from singularity and uh uh the code emits its first DNS query. So this is a query. So what is in a query? Um as you can see the- the- the query is made of several components. These uh components encodes uh everything singularity needs to perform an attack. So first you have a start tag. Um then you have the attacker host IP address where we run singularity. Then you have the target IP address or it can be a name as well. Followed by a session ID. Uh session allow for the uh use of concurrent uh users and- and uh uh target IP address. Then uh you have the DNS rebinding strategy. Singularity uh incorporates uh a number of uh d- uh different DNS rebinding strategy. Here you can see uh uh FS first and second. Also known as a time varying attack. Uh this is the simplest uh and most reliable uh DNS rebinding strategy you can implement. Then you have the end tag and then you have the attacker domain. The one that you have either purchased or um uh compromised. Uh this is the step to check that the uh uh the user and the attacker don't have the same job. Uh this is a one that you have to do to uh�� 없어요 uh the uh the uh the attacker. Uh just to make sure that we uh that we uh do uh to uh skip the uh uh the attacker and then we can uh execute uh the uh the attacker uh by uh by using uh uh a voice over uh uh uh a uh web server for uh uh the uh the attacker to log into this uh uh web server. Uh so uh the uh the uh uh the instruct singularity to drop uh idle connection from browsers. So when it is time to uh rebind against the target IP address the uh browser doesn't maintain a connection to uh singularity. What about ETL value? Um most literature and other tools uh use uh a value of uh one second. Uh we tried zero in the hope that um it will break stuff. It didn't. Uh zero second is a valid ETL value so we just sticked with that. So how do we know that we have uh successfully uh rebinded against the target service? Um historically uh singularity used an index token in the HTML body. Um so if this index token is present um then the javascript code knows uh it's still pointing against singularity. If this token is uh disappears on the next next fetch uh then it means that you have successfully rebinded. We recently moved to a custom HTTP header uh however the index token is still useful in uh uh one specific DNS rebinding strategy uh where we uh abruptly uh terminated the connection uh from singularity to the browser and the browser get confused. We will uh go into more details uh on this later. Something you need to consider as well is that uh you may uh encounter an environment uh where there is an IPS and IDS um and uh these IPs are uh uh uh IPS. IDS may emit their own uh Sperius uh DNS queries when they see uh request from uh the t- the target browser. So it it means that you may receive uh uh uh uh IP address uh out of sequence when you make your DNS query. Uh um which um uh means that um the target browser will never see the IP address of singularity only the target so will never be able to download the code and uh performed DNS rebinding. So to address that we um have implemented a random DNS run uh rebinding strategy where um um we respond either with the attacker IP address or the service uh IP address uh which is a much slower technique in general but you could get lucky. So um we're now going to explore how we um improve the speeds uh um of DNS rebinding in um in Singularity. So the first thing to know is that implementation details matter. Um the DNS uh rebinding speed will vary uh depending on the host implementation. Whether you use uh a Windows or Unix-like environments uh operating systems such as um Linux or MacOS, the browser vendor uh IE, Edge, uh Firefox, Chrome and all uh it's been off uh and Safari. The target specification matters um whether you use um the DNS rebinding method or the service uh targeting a service that's bound to the loopback interface or uh uh on the private network or a remote public IP address. Obviously we just uh so that uh um external factor may impact the speed such as the presence of an IPS and IDS. So just to illustrate uh DNS rebinding may take 40 plus minutes uh when uh uh using Edge uh and down to 3 seconds depending on what strategy you use. Uh Singularity can automatically uh use the DNS rebinding method. Uh the DNS rebinding method can automatically uh fingerprint to optimize for speed uh in some condition. We will discuss this later. So the time varying attack uh uh Singularity first and second is approximately 60 seconds on all browsers except uh IE and Edge. Um we um there's another technique called multiple answers but we didn't believe would work uh however uh one of our colleague Michael Roberts from NCC Group uh created a a small proof of concept uh uh that uh uria uh nikko actually had uh uh demonstrated that it was working on windows. When we specified uh an IP address of 127.0.0.1 and uh we were achieving rebinding time of uh uh three-second ones uh we implemented batch. Uh however, it didn't work with uh um the same technique didn't work with a unix leichth machine uh such a Linux or or Mac os, however after a bit of digging when specify a target service IP address of 0.0.0 we achieve a decision. So uniction uh, approximately three second, um, rebinding time. So now we have a solid and fast, uh, DNS rebinding against all loop back bound, uh, services. Just to illustrate at a high level how the multiple answer rebinding strategy work. So the target browser will emit its DNS query, uh, to rebind at it, uh, where we run singularity as usual. Um, instead of responding, um, with the IP address of the attacker, then, uh, the IP address of the service, uh, as we do for the time varying attack, we respond with both record at the same time. So then the target browser is going to keep, uh, polling, uh, the service, uh, and, um, uh, to determine whether it's pointing against singularity or the targets. Uh, then, singularity is going to then implement at some stage, uh, ephemeral, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, firewall rule that will, uh, abruptly block the traffic. This will force the browser, uh, to, um, uh, connect, uh, to the target service using the second IP address we provided earlier. So the multiple answer technique, um, strategy work very well for loop back bound type of, uh, services. So if your service, uh, uh, for instance, for instance is listening on one to seven dot zero dot zero dot one, but we were getting, uh, uh, uh, uh, uh, uh, uh, uh, inconsistent results for over target specification, for instance, on the, uh, private network, uh, where, uh, one attempt out of five would, uh, succeed. Uh, we implemented another technique called DNS cache flooding. Um, this worked very well in, uh, Google Chrome and, uh, Safari and iOS platform. Uh, you basically, basically, uh, floods the cache of the browser with thousands of queries, um, and, uh, uh, you can reduce then the DNS rebinding time from five to 40 seconds, which is a great progress over the average of 60 seconds. Uh, Roger Demo was using this technique, uh, when we're using iOS and we got rebinding time of five seconds. Um, flooding the cache is performed in a separate web worker. So here, you have a Chrome, uh, uh, console and in blue uh you have your regular uh attempts to fetch uh uh resources to determine whether um um we were pointing against the target service or not and uh uh in between all these uh requests you have thousands of query that fill the cache of the browser the DNS cache uh in an attempt to uh evict the IP address of the singularity server forcing then the browser to point to the service for instance 127.0.0.1. So we have uh illustrated in this table some configuration and uh what can you expect uh uh from a DNS rebinding time perspective. Order. Let's talk about DNS rebinding protection bypasses. Using singularity we can bypass all known DNS rebinding protections such as those implement in open source DNS servers unbound or DNS mask. We would like to emphasize that common recommendations and default configurations do not provide complete protection. How do common DNS protections look like? Most solutions block certain DNS responses at the parameter so when they enter your internal network. Some tools block RFC 1918, private IP address, such as 10 slash zero, 192 dot 68 slash zero. Some tools block local host IPs, 127 slash eight. Some tools can be configured with which IP addresses you're using internally, such if you're using public IPs on your internal network you can get those blocked. Some tools block the zero slash eight range. DNS mask and unbound are two widely used open source DNS servers. They're used in tools such as PFSense, OpenWRT, and certain home routers. There are also free public DNS services such as Cisco's OpenDNS which advertise that they have uh rebinding DNS rebinding protection implemented. For OpenDNS it's called block internal IP addresses and that just blocks private IPs. DNS mask has a separate IP address that blocks private IP addresses. DNS mask has a setting called stop DNS rebind which blocks private IPs. The zero slash eight range and the 127 slash eight range, this does not block local host. We will talk about what we mean by local host in a minute The unbound DNS server has a configuration setting called private address where you can configure internal IP address range. And this will then be blocked this does not block the 0000 IP the also consists of two tokens for an IP address очень common to online data sender 127.001 or the local host. Our first protection bypass is using the 0.0.0.0 IP address. This is a non-routable or invalid IP address but it works very well on Linux and Mac OS using Firefox and Chrome to access the local host. This bypasses protections that block DNS responses containing the IP address of 127.001 or the whole 127 slash 8 range. When we query singularity, we can specify the target here so we can use the 0.0.0 target and then the DNS response will be an A record pointing to 0.0.0.0. What if the DNS protection solution blocks all internal IP addresses? Then we can use CNAMEs. Can we use CNAMEs to block all internal IP addresses? Yes, we can and non-nuclear name records are DNS records which went one domain name to another domain name. We can return a DNS C record instead of an internal IP address such as wiki dot NCC group dot com or Jenkins dot internal dot com whatever our target is. This bypasses protection that block DNS responses on of private IP addresses. The local internal DNS server will then resolve the C name for us in a codename, which means we can use CNAMEs and and you don't want to block internal DNS resolution if you want to use internal host names. When we query singularity we specify the target here so instead of an IP address we specify wiki.nccgroup.com and then the DNS response will be a CNAME pointing to wiki.nccgroup.com. Our third bypass is a variation of the previous technique. We can use the CNAME of local host. This bypasses protections that block DNS responses containing 127.0.0.1. This works well in Linux and Mac OS. When we query singularity we specify local host here and then in the response we just return a CNAME pointing to local host. Ok, now we're going to uh discuss uh the architecture we implemented in uh uh singularity uh to uh browse the uh a victim internal network after a DNS rebinding. So tools such as BEEF, the browser exploitation framework, and Firedrill, a DNS attack tool uh can use a hook browser to uh uh access uh data from a DNS attack tool. Uh we can also use a hook browser to uh uh counter attack targets uh which are not typically available directly from an attacker. So it's your own uh appliance or uh corporate environment assets either via uh cross site scripting or DNS rebinding. So we know that uh BEEF uh require you to the the attacker to configure uh its uh browser or operating system to use the BEEF application server uh to uh uh to uh avail of this uh functionality. Uh we don't know how uh FireDrill uh does it uh but uh you since the code uh and the binaries are not available. Uh we implemented the browsing of service in Singularity uh without requiring the attacker to uh setting up its browser to use an HTTP proxy but instead just to uh point to Singularity uh via uh using normal HTTP requests. So at a high level once your um browser uh has been hooked um or the victim browser has been hooked uh the browser will make a web socket connection uh to the Singularity um application server and wait for instruction. The uh attacker will use is a browser to connect to Singularity and uh uh display the list of uh uh victim that's been hooked and select one to browse. So uh let's say you want to connect to the home directory of a service bound to 127.0.0.1 uh the attacker's browser will have made a normal uh uh HTTP request to obtain this directory. The Singularity application server will translate this into a web socket operation uh to fetch the resource. Um then the target browser using the Singularity JavaScript code will translate this web socket's fetch operation into a normal um fetch API call to uh the home directory then the data will be sent back all the way uh bandwidth. So, there you go that's how these both uh the attacker browser, sorry. At a low level we just customized the Golang round tripper interface. And we use uh, the WebSocket plaintext protocol to package uh, each fetch request and response. Um, since we use uh, base64 encoding uh, the size of the message is increased by four thirds of the original length of the message. Please note that you don't have to use uh, a browser. You can use any uh, user agent. You can use curl, HTTP uh, inspecting proxy such as uh, uh, burp port swigger or wasp zap or SQL map and and so on. So when we implemented this architecture in Singularity we uh, we encountered a number of challenge. Uh, the first assumption we made was that we didn't have to care about the cookies exchanged between the victim browser and the victim service, the target service. Uh, however our first uh, test case was Duplicatee, a backup solution uh, that was vulnerable to uh, DNS rebinding. And uh, as you can see the code snippet here uh, Duplicatee is extracting CSERF token from the cookie uh, to generate links that allow you to browse the Duplicatee application and perform a number of actions including running a backup. So Singularity didn't work uh, with that. So um, we had to uh, uh, we had to uh, we had to uh, consume this cookie. So we um, we read them from the target browser and we transmi- transmit them to the Singularity server over WebSocket and then the Singularity application server set them uh, on the attacker uh, browser for the target domain uh, that uh, Singularity uh, has constructed. Um, for HTTP only cookie uh, we don't really care about them. Uh, they cannot be read by Javascripts. Uh, so they cannot be used by Javascript on the attacker uh, uh, on the um, browser. So we let the target, the target browser handle uh, them for us. Another challenge uh, is that to be able to read uh, cookie uh, when you perform a fetch request, a fetch API, you have to pass the credentials includes option to the fetch request. Uh, and if your application require um, uh, HTTP authentication, this is not going to work. And, and why is that? This is illustrated in this slide. Um, so let's uh, let's uh, let's uh, let's uh, let's say you have a service that require HTTP authentication and you issue the commands uh, fetch uh, HTTP 127.0.0.1 with the credentials includes, then an authentication dialog box appears. Uh, that will warn the user that something is amiss. So we don't want that. Um, however, if you type the same command but you pass a different argument, credentials omits, then there's no, there's no uh, authentication dialog box. So the victim is not the wiser. So uh, when uh, we have cookie and HTTP authentication uh, required, then we forget about, we actually don't transmit the, the cookie to uh, uh, the attacker. Okay, now that Gérald introduced us to this hook and control feature, we would like to show you how this works in a demo. For this demo we'll have two browsers. One is the victim, the other one is the attacker. In this case they will be both on the same machine, but in a real world attack this does not have to be. The attacker can be anywhere. So the victim will have a Jenkins instance installed in the local host and the attacker will try to access this. So this is the victim chromium browser, uh, which has this Jenkins instance running, listening in the local host. Now we're switching to the attacker. This is the hooked uh, victim clients which will show, uh, the page. So we reload the page and show it's currently empty, there's nothing there. Switching back to the attacker, sorry to the victim browser, we're going to the singularity manager interface. We're setting the target to zero zero zero for local host. Target port is 8080. We're using the hook and control attack payload. We're using the multiple answers attack strategy. We're using one second interval. We're starting the attack. It only takes three seconds. Uh, we're switching back to the attacker. We're reloading the page and we can see this new victim session. So we click on it and we can now browse the victim's Jenkins instance over the internet. So the attacker browsed this credentials endpoint. We're going back to the, uh, the attacker's victim to show you the requests. The first request is this slash credentials, which the attacker was browsing to to show you how this looks like. And we can see slash credentials. The remote address is zero zero zero for local host. And the request URL is the origin still points to the attacker. We'd like to show you how we exfiltrate our data back to the attacker. So this s-o-o-w-s endpoint is how we send an exfiltration request to an attacker. And we can need to use the user's the data back to singularity uh using web socket messages and that's how we can all the attacker can then browse to uh Jenkins instance. Okay now we're going to discuss how to uh scan for vulnerable hosts and and services. So in the past there have been uh many very smart attempts to replicate uh nmap uh behavior in the context of uh the browser but uh we've had the power of four sockets. So many of the solution uh we have looked at uh uh ever not completely reliable or do too much for our purpose. Uh for instance we don't care whether SSH port uh is open or not. Uh DNS rebinding is concerned uh with uh exploiting uh issue with HTTP uh resources so far. Uh so the only thing we care about is uh the uh the uh the uh the uh the uh the uh the does it speak HTTP. So we implemented a very uh simple solution that leverage uh modern um API and um and uh so it's uh uh including sorry uh fetch abort uh for uh uh implementing a timeout. So um we distribute the the list of target we want to scan uh that uh includes IP address and uh uh ports uh across uh four web workers. We only fetch uh the rest of the uh resource header. Uh we don't bother with the the response uh body uh and we have um a timeout the limit of 300 milliseconds uh before we move on on to our next target if we don't get a uh sufficient results. Um so the timeout will obviously drive how fast you can scan uh a host or a whole network. It is fast for HTTP open port uh obviously and it's fast as well for close ports because if you if you emit you sent a packets to uh a close port the TCP IP stacks everybody. So we can get um a pass and get a pass at the end of the event and uh it's a nice of the target will respond with a reset packet if nothing is listening on this port. Uh it is slower for firewall ports but because here the typically a firewall will drop any response so you don't know what's going on uh so the scan will uh wait 300 millisecond and then move on to another target. Uh and slow as well possibly for slow HTTP service and uh over protocol that are not handled by fetch. Um so uh you want to use a lower timeout when you're scanning a LAN or fast HTTP service or uh you can use HTTP uh higher timeouts uh when you scan uh over a network uh uh make it one that have um high latency such as VPN. Over interesting bits and pieces uh we use the classic web RTC IP address leak to obtain uh the IP address uh the private IP address of the uh victim when available it works uh on Chrome and uh Firefox and we use this IP address to derive a subnet uh we can use to uh scan. We obviously passed the credentials omits to fetch so uh the victim uh is uh not made aware that uh a scan is on go on ongoing and uh we currently considering performing a second pass scan uh to identify uh slower HTTP service that we may have missed. So we have learned how distributed information like時間 can be used to uh, we, um, made Singularity more reliable, uh, faster, how we can, uh, uh, find, uh, vulnerable, uh, targets, uh, and services. Um, now we're going to, uh, show you how, uh, you can implement all the above, orchestrate all the above, and, uh, uh, perform service detection and auto-exploitation as a bonus. So, Singularity provides a sample auto-attacking dot HTML file, automation file. It is fully customizable and, uh, permits, uh, to leverage all the features we have discussed so far, um, including but not limited to, uh, you can specify, uh, specific, uh, exploitation payload. For instance, uh, targeting a service like Jenkins, or you can ask Singularity to auto-select the, the payload based on the service it detected. You can out-code your targets, uh, and ask Singularity to optionally detect more targets, maybe on your network. Uh, same thing for ports. You can specify a DNS, a default DNS rebinding strategy and ask, uh, Singularity optionally to auto-optimize and find the best strategy for you. And, uh, obviously you have all your options, such as flooding the DNS cache, uh, visibility hiding activity, and so on. Uh, in the future we intend to, uh, implement more auto-optimization so you don't have to read the extensive wiki. So, when you're designing your attack, you want to mix and match, uh, different specification of the same targets. Uh, for instance, uh, for local, uh, uh, host-bound, uh, service, uh, specify 0.0.0.0, local host as a CNAME, or 127.0.0.1. This will improve reliability, uh, uh, uh, permit you to bypass, uh, uh, security controls, and, uh, for speed. Uh, you can instruct Singularity to find and use the external IP address to exploit the internal interface, um, of Wi-Fi, uh, access points, uh, and routers, um, uh, for, uh, device that use the weak end system model. I can only encourage you to refer back to the DEFCON presentation, DEFCON 18, uh, in that regard to see how it works. And, uh, you want to do some homework, uh, using, uh, uh, open source intelligence. Uh, try to figure, uh, uh, what is the naming convention for assets in a corporate network, or even use a dictionary of service name, and specify, specify them as CNAME, uh, in your target, uh, list. For instance, jenkins.internal.corp.com. This is likely going to pay off because a lot of, uh, uh, service are, uh, still unauthenticated in a corporate environment. So we mentioned that Singularity can, uh, do service detection as well. So, um, Singularity come with a number of attack payloads, uh, uh, that targets, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, services such as Ruby on Rails, the admin console, uh, Amazon, uh, AWS instance metadata, and so on. And, uh, we recently added, uh, a service detection routine, uh, that allow you to detect what service is running, uh, behind, and, uh, try to deliver an appropriate payload. Uh, so, for instance, if, uh, you find that the service responds with, uh, a HTTP address that contains the value xjenkins, then Singularity, uh, will figure out that's more, more than likely, uh, is using, uh, uh, uh, is facing, uh, jenkins application instance. So when you select the automatic, uh, uh, attack payloads, Singularity will try to detect the service and, uh, deliver the appropriate payload it has. So, um, with our tool we were trying to blur the line, uh, between origin, and, uh, uh, I think we have achieved that, hence the name, Singularity of Origin. So, how do you protect from, um, uh, DNS threats? Well, uh, uh, uh, sniffing, sunlight, uh, chick tormenting attack. Uh, you often hear, uh, commands or, on blogs or a recommendation to use DNS black lists or to use, tentatively to use DNSSEC maybe or to use this DNS service provider or one of your colleague or friend, uh, bought this, uh, appliance that, uh, uh, or to uh, state that it, uh, it, it provides DNS rebinding protection. Well, as we learned, uh, common wisdom is not enough. Uh, it is hard to understand all the or the subtleties of DNS rebinding and no DNSSEC won't help you there. So Roger how do we protect from DNS rebinding? There are three proper ways to protect your service. One is to use TLS on your application including the service listening on local host. You can require authentication if the attacker doesn't know the credentials they can't make a valid request. Or you could validate the host header for all incoming requests using a whitelist of trusted domain names such as local host or 127.0.0.1. Remember when we showed the origin in our last demo it was still pointing to the attacker which won't be whitelisted. There is also a proposal called course RFC 1918 which would require a pre-flight course that would require a pre-flight course request for websites hosting a public IP address when they make a request to a private IP address. This is currently a draft and not shipped in any browser but it this may prevent DNS rebinding in the browser. We have one last demo where we show you how to automate this whole process. So previously the victim was browsing through the singularity manager interface where they had to configure everything which is not very realistic so in this demo we'll show that the victim only has to browse through singularity. We start with a port scan to detect services listening on the local host. You rebind to these discovered services in three seconds. Already detects the service listening for the payloads we have and launch the exploit right away. For this demo we have a Rails listening on the local host port 3,000 and a Jenkins instance listening on port 8080. So this shows the managed web interface which we are not going to use. What we're going to use is this um auto attack demo uh page. So browsing to the page we see that we detected port 8080 and 3,000. We're launching DNS rebinding right away. The rebinding was successful. It uh detects, already detects the services. We uh um it's not showing. Uh let's go back one more time. That didn't update quite well. It detected Jenkins right away um and it should detect uh let's launch. It detected Jenkins and here it's still rebinding, already detecting but it doesn't seem to update quite well. So for Rails we have uh remote code execution which launches the calculator and for Jenkins we just dumped the plain text password stored in cred, stored in credentials to the console. We'd like to show you how the, how the, how the, uh how the script looked like, the configuration script. It's very simple, the auto attack script so we can define the rebinding strategy as here we use multiple answers. We use the attack payload automatic which automatically tries to detect the service. We specify the ports port 8080 and 3,000 in this case only and we can specify which address to use. There are a few more settings but uh which we, we'll show you in a second. Okay here we go. Uh so the uh this is the uh the uh we don't need for you. You can get the slides including our notes on this URL, you can get singularity or tool on our github page with all these uh features and let us know if you have any questions. Thank you.