So, soon to be a good afternoon to everyone. And now it is my absolute pleasure to introduce you to Emilio. Thank you, thank you. Let's see, can you hear me? Good. Alright, I think, good morning, good afternoon, good evening, depending on which time zone you are. Let me start with... Today I'm going to present a tool called Circo. So let me first do some introductions. Hello, that's me. So, I come from Japan. I know that I don't look very Japanese yet, but I've been living there for 10 years. So, you can call me either way. It works both ways, Emilio, Emidio, or something like that. I like to play with networks, packets, and, you know, a bit of 3D printing as well. So, I did demo a few tools already in a couple of conferences. Some of them are in Japan, so you may be aware or not. And just keep in mind, I'm not a programmer. So, the code works, it's nice, and there's a lot of improvement to do. But it runs. As long as it runs, it's not good to go. Alright, for those of you who are not familiar with it, it's actually the tool itself. The idea is born, actually, from the automations. Within enterprise networks, we have a lot of automation tools. And those tools actually are just discovering every new device that connects to the network, and actually connecting and provisioning and doing a lot of really cool stuff. Sure, but what about if it's not the Cisco switch that you are connecting to? They're basically giving us the credentials for free. Great! That was a good idea, I thought. So, what came out, actually, was a way to make something camouflage, which is not going to be noticed, and put it in there when you do red teaming within meeting rooms, open space, secretary, those kind of places. So, I'm looking to find a way to do this. So, in this release 1.5, what is new is actually, before releases, I was not able to have an IP phone working, so I will go and unplug the IP phone and use that cable, but that's it, the IP phone will be off. That's something that people will notice, because either it's not working anymore, and I wasn't very comfortable. So, a few people pointed out as well, so this version I managed to remove the phone, but plug the phone back to the box itself, and it keep working as if nothing. So, we're going to dig into that. I did some coding updates, and also add some exfiltration techniques, and encryption for forensic, cell destroy switches, integration with Faraguy, and bypass NAC, basically. A lot of features, basically, between 1.4 to 1.5. So, who do we target? Well, pretty much any automation system out there. These are quite, quite a few known systems. HPNA is very popular. Of course, NetMRI as well. NAC itself is not an automation system for network provisioning, but what it does is try to prevent things that I'm trying to do, basically. So, I will get rid of NAC as well. And, of course, there's always some admin connecting to things, that trusts and put password everywhere. This is an example of things that happen with a Raspberry Pi. You know, some device in the network that nobody noticed, you've been exfiltrating data in the NSA. And this is not uncommon, because NAC is very hard to solve all our problems. So, it did happen. Okay, so what are my main issues for version 1.5? Power options. I'm going to put a Raspberry Pi, which I need power, okay? Battery, PoE. IP phone, when I plug it, that looks suspicious. Someone told me about, if you find the little enclosure and you open, you can see the keys, where the box is exfiltrating data, because it's just an SD card in Linux. Yes, so I need to add some forensics, prevent forensics on it. Encryption, basically. Which is a key, always a problem. Alright, so let's start with the first problem, that is the power. So, I came up with the paper idea. It's the easiest one. You just start drawing things and come up with a list of wishes that you want to do. So, this concept was, okay, the PoE negotiation is very complicated. And there's many standards and there's many different ways to do it. Many implementations are different. But there's one thing, one element, that the phone and the switch, they will do the negotiation of the power. How much power you need, how many watts, etc, etc. So, I didn't want to get into that. So, I say, okay, let the phone negotiate. Once that's done, I just hook the power. So, you come up with an idea that violates every principle in networking, pretty much. Okay, why not? Let's give it a try. So, once you have a paper idea, what you tend to do is breakboarding. Let's do, let's go, come on. Plug some cables and see what happens. Something will blow up for sure. So, you start to build up some ports and this breaks all network industry standards, by the way. So, trust me on that one. So, what tend to happen when you start to do this is at some point, without you noticing, this actually works. And I'm like, okay, this is actually a good thing. So, now you actually elaborate on it. So, you move into prototyping. So, this is a little board for just, because they keep coming out, the jumpers from the breadboard. So, you say, okay, let's make it a bit more stable. So, I did a prototype to see. Basically, it's four RJ45 and a DC to DC converter plus a USB socket. So, it was a very simple idea. It's all the wiring, the thing that goes underneath. So, again, I never designed a PCB. So, it would be nice to have a Raspberry Hub, maybe, or go into that. So, I'm still trying to figure out. So, prototyping is okay. All right, how Circo evolved between different releases. So, Circo has around one year old, maybe, around October 2018. So, it started like an idea in a box. When I mean in a box, I mean literally in a cardboard box. It was good because you can see the components and you can see, ah, this is this. You can even put labels on it. So, it was quite, yeah, it was fun. So, what happened here is that I used to use a PoE LAN modules. And I bought one that you see. So, basically, what it does is it does the PoE negotiation and then give you the LAN back and the power. So, I bought one, 12 volts. Okay, I need to convert this to 5 volts. And then I figure out they sell the 5 volts. So, this is the first release, right? So, then we evolved into a production. So, I say, okay, let's move on. So, I got some enclosures. They look like these boxes that you have under your desk, over your desk. So, the whole concept is, okay, let's work with what we have in the market. So, I look for these enclosures to put stuff in it. So, in this release, I only have, you see, there's only one cable going on. That's because I unplugged the phone and that's it. And also, the smaller version, that was a bit more tricky because there's less space. But you can use Raspberry Pi Zero, which is a bit cool, but you really need to work with space. Again, this version has only one LAN. So, you need to work with the LAN adapters on the Raspberry Pi. Right, so we move to this version. This version is actually this box. This box, because, remember, now I'm still in the phone and I'm going to plug back the phone here. So, what I'm going to do is use two different LAN adapters on the Raspberry Pi. So, that's the reason I have a USB LAN adapter plus the onboard. As well, there is on the bottom, you will see a DC-DC converter. The 48 volts of PoE back to 5 volts to power the Raspberry Pi. And on the yellow thing that you may see there, that's actually a magnet switch. It's a 3D print some handles to mount it. But it's basically a magnet and a tilt magnet switch. So, what it does, that is the key lock. When you open the case, it will detect that you open it. And, you know, you can RMRF, you can do whatever you want. Reboot, shutdown. So, this is to prevent forensic, in case some forensic go and don't unplug the cables and just open the suspicious case that they found. It will blow up, basically, if you want to. That was a bit dangerous to do. EPMs, you know, heatups, fire hazards. So, just be careful. Of course, the same thing into the smaller box as well. Here, what I need to do is choose USB LAN adapters and a hub. So, it gets tricky, but it still fits. So, depending on what you find in the market, as a discussed box, you can play around. So, how much does this cost? Because this must be a really expensive thing. Well, this is an example of how this box costs, right? So, to give you an idea, this is a Raspberry Pi Zero. The two USB LAN adapters, the USB, micro USB hub, are, like, ridiculously small. And just the outlet, which is one of the things more expensive. The outlet, I think, is $10 or something. So, yeah, you can get this for $50. So, if you don't want to go to pick it up. So, you do a pen testing, you leave it there. You are welcome to go and pick it up, or not. That's how well things finish on the pen testing report, right? So, you know, just in case you want to lose it. All right. So, the hardware is one thing. It's very simple components. It's LAN adapters, Raspberry Pi, plastic box, and some DC-DC bucket. So, now the question is what we are using as a software. Well, Circo is actually the little box, but we also have a few components. We have a component called Carpa, which is actually a software component only. Running on the internet. In a VPS, Python, and Linux. That's very simple components. So, that's software only. Why? Because once this box is infiltrated into the network, what is it going to do? Well, it's going to become a Cisco switch. To get discovered. So, all these lovely automation systems will connect to me and give me the credential. So, essentially, it's a honeypot, basically. But what happens once I have the credentials? SNMP, TEL, SSH, whatever the user sends to me. Great, now I need to exfiltrate to the internet. And this is the tricky part. Because I need something on the internet to receive it. And that's where Carpa comes into play. At the moment, I have a demo here, which I'm running on a Raspberry Pi, Linux. You can run it anywhere, any VPS on the internet, Amazon, or any VPS server will do. The only requirement is that you have a domain name assigned to NS records assigned to this public IP of your VPS. Or NATED, if you have a NATED. So, and then we have one more component, which is Haula. Haula is, again, a software component. You can run it on a Raspberry Pi with a power bank and a wireless adapter. What it does is, basically, you can also exfiltrate via wireless. So, it will do from the box itself to the internet, or via wireless. Or both, if you want to. But via wireless, of course, you need to be in proximity. Keep in mind here, we are not setting up any access point. This is not an access point, because that will be caught by WIPS, right? So, we don't want any WIPS to notice us. So, currently it's in Python 2. Coming to 3 soon. And it's all packet manipulation are mainly based in Scapi, in Python. And we are using some other tools from a different combination of people as well. For example, for the OS Fuller. Some part of the code of the OS Fuller to full NAC, effectively speaking. And what actually exfiltration we can use. We have ping, traceroute, NTP, HTTP, HTTPS, DNS, proxy and wireless. Of which, all of these are atomic. Basically, nothing come back, ever. So, from a firewall point of view, it's a timeout session, HOUT. So, there's never a session in none of those protocols that I just mentioned. Or established connection or anything back. So, basically the Carpa never send anything back to me. And another new feature that came out is just because I have a phone, right? And the phones keep working. I'm basically man in the middle between the phone and the network. However, most of the offices people connect the phone and the PC to the phone. So, that automatically give me free traffic from the PC as well. So, that was a free bug, kind of. So, effectively speaking, you can run different tools to capture TELNET, SSH, FTP. So, unencrypted protocols or hashes are exfiltrated as well. So, not just the network part, but also the PC, if any, connected to it. So, how I become a Cisco switch? Well, I need to be able to send a CDP, LLDPs. I need to be able to have an SNMP server agent basically running. And TELNET and SSH. And all my packets need to look like a Cisco switch. So, that was the triage, basically, of how we come up. So, for flows, I have a single mode that used to be when you don't connect the phone back. And the bridge mode, which is the most interesting for this talk. So, in bridge mode, this is how it will work the logic, right? So, once this box turns on, what it does is it does the discovery first to see what is the switch that is close to me, the real switch. And it tries to get the name. Once it gets the name, it will try to get one similar to itself. So, if this switch, for example, is switch Tokyo 01, it will become 03. It will change the last digit by two. The logic is very simple. There is always a fallback to test 01. We need to pretend to be a nice new brand Cisco switch in the network. So, we want to get that information first. Then we get an IP address and we start to set it up. Of course, the MAC address is of the Cisco switch. We change MAC address at the beginning. As well, one thing we want to do is to start to advertise CDP and LLDP to the switch. That's the way we get discovery of the automation tool. What tends to happen is the existing production switch is already hooked to automation tool. And when he sees CDP and LLDP new neighborhoods, he will discover that on the system. And the system, once a day, will connect and try to pull the config, etc., etc. Basically, give us the credentials. So, once this happens, once we get the credentials, we can set it up to how often we want to exfiltrate it. And I will cycle if we want to just do it once or do it every one hour. The same exfiltration and which method you want, all of them. So, to do this demo, I actually need to build a network with a proper switch and a firewall and a router and a DHCP and the internet. So, I used to have all this spread in the desk. It was very difficult to set it up. You always forget one cable and things don't work. So, because in Japan we have a Toyota that makes cars, right? So, it came out with Macaroni. This is our infrastructure in a box, basically, in a briefcase. And it only costs 200 bucks. It doesn't cost 20 grand like Toyota. But what it does is simplify things very much. And so, the lab itself... I know, everything has an acronym, right? It matches perfectly. So, the lab itself looks like this. It's basically a proper Cisco... you can look it up after if you want to. It's a proper Cisco switch and a CarPi simulated with a Raspberry Pi. I also hooked a Snort in the outside on the internet to see what the Snort will see. This Snort is configured as it comes. In the middle, there's no tuning. So, it's default, basically. All. So, it's supposed to catch even rubbish traffic as well. So, what I'm going to do is explain how the exfiltration technique works. So, for exfiltration, what I'm doing... I need to be able to tell my device in the internet... which... these credentials, who took it from. So, it came from my telnet daemon, my SSH daemon, through SNMP, or even the PC that was hooked. It's an optional work I'm working. Also, I want to know that this is enabled password of the switch, or is the user unpassword of the switch? And is SNMP the community of, basically? This work with SNMP 1, 2, V2 as well. 3, not yet. Nobody used 3, actually, in any network that I'm aware of. So, this is the format and the source IP of the automation tool, or the laptop administrator, or whoever connects to my box. This is specifically the format that we want to exfiltrate. So, one way to exfiltrate this data is, first of all, we will encrypt it with AES-256. So, let me first go into Showtime. Let's start with the demo. Let me see if you can see. Let me close this. I cannot see, though. I cannot see what I'm typing. Let me bring back... Can I mirror? I don't know how to do this. Look better now? Look okay? Yep, right. So, this is my server in the Internet. So, when I run it, this gives me the options of the server. So, this is my snort. This is my administrator PC. And what I need now is my box. I also have this, because this version integrates with Faraday. So, let me log in. So, Faraday, I just have one workspace. And I have hosts. I only have one host with some vulnerabilities. All right, so let me do the magic. I do need to put a magnet, because I opened the lid. I need to hack the lid open. And there's a lot of flashing lights here. That is just a Raspberry Pi. Nothing more interesting than that. So, one thing that I did find out was how to prevent encryption. So, I'm going to use Lux to encrypt the partition, where I'm going to have the software here in case someone finds it. The problem with encryption is to decrypt and decrypt you need a key. So, what happens when you want to do that in a box that is already closed? You go there and put it. You don't have a laptop and installation system to put a keyboard to a Raspberry or whatever. So, what I came up with is I need a long key that I can use quickly to mount and encrypt this Raspberry Pi. So, I found that this Raspberry Pi has Bluetooth. Great. So, I created a million of applications. There's a Bluetooth application that you can create the services. You can do it from Linux as well. So, what I'm doing is I'm creating a service called Circo. And it has the UUID, which is 128 bits. So, guess what? That's my key. So, what this guy is doing, once he boot up, at the moment it's in demo mode. So, I should be able to access. So, if I do the F, the home drive I want to do is called PEncrypt. So, if I do, there's nothing because it's not mounted, right? So, what I'm going to do is turn on these Bluetooth services. It's a demo key, in case you are sniffing Bluetooth. It's not for production use, right? So, once I turn on, it runs every 5 seconds, I think I put it at 10 seconds. What it does, basically, is it's scanning to see if it found the services. And use that key to mount and decrypt looks. So, ideally this is all automatically, actually. Let me see, I think it's 10 seconds every... I don't remember where I put it. So, I create the services. System. Looks. Yeah, I create a little script, basically, to do that. Let me see, this is on. Or maybe I have Bluetooth. I will explain. There we go. Now it's jamming Bluetooth, right? Yeah, there you go. This is what happens with live demos. Come on. It did work before. Yes. Let me stop start. And let me do start. I think it's my phone, actually. Alright. Let's see. Alright. Let me do this manually. Let me create this. Oh, it did work. Oh, it was already mounted. Yeah. Playing with Bluetooth within DEF CON sometimes is not a good idea. So, let me turn this back off. Alright, it's already mounted. So, let me go to... This normally will start automatically, but... So... Oops. So, I'll just give you the menu. So, I have Carpa, which is the one in the Internet to receive the credentials, which I'm going to start in Verbose mode. And the plugin is a Faraday plugin. And the interface is here. And just a file where you want to put the output, the credentials you find. So, this is the Circo interface. So, what you do, first of all, we go into Bridge mode, where I put Verbose. We go into Bridge mode, because it's the one using the phone and the LAN at the same time. Still have backward compatibility, because that's a good way to do things. And then we can choose what exfiltration technique we want. You can choose either all, or... Can you ping DNS, HTTP, web, NTP, proxy... I don't know. I couldn't put minus A, actually. So, when you start it... Let me see. This one already started. I'm logging into Faraday. OK. Plugin to Faraday, what it does, basically, is... Every credential that he gets, he will inject it into Faraday directly. So, when the Circo starts, it's in Verbose mode. That's the reason you see all the steps of what it's doing. So, it starts becoming a Cisco MAC address switch. This is to bypass NAC. Due to the MAC address I'm using, it's a golden one. So, if you read through NAC... For Cloud NAC manual, there's a very small syntax that says... If you use this MAC address, you are always allowed. Just read the document. It should be fine, right? Guess what? That's what I'm using. Great. Thank you for the manual. So, it becomes a... Can you read, right? Yes? Do you know how we can make it bigger? That's too big? Better? So, what it does is... It becomes a MAC address switch. Discover. Start the ACP. This is all the configuration proxy. The proxy... I have three different techniques for the proxy. We'll go into details. This one is using the ACP. And then, from here onwards... It becomes a honeypot. Right? The last line you see is because the magnet I put there. The lid is open, but I put a magnet manually. So, if I take that magnet out, things will go crazy. So, now... I'm going to go to the real switch. This is my... Real switch. Right? This is Tokyo 01. It's my real switch. If I don't show CDP, neighbors... Guess what? I see a phone. I also see a switch called 03. It's a 2960. You can choose details. And this is... This is an IP address. This is a version. The port. The soft... It's a Cisco switch. So, I can see show CDP and show LLDP. As well, I can see LLDP. So, this switch, believe, is connect... Someone connected a new switch. Maybe in a meeting room, for a training or something. So, it does have an IP address. Which is 151. Right? So, this is my admin PC. What happens if I tell it that IP address? Okay. So, I type my... Superuser. And switch number 3. So, now... What I believe is a switch. I can run commands. Cisco commands. Show version. Yep, it's a 2960. This is the version running. Show IP route. Show IP app. Show MAC address. Show interface description. It is a Cisco switch. Well, I believe it. Show CDP. Neighbors. I need to type it correctly. Of course, it is a Cisco switch. Yeah, I can see now Cisco switch 1. The production one. So, they see each other in theory. Same with show LLDP. Neighbors. Yeah, I can see. So, from this switch... So, when automation systems connect to this switch, either by telnet or SSH, with the master credentials, they will run a set of commands to get the configuration, inventory, etc, etc. So, those are most of the commands that support. I did not code the whole iOS simulator just for fun. It wasn't fun. Yeah. The question mark also worked, by the way. Yeah. Oh, and if you want to go to show run, of course, you need to be enable mode. Okay, go enable. Yeah, sure. Great. Secret. Now, I can do show run. Yeah, that worked. What I can't do is config. No, that doesn't work. That's a common stack errors because I'm not going to prepare an iOS, basically. Right? So, this was a tenant I did. Right? So, you can see in the configuration that the community is public. The SNMP community. Now, what tend to happen is automation system will first try their own SNMP community. And if fail, it will try the public. You know, one of the least of the common ones. So, let's say I will try the system community. The one that they use in the company. Right? So, when I try that, that will not work. A, because it's public, the one that works. But, you did already give in the community with that command. So, when you do public... It has reply like a Cisco switch. It is actually a name, the uptime, the version. It is a full SNMP device that you can pull. Now, what happened when I went back to Carpa? Well, I start to receive this data. This is because it's verbose. So, basically tell me that something via ping from this public IP, telnet, usernetadmin, password Defcon, very smart, from this source IP they connect, which is internal IP of this administrator laptop automation system. And then I get the same password via ping DNS, traceroute. PDNS is proxy, by the way. HTTP, NTP, and then I also get this via here. So, oops, someone connect telnet enable, the E just standby enable with this super secret password. So, again, if I now do the same thing, let me open the... So, this is what this LPS is looking. Ignore the unreachable because I don't have internet connection, of course. But the only traffic that these guys can see, because I enable the default, is a ping. So, a Cisco switch is sending a packet ping. Nothing come back, but that's only alarm. Which I don't know anyone that has a snort with IC ping configured for alarms. That would be quite a lot of alarms. That's the only thing you can see on the snort side. So, again, when you see a P on the community, deleting the switch, my switch did not reply to the community, but you did give it to me. It did reply to public, but not to the community you give me, but I exfiltrate it. So, now if I go to Faraday, right? So, when I do a host, when I do refresh, now I have a new extra host. This 10.10.10.88 is the source IP of the automation tool or administrator, then whoever is connecting. So, what happen is if I go to the credentials, I can see the target, I can see the protocol, this comes with Telnet, the enabler, and the password. This is Telnet, the username, and the password. And this is SNMP. I should put SNMP instead of P. But, so now, as soon as I get them in Carpa, via an API, I can inject it in Faraday in real time. So, that's for helping the pen testing report side. So, now, what happen if I actually remove the magnet? You know? Careful. So, you start to see this alarm, alarm open, alarm open. That means that the, because I did not unplug it, right? I removed the magnet. So, what it does is when it detect that someone opened the case, the magnet get open, it will send a magic packet via exfiltration, saying that someone opened it. So, you know, maybe it's time to make the report. So, of course, you can make it, if you go here, for example, this was the circle running in debug mode, right? So, you see that it's sending the credentials. And here is when I took the magnet off, right? You can do this, for example. That command, what it does is immediately reboot. So, what it does, remember, because we have the Bluetooth encryption. So, unless I'm back close to this box with this thing enabled, that will not work if you reboot. So, if someone unplugged it and replugged it, it will not mount encryption. So, that is a balance between having encryption and functionality. So, if you want encryption, you want the Bluetooth, sure. But if someone by mistake unplugged and replugged it, it will not work again. You need to be back, walking around with your mobile in your pocket, right? So, yeah, you can do whatever you want. You can, you know, PGM pulls, I don't know, burn, fires, whatever you like there. So, this is the way that this stuff works. So, these are the components. So, let me go deep into the exfiltration. Something's in the middle, right? Excuse me. There you go. Go away. Alright, so how I do... So, this is basically a nice honeypot. Now, how do I take the data out? That's an interesting point. So, this is going back to basics. So, we are using protocols that are through firewalls. Some of them are blocking the company, some of them can't go through. So, for example, some companies do allow ping to go for troubleshooting or traceroute. So, these are the protocols I'm using. ICMP, I'm using specific TCP and IP and UDP packets fields to actually put my data. Remember, I have one line. It's a T, dash, comma, username, comma, password, comma, and IP address. That, what I do is encrypt it, AS256, and now chunk it in 2 bytes or 6 bytes. So, the way to work encryption, basically to decrypt it, you need to tell me how many packets I should expect, how long should my crypto be. So, I'm going to send you 13 bytes of crypto in 7 packets, 2 bytes each. So, first of all, I need to be able to tell that in advance before sending the packets. So, what I'm doing is, I'm sending one packet. These are the IP header. There's a field called identification in IP packets. That does not get changed by NAT. When you NAT through a firewall, that doesn't get changed. So, okay, it's 2 bytes that I can use for something. ICMP packets. Within the ICMP packet, you also have identification and sequence numbers. Again, 2 and 2 bytes that I can use for something. So, ICMP, how it works? Basically, I need to tell you my 13 bytes and 7 packets. So, I will send one packet saying that 213 is the IP ID, right? And the rest is just randoms. So, that means that the receiver knows that it's expecting 13 bytes, right? Then I'm going to send you 307 as the IP ID. 300 means that actually you're expecting 7 packets, right? And then I will send you 7 packets, right? With the 500, 1, 500, 2 as a sequence ID. That is a sequence of a packet, in case they get a different order. And the crypto, within the ICMP sequence, which is 2 bytes, I will get that to become an integer, and that will be my crypto. So, I need 7 packets to do 13 bytes. Plus padding, right? One byte of padding. So, this is the way that most of the exfiltration technique works. It's basically chunking data into specific fields within different protocols. Like ping, for example, or traceroute. Traceroute, we are using the data payload. The Cisco switch, the last 4 bytes are rubbish. So, we are using those 4 bytes with X. My encrypted data becomes X. So, I encode it into X. It looks like an hexadecimal string. So, that's a good place to put 4 bytes. Again, similar concept. First, I need to tell you I'm sending 30 bytes and 7 packets, and then I send it one by one. Now, if we move into HTTP or HTTPS, remember, I'm not making a session. I'm just merely sending the same packet. That's it. So, there's something called window size in TCP, and do not change between the client and the server. Do not. So, you have not, and that thing doesn't change. Again, great. So, I have 1, 2 bytes that I can use that does not change between an internal client and an internet server. So, that's what I'm using. Similar concept, I'm using the sending 213, like we saw in ISMP, but I'm putting the crypto within the window size of the TCP packet. So, yeah, port 80, 443, or any port you like, 25 if you want to. But remember, most of the stuff probably don't have direct access to the internet. So, those exfiltration may not work. HTTP, HTTPS, actually any TCP port will be the same concept on this, right? You just send the SYN, nothing comes back, and the crypto goes into the window size. Of course, I become an integer, right? It's just supposed to be a number. So, from X, I convert it into an integer. And the whole process is in reverse on the other side. In the CARPA, it's the other side receiving, it's the whole thing the other way around. So, NTP. So, NTP was a bit fun. There's something called transmission timestamp, right? So, the transmission timestamp has this format. So, it's basically a timestamp plus a fraction. And the timestamp is 32 bits, and the fraction is 32 bits. Wait a minute, that's a lot of data I can put there into 32 bits. So, I'm using the fraction. So, basically the way that works is I'm using, I'm playing with the stratum and pole to tell them, again, my crypto is 13 bytes, and it will send 7 packets or 6 packets or whatever is the padding that I need to do. In this case, I can send 4 bytes. So, in reality, I don't need 7 packets because it's 13 bytes. So, maybe 4 packets will do. So, I need to tell them it's 4 packets for this protocol specifically. And then I put it in the fraction, convert it into an integer, so actually it's a float because it's 32 bits. And then the process is the other way. So, inside the NTP query, I'm putting the fraction timestamp of the transmission timestamp, 32 bits of it. DNS packet, this one is easy. It just uses subdomain, encrypted.mydomain.com. But I'm not sending a query to the internet. I'm sending an NS query to the actually internal DNS on the company. So, this attack is not direct. So, I don't have access to go outside. But the DNS server has internet resolution through a relay or direct maybe. So, what tends to happen when you do an NS query, what it does, it will do a recursion until you get it. Assuming your DNS actually has internet resolution. Again, this is a hash encrypted. It's 20 bytes, 13 bytes we talk, so it's not a very long chart. Uh, you send it one, one query. Here is, you don't need multiple. So, in this case it's the flow of the thing. You will send just to the DNS server, internal DNS server, and the DNS server will go just directly to the... The trick here is that NS server should be CARPA, the IP address, the public IP of course of that evil domain that you're using. Now, what happen when the company do not have DNS resolution as well? You know, no access to internet in any protocol, no DNS resolution, external DNS resolution. All right, proxy. They might have something. So, proxy works in a way, how you discover proxy? Well, through how you set up in PC's proxy. DHCP option 252, WAP, or GPO. This is the three main, or manually, but I don't think people do that anymore. Those are the three most common. Okay, so what I do for DHCP, I will do a DHCP inform to actually the DHCP server to see if that option 252 is there and get the pack file. Now, what you get is actually a pack file server, right? URL. Get there, connect, get the pack file, parse it to get the proxy IP and port, then connect to the proxy, right? And of course, all proxies are most likely authenticated. Doesn't matter. This doesn't need authenticate to the proxy to work. So, this is a bit tricky because this unfortunately works with all Bluecoats, McAfees, all the high-end proxies. Because they forgot about something. When I do a simple telnet to a proxy, and I do a get http, my crypto.mydomain, and of course, I do enter, enter, and I get a 403, right? From the proxy. However, the proxy will generate the log in the system saying this IP address tried to go to this URL and he got a 403. But a proxy does one more thing. He does an NSQuery of that URL to put in the log, the IP. Which there's no IP. But what that means is he, which has DNS resolution, now is querying my DNS server with a string that I want to send. So, he's... Okay, thank you. That will do. So, yes, it does generate one entry of 403 in a proxy logs. You know how many of those you get in a proxy constantly? Millions. So, yeah, great. That works if we have DHCP 0.252. Okay, sometimes you have WAP, if you still have WAP. Similar concept, I just will look for the WAP DNS entry, connect to the pack file, get the proxy, and do all over again. But again, no DHCP, no WAP, so most likely GPO. So, the last thing I can do is DNS guessing. Basically, you're given a array of names, like keywords, internet, or gateway, or GW, or PRX, or proxy, or gateway something. So, you do that list of 10, 15 words, and I will generate a dictionary with a dash, with an underscore, backward and forward. A matrix. And I will generate a list of 12, we'll say maybe 280. And then I will try, with a DNS internal, which one actually replied back to me. Then I will test, is this a proxy, a pack file server? So, I will try to connect and try to get a pack file. Could be something else. If it doesn't work, I will keep trying until I see something. So, this is the way to go around the GPO. Because GPOs, you need to have access to a Windows to actually see them. They're not in, it's per profile basically, so you can't really sniff it out of the network. And the last thing is the wireless. For wireless infiltration, remember I said I'm not setting up a wireless access point? I'm using beacons. Very short beacons of 500 milliseconds. So, what I'm doing is, within the beacons, I'm using the SSID names of the wireless at home and in many places. Normally tend to have like an X address. The last six digits of the MAC address of that home router is on the name of the wireless SSID. So, I'm taking the opportunity to mirror that. I'm broadcasting my standard MAC address, part of my crypto. Again, I have a 13 byte, I will chop it in three. I will have six, six, and one. We'll get padding. And then broadcast for 500 milliseconds that SSID of each of the three. And the receiver will be looking for, it's like a phone broadcasting SSIDs for a very short time of period. So, that's the reason WIPs will not see it. Basically, I'm using beacons as a back channel to push data out for credentials. And that's it. Questions? Oh, no. Can you defeat MACSEC? The thing is, when you connect the switch, right? What you have is actually a phone connected to the switch. So, most NAC systems, so if you like, you want to have a network with one MAC address allowed only. Well, most of the company has a phone, the phone tend to have a PC after. So, you need at least two. Minimum, right? So, because you are putting a Cisco switch and the MAC address that... Raspberry Pi. The MAC address I'm using is actually a golden MAC. NAC cannot block that one. Because the trick is very simple. There's a MAC address for virtual, like, HSRP or VRRP services. Cisco HSRP is a routing gateway, right? So, what it does is, they have virtual MAC address that they create. Those virtual MAC address are whitelisted by default in all NACs. Based on the documentation. I did not write it. So, I'm using one of those. Any other question? Yeah? Where? This one? Ah, sorry. Yeah, I will release the version after DEF CON. No time over DEF CON. It's procrastination. I will push it out to GitHub, the newest version. And the guide for the building is quite straightforward. It doesn't require electronics to do that. Just Raspberry Pi and a few things. And the presentation, I believe, the slides will be up soon. We put it in the website as well. There's a website somewhere? Yeah. There's stickers on the back. If someone wants stickers. If not, let me know. I still have some stickers. If no more questions, thank you very much for listening.