WEBVTT

00:00.000 --> 00:03.660
So, soon to be a good afternoon to everyone.

00:03.660 --> 00:07.720
And now it is my absolute pleasure to introduce you to Emilio.

00:10.740 --> 00:12.900
Thank you, thank you.

00:13.160 --> 00:14.660
Let's see, can you hear me?

00:15.280 --> 00:16.060
Good.

00:16.720 --> 00:22.140
Alright, I think, good morning, good afternoon, good evening, depending on which time zone you are.

00:22.700 --> 00:24.340
Let me start with...

00:24.340 --> 00:27.860
Today I'm going to present a tool called Circo.

00:29.300 --> 00:31.880
So let me first do some introductions.

00:33.180 --> 00:35.220
Hello, that's me.

00:35.740 --> 00:40.300
So, I come from Japan.

00:40.300 --> 00:44.680
I know that I don't look very Japanese yet, but I've been living there for 10 years.

00:45.040 --> 00:48.240
So, you can call me either way.

00:48.240 --> 00:52.040
It works both ways, Emilio, Emidio, or something like that.

00:52.240 --> 00:57.140
I like to play with networks, packets, and, you know, a bit of 3D printing as well.

00:57.660 --> 01:01.780
So, I did demo a few tools already in a couple of conferences.

01:01.940 --> 01:04.880
Some of them are in Japan, so you may be aware or not.

01:05.220 --> 01:08.980
And just keep in mind, I'm not a programmer.

01:09.380 --> 01:14.160
So, the code works, it's nice, and there's a lot of improvement to do.

01:14.220 --> 01:15.700
But it runs.

01:15.700 --> 01:18.960
As long as it runs, it's not good to go.

01:20.040 --> 01:24.180
Alright, for those of you who are not familiar with it, it's actually the tool itself.

01:24.400 --> 01:28.060
The idea is born, actually, from the automations.

01:28.400 --> 01:32.700
Within enterprise networks, we have a lot of automation tools.

01:32.700 --> 01:43.640
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.

01:43.800 --> 01:48.140
Sure, but what about if it's not the Cisco switch that you are connecting to?

01:48.140 --> 01:51.480
They're basically giving us the credentials for free.

01:51.480 --> 01:52.000
Great!

01:52.000 --> 01:53.760
That was a good idea, I thought.

01:53.760 --> 02:10.640
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.

02:10.860 --> 02:14.480
So, I'm looking to find a way to do this.

02:14.600 --> 02:28.680
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.

02:29.220 --> 02:34.920
That's something that people will notice, because either it's not working anymore, and I wasn't very comfortable.

02:35.460 --> 02:45.380
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.

02:45.380 --> 02:48.500
So, we're going to dig into that.

02:48.680 --> 03:02.980
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.

03:03.620 --> 03:07.000
A lot of features, basically, between 1.4 to 1.5.

03:07.860 --> 03:09.740
So, who do we target?

03:09.740 --> 03:12.440
Well, pretty much any automation system out there.

03:12.440 --> 03:16.840
These are quite, quite a few known systems.

03:16.840 --> 03:18.680
HPNA is very popular.

03:19.180 --> 03:21.840
Of course, NetMRI as well.

03:21.840 --> 03:30.260
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.

03:30.260 --> 03:32.720
So, I will get rid of NAC as well.

03:33.360 --> 03:39.360
And, of course, there's always some admin connecting to things, that trusts and put password everywhere.

03:40.800 --> 03:43.960
This is an example of things that happen with a Raspberry Pi.

03:44.220 --> 03:50.380
You know, some device in the network that nobody noticed, you've been exfiltrating data in the NSA.

03:50.380 --> 03:56.160
And this is not uncommon, because NAC is very hard to solve all our problems.

03:56.980 --> 03:59.440
So , it did happen.

04:00.640 --> 04:04.560
Okay, so what are my main issues for version 1.5?

04:04.560 --> 04:05.380
Power options.

04:05.380 --> 04:08.860
I'm going to put a Raspberry Pi, which I need power, okay?

04:08.860 --> 04:10.500
Battery, PoE.

04:10.620 --> 04:13.460
IP phone, when I plug it, that looks suspicious.

04:14.160 --> 04:24.620
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.

04:25.040 --> 04:28.900
Yes, so I need to add some forensics, prevent forensics on it.

04:28.900 --> 04:30.000
Encryption, basically.

04:30.000 --> 04:32.140
Which is a key, always a problem.

04:33.480 --> 04:37.220
Alright, so let's start with the first problem, that is the power.

04:37.220 --> 04:40.600
So, I came up with the paper idea.

04:40.600 --> 04:41.500
It's the easiest one.

04:41.500 --> 04:47.060
You just start drawing things and come up with a list of wishes that you want to do.

04:47.660 --> 04:54.080
So, this concept was, okay, the PoE negotiation is very complicated.

04:54.240 --> 04:57.100
And there's many standards and there's many different ways to do it.

04:57.100 --> 04:58.720
Many implementations are different.

04:58.820 --> 05:04.660
But there's one thing, one element, that the phone and the switch, they will do the negotiation of the power.

05:04.660 --> 05:07.120
How much power you need, how many watts, etc, etc.

05:07.320 --> 05:09.080
So, I didn't want to get into that.

05:09.080 --> 05:11.220
So, I say, okay, let the phone negotiate.

05:11.220 --> 05:14.440
Once that's done, I just hook the power.

05:14.440 --> 05:21.440
So, you come up with an idea that violates every principle in networking, pretty much.

05:21.480 --> 05:23.140
Okay, why not?

05:23.140 --> 05:24.160
Let's give it a try.

05:24.220 --> 05:28.800
So, once you have a paper idea, what you tend to do is breakboarding.

05:28.800 --> 05:30.640
Let's do, let's go, come on.

05:30.640 --> 05:32.820
Plug some cables and see what happens.

05:32.820 --> 05:34.480
Something will blow up for sure.

05:35.460 --> 05:41.980
So, you start to build up some ports and this breaks all network industry standards, by the way.

05:41.980 --> 05:43.600
So, trust me on that one.

05:44.440 --> 05:50.480
So , what tend to happen when you start to do this is at some point, without you noticing, this actually works.

05:50.480 --> 05:53.140
And I'm like, okay, this is actually a good thing.

05:53.360 --> 05:56.220
So, now you actually elaborate on it.

05:56.220 --> 05:58.520
So, you move into prototyping.

05:58.860 --> 06:06.240
So, this is a little board for just, because they keep coming out, the jumpers from the breadboard.

06:06.240 --> 06:09.540
So, you say, okay, let's make it a bit more stable.

06:09.540 --> 06:11.320
So, I did a prototype to see.

06:11.320 --> 06:18.420
Basically, it's four RJ45 and a DC to DC converter plus a USB socket.

06:18.420 --> 06:19.960
So, it was a very simple idea.

06:20.560 --> 06:23.040
It's all the wiring, the thing that goes underneath.

06:23.620 --> 06:26.080
So, again, I never designed a PCB.

06:26.100 --> 06:30.720
So, it would be nice to have a Raspberry Hub, maybe, or go into that.

06:30.840 --> 06:33.600
So, I'm still trying to figure out.

06:33.720 --> 06:35.360
So, prototyping is okay.

06:36.360 --> 06:40.540
All right, how Circo evolved between different releases.

06:40.820 --> 06:45.920
So, Circo has around one year old, maybe, around October 2018.

06:46.500 --> 06:49.440
So, it started like an idea in a box.

06:49.440 --> 06:52.260
When I mean in a box, I mean literally in a cardboard box.

06:53.200 --> 06:57.180
It was good because you can see the components and you can see, ah, this is this.

06:57.180 --> 06:58.660
You can even put labels on it.

06:58.660 --> 07:03.220
So , it was quite, yeah, it was fun.

07:03.220 --> 07:07.760
So, what happened here is that I used to use a PoE LAN modules.

07:08.200 --> 07:09.680
And I bought one that you see.

07:09.680 --> 07:15.160
So, basically, what it does is it does the PoE negotiation and then give you the LAN back and the power.

07:15.180 --> 07:16.700
So, I bought one, 12 volts.

07:16.700 --> 07:18.760
Okay, I need to convert this to 5 volts.

07:18.760 --> 07:20.600
And then I figure out they sell the 5 volts.

07:20.640 --> 07:23.920
So, this is the first release, right?

07:24.360 --> 07:26.540
So, then we evolved into a production.

07:26.680 --> 07:28.220
So, I say, okay, let's move on.

07:28.220 --> 07:31.020
So, I got some enclosures.

07:32.200 --> 07:37.020
They look like these boxes that you have under your desk, over your desk.

07:37.080 --> 07:40.020
So, the whole concept is, okay, let's work with what we have in the market.

07:40.020 --> 07:42.980
So, I look for these enclosures to put stuff in it.

07:45.380 --> 07:50.080
So, in this release, I only have, you see, there's only one cable going on.

07:50.100 --> 07:53.780
That's because I unplugged the phone and that's it.

07:54.240 --> 07:58.560
And also, the smaller version, that was a bit more tricky because there's less space.

07:58.560 --> 08:05.300
But you can use Raspberry Pi Zero, which is a bit cool, but you really need to work with space.

08:05.300 --> 08:07.060
Again, this version has only one LAN.

08:07.280 --> 08:10.480
So, you need to work with the LAN adapters on the Raspberry Pi.

08:10.760 --> 08:12.880
Right, so we move to this version.

08:13.040 --> 08:15.680
This version is actually this box.

08:15.900 --> 08:22.060
This box, because, remember, now I'm still in the phone and I'm going to plug back the phone here.

08:22.220 --> 08:26.200
So, what I'm going to do is use two different LAN adapters on the Raspberry Pi.

08:26.200 --> 08:29.740
So, that's the reason I have a USB LAN adapter plus the onboard.

08:30.800 --> 08:34.680
As well, there is on the bottom, you will see a DC-DC converter.

08:34.680 --> 08:38.680
The 48 volts of PoE back to 5 volts to power the Raspberry Pi.

08:39.380 --> 08:45.100
And on the yellow thing that you may see there, that's actually a magnet switch.

08:45.100 --> 08:49.520
It's a 3D print some handles to mount it.

08:49.520 --> 08:52.820
But it's basically a magnet and a tilt magnet switch.

08:52.820 --> 08:54.900
So, what it does, that is the key lock.

08:54.900 --> 08:57.900
When you open the case, it will detect that you open it.

08:57.900 --> 09:01.020
And , you know, you can RMRF, you can do whatever you want.

09:01.060 --> 09:02.180
Reboot, shutdown.

09:02.480 --> 09:09.300
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.

09:09.580 --> 09:11.900
It will blow up, basically, if you want to.

09:12.040 --> 09:13.600
That was a bit dangerous to do.

09:14.240 --> 09:18.380
EPMs, you know, heatups, fire hazards.

09:18.500 --> 09:19.660
So, just be careful.

09:20.360 --> 09:24.360
Of course, the same thing into the smaller box as well.

09:24.400 --> 09:28.620
Here, what I need to do is choose USB LAN adapters and a hub.

09:28.800 --> 09:31.980
So, it gets tricky, but it still fits.

09:32.060 --> 09:37.340
So, depending on what you find in the market, as a discussed box, you can play around.

09:39.560 --> 09:43.060
So, how much does this cost?

09:43.060 --> 09:45.520
Because this must be a really expensive thing.

09:45.520 --> 09:48.720
Well, this is an example of how this box costs, right?

09:48.720 --> 09:52.880
So, to give you an idea, this is a Raspberry Pi Zero.

09:53.720 --> 10:01.600
The two USB LAN adapters, the USB, micro USB hub, are, like, ridiculously small.

10:01.940 --> 10:05.500
And just the outlet, which is one of the things more expensive.

10:05.860 --> 10:08.920
The outlet, I think, is $10 or something.

10:09.020 --> 10:10.720
So, yeah, you can get this for $50.

10:11.060 --> 10:13.360
So, if you don't want to go to pick it up.

10:13.360 --> 10:15.520
So, you do a pen testing, you leave it there.

10:15.720 --> 10:18.180
You are welcome to go and pick it up, or not.

10:18.720 --> 10:22.160
That's how well things finish on the pen testing report, right?

10:22.640 --> 10:26.020
So, you know, just in case you want to lose it.

10:27.300 --> 10:27.940
All right.

10:27.940 --> 10:30.240
So, the hardware is one thing.

10:30.240 --> 10:31.460
It's very simple components.

10:31.460 --> 10:36.600
It's LAN adapters, Raspberry Pi, plastic box, and some DC-DC bucket.

10:36.740 --> 10:39.040
So, now the question is what we are using as a software.

10:39.580 --> 10:44.060
Well, Circo is actually the little box, but we also have a few components.

10:44.060 --> 10:48.700
We have a component called Carpa, which is actually a software component only.

10:48.720 --> 10:50.220
Running on the internet.

10:50.220 --> 10:51.820
In a VPS, Python, and Linux.

10:51.820 --> 10:53.660
That's very simple components.

10:53.860 --> 10:54.860
So, that's software only.

10:54.860 --> 10:55.160
Why?

10:55.160 --> 11:00.500
Because once this box is infiltrated into the network, what is it going to do?

11:00.500 --> 11:02.640
Well, it's going to become a Cisco switch.

11:02.820 --> 11:04.120
To get discovered.

11:04.160 --> 11:08.840
So, all these lovely automation systems will connect to me and give me the credential.

11:08.840 --> 11:11.060
So, essentially, it's a honeypot, basically.

11:11.180 --> 11:13.180
But what happens once I have the credentials?

11:13.280 --> 11:16.300
SNMP, TEL, SSH, whatever the user sends to me.

11:16.340 --> 11:18.420
Great, now I need to exfiltrate to the internet.

11:18.720 --> 11:20.000
And this is the tricky part.

11:20.000 --> 11:22.660
Because I need something on the internet to receive it.

11:22.660 --> 11:25.700
And that's where Carpa comes into play.

11:26.120 --> 11:30.800
At the moment, I have a demo here, which I'm running on a Raspberry Pi, Linux.

11:30.800 --> 11:37.140
You can run it anywhere, any VPS on the internet, Amazon, or any VPS server will do.

11:37.340 --> 11:44.740
The only requirement is that you have a domain name assigned to NS records assigned to this public IP of your VPS.

11:44.740 --> 11:46.420
Or NATED, if you have a NATED.

11:46.420 --> 11:50.140
So, and then we have one more component, which is Haula.

11:50.160 --> 11:52.380
Haula is, again, a software component.

11:52.380 --> 11:56.420
You can run it on a Raspberry Pi with a power bank and a wireless adapter.

11:56.420 --> 12:00.100
What it does is, basically, you can also exfiltrate via wireless.

12:00.700 --> 12:05.600
So, it will do from the box itself to the internet, or via wireless.

12:05.600 --> 12:06.860
Or both, if you want to.

12:06.860 --> 12:09.140
But via wireless, of course, you need to be in proximity.

12:09.480 --> 12:12.440
Keep in mind here, we are not setting up any access point.

12:12.440 --> 12:16.700
This is not an access point, because that will be caught by WIPS, right?

12:17.060 --> 12:20.100
So, we don't want any WIPS to notice us.

12:20.540 --> 12:23.520
So, currently it's in Python 2.

12:24.240 --> 12:26.000
Coming to 3 soon.

12:26.000 --> 12:30.460
And it's all packet manipulation are mainly based in Scapi, in Python.

12:30.920 --> 12:36.800
And we are using some other tools from a different combination of people as well.

12:36.800 --> 12:38.920
For example, for the OS Fuller.

12:38.920 --> 12:44.140
Some part of the code of the OS Fuller to full NAC, effectively speaking.

12:44.720 --> 12:47.780
And what actually exfiltration we can use.

12:47.780 --> 12:55.280
We have ping, traceroute, NTP, HTTP, HTTPS, DNS, proxy and wireless.

12:55.460 --> 12:59.460
Of which, all of these are atomic.

12:59.460 --> 13:01.900
Basically, nothing come back, ever.

13:01.900 --> 13:05.420
So, from a firewall point of view, it's a timeout session, HOUT.

13:05.420 --> 13:09.740
So, there's never a session in none of those protocols that I just mentioned.

13:09.740 --> 13:12.000
Or established connection or anything back.

13:12.000 --> 13:15.660
So, basically the Carpa never send anything back to me.

13:16.640 --> 13:21.220
And another new feature that came out is just because I have a phone, right?

13:21.600 --> 13:23.080
And the phones keep working.

13:23.080 --> 13:25.880
I'm basically man in the middle between the phone and the network.

13:26.060 --> 13:30.640
However, most of the offices people connect the phone and the PC to the phone.

13:30.640 --> 13:36.060
So, that automatically give me free traffic from the PC as well.

13:36.120 --> 13:39.580
So, that was a free bug, kind of.

13:39.660 --> 13:46.440
So, effectively speaking, you can run different tools to capture TELNET, SSH, FTP.

13:46.440 --> 13:52.960
So , unencrypted protocols or hashes are exfiltrated as well.

13:52.960 --> 13:57.980
So, not just the network part, but also the PC, if any, connected to it.

13:59.120 --> 14:01.480
So, how I become a Cisco switch?

14:01.480 --> 14:05.060
Well, I need to be able to send a CDP, LLDPs.

14:06.020 --> 14:09.980
I need to be able to have an SNMP server agent basically running.

14:10.100 --> 14:11.800
And TELNET and SSH.

14:11.960 --> 14:14.080
And all my packets need to look like a Cisco switch.

14:14.240 --> 14:18.400
So, that was the triage, basically, of how we come up.

14:18.740 --> 14:24.760
So, for flows, I have a single mode that used to be when you don't connect the phone back.

14:24.760 --> 14:28.640
And the bridge mode, which is the most interesting for this talk.

14:31.080 --> 14:35.220
So, in bridge mode, this is how it will work the logic, right?

14:35.220 --> 14:44.500
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.

14:44.500 --> 14:45.960
And it tries to get the name.

14:45.960 --> 14:50.480
Once it gets the name, it will try to get one similar to itself.

14:50.480 --> 14:55.760
So, if this switch, for example, is switch Tokyo 01, it will become 03.

14:56.520 --> 14:59.080
It will change the last digit by two.

14:59.120 --> 15:00.620
The logic is very simple.

15:00.700 --> 15:03.060
There is always a fallback to test 01.

15:03.460 --> 15:07.500
We need to pretend to be a nice new brand Cisco switch in the network.

15:07.680 --> 15:10.220
So, we want to get that information first.

15:10.220 --> 15:14.420
Then we get an IP address and we start to set it up.

15:14.980 --> 15:17.360
Of course, the MAC address is of the Cisco switch.

15:17.360 --> 15:18.920
We change MAC address at the beginning.

15:18.920 --> 15:23.760
As well, one thing we want to do is to start to advertise CDP and LLDP to the switch.

15:23.760 --> 15:26.940
That's the way we get discovery of the automation tool.

15:27.440 --> 15:32.580
What tends to happen is the existing production switch is already hooked to automation tool.

15:32.580 --> 15:37.660
And when he sees CDP and LLDP new neighborhoods, he will discover that on the system.

15:37.660 --> 15:42.620
And the system, once a day, will connect and try to pull the config, etc., etc.

15:43.180 --> 15:45.320
Basically, give us the credentials.

15:45.320 --> 15:54.500
So, once this happens, once we get the credentials, we can set it up to how often we want to exfiltrate it.

15:54.880 --> 15:59.200
And I will cycle if we want to just do it once or do it every one hour.

15:59.200 --> 16:02.820
The same exfiltration and which method you want, all of them.

16:03.360 --> 16:11.780
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.

16:11.780 --> 16:16.020
So, I used to have all this spread in the desk.

16:16.140 --> 16:17.460
It was very difficult to set it up.

16:17.460 --> 16:19.600
You always forget one cable and things don't work.

16:19.960 --> 16:25.760
So, because in Japan we have a Toyota that makes cars, right?

16:25.760 --> 16:29.100
So, it came out with Macaroni.

16:29.100 --> 16:34.300
This is our infrastructure in a box, basically, in a briefcase.

16:34.760 --> 16:36.920
And it only costs 200 bucks.

16:36.920 --> 16:39.380
It doesn't cost 20 grand like Toyota.

16:39.380 --> 16:42.920
But what it does is simplify things very much.

16:43.320 --> 16:47.580
And so, the lab itself... I know, everything has an acronym, right?

16:47.660 --> 16:49.760
It matches perfectly.

16:50.040 --> 16:52.480
So, the lab itself looks like this.

16:52.700 --> 16:56.060
It's basically a proper Cisco... you can look it up after if you want to.

16:56.060 --> 16:59.860
It's a proper Cisco switch and a CarPi simulated with a Raspberry Pi.

16:59.860 --> 17:05.340
I also hooked a Snort in the outside on the internet to see what the Snort will see.

17:05.340 --> 17:07.400
This Snort is configured as it comes.

17:07.400 --> 17:10.620
In the middle, there's no tuning.

17:10.640 --> 17:11.720
So, it's default, basically.

17:11.720 --> 17:12.280
All.

17:12.580 --> 17:15.580
So, it's supposed to catch even rubbish traffic as well.

17:16.560 --> 17:21.280
So, what I'm going to do is explain how the exfiltration technique works.

17:22.940 --> 17:29.200
So, for exfiltration, what I'm doing... I need to be able to tell my device in the internet...

17:29.200 --> 17:32.460
which... these credentials, who took it from.

17:32.460 --> 17:39.780
So, it came from my telnet daemon, my SSH daemon, through SNMP, or even the PC that was hooked.

17:39.960 --> 17:41.680
It's an optional work I'm working.

17:41.760 --> 17:46.220
Also, I want to know that this is enabled password of the switch, or is the user unpassword of the switch?

17:46.220 --> 17:48.360
And is SNMP the community of, basically?

17:48.420 --> 17:51.880
This work with SNMP 1, 2, V2 as well.

17:52.080 --> 17:53.460
3, not yet.

17:53.800 --> 17:56.760
Nobody used 3, actually, in any network that I'm aware of.

17:56.760 --> 18:06.040
So, this is the format and the source IP of the automation tool, or the laptop administrator, or whoever connects to my box.

18:06.760 --> 18:11.460
This is specifically the format that we want to exfiltrate.

18:11.460 --> 18:17.260
So, one way to exfiltrate this data is, first of all, we will encrypt it with AES-256.

18:18.040 --> 18:22.820
So, let me first go into Showtime.

18:24.280 --> 18:26.520
Let's start with the demo.

18:27.980 --> 18:29.920
Let me see if you can see.

18:38.320 --> 18:40.100
Let me close this.

18:51.790 --> 18:53.770
I cannot see, though.

18:54.610 --> 18:56.350
I cannot see what I'm typing.

18:58.290 --> 18:59.730
Let me bring back...

19:04.570 --> 19:05.670
Can I mirror?

19:17.820 --> 19:19.440
I don't know how to do this.

19:32.020 --> 19:33.280
Look better now?

19:35.490 --> 19:36.750
Look okay?

19:36.750 --> 19:38.370
Yep, right.

19:39.030 --> 19:45.410
So, this is my server in the Internet.

19:45.490 --> 19:50.930
So, when I run it, this gives me the options of the server.

19:51.650 --> 19:54.010
So, this is my snort.

19:54.170 --> 19:56.090
This is my administrator PC.

19:56.090 --> 19:58.410
And what I need now is my box.

19:58.890 --> 20:03.290
I also have this, because this version integrates with Faraday.

20:03.290 --> 20:06.590
So, let me log in.

20:09.840 --> 20:12.960
So, Faraday, I just have one workspace.

20:13.440 --> 20:15.160
And I have hosts.

20:15.200 --> 20:18.120
I only have one host with some vulnerabilities.

20:18.480 --> 20:21.200
All right, so let me do the magic.

20:29.240 --> 20:32.380
I do need to put a magnet, because I opened the lid.

20:32.940 --> 20:35.940
I need to hack the lid open

21:06.680 --> 21:07.160
.

21:07.600 --> 21:09.700
And there's a lot of flashing lights here.

21:09.800 --> 21:11.220
That is just a Raspberry Pi.

21:11.220 --> 21:12.940
Nothing more interesting than that.

21:12.940 --> 21:19.040
So, one thing that I did find out was how to prevent encryption.

21:19.040 --> 21:24.200
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.

21:24.200 --> 21:28.920
The problem with encryption is to decrypt and decrypt you need a key.

21:28.980 --> 21:32.580
So, what happens when you want to do that in a box that is already closed?

21:32.580 --> 21:33.740
You go there and put it.

21:33.740 --> 21:39.880
You don't have a laptop and installation system to put a keyboard to a Raspberry or whatever.

21:39.880 --> 21:48.020
So, what I came up with is I need a long key that I can use quickly to mount and encrypt this Raspberry Pi.

21:48.140 --> 21:51.180
So, I found that this Raspberry Pi has Bluetooth.

21:51.300 --> 21:52.260
Great.

21:52.320 --> 21:56.380
So, I created a million of applications.

21:56.380 --> 21:59.300
There's a Bluetooth application that you can create the services.

21:59.300 --> 22:01.460
You can do it from Linux as well.

22:01.460 --> 22:05.260
So, what I'm doing is I'm creating a service called Circo.

22:05.260 --> 22:09.860
And it has the UUID, which is 128 bits.

22:10.320 --> 22:11.560
So, guess what?

22:11.560 --> 22:12.720
That's my key.

22:13.340 --> 22:17.660
So, what this guy is doing, once he boot up, at the moment it's in demo mode.

22:17.660 --> 22:20.340
So, I should be able to access.

22:22.020 --> 22:32.400
So, if I do the F, the home drive I want to do is called PEncrypt.

22:32.420 --> 22:37.040
So, if I do, there's nothing because it's not mounted, right?

22:37.080 --> 22:39.840
So, what I'm going to do is turn on these Bluetooth services.

22:40.820 --> 22:43.400
It's a demo key, in case you are sniffing Bluetooth.

22:44.740 --> 22:46.760
It's not for production use, right?

22:47.360 --> 22:52.960
So, once I turn on, it runs every 5 seconds, I think I put it at 10 seconds.

22:53.260 --> 22:56.520
What it does, basically, is it's scanning to see if it found the services.

22:56.520 --> 22:59.580
And use that key to mount and decrypt looks.

23:00.540 --> 23:03.680
So, ideally this is all automatically, actually.

23:05.360 --> 23:09.860
Let me see, I think it's 10 seconds every...

23:09.860 --> 23:11.260
I don't remember where I put it.

23:11.900 --> 23:14.480
So, I create the services.

23:25.050 --> 23:25.850
System.

23:27.870 --> 23:28.670
Looks.

23:30.050 --> 23:33.350
Yeah, I create a little script, basically, to do that.

23:37.450 --> 23:38.790
Let me see, this is on.

23:40.250 --> 23:41.790
Or maybe I have Bluetooth.

23:42.610 --> 23:43.850
I will explain.

23:45.170 --> 23:46.530
There we go.

23:52.970 --> 23:54.890
Now it's jamming Bluetooth, right?

23:57.450 --> 23:58.790
Yeah, there you go.

24:03.970 --> 24:05.670
This is what happens with live demos.

24:07.090 --> 24:08.170
Come on.

24:19.860 --> 24:21.160
It did work before.

24:26.540 --> 24:27.460
Yes.

24:28.480 --> 24:29.900
Let me stop start.

24:34.950 --> 24:36.330
And let me do start.

24:57.130 --> 24:58.790
I think it's my phone, actually.

25:18.110 --> 25:19.030
Alright.

25:19.030 --> 25:20.270
Let's see.

25:56.440 --> 25:57.400
Alright.

26:01.000 --> 26:02.860
Let me do this manually.

26:10.240 --> 26:11.700
Let me create this.

26:19.980 --> 26:21.460
Oh, it did work.

26:21.860 --> 26:23.600
Oh, it was already mounted.

26:25.200 --> 26:25.900
Yeah.

26:27.360 --> 26:31.200
Playing with Bluetooth within DEF CON sometimes is not a good idea.

26:31.500 --> 26:33.720
So, let me turn this back off.

26:34.320 --> 26:36.020
Alright, it's already mounted.

26:36.020 --> 26:37.520
So, let me go to...

26:37.520 --> 26:40.980
This normally will start automatically, but...

26:40.980 --> 26:41.700
So...

26:42.720 --> 26:43.520
Oops.

26:43.800 --> 26:45.520
So, I'll just give you the menu.

26:45.520 --> 26:50.640
So, I have Carpa, which is the one in the Internet to receive the credentials, which I'm going to start in Verbose mode.

26:50.740 --> 26:53.300
And the plugin is a Faraday plugin.

26:54.120 --> 26:55.880
And the interface is here.

26:55.880 --> 27:00.100
And just a file where you want to put the output, the credentials you find.

27:01.800 --> 27:03.580
So, this is the Circo interface.

27:03.580 --> 27:07.120
So, what you do, first of all, we go into Bridge mode, where I put Verbose.

27:07.520 --> 27:11.700
We go into Bridge mode, because it's the one using the phone and the LAN at the same time.

27:11.700 --> 27:15.520
Still have backward compatibility, because that's a good way to do things.

27:15.900 --> 27:18.740
And then we can choose what exfiltration technique we want.

27:18.740 --> 27:20.680
You can choose either all, or...

27:20.680 --> 27:30.280
Can you ping DNS, HTTP, web, NTP, proxy...

27:30.280 --> 27:31.080
I don't know.

27:31.780 --> 27:34.320
I couldn't put minus A, actually.

27:34.540 --> 27:35.980
So, when you start it...

27:35.980 --> 27:36.400
Let me see.

27:36.400 --> 27:37.400
This one already started.

27:37.400 --> 27:38.300
I'm logging into Faraday.

27:38.300 --> 27:38.840
OK.

27:40.740 --> 27:43.520
Plugin to Faraday, what it does, basically, is...

27:43.520 --> 27:46.900
Every credential that he gets, he will inject it into Faraday directly.

27:47.220 --> 27:49.200
So, when the Circo starts, it's in Verbose mode.

27:49.200 --> 27:51.620
That's the reason you see all the steps of what it's doing.

27:51.920 --> 27:54.700
So, it starts becoming a Cisco MAC address switch.

27:54.700 --> 27:56.060
This is to bypass NAC.

27:56.060 --> 27:59.040
Due to the MAC address I'm using, it's a golden one.

27:59.220 --> 28:00.480
So, if you read through NAC...

28:00.480 --> 28:04.120
For Cloud NAC manual, there's a very small syntax that says...

28:04.120 --> 28:06.360
If you use this MAC address, you are always allowed.

28:07.380 --> 28:08.660
Just read the document.

28:08.660 --> 28:09.580
It should be fine, right?

28:09.580 --> 28:10.220
Guess what?

28:10.220 --> 28:11.360
That's what I'm using.

28:12.500 --> 28:13.080
Great.

28:13.080 --> 28:14.280
Thank you for the manual.

28:15.060 --> 28:16.120
So , it becomes a...

28:17.720 --> 28:19.040
Can you read, right?

28:19.440 --> 28:20.020
Yes?

28:20.560 --> 28:21.880
Do you know how we can make it bigger?

28:23.620 --> 28:24.680
That's too big?

28:24.920 --> 28:25.520
Better?

28:27.380 --> 28:29.200
So, what it does is...

28:29.200 --> 28:32.460
It becomes a MAC address switch.

28:32.460 --> 28:33.240
Discover.

28:33.240 --> 28:34.180
Start the ACP.

28:34.360 --> 28:36.840
This is all the configuration proxy.

28:37.020 --> 28:38.380
The proxy...

28:38.380 --> 28:40.640
I have three different techniques for the proxy.

28:40.640 --> 28:41.720
We'll go into details.

28:41.720 --> 28:43.420
This one is using the ACP.

28:43.820 --> 28:46.160
And then, from here onwards...

28:46.160 --> 28:48.880
It becomes a honeypot.

28:48.980 --> 28:49.520
Right?

28:49.520 --> 28:52.640
The last line you see is because the magnet I put there.

28:52.640 --> 28:54.960
The lid is open, but I put a magnet manually.

28:55.260 --> 28:57.940
So, if I take that magnet out, things will go crazy.

28:58.660 --> 29:00.260
So, now...

29:00.680 --> 29:02.880
I'm going to go to the real switch.

29:02.900 --> 29:04.180
This is my...

29:04.920 --> 29:06.200
Real switch.

29:06.920 --> 29:07.720
Right?

29:10.220 --> 29:11.940
This is Tokyo 01.

29:11.940 --> 29:13.400
It's my real switch.

29:13.400 --> 29:16.020
If I don't show CDP, neighbors...

29:16.020 --> 29:17.020
Guess what?

29:17.020 --> 29:18.400
I see a phone.

29:18.600 --> 29:20.960
I also see a switch called 03.

29:20.960 --> 29:22.460
It's a 2960.

29:23.000 --> 29:25.060
You can choose details.

29:25.780 --> 29:27.600
And this is...

29:27.600 --> 29:28.560
This is an IP address.

29:28.560 --> 29:29.880
This is a version.

29:29.900 --> 29:30.900
The port.

29:31.220 --> 29:31.860
The soft...

29:31.860 --> 29:33.120
It's a Cisco switch.

29:33.140 --> 29:36.380
So, I can see show CDP and show LLDP.

29:36.380 --> 29:38.140
As well, I can see LLDP.

29:38.240 --> 29:40.240
So, this switch, believe, is connect...

29:40.240 --> 29:42.240
Someone connected a new switch.

29:42.240 --> 29:45.260
Maybe in a meeting room, for a training or something.

29:45.800 --> 29:47.560
So, it does have an IP address.

29:47.560 --> 29:48.800
Which is 151.

29:48.900 --> 29:49.780
Right?

29:49.980 --> 29:52.380
So, this is my admin PC.

29:52.380 --> 29:54.700
What happens if I tell it that IP address?

29:58.400 --> 29:59.320
Okay.

29:59.320 --> 30:00.600
So, I type my...

30:01.800 --> 30:02.920
Superuser.

30:04.820 --> 30:06.720
And switch number 3.

30:06.720 --> 30:07.240
So, now...

30:07.240 --> 30:09.720
What I believe is a switch.

30:09.780 --> 30:11.020
I can run commands.

30:11.020 --> 30:11.740
Cisco commands.

30:11.740 --> 30:12.500
Show version.

30:12.500 --> 30:14.060
Yep, it's a 2960.

30:14.060 --> 30:15.700
This is the version running.

30:15.700 --> 30:17.580
Show IP route.

30:17.580 --> 30:19.440
Show IP app.

30:19.440 --> 30:20.840
Show MAC address.

30:20.840 --> 30:22.880
Show interface description.

30:23.020 --> 30:24.560
It is a Cisco switch.

30:24.560 --> 30:25.820
Well, I believe it.

30:26.580 --> 30:27.760
Show CDP.

30:27.760 --> 30:28.600
Neighbors.

30:29.340 --> 30:30.760
I need to type it correctly.

30:30.760 --> 30:32.240
Of course, it is a Cisco switch.

30:32.720 --> 30:35.160
Yeah, I can see now Cisco switch 1.

30:35.160 --> 30:36.040
The production one.

30:36.040 --> 30:38.900
So, they see each other in theory.

30:39.120 --> 30:41.480
Same with show LLDP.

30:42.040 --> 30:42.940
Neighbors.

30:42.940 --> 30:44.040
Yeah, I can see.

30:44.040 --> 30:45.060
So, from this switch...

30:45.060 --> 30:54.480
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.

30:54.480 --> 30:57.300
So, those are most of the commands that support.

30:57.300 --> 31:01.120
I did not code the whole iOS simulator just for fun.

31:01.360 --> 31:02.540
It wasn't fun.

31:03.880 --> 31:04.560
Yeah.

31:04.720 --> 31:07.220
The question mark also worked, by the way.

31:08.460 --> 31:08.960
Yeah.

31:08.960 --> 31:13.540
Oh, and if you want to go to show run, of course, you need to be enable mode.

31:13.540 --> 31:14.900
Okay, go enable.

31:15.240 --> 31:16.440
Yeah, sure.

31:16.880 --> 31:17.760
Great.

31:17.760 --> 31:18.500
Secret.

31:19.100 --> 31:20.580
Now, I can do show run.

31:20.720 --> 31:21.740
Yeah, that worked.

31:21.740 --> 31:23.720
What I can't do is config.

31:23.800 --> 31:25.100
No, that doesn't work.

31:25.100 --> 31:30.080
That's a common stack errors because I'm not going to prepare an iOS, basically.

31:30.080 --> 31:30.640
Right?

31:31.200 --> 31:33.200
So, this was a tenant I did.

31:33.200 --> 31:33.860
Right?

31:33.980 --> 31:37.440
So, you can see in the configuration that the community is public.

31:37.440 --> 31:38.680
The SNMP community.

31:38.680 --> 31:43.960
Now, what tend to happen is automation system will first try their own SNMP community.

31:43.960 --> 31:45.980
And if fail, it will try the public.

31:45.980 --> 31:47.900
You know, one of the least of the common ones.

31:48.040 --> 31:53.200
So, let's say I will try the system community.

31:53.200 --> 31:54.760
The one that they use in the company.

31:54.760 --> 31:55.320
Right?

31:56.180 --> 31:58.880
So, when I try that, that will not work.

31:58.980 --> 32:01.200
A, because it's public, the one that works.

32:01.400 --> 32:06.280
But, you did already give in the community with that command.

32:06.280 --> 32:07.980
So, when you do public...

32:10.400 --> 32:12.660
It has reply like a Cisco switch.

32:12.660 --> 32:15.780
It is actually a name, the uptime, the version.

32:15.780 --> 32:18.600
It is a full SNMP device that you can pull.

32:18.600 --> 32:22.160
Now, what happened when I went back to Carpa?

32:22.720 --> 32:25.500
Well, I start to receive this data.

32:25.520 --> 32:27.060
This is because it's verbose.

32:27.060 --> 32:44.900
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.

32:44.900 --> 32:50.040
And then I get the same password via ping DNS, traceroute.

32:50.040 --> 32:52.140
PDNS is proxy, by the way.

32:52.140 --> 32:59.620
HTTP, NTP, and then I also get this via here.

32:59.620 --> 33:08.000
So, oops, someone connect telnet enable, the E just standby enable with this super secret password.

33:08.000 --> 33:14.660
So, again, if I now do the same thing, let me open the...

33:15.800 --> 33:19.500
So, this is what this LPS is looking.

33:19.880 --> 33:23.020
Ignore the unreachable because I don't have internet connection, of course.

33:23.020 --> 33:29.580
But the only traffic that these guys can see, because I enable the default, is a ping.

33:29.620 --> 33:32.440
So, a Cisco switch is sending a packet ping.

33:32.440 --> 33:34.680
Nothing come back, but that's only alarm.

33:34.680 --> 33:39.620
Which I don't know anyone that has a snort with IC ping configured for alarms.

33:40.700 --> 33:43.080
That would be quite a lot of alarms.

33:43.280 --> 33:45.420
That's the only thing you can see on the snort side.

33:46.180 --> 33:55.260
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.

33:55.480 --> 34:00.020
It did reply to public, but not to the community you give me, but I exfiltrate it.

34:00.340 --> 34:04.600
So, now if I go to Faraday, right?

34:04.600 --> 34:10.340
So, when I do a host, when I do refresh, now I have a new extra host.

34:10.340 --> 34:18.020
This 10.10.10.88 is the source IP of the automation tool or administrator, then whoever is connecting.

34:18.560 --> 34:27.340
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.

34:27.340 --> 34:30.080
This is Telnet, the username, and the password.

34:30.180 --> 34:32.360
And this is SNMP.

34:32.400 --> 34:34.320
I should put SNMP instead of P.

34:34.620 --> 34:42.860
But, so now, as soon as I get them in Carpa, via an API, I can inject it in Faraday in real time.

34:43.040 --> 34:46.220
So, that's for helping the pen testing report side.

34:47.140 --> 34:50.860
So, now, what happen if I actually remove the magnet?

34:51.300 --> 34:51.940
You know?

34:53.440 --> 34:54.320
Careful.

34:57.590 --> 35:02.030
So, you start to see this alarm, alarm open, alarm open.

35:02.170 --> 35:04.770
That means that the, because I did not unplug it, right?

35:04.770 --> 35:06.570
I removed the magnet.

35:07.050 --> 35:17.730
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.

35:17.730 --> 35:22.210
So, you know, maybe it's time to make the report.

35:23.450 --> 35:30.450
So, of course, you can make it, if you go here, for example, this was the circle running in debug mode, right?

35:30.450 --> 35:32.530
So, you see that it's sending the credentials.

35:33.030 --> 35:36.210
And here is when I took the magnet off, right?

35:36.290 --> 35:37.910
You can do this, for example.

35:37.910 --> 35:41.870
That command, what it does is immediately reboot.

35:42.790 --> 35:46.090
So, what it does, remember, because we have the Bluetooth encryption.

35:46.550 --> 35:51.970
So, unless I'm back close to this box with this thing enabled, that will not work if you reboot.

35:52.210 --> 35:56.030
So, if someone unplugged it and replugged it, it will not mount encryption.

35:56.030 --> 36:01.110
So, that is a balance between having encryption and functionality.

36:01.450 --> 36:04.470
So, if you want encryption, you want the Bluetooth, sure.

36:04.470 --> 36:08.290
But if someone by mistake unplugged and replugged it, it will not work again.

36:08.390 --> 36:11.810
You need to be back, walking around with your mobile in your pocket, right?

36:12.690 --> 36:14.190
So, yeah, you can do whatever you want.

36:14.190 --> 36:19.650
You can, you know, PGM pulls, I don't know, burn, fires, whatever you like there.

36:20.750 --> 36:24.070
So, this is the way that this stuff works.

36:24.110 --> 36:25.530
So, these are the components.

36:25.630 --> 36:28.450
So, let me go deep into the exfiltration.

36:34.340 --> 36:35.820
Something's in the middle, right?

36:37.660 --> 36:38.720
Excuse me.

36:38.720 --> 36:39.860
There you go.

36:40.700 --> 36:41.700
Go away.

36:48.770 --> 36:50.350
Alright, so how I do...

36:50.350 --> 36:52.210
So, this is basically a nice honeypot.

36:52.210 --> 36:53.770
Now, how do I take the data out?

36:53.770 --> 36:55.590
That's an interesting point.

36:55.670 --> 36:58.810
So, this is going back to basics.

36:58.810 --> 37:01.630
So, we are using protocols that are through firewalls.

37:01.630 --> 37:05.390
Some of them are blocking the company, some of them can't go through.

37:05.390 --> 37:09.730
So, for example, some companies do allow ping to go for troubleshooting or traceroute.

37:09.890 --> 37:12.430
So, these are the protocols I'm using.

37:12.430 --> 37:20.770
ICMP, I'm using specific TCP and IP and UDP packets fields to actually put my data.

37:20.770 --> 37:22.450
Remember, I have one line.

37:22.450 --> 37:27.490
It's a T, dash, comma, username, comma, password, comma, and IP address.

37:27.490 --> 37:35.610
That, what I do is encrypt it, AS256, and now chunk it in 2 bytes or 6 bytes.

37:35.610 --> 37:43.630
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.

37:43.630 --> 37:49.830
So, I'm going to send you 13 bytes of crypto in 7 packets, 2 bytes each.

37:49.870 --> 37:54.190
So, first of all, I need to be able to tell that in advance before sending the packets.

37:54.190 --> 37:57.450
So, what I'm doing is, I'm sending one packet.

37:58.050 --> 38:00.290
These are the IP header.

38:00.290 --> 38:02.930
There's a field called identification in IP packets.

38:02.930 --> 38:05.590
That does not get changed by NAT.

38:05.590 --> 38:08.810
When you NAT through a firewall, that doesn't get changed.

38:09.030 --> 38:11.810
So, okay, it's 2 bytes that I can use for something.

38:12.770 --> 38:13.910
ICMP packets.

38:13.910 --> 38:18.050
Within the ICMP packet, you also have identification and sequence numbers.

38:18.050 --> 38:21.270
Again, 2 and 2 bytes that I can use for something.

38:22.030 --> 38:24.230
So, ICMP, how it works?

38:24.230 --> 38:28.250
Basically, I need to tell you my 13 bytes and 7 packets.

38:28.250 --> 38:35.150
So, I will send one packet saying that 213 is the IP ID, right?

38:35.150 --> 38:37.030
And the rest is just randoms.

38:37.030 --> 38:41.070
So, that means that the receiver knows that it's expecting 13 bytes, right?

38:41.070 --> 38:45.610
Then I'm going to send you 307 as the IP ID.

38:45.630 --> 38:49.650
300 means that actually you're expecting 7 packets, right?

38:49.650 --> 38:52.330
And then I will send you 7 packets, right?

38:52.330 --> 38:56.510
With the 500, 1, 500, 2 as a sequence ID.

38:56.510 --> 39:00.390
That is a sequence of a packet, in case they get a different order.

39:00.490 --> 39:08.770
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.

39:08.770 --> 39:11.550
So, I need 7 packets to do 13 bytes.

39:11.610 --> 39:12.670
Plus padding, right?

39:12.690 --> 39:14.450
One byte of padding.

39:14.710 --> 39:18.790
So, this is the way that most of the exfiltration technique works.

39:18.790 --> 39:25.090
It's basically chunking data into specific fields within different protocols.

39:25.090 --> 39:27.350
Like ping, for example, or traceroute.

39:27.770 --> 39:30.650
Traceroute, we are using the data payload.

39:30.690 --> 39:34.470
The Cisco switch, the last 4 bytes are rubbish.

39:34.530 --> 39:37.410
So, we are using those 4 bytes with X.

39:37.410 --> 39:39.330
My encrypted data becomes X.

39:39.330 --> 39:40.630
So, I encode it into X.

39:40.630 --> 39:43.170
It looks like an hexadecimal string.

39:43.190 --> 39:45.770
So, that's a good place to put 4 bytes.

39:46.690 --> 39:48.210
Again, similar concept.

39:48.210 --> 39:53.290
First, I need to tell you I'm sending 30 bytes and 7 packets, and then I send it one by one.

39:53.330 --> 39:58.610
Now, if we move into HTTP or HTTPS, remember, I'm not making a session.

39:58.610 --> 40:01.530
I'm just merely sending the same packet.

40:01.890 --> 40:02.810
That's it.

40:02.850 --> 40:09.550
So, there's something called window size in TCP, and do not change between the client and the server.

40:09.550 --> 40:10.230
Do not.

40:10.230 --> 40:12.570
So, you have not, and that thing doesn't change.

40:12.570 --> 40:13.570
Again, great.

40:13.570 --> 40:20.230
So, I have 1, 2 bytes that I can use that does not change between an internal client and an internet server.

40:20.430 --> 40:21.750
So, that's what I'm using.

40:21.910 --> 40:32.510
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.

40:32.510 --> 40:37.530
So, yeah, port 80, 443, or any port you like, 25 if you want to.

40:37.550 --> 40:41.590
But remember, most of the stuff probably don't have direct access to the internet.

40:41.590 --> 40:44.810
So, those exfiltration may not work.

40:46.110 --> 40:50.570
HTTP, HTTPS, actually any TCP port will be the same concept on this, right?

40:50.570 --> 40:56.330
You just send the SYN, nothing comes back, and the crypto goes into the window size.

40:56.390 --> 40:57.790
Of course, I become an integer, right?

40:57.790 --> 40:59.430
It's just supposed to be a number.

40:59.570 --> 41:01.570
So, from X, I convert it into an integer.

41:01.710 --> 41:04.290
And the whole process is in reverse on the other side.

41:04.290 --> 41:07.910
In the CARPA, it's the other side receiving, it's the whole thing the other way around.

41:09.470 --> 41:10.750
So, NTP.

41:10.750 --> 41:12.190
So , NTP was a bit fun.

41:12.370 --> 41:16.690
There's something called transmission timestamp, right?

41:16.690 --> 41:19.370
So, the transmission timestamp has this format.

41:19.770 --> 41:23.750
So, it's basically a timestamp plus a fraction.

41:23.890 --> 41:27.670
And the timestamp is 32 bits, and the fraction is 32 bits.

41:27.670 --> 41:31.530
Wait a minute, that's a lot of data I can put there into 32 bits.

41:31.690 --> 41:33.830
So, I'm using the fraction.

41:33.830 --> 41:46.970
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.

41:46.970 --> 41:48.890
In this case, I can send 4 bytes.

41:48.890 --> 41:51.730
So, in reality, I don't need 7 packets because it's 13 bytes.

41:51.730 --> 41:53.610
So, maybe 4 packets will do.

41:53.970 --> 41:57.350
So, I need to tell them it's 4 packets for this protocol specifically.

41:57.770 --> 42:05.710
And then I put it in the fraction, convert it into an integer, so actually it's a float because it's 32 bits.

42:05.830 --> 42:07.730
And then the process is the other way.

42:07.730 --> 42:16.370
So, inside the NTP query, I'm putting the fraction timestamp of the transmission timestamp, 32 bits of it.

42:16.750 --> 42:18.690
DNS packet, this one is easy.

42:18.690 --> 42:24.250
It just uses subdomain, encrypted.mydomain.com.

42:24.250 --> 42:27.030
But I'm not sending a query to the internet.

42:27.030 --> 42:31.810
I'm sending an NS query to the actually internal DNS on the company.

42:31.810 --> 42:34.030
So, this attack is not direct.

42:34.650 --> 42:36.890
So, I don't have access to go outside.

42:36.990 --> 42:43.470
But the DNS server has internet resolution through a relay or direct maybe.

42:43.570 --> 42:48.950
So, what tends to happen when you do an NS query, what it does, it will do a recursion until you get it.

42:49.010 --> 42:52.530
Assuming your DNS actually has internet resolution.

42:52.790 --> 42:55.610
Again, this is a hash encrypted.

42:55.610 --> 42:59.490
It's 20 bytes, 13 bytes we talk, so it's not a very long chart.

42:59.490 --> 43:03.530
Uh, you send it one, one query.

43:03.530 --> 43:05.410
Here is, you don't need multiple.

43:05.810 --> 43:08.670
So, in this case it's the flow of the thing.

43:08.670 --> 43:13.830
You will send just to the DNS server, internal DNS server, and the DNS server will go just directly to the...

43:13.830 --> 43:21.390
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.

43:21.510 --> 43:25.770
Now, what happen when the company do not have DNS resolution as well?

43:25.770 --> 43:31.830
You know, no access to internet in any protocol, no DNS resolution, external DNS resolution.

43:32.210 --> 43:33.610
All right, proxy.

43:33.770 --> 43:35.010
They might have something.

43:35.510 --> 43:38.650
So , proxy works in a way, how you discover proxy?

43:38.790 --> 43:41.430
Well, through how you set up in PC's proxy.

43:41.430 --> 43:44.730
DHCP option 252, WAP, or GPO.

43:44.730 --> 43:48.750
This is the three main, or manually, but I don't think people do that anymore.

43:49.510 --> 43:51.450
Those are the three most common.

43:51.450 --> 44:00.770
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.

44:00.770 --> 44:03.150
Now, what you get is actually a pack file server, right?

44:03.150 --> 44:03.910
URL.

44:04.090 --> 44:11.070
Get there, connect, get the pack file, parse it to get the proxy IP and port, then connect to the proxy, right?

44:11.090 --> 44:14.430
And of course, all proxies are most likely authenticated.

44:14.650 --> 44:15.610
Doesn't matter.

44:15.610 --> 44:18.430
This doesn't need authenticate to the proxy to work.

44:18.510 --> 44:26.290
So, this is a bit tricky because this unfortunately works with all Bluecoats, McAfees, all the high-end proxies.

44:26.490 --> 44:29.130
Because they forgot about something.

44:29.130 --> 44:41.750
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?

44:41.750 --> 44:42.890
From the proxy.

44:43.150 --> 44:52.790
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.

44:53.050 --> 44:55.450
But a proxy does one more thing.

44:55.690 --> 45:00.390
He does an NSQuery of that URL to put in the log, the IP.

45:00.590 --> 45:01.810
Which there's no IP.

45:01.810 --> 45:09.950
But what that means is he, which has DNS resolution, now is querying my DNS server with a string that I want to send.

45:10.650 --> 45:11.310
So, he's...

45:12.310 --> 45:13.670
Okay, thank you.

45:13.670 --> 45:14.870
That will do.

45:15.510 --> 45:19.610
So, yes, it does generate one entry of 403 in a proxy logs.

45:19.610 --> 45:22.030
You know how many of those you get in a proxy constantly?

45:22.990 --> 45:23.830
Millions.

45:24.090 --> 45:25.510
So, yeah, great.

45:25.510 --> 45:28.190
That works if we have DHCP 0.252.

45:28.790 --> 45:32.530
Okay, sometimes you have WAP, if you still have WAP.

45:33.010 --> 45:39.870
Similar concept, I just will look for the WAP DNS entry, connect to the pack file, get the proxy, and do all over again.

45:40.070 --> 45:43.750
But again, no DHCP, no WAP, so most likely GPO.

45:43.950 --> 45:46.470
So, the last thing I can do is DNS guessing.

45:46.470 --> 45:57.570
Basically, you're given a array of names, like keywords, internet, or gateway, or GW, or PRX, or proxy, or gateway something.

45:57.570 --> 46:06.450
So, you do that list of 10, 15 words, and I will generate a dictionary with a dash, with an underscore, backward and forward.

46:07.110 --> 46:07.990
A matrix.

46:07.990 --> 46:11.370
And I will generate a list of 12, we'll say maybe 280.

46:11.590 --> 46:16.350
And then I will try, with a DNS internal, which one actually replied back to me.

46:16.470 --> 46:20.130
Then I will test, is this a proxy, a pack file server?

46:20.150 --> 46:22.270
So, I will try to connect and try to get a pack file.

46:22.390 --> 46:23.390
Could be something else.

46:23.390 --> 46:26.450
If it doesn't work, I will keep trying until I see something.

46:26.630 --> 46:29.210
So, this is the way to go around the GPO.

46:29.210 --> 46:32.350
Because GPOs, you need to have access to a Windows to actually see them.

46:32.350 --> 46:36.350
They're not in, it's per profile basically, so you can't really sniff it out of the network.

46:37.610 --> 46:39.670
And the last thing is the wireless.

46:39.890 --> 46:44.310
For wireless infiltration, remember I said I'm not setting up a wireless access point?

46:44.310 --> 46:45.870
I'm using beacons.

46:45.870 --> 46:49.930
Very short beacons of 500 milliseconds.

46:50.170 --> 46:58.150
So, what I'm doing is, within the beacons, I'm using the SSID names of the wireless at home and in many places.

46:58.150 --> 47:00.410
Normally tend to have like an X address.

47:00.410 --> 47:05.910
The last six digits of the MAC address of that home router is on the name of the wireless SSID.

47:05.970 --> 47:08.770
So, I'm taking the opportunity to mirror that.

47:08.770 --> 47:13.950
I'm broadcasting my standard MAC address, part of my crypto.

47:14.310 --> 47:17.250
Again, I have a 13 byte, I will chop it in three.

47:17.250 --> 47:18.990
I will have six, six, and one.

47:18.990 --> 47:20.250
We'll get padding.

47:20.250 --> 47:26.270
And then broadcast for 500 milliseconds that SSID of each of the three.

47:26.350 --> 47:33.190
And the receiver will be looking for, it's like a phone broadcasting SSIDs for a very short time of period.

47:33.190 --> 47:35.350
So, that's the reason WIPs will not see it.

47:35.590 --> 47:41.530
Basically, I'm using beacons as a back channel to push data out for credentials.

47:44.690 --> 47:46.610
And that's it.

47:53.790 --> 47:54.670
Questions?

47:59.080 --> 47:59.940
Oh, no.

48:03.870 --> 48:05.730
Can you defeat MACSEC?

48:06.490 --> 48:09.010
The thing is, when you connect the switch, right?

48:09.250 --> 48:11.690
What you have is actually a phone connected to the switch.

48:12.010 --> 48:18.050
So, most NAC systems, so if you like, you want to have a network with one MAC address allowed only.

48:18.190 --> 48:22.190
Well, most of the company has a phone, the phone tend to have a PC after.

48:22.190 --> 48:23.710
So, you need at least two.

48:24.090 --> 48:25.210
Minimum, right?

48:25.210 --> 48:30.370
So, because you are putting a Cisco switch and the MAC address that...

48:30.830 --> 48:31.830
Raspberry Pi.

48:31.830 --> 48:34.970
The MAC address I'm using is actually a golden MAC.

48:35.030 --> 48:36.790
NAC cannot block that one.

48:36.790 --> 48:39.270
Because the trick is very simple.

48:39.270 --> 48:43.650
There's a MAC address for virtual, like, HSRP or VRRP services.

48:43.710 --> 48:47.250
Cisco HSRP is a routing gateway, right?

48:47.250 --> 48:50.270
So, what it does is, they have virtual MAC address that they create.

48:50.270 --> 48:54.590
Those virtual MAC address are whitelisted by default in all NACs.

48:54.770 --> 48:56.350
Based on the documentation.

48:56.770 --> 48:58.410
I did not write it.

48:58.490 --> 49:00.030
So, I'm using one of those.

49:06.650 --> 49:07.810
Any other question?

49:11.000 --> 49:11.460
Yeah?

49:11.460 --> 49:12.100
Where?

49:15.550 --> 49:16.390
This one?

49:17.210 --> 49:18.050
Ah, sorry.

49:20.510 --> 49:23.830
Yeah, I will release the version after DEF CON.

49:23.830 --> 49:25.210
No time over DEF CON.

49:25.210 --> 49:26.190
It's procrastination.

49:26.190 --> 49:29.830
I will push it out to GitHub, the newest version.

49:29.990 --> 49:34.330
And the guide for the building is quite straightforward.

49:34.410 --> 49:37.030
It doesn't require electronics to do that.

49:37.030 --> 49:39.010
Just Raspberry Pi and a few things.

49:39.970 --> 49:43.630
And the presentation, I believe, the slides will be up soon.

49:43.630 --> 49:45.410
We put it in the website as well.

49:45.490 --> 49:46.530
There's a website somewhere?

49:46.530 --> 49:47.130
Yeah.

49:52.780 --> 49:54.340
There's stickers on the back.

49:54.340 --> 49:55.740
If someone wants stickers.

49:56.500 --> 49:57.760
If not, let me know.

49:57.760 --> 49:59.000
I still have some stickers.

50:00.440 --> 50:04.060
If no more questions, thank you very much for listening.

