Yeah, my name is Thomas and um, my daily work is incident response and forensics. Uh, I have done some red team. So, in red team engagements, I often use Responder, where there's a function to set up a rogue proxy server with the WPAD function. So, monitoring the network to see the traffic, seeing that clients is asking for the WPAD domain, and in the company, but it is also sometimes asking for WPAD.TLD. So, who is having this domain? Is it in use? Is it free? Can I buy it? What are they using it for? So, at the time, I looked at this, I looked up and discovered it was a German guy that had this Danish domain. Uh, don't know what he was using it for. Two years later, I looked again, discovered there's a man in Israel having the Danish domain. And in 2020, the Danish register for DK, DK domains added a function where you can sign up for a waiting list. So, I signed up for a waiting list and paid small fee every year. So, how it's working, the basic is that a client goes to, for requesting a webpage, it's going to the DNS server, finding the IP address, then go to the web server and, and getting the content back. Very basic. If we are adding a proxy server into the mix, then the proxy server will do all the heavy lifting. So, the client is asking the proxy server, the proxy server is, is doing the name resolving and getting the webpage and returning the content to the end client. So, back in 1996, Netscape decided that there must be an easier function for, when you're adding a machine to a network, to automatically config the machine. So, they come up with this WP pad function to automatically ask for the machine where the configuration file is stored. They sit down a consortium to try to make an FC standard for it, but it never eclipsed as it expired in 1999. So, it's 25 years anniversary now. According to Wikipedia, the way it works is that you have the name where the client is part of the domain, it will add WP in the front and slowly test until it finds a name where it matches and get a response and can download the configuration file. But, in some implementations, it will go down to WP pad dot TLD and then download the configuration file from there. And as you can see on the Wikipedia page here, it says that it, uh, incorrect, uh, solution and it shouldn't be used that way. So, that's a security issue. So, the way with WP pad is that you have a client, it's called client dot A dot company dot com, then it will search for WP pad when the browser is open. It will then remove the client name and then try to add WP pad dot A dot company dot com and try to resolve that. If that's not working, it removes one name. So, it's WP pad dot company dot com. And in this example, it's resolving the IP address and then it goes to a web server trying to download a file called WP pad dot that. And that's the configuration file for the client. It can also be configured with other solutions like DHCP bins and so on. So, the that file, it downloads, is actually a small Java script that the client execute on the client machine with, uh, called find proxy for URL. It's input what URL it's trying to go to and the name. And then you can modify this script to say that the client should go direct if it's company name addresses or it should go to a proxy server if it's all, anything else on the internet. Like this proxy dot company dot TLD dot 880. So, here we have an example of where it's trying to go to Defcon dot org and it's not matching any of the if statements and then go to the proxy as the last return statement. There's a website dedicated for all the functions that can be used in this limited, very limited, uh, uh, JavaScript language. You cannot use all functions. Um, here you can see the top part of the functions. There's DNS domains resolved, is it in net and so on. But there's also some other functions that work, like I have found here, the stable functions, I call them, which I can get user agent, host name, time zone and so on. In the past I could also from some clients get screen resolution and color depth and so on from each client. But that's very unstable and many of the clients that crashes the JavaScript when trying to ask for that. So I can, uh, VPAT is implemented, is not implemented in a company and someone gets the top level domain. Then what happens is that the client is asking for the VPAT in the company. It doesn't get any results. It tries again by removing one name and tries again by removing one name and ending on VPAT DK. So it goes to an external VPAT web server downloading a configuration file for the client, how it should use proxy settings and trust that server even as it's not inside the company. In 1999, when it expired and Microsoft was part of this consortium, the same month Microsoft was informed that there's a security issue. If someone buys the top level domain with any TLD, you can basically own a complete country. And so there has been talks about this before. In 2007 on KiwiCon, there was some guy having an 80 year anniversary for this issue, looking at the things and had a very good talk. Unfortunately it's not public anymore. And then at SmoothCon, same year, another guy had the look into this. And then Microsoft got busy again trying to make a new patch, trying to fix whatever was found in 2007. So now it's fixed, right? It should be. So for me the waiting time is over. In 2023, in March, I got a mail from the Danish registrar, the host master, saying that the VPAT DK domain was now mine and I could register it and assign it to a server. So I found a cheap web portal and added to a web server there just because I wanted to see if there was any traffic at all, just monitor the logs and so on. At the same time I looked at who has owned this domain in the past and I could see that from the talks in 2007, there was someone in Denmark deciding it was a good idea to have this domain for some years. But then he sold it and one guy in Belgium got the domain and one in Germany and then one in Israel and then I got it here last year. So this is the logs from the first day I assigned the VPAT to a web portal. I was a bit surprised to get more than 80,000 requests of this VPAT.dat file on the first day basically. The spike in the graph, I think that's the rollover time from I started, that has to go to 24 hours. That's why it's not linear. So basically 80,000 requests on the first day without doing anything other than buying a web portal and adding the domain. So that's not fun because I don't have access to all the log files. So the way was that I set up a VPS server, installed DNS server on it, become my own name server on the internet, registered and DNS sec and all the things and added a web server on top of that. That way I could add the domains I got into this server and capture all the traffic, all the logs in the way I like to have them. And every good website should have a web page, right? So I took my best skills and opened notepad and crafted a web page where I added some crap about you shouldn't use this page and this is for research and so on. So when the client is downloading this VPAT.dat file, the Javascript and executing it on the internal client machine, it cannot see the public IP that is coming out when it's going onto the internet. So the way I fixed that was that I added on my web server a dynamic web page that builds the Javascript for the client dynamically. So I add the client's public IP into the script before each client get the script. So they're getting a dedicated script for each client. So I have the public IP, even the client doesn't know it by themselves on the internal network. So when a client, one, two, three, want to go to the net, this is a simplified version of my script. But what it's basically doing, I'm building a string in the DNS name with the information I take from the client like the time zone, internal IP, external IP and so on. So I can leak data to my DNS server about the internal client. So in this example you can see the client is told to go to Defcon.org and the D is the time zone, I and then internal IP, W is the world IP, public IP, and then it goes to p.vpat.dk as my server. And of course I use port 80 because I want all the traffic to be unencrypted. So just come as normal HTTP, unencrypted. So then the client for every request they make on the machine, all URLs, they will pass it through this web proxy script. And then it will go to this address that builds automatically or dynamically for each request they're doing. So I get in my log files a listing of what traffic they are trying to resolve and then I tell them to all the requests go to this web server, that is my web server on the same host. And then the client is asking my server for some webpage and I'm so kind so I return errors for everything because I don't want to run a proxy server on the internet that is open and be a man in the middle. So I get to see the inside with HTTP clear text but they think I'm asking on the outside at HTTPS. So for every request every client is making, I'm returning this error page. And to be nice to the users, I have included an input form so if they don't like what they're seeing, they can tell me what the hell is wrong and what I should do better. And there's also a check box for whitelisting the client so they can input their host name and add the whitelist check box. But I haven't implemented that function so this is first step on the form, right? And just a disclaimer, I'm not intercepting any traffic, I'm just looking at log files and so on from requests that's coming in. I haven't told any clients anywhere to contact my server. I've only just bought one domain name, set up a web server and all the clients are coming to my server. So this is an example of information I'm getting from one client. I can see the client's public IP, what name server it used, what internal IP address it has, the time zone and then of course from the web server log I can see what they're asking for and thereby also which user agency they have. What application are they using and operating system and so on. So this was fun. I can get a lot of traffic into the server. More than I expected. So why not look for buying some more domains? Sadly the three domains here, they are protected so you cannot register them. There's a limit on that. They have already set that up. But I got ID and site and build just for fun. Why not looking at the list that was press and porn so we can try and see which one of them is the most popular one. And because we are here, dot Vegas. And then I found that the vpat.eu was apparently registered but there was someone trying to sell the domain but I'm not buying it at that price. So I could see that also rented domain. So I asked them can I rent this domain for one year? And is there any limits or rules for what I can use the domain for? And they say no, you can, there's no rules. You can rent it for one year. And I paid three and a half euro per month for renting the domain. And then I politely returned it when I was done with it. So this is my list of domains for this research. And for one year, from April to April, I get 1.1 billion DNS requests resolving in 200 gigabyte text log files. This is for the DNS server alone. And if you look down on the, I don't know how big it is, but there's a client asking for cnn.com and you can then see the internal IP and public IP and so on of the clients. So here I have seen on which repat domain, where are the clients coming from in the world. And for the Danish domain, .dk, there's obviously a lot of traffic from Denmark, but to my surprise, why is there so much traffic from Russia and Ukraine to the Danish domain? And then there's a big jump down to Germany. So it's a bit odd. There's so much traffic for that on the DK domain. And the .vegas domain on the right, yeah, of course United States would be there, but all the other domains, it's a mixed order of why they have the .vegas. So when Windows machines today is connected to a network, it will in the lower right corner have a nice icon indicating it has internet access and is working. But because I'm a proxy server that doesn't return anything and doesn't work by design, the clients of course will show that they don't have internet access. So I found that for this list of six Microsoft domains, if I return the string OK for every request, the client will indicate it has good internet access. So I just added a rule to the proxy web server function saying if you see this domain, respond with OK. And all the clients then suddenly indicated they have good internet access again. So what type of traffic do I see? Here's the types of requests I see. And again, of course, I see a lot of GET requests, but I also see a lot of POST requests. So that's clients sending data up to the servers. And then I got all the CONNECT requests, that's the proxy traffic. There's 1.1 billion requests for asking the proxy server to collect something. So that's actually clients that has downloaded the proxy pack scripts and executed it on a machine and then coming and asking for a web page. But also we see on the list, there's WebDAO, there's Apple, there's Microsoft SSM client, there's Microsoft VPN, and there's many more I have not included in this. So there's a lot of different traffic in this. And that is based on the Apache log files. You can see in the lower corner about 470 gigabytes Apache log files with 1.5 billion requests in them. So it takes some time to grab through them and find the data. So because I am a proxy server, the client trusts, and I've given them a configuration script, I've told them to send every data to my server, including local traffic. So if you look here, you can see an internal client, there's 1.5. It should actually talk to the same computer on the same network next to it, 1.1. But because I've given it a script saying, no, you should ask the proxy server, it's sending the traffic up to me and asking me as a proxy server. Even that they are on the same network. And post requests, this is client sending data. They are just posting data against a web server. 37 million requests. As I don't have the data, I only have the logs. I don't know what it is. But everything clients sends to servers, so they can be confidential data, whatever documents, files, content, whatever. And again, because I'm controlling everything with my proxy scripts, so every local traffic I have in the domain, from the clients, it should never go to the Internet because it's not resolvable on the Internet. That's designed to be handled, to be used for internal network. So here we see some funny domains like Citrix and FilePrint and vCenter and, yeah, where the client is coming up to my proxy server and asking for me to get that traffic. Because it's local, I can of course not get the traffic, but I can see what they are asking for. And then some years back, there started to be a new smart function in the browsers because they want to protect the DNS traffic, saying we want now to send the DNS traffic over HTTPS because then rogue guys, man in the middle, couldn't happen and they couldn't control it. But because I'm now a man in the middle proxy server, I'm also controlling the DNS over HTTP and it's basically just, as you can see here, a client asking for Baidu.com and then it returns a JSON blob. So my proxy could return whatever I want, a JSON blob directing the client to go to another location or whatever. So passing through the log files and looking for all the file extensions that is downloaded. This is some of them. This is the highlighted one. It's a bit scary to see all the credentials and certificates and there's the executables, there's database files, there's scripts so I could replace a script if the client is executing the script on the machine. It's not a good thing for the client. Here's an example of executable files the clients tried to download. So there's Windows Update, Microsoft Installer, there's Antivirus Updates, Microsoft SCCM Client, and RealPlayer. And didn't know RealPlayer still was a thing, but okay. So there's a lot of different requests here and I get a lot of them. This is just a small sample list. But the list of file names I found with the extensions is not fully true because I also found that there was some bad guys trapped in my setup trying to scan other servers so they were trying to enumerate for different files like PFX files and other files. So you can see here there's a long list where they try to access a web server asking for different files and hoping that they find something. So credentials in the URL, there's a lot of them. I get 200,000 URL requests where the username and password is part of the URL. And I don't know if you can see the size of the screenshot there, but it's apparently an Indian guy that has a lot of friends. He's using a web service to send SMS messages to all his friends. He apparently has a lot of friends. There are many, many log lines here. So they all start with something. I don't know what he's trying to do. So credentials, here's some of the clear text, non-encrypted credentials. I just get to the server and some of them are so ridiculous like admin, admin. I cannot censor that away. You should see it. And there's change me, change me. I think that's a good idea to change that one. And security party, yeah, we are DEF CON, security is a party. So, yeah, that's very crappy credentials. And NTLM version 1 shouldn't be used for the last 20 years as Microsoft has tried to tell us, change to NTLM version 2. So administrator, root, security accounts and so on with NTLM version 1. And then there's NTLM version 2. I also got many, many clients sending the credentials and there's some good usernames here, admin, administrator, doctor, hotel manager, and then laser, that sounds fun to play with. And SA, that's normally a system administrator account on SQL servers and likes. So many good credentials if you are malicious. So what is the client talking to this server? When I started this project my thinking was this is just Microsoft crap. They should patch the things. But if you look at the list you can see it's basically everything. Every application, it's VPN clients, it's anti-virus applications, it's, yeah, the list is very long. This is just some of them. There's Cobalt Strike. And you can see in the lower left corner there's even some guy having trouble with his internet access. So he's using Wireshark to debug his network is not working because he's apparently using a proxy that doesn't return anything. So he's debugging that and I then get his update check from Wireshark. Yeah. So the list is long. There's ProtonVPN and many clients. In fact I got 27,000 different user agent strings with Linux, Mac, iPhone, Android, whatever, all platforms. So now I cannot say which client it is that has the issue and which application that has the issue because it seems to be everything. Yeah. So when you're running a proxy server that doesn't return anything and you have clients behind it, some of the clients was not able to download some updated background screen that CrowdStrike provided to Windows machines. So I have actually protected 226 machines from CrowdStrike. And what about detection? The only place I have seen any detection is when clients is behind a Palo Alto setup. The Palo Alto setup will monitor the URLs the client is asking for and then try to categorize them and check them for malicious things and so on, like many other proxy servers is also doing. It's the only one I have seen in the traffic that's interacting with the traffic. And the way it's doing it is replaying the same request that the user tried to do, but adding this user agent string, this long string you see here, that's the complete string. So it's a pretty long user agent string where it says it's Palo Alto monitoring device and so on. And it's suggesting I can send a mail to them to get whitelisted. But again, I'm a proxy server and I'm not the destination so it's pretty many mails I have to send to them to get whitelisted for everything. So I haven't tried that. And then Cisco apparently has some kind of in point client you can install on computers. And it's my understanding it is designed to protect the client from rogue DNS servers and rogue proxy servers. It's not working so well. Because what happened is because I'm returning error pages to everything and rejecting all traffic, the client and the client machine, the application seems to get angry and just making brute force against my machine trying to loop and getting the request again and again and again and trying. So the only way was I had to make a black hole for the domain so I just discarded everything with open DNS.com into a null and didn't reply on it and then the Cisco client stopped DDoSing my server. Yeah. So I have also found what I think is malicious. This is for the domain's engineer, exchange, exposed software and so on. There's a VPAT script and it seems to be running a proxy for HTTP and FTP traffic with the fail option so if it doesn't work it will go direct. But it's also collecting data and sending it over an extra channel with some communication so this looks like someone is monitoring traffic for this, for domains here. And this, this one is a bit weird one. It's a, I think it's, it's a guy that really, that's, or it's, it's just some testing going on because on VPAT.trade there's a proxy script that's looking with a lot of if statements if there's including some kind of ad word in the request it will send the request through a proxy server. If there's not a word then it will go direct. So it seems that someone is trying to collect all the ads. The reason for this I think can maybe be that he is replacing the ad IDs in the traffic to his own and by this earning money on capturing the traffic and then getting paid for, because he's directing all the clients to his ad ID. Maybe. Or it's a test for something. Or he's just like ads. I don't know. So here's another one. Also a bit weird. And the name, the CLDs that doesn't MR, cooking, storage, surf, there's no, no continuous line in them. It claims to be some sort of security project. I haven't been able to find any place where they are talking about this project and anything. So it's only a claim inside this configuration file. It's, it's a bit weird in, it's only sending the traffic to a proxy server for what is not a result of domains. So all the things that failed, it sends to the proxy server. Anything else, it goes to direct. So it's maybe something that tries to look for all the odd things that's hidden on the net. I don't know what the function is. Yeah. So we have a winner. Apparently press is more interesting than porn. I wouldn't have guessed otherwise. But this is the score for the vpat.dat file, how many times it downloaded. And they have been running at the same server, same time, for the same. So from the client, from the forms I get with the users, I got 40 users that clicked, that wanted whitelisting from this error. Even I haven't implemented any function to whitelist anything and just returning errors to them. And they insert some computer names. It doesn't look like DNS names, but it's computer names. So yeah, maybe a day I will add a whitelist function. And here we have some feedback from the users. Apparently they are not all happy. Some users say I got this error message when trying to get to my net bank, or I clicked this link in the mail and got this error, or t-shirt, or whatever. So not all users are happy. So when I saw that I was getting feedback from the users, thinking why not set up a survey asking the user how much they like my non-working proxy server that only returned errors to all the clients. So I added this, three normal steps to ask. And to my surprise, I have a higher leaning on they really like my service and would recommend it to their friends. So this is for non-working proxy. But there was only four responses, so. Yeah, and there was no one submitting an e-mail address. So the hundred dollars are going to Danish Cancer Fund. I added on the web page, I added a feedback form. Maybe getting some good suggestions and so on to what I can improve on my non-working proxy. But I only got more than 3,000 spam messages saying that they will ECAO, optimize my website so more will find it. I don't know if I should sign up for that. I have many clients already. And zero feedback from anyone. So for the period of this one year, I managed it by Google. If anyone anywhere was writing about this domain I had on my list to see if they were talking about it in some forum, talking about disabling VPAT and so on. I haven't found anyone for one year talking about anything about the domains. So it has been, to my knowledge, completely silent for one year without any detection anywhere. So my question is, why can a dude like me even buy this domain? Why should this crap that is 25 years old not be just disabled? Why do we have this? It's not modern security model. We just download a pack script with a JavaScript, run it on the client, and then the client just sends all the traffic to a proxy server. It's not very secure. So I don't know if I can stand here in 25 years or in a wheelchair talking about the same thing once again, saying that nothing has changed. I don't know. But it is this 25 year anniversary. Yeah, I can see I have still some time. So first of all, a big shout out to my friend Kel Norman for a lot of help with the research and information. And I have some bonus slides because I have some extra time. So I posted this talk on the schedule page on DEF CON. And shortly after that time, I was contacted by a guy that's called Teton, saying that he was for the last half year basically doing the same research into some other domain names. And we could look and share some data. That could be fun if we had the time. But also he's had paid up for some domains in the .AD. And from what I've heard, there should be coming a really, really good talk. I look forward to hear how many active directories that's coming in the same way. Okay, ten minutes. So after running this for basically two months, I got contacted in Denmark. Denmark is not a very big place, about 5, 6 million people. So the security community is not that big. I got contacted from someone saying, Thomas, you're running some kind of research project for the VPAT? Yeah? Okay. This big company apparently got a lot of machines trapped in the VPAT.dat file and all the traffic was going to my server. So they, they just wanted to know. And the way they found it was because one of the domains I had on my list, it was not fully anonymized. So they could see the name Thomas and then say, ah, Thomas from Denmark. We tried to call him. That's good research. Yeah. So if you're looking back on 27,000 different user agent strings on basically all platforms, I would like to present one slide saying, this is Microsoft crap. Here's the three settings you want to set on a Microsoft machine and you're protected. But this seems to be all platforms, all applications that has the issue. Otherwise I wouldn't have got so much traffic as I've seen in my data. So my best advice is to add into the host file on the machine, the VPAT domains and saying that it looped back to itself so it will never send any traffic to the internet. And then you have to look up each OS to see which way you can disable the function on there. And also add the VPAT to your company domain. So if a client is asking on that domain, it will not resolve other than 127. A thing also to note here that I skipped over is that when a client download my VPAT configuration config file, it caches the file. So when people are working from home, they may be on a network where they can download the file in a DK domain. They download the file, start using the proxy, get into the workplace, keep using the proxy because they are caching the file. I have told them to use this file for 14 days or something. So they will keep using it. Yeah. And it's best to disable this VPAT function at system level. Otherwise if you only disable the browser, all the services you have on the machine that are running at system, they are also talking like antivirus application. They are talking to the internet. That will not inherit the configuration from the client settings. So it's best to set it on machine level so it's everything on the machine and disable its function. And as you can see, there's a Windows service called HTTP Windows Proxy Automatic Discovery Service. It's on all machines. No one know what it is, but now you know what it is. It can be difficult to disable because it has dependency to other things. Yeah. So basically read the fucking manual to find out how to disable it on all applications and OSs because it's not easy for me to make one slide to fix it at all. Yeah. So this is the slides. Again, thank you to Kel.