[00:00.000 --> 00:04.420] All right. Good morning, audience. Welcome to the second day of DEF CON. [00:04.420 --> 00:07.340] Proud to be here. Hopefully everyone's had a great experience so far. [00:08.780 --> 00:11.700] I want to kick things off by introducing our next speaker. [00:11.760 --> 00:15.300] He is coming all the way from Norway. So he's had a very long flight. [00:15.300 --> 00:17.480] So we definitely want to give this guy a lot of attention. [00:17.500 --> 00:22.740] His name is Melvin Langvik, and I'll read just a quick breakdown of his bio. [00:22.900 --> 00:26.600] Melvin is an accomplished professional with a diverse background in tech. [00:26.600 --> 00:30.060] He started his career as a developer and integration consultant, [00:30.060 --> 00:33.360] gaining practical experience in distributing critical back-end infrastructure [00:33.360 --> 00:36.500] for an international customer base. [00:36.520 --> 00:42.800] Melvin's passion for cybersecurity led him to transition into offensive security, the bad team. [00:42.800 --> 00:47.900] He previously worked for TrustedSec, which is an internationally recognized security company. [00:47.900 --> 00:51.900] As part of TrustedSec's targeted operations team, Melvin was tasked with performing [00:51.900 --> 00:57.980] targeted cyber attacks against some of the most mature and often largest companies in the world. [00:58.100 --> 01:03.760] Today, Melvin is with the offensive security team lead at a company called Colbert AS. [01:03.800 --> 01:08.760] So please give Melvin a very warm welcome and listen to what he has to say. [01:09.260 --> 01:10.860] Thank you, Melvin. Thank you so much. [01:11.240 --> 01:12.600] Thank you so much, guys. [01:12.740 --> 01:16.380] Okay, so this talk is only 25 minutes, so the first portion is going to be super quick, [01:16.380 --> 01:19.480] and then towards the end, we'll slow down and I'll give you guys a nice demo, okay? [01:19.480 --> 01:22.560] So evading modern fences versus phishing with pixels. [01:22.560 --> 01:25.680] We're going to be talking about QR code phishing specifically. [01:25.680 --> 01:29.520] Quick introduction about myself, even though my biography got read up here. [01:29.520 --> 01:32.300] My name is Melvin Langvik. I go by the alias Flangvik. [01:32.300 --> 01:35.020] I'm the team lead for a small Norwegian pentest company called Colbert. [01:35.020 --> 01:36.680] Previously, I was at TrustedSec. [01:36.680 --> 01:39.660] I've done quite a few offensive security tools for the community. [01:39.660 --> 01:42.280] Maybe somebody recognizes sharp collection or team filtration. [01:42.600 --> 01:46.900] I also create trash, semi-good-ish infosec content on YouTube and Twitch. [01:47.380 --> 01:51.120] I don't want to go on a stream every Sunday, but close to every Sunday, I do a stream. [01:52.580 --> 01:55.540] Like you guys, I'm a part-time alcoholic when I'm at conferences. [01:55.940 --> 02:00.260] And I'm also the guy who did the meme-y C2 and EDR tier lists. [02:00.640 --> 02:03.240] Obviously, AnyDesk is the best C2 out there, right? [02:03.240 --> 02:04.340] So this is all a meme. [02:04.940 --> 02:06.740] Okay, so the game plan for this talk. [02:06.740 --> 02:08.360] We're going to talk about QR codes one-on-one. [02:08.360 --> 02:10.120] We're going to talk about phishing with QR codes. [02:10.120 --> 02:11.900] Some basic detection engineering. [02:11.900 --> 02:14.080] Obviously, not my field, but just some basic stuff. [02:14.080 --> 02:19.240] Imageless QR codes, question mark, potential profit, taking things a step further. [02:19.240 --> 02:22.000] And then we're going to talk about the tool and toolkit I'm going to be demoing [02:22.000 --> 02:23.980] and sort of releasing today called Crucible. [02:24.420 --> 02:26.660] Okay, so let's talk about some QR codes. [02:26.660 --> 02:27.580] What is a QR code? [02:27.580 --> 02:29.360] QR code is a quick response code. [02:29.360 --> 02:32.720] It's essentially a barcode that contains a given amount of data. [02:33.120 --> 02:35.920] A QR code works while you scan it using a device. [02:35.920 --> 02:37.040] Typically, it's a mobile, right? [02:37.040 --> 02:40.000] The scan secure code takes you to a link or some other data. [02:41.780 --> 02:44.660] The QR code itself has a couple of key factors. [02:44.660 --> 02:47.240] Finder patterns, marked down here in purple, [02:47.240 --> 02:50.960] is for the device you're scanning the QR code to identify where the QR code is. [02:51.060 --> 02:52.800] Is this a QR code or not? [02:52.800 --> 02:54.600] You got the alignment marker in green, [02:54.600 --> 02:57.860] sort of telling the device the position of the QR code, [02:57.860 --> 02:59.600] so it knows which way to read it. [02:59.600 --> 03:01.360] And then you get the actual data modules, [03:01.360 --> 03:06.580] which is the black and white data between the alignment and finder markers. [03:07.000 --> 03:09.060] And then you have also error correction. [03:09.060 --> 03:10.700] I didn't know this before doing the talk, [03:10.700 --> 03:14.980] but QR codes can actually have error correction up to 30%. [03:14.980 --> 03:17.540] So if up to 30% of the QR code is missing, [03:17.540 --> 03:20.080] it's still readable depending on how it's generated. [03:20.960 --> 03:24.380] Different versions of QR codes refer to different size, [03:24.380 --> 03:26.640] how many modules are within. [03:26.640 --> 03:30.440] Take like the smallest one, I believe it's like a 21 by 21. [03:30.440 --> 03:34.340] Then you can go all up to like 172, I think, 171. [03:34.340 --> 03:38.840] And that will actually give you a bit over 4,000 alphanumerical characters. [03:38.840 --> 03:41.620] So a QR code can be huge and can contain a lot of data. [03:41.760 --> 03:43.780] Typical use cases for us, it's much smaller [03:43.780 --> 03:49.100] and does contain like a series of numbers or URL or something like that. [03:49.880 --> 03:52.620] QR codes has a lot of legitimate use cases. [03:52.760 --> 03:54.840] If you ever charge your electric vehicle, [03:54.840 --> 03:57.300] if you ever booked like an e-bike or like a scooter, [03:57.300 --> 03:59.760] if you ever ordered at a restaurant during COVID, [03:59.760 --> 04:00.780] they use QR codes. [04:00.780 --> 04:02.220] You scan them, you get to a web page, [04:02.220 --> 04:04.900] and then you give them all your data and you get some food, right? [04:04.900 --> 04:07.960] So they have a ton of legitimate use cases and they're great. [04:07.960 --> 04:09.040] We use them all the time. [04:10.020 --> 04:13.140] The thing is that attackers also like to use QR codes. [04:13.700 --> 04:15.520] I'm actually super proud of this meme. [04:16.940 --> 04:19.300] And why do attackers use QR codes? [04:19.300 --> 04:21.240] They're simple to create and easy to share. [04:21.240 --> 04:22.600] There's a bunch of online tools. [04:22.600 --> 04:24.440] There's libraries to use in scripting languages. [04:24.440 --> 04:26.680] There's pre-built offline tools, right? [04:26.680 --> 04:29.240] Easy to create, easy to share, and therefore easy to abuse. [04:29.780 --> 04:31.920] Again, everybody knows what a QR code is. [04:31.920 --> 04:34.460] Even non-technical people working in large organizations [04:34.460 --> 04:36.800] have some sort of reference to QR codes, right? [04:36.800 --> 04:40.300] So it definitely looks like a legitimate delivery method. [04:41.080 --> 04:42.720] Sometimes we'll talk more about this, [04:42.720 --> 04:45.280] but typically it's easy to evade initial email filters [04:45.280 --> 04:49.060] and some sandbox solutions by delivering URLs or data in QR codes. [04:49.780 --> 04:52.800] And actually, I think they convey a sense of legitimacy. [04:52.800 --> 04:55.040] I asked a bunch of my friends who's not technical, [04:55.040 --> 04:57.640] you know, can anybody create a QR code? [04:57.640 --> 04:59.220] And a lot of them thought no. [04:59.220 --> 05:02.340] A lot of them thought that you had to be some sort of legitimate entity, [05:02.340 --> 05:04.600] that you had to be an organization or get a license or whatever [05:04.600 --> 05:07.980] to create your QR code, which is obviously wrong, right? [05:07.980 --> 05:12.700] So I think that is underlying of why a lot of people feel QR codes are very legitimate. [05:13.860 --> 05:16.680] And also, the best thing about phishing, specifically with QR codes, [05:16.680 --> 05:20.480] is that you move the initial access of whatever you are giving to the victim [05:20.480 --> 05:21.900] off the main device. [05:21.900 --> 05:24.200] A lot of large corporate networks or large companies [05:24.200 --> 05:26.540] will have heavily protected machines, [05:26.540 --> 05:30.640] but the mobile devices are either private, owned by the employee themselves, [05:30.640 --> 05:32.540] or maybe not as heavily enrolled [05:32.540 --> 05:37.740] or doesn't have the same defensive capabilities as the machine itself. [05:37.740 --> 05:39.800] Meaning that, you know, a potential defense, a SOC, [05:39.800 --> 05:43.080] wouldn't gain the same telemetry from that phone as they would from the device. [05:43.080 --> 05:45.960] I think this is true for many, many organizations out there. [05:47.000 --> 05:49.480] Okay, so obviously, phishing with QR codes, [05:49.480 --> 05:51.580] I think everybody's seen a couple of these examples. [05:51.800 --> 05:53.760] I think the Microsoft multi-factor authentication one [05:53.760 --> 05:55.240] is by far the most abused, right? [05:55.240 --> 05:57.100] Because it's based on the legitimate use case [05:57.100 --> 05:58.700] where you set up a Microsoft account, [05:58.700 --> 06:01.420] you have to scan the QR code to set up your multi-factor app. [06:01.420 --> 06:03.320] And therefore, you know, you have to re-authenticate [06:03.320 --> 06:06.320] or whatever the context is a couple of times a year, [06:06.320 --> 06:08.040] and that really makes a good phishing campaign. [06:08.040 --> 06:09.640] DocuSign is also heavily abused. [06:09.640 --> 06:11.200] Anything related to Microsoft, really, [06:11.200 --> 06:13.600] people love throwing Microsoft logos around, right? [06:14.280 --> 06:16.440] So a bit of detection engineering. [06:16.440 --> 06:18.300] How do we detect QR codes? [06:18.300 --> 06:22.180] I googled this, which means I did great research on the subject, right? [06:22.200 --> 06:24.620] Found this blog post by Liam Jones, [06:24.620 --> 06:26.140] who created a basic detection rule [06:26.140 --> 06:29.640] for basically pulling out image attachments from emails. [06:29.640 --> 06:32.140] He then had some automation for parsing the images [06:32.140 --> 06:34.060] and looking for QR codes, [06:34.060 --> 06:36.880] essentially attempting to parse every image as a QR code [06:36.880 --> 06:38.460] and then look at the data, right? [06:38.460 --> 06:40.160] That's the manual way to do it. [06:40.160 --> 06:41.640] There's a couple of flaws in this rule. [06:41.640 --> 06:42.660] You can probably spot it. [06:42.660 --> 06:44.380] You know, there's a bunch of more image extensions [06:44.380 --> 06:46.420] than PNG, JPEG, and SVG. [06:46.620 --> 06:48.480] But yeah, that's just an example, right? [06:48.480 --> 06:49.880] And then you have black box solutions, [06:49.880 --> 06:52.000] which we don't know how to work like Microsoft Sentinel. [06:52.020 --> 06:54.160] If you give Microsoft some of your hard-earned money [06:54.160 --> 06:56.420] and get like an E5 or E3 or whatever [06:56.420 --> 06:58.600] their licensing model is at the time, [06:58.600 --> 07:01.120] you'll get this, which is Microsoft Sentinel. [07:01.120 --> 07:03.680] It will overwatch all your emails, [07:03.680 --> 07:05.420] inbound, outbound from the organization. [07:05.460 --> 07:08.580] And it will actually tell you if you got a URL from a QR code. [07:08.580 --> 07:11.360] You see, it will tag it as the source of this data [07:11.360 --> 07:13.620] is from a QR code and will give it a URL. [07:13.840 --> 07:15.600] And it will automatically browse through it. [07:15.600 --> 07:16.420] It will take a look at it [07:16.420 --> 07:18.660] and try to determine if it's nasty or not, right? [07:18.660 --> 07:20.420] So the detection solutions, [07:20.420 --> 07:21.480] defensive solutions out there [07:21.480 --> 07:23.020] are definitely aware of QR code phishing [07:23.020 --> 07:24.460] and it's an established thing. [07:24.460 --> 07:26.080] We'll get back to this later. [07:26.560 --> 07:29.180] Okay, how about image-less delivery methods, right? [07:29.180 --> 07:30.820] I think when I say that, [07:30.820 --> 07:32.260] most of you are immediately going to think [07:32.260 --> 07:33.400] about the ASCII art method [07:33.400 --> 07:34.420] because it's a known method [07:34.420 --> 07:37.020] where you basically use different weird ASCII characters [07:37.020 --> 07:38.800] to represent the QR code. [07:38.940 --> 07:40.620] And the reason I say that this is a known method [07:40.620 --> 07:43.460] because our well-known influencer John Hammond [07:43.460 --> 07:44.900] made a video about this four months ago [07:44.900 --> 07:47.420] and at least 2 million people know about this now. [07:47.420 --> 07:48.800] So it's definitely known. [07:48.800 --> 07:51.180] Obviously not to throw him under the bus, it's great. [07:51.180 --> 07:53.040] Just want to say it's an established thing. [07:53.340 --> 07:55.060] And so when we want to phish, [07:55.060 --> 07:57.040] if I wanted to phish without the use of images [07:57.040 --> 07:59.440] to avoid this detection that I just talked about, [07:59.440 --> 08:02.100] what could I possibly use for this? [08:02.100 --> 08:04.660] Well, I found this example in CSS. [08:04.660 --> 08:06.860] So there's a great guy called Jason Adelia [08:06.860 --> 08:08.340] or whatever I butcher his name. [08:08.560 --> 08:10.560] He's a web developer or a web designer [08:10.560 --> 08:13.860] and he has this CodePen link out on Google somewhere [08:13.860 --> 08:16.800] where he showcases his QR code to his website [08:16.800 --> 08:18.280] created with CSS. [08:18.280 --> 08:20.780] So he's actually using a blank white canvas [08:20.780 --> 08:22.160] and then using box shadows [08:22.160 --> 08:23.940] to fill in the black and white [08:23.940 --> 08:25.360] for the entire grid array [08:25.360 --> 08:27.860] and it turns into this beautiful QR code. [08:27.860 --> 08:29.320] Now, this looks interesting. [08:29.320 --> 08:30.600] This doesn't look like shit, right? [08:30.600 --> 08:32.260] So we could potentially use this. [08:32.300 --> 08:34.160] So me and ChatTPT sat down one night [08:34.160 --> 08:35.480] and we looked at some Python code [08:36.020 --> 08:38.560] and I came up with this dirty piece of crap. [08:38.560 --> 08:40.260] Basically, creates a QR code, [08:40.260 --> 08:42.460] goes through every cell in the QR code, [08:42.460 --> 08:44.320] determines if the QR code is... [08:44.320 --> 08:45.880] or that pixel or cell is black [08:45.880 --> 08:48.160] and then fills in the box shadow, the CSS [08:48.160 --> 08:50.360] using his technique with that. [08:50.380 --> 08:51.900] And then this looks really great. [08:51.900 --> 08:53.080] Actually, a bunch of email clients [08:53.080 --> 08:54.200] will happily render this. [08:54.200 --> 08:55.960] Both Thunderbird and Apple Mail, [08:55.960 --> 08:57.040] the built-in Apple Mail, [08:57.040 --> 08:58.160] will render this as CSS [08:58.160 --> 08:59.600] and it scans, it looks great [08:59.600 --> 09:00.720] and it's not an image. [09:00.720 --> 09:02.660] So this will fly by basic detection [09:02.660 --> 09:03.740] for email filters [09:03.740 --> 09:04.880] because there's no image there. [09:04.880 --> 09:06.820] So there's obviously no QR code there, right? [09:06.880 --> 09:08.300] And of course, you can see [09:08.300 --> 09:09.540] that the CSS is not offset [09:09.540 --> 09:11.160] because, you know, centering things to CSS [09:11.160 --> 09:12.740] is an absolute fucking nightmare. [09:12.740 --> 09:14.120] So I didn't bother spending [09:14.120 --> 09:15.980] the needed two hours to center this thing. [09:15.980 --> 09:17.340] I just screenshots it. [09:17.340 --> 09:18.820] That's your issue now. [09:18.820 --> 09:20.060] But it is what it is. [09:20.060 --> 09:21.320] The sad thing about this though [09:21.320 --> 09:24.240] is that Outlook doesn't support this [09:24.240 --> 09:25.560] in the desktop client. [09:25.560 --> 09:26.700] The web version of Outlook [09:26.700 --> 09:28.760] will happily render CSS for you, [09:28.760 --> 09:30.360] but the, again, not centered, [09:30.360 --> 09:33.520] but the desktop client will not render CSS. [09:33.520 --> 09:35.240] This is because the Outlook desktop client [09:35.240 --> 09:36.420] is extremely sassy [09:36.420 --> 09:41.160] and in general just is very picky [09:41.160 --> 09:43.000] about what HTML tags you can use, [09:43.000 --> 09:44.440] what CSS you can use. [09:44.440 --> 09:46.360] And if you ever made an email [09:46.360 --> 09:47.780] in the Outlook desktop client, [09:47.780 --> 09:48.760] you know what I'm talking about. [09:48.760 --> 09:50.260] It's a nightmare, right? [09:50.260 --> 09:51.460] So it doesn't work. [09:51.460 --> 09:52.240] And it's kind of important [09:52.240 --> 09:53.440] because it turns out, [09:53.440 --> 09:55.060] at least based on one source, [09:55.060 --> 09:56.520] that the Outlook desktop client [09:56.520 --> 10:00.420] owns about 58.1% of desktop machines. [10:00.420 --> 10:01.780] So it's kind of important. [10:01.780 --> 10:02.560] And, you know, when working [10:02.560 --> 10:04.260] against large organizations, [10:04.260 --> 10:06.220] by far the experience I have [10:06.220 --> 10:07.340] is that most people use [10:07.340 --> 10:08.840] the Outlook desktop client. [10:08.840 --> 10:10.480] I think we can all agree on that, right? [10:10.480 --> 10:11.660] That's a given. [10:12.560 --> 10:14.240] Okay, so we got to take a step back then. [10:14.240 --> 10:15.600] CSS, sure, we can use that. [10:15.600 --> 10:16.860] We already scripted that way, [10:16.860 --> 10:19.020] but we got to find some other way. [10:19.020 --> 10:20.340] What other structure [10:20.340 --> 10:21.840] could we possibly use [10:21.840 --> 10:25.180] to create like a drawing [10:25.180 --> 10:26.580] almost of pixels? [10:26.580 --> 10:28.220] Like what could we use, right? [10:28.260 --> 10:29.820] So the answer to that, [10:29.820 --> 10:32.020] at least one, is tables. [10:32.020 --> 10:33.320] So tables is something [10:33.320 --> 10:35.460] that Outlook desktop client supports. [10:35.460 --> 10:36.440] When I say tables, [10:36.440 --> 10:38.480] I don't mean like Excel tables. [10:38.480 --> 10:40.540] I mean like actual HTML tables [10:40.540 --> 10:42.020] and rows and columns. [10:42.020 --> 10:43.500] And they support styling. [10:43.500 --> 10:45.100] So you could take a table [10:45.100 --> 10:46.940] and you can style each column [10:46.940 --> 10:49.020] in that either white color [10:49.020 --> 10:49.980] or black color. [10:49.980 --> 10:51.480] And you can create a QR code. [10:51.660 --> 10:53.640] So again, me and ChattyPT sat down [10:53.640 --> 10:55.760] one night and we created this. [10:55.760 --> 10:57.180] So you set the cell spacing [10:57.180 --> 10:59.260] and the cell padding to zero [10:59.260 --> 11:00.180] or a given size [11:00.180 --> 11:02.100] for how big QR code you want to make. [11:02.100 --> 11:03.540] And then you basically start filling in, [11:03.540 --> 11:06.340] okay, this pixel of this QR code is white. [11:06.340 --> 11:07.280] Let's pad this [11:07.280 --> 11:08.840] or let's make the background color [11:08.840 --> 11:10.740] of this cell white or black, right? [11:10.740 --> 11:11.840] And then you go through the whole thing [11:11.840 --> 11:14.280] and voila, you got a beautiful [11:14.280 --> 11:16.660] looking table in HTML. [11:16.940 --> 11:18.460] And you got a beautiful looking QR code [11:18.460 --> 11:20.000] in Outlook Desktop Client, right? [11:20.000 --> 11:20.960] And this looks good. [11:20.960 --> 11:22.240] I actually think this deserves [11:22.400 --> 11:23.060] a round of applause, [11:23.060 --> 11:24.900] to be perfectly honest with you. [11:25.420 --> 11:26.740] And this is really dumb. [11:26.740 --> 11:28.540] This is KISS all the way, right? [11:28.540 --> 11:30.000] It's super simple, super dumb. [11:30.000 --> 11:30.980] And is it effective? [11:30.980 --> 11:31.900] That's the big question. [11:31.900 --> 11:32.980] Is this effective? [11:33.100 --> 11:34.640] So I actually, you know, [11:34.640 --> 11:36.180] I reached into my paycheck [11:36.180 --> 11:38.000] and I bought Microsoft Sentinel, [11:38.000 --> 11:39.640] XDR, EDR, whatever they call it now. [11:39.640 --> 11:40.940] They change them every week. [11:41.300 --> 11:43.040] And I give them my money [11:43.040 --> 11:44.020] and I wanted to test it. [11:44.020 --> 11:46.380] So first I set up two accounts. [11:46.380 --> 11:47.680] I set up Microsoft Sentinel. [11:47.680 --> 11:48.340] I started monitoring [11:48.340 --> 11:49.780] incoming email traffic. [11:49.920 --> 11:51.720] And then I set out this QR code [11:51.720 --> 11:54.080] in a Base64, as a Base64 image [11:54.080 --> 11:55.480] embedded in the email. [11:55.480 --> 11:56.560] And obviously Microsoft Sentinel [11:56.560 --> 11:57.600] picked this right up. [11:57.600 --> 11:58.080] It says, you know, [11:58.080 --> 11:59.060] this is a QR code. [11:59.060 --> 12:00.120] This is the URL. [12:00.340 --> 12:02.020] That's Rick Roll, [12:02.020 --> 12:03.280] if anybody recognized that. [12:03.280 --> 12:04.180] Hacks, Elite Hacks are to you [12:04.180 --> 12:05.380] if you recognize that. [12:05.640 --> 12:07.260] And then I tried sending a table [12:07.260 --> 12:09.500] and long and behold, nothing happened. [12:09.500 --> 12:10.160] So Microsoft Sentinel [12:10.160 --> 12:11.940] did not detect the table as an image [12:11.940 --> 12:13.360] or as a QR code at all [12:13.360 --> 12:14.800] and didn't parse it. [12:14.800 --> 12:16.260] And therefore, as a defender, [12:16.260 --> 12:18.140] you don't have telemetry for this. [12:18.180 --> 12:19.640] So if I send a bunch of phishing emails [12:19.640 --> 12:21.420] with QR codes generated as tables, [12:21.420 --> 12:22.760] the URL will not pop up. [12:22.760 --> 12:23.700] Nobody will spam it. [12:23.700 --> 12:24.580] No bot will hit it [12:24.580 --> 12:25.820] and it will reach a target [12:25.820 --> 12:28.400] and it's still scannable by mobile devices. [12:28.400 --> 12:30.200] So this works great. [12:30.660 --> 12:32.220] Now this, I've already done this. [12:32.220 --> 12:33.280] I talked about this at a conference [12:33.480 --> 12:34.640] a couple of months back. [12:34.640 --> 12:37.340] This is built into the tool Crucible, [12:37.340 --> 12:38.680] which I'll talk about later. [12:38.680 --> 12:40.140] And you can find that on GitHub. [12:40.140 --> 12:41.220] It works great. [12:41.220 --> 12:43.100] And yeah, it's cool. [12:43.100 --> 12:44.660] But let's think about it [12:44.660 --> 12:45.680] and take it a step further. [12:45.680 --> 12:48.380] We can generate QR codes in CSS, sick. [12:48.400 --> 12:51.120] We can generate QR codes in tables, even sicker. [12:51.280 --> 12:54.220] But what about obfuscating email content [12:54.220 --> 12:55.940] using tables? [12:56.260 --> 12:57.280] Because think about it, [12:57.280 --> 12:59.520] the table is essentially our drawing board. [12:59.520 --> 13:01.080] We can draw whatever we want. [13:01.080 --> 13:03.940] Each column in the table is a pixel for us, right? [13:04.020 --> 13:06.340] So we could draw the entire email. [13:06.540 --> 13:07.860] We could render HTML [13:07.860 --> 13:10.480] and draw the entire thing as a table. [13:11.020 --> 13:13.160] So this is what we dive into. [13:13.160 --> 13:14.500] And this was a bit of a nightmare, [13:14.500 --> 13:15.500] to be perfectly honest. [13:15.500 --> 13:16.660] This is the process. [13:17.100 --> 13:18.620] So we need to... [13:18.620 --> 13:19.800] So the point, what I want to do, [13:19.800 --> 13:21.080] I guess I should go back on this. [13:21.080 --> 13:22.380] Why would you want to do this [13:22.380 --> 13:23.420] in the first place, right? [13:23.420 --> 13:26.240] So more and more defensive solutions out there [13:26.240 --> 13:28.320] are using AI to get the context [13:28.320 --> 13:29.440] of the email you're sending. [13:29.440 --> 13:30.680] They're using risk scores. [13:30.680 --> 13:32.300] They're using a context-aware AI [13:32.300 --> 13:33.220] to understand, you know, [13:33.220 --> 13:35.760] is this potentially a legitimate message [13:35.760 --> 13:37.000] being delivered to my user? [13:37.000 --> 13:38.520] And then based on the risk score, whatever, [13:38.520 --> 13:40.060] it will be delivered, sandboxed, [13:40.060 --> 13:41.420] looked at, whatever, right? [13:41.580 --> 13:43.220] So the thought behind this is that [13:43.220 --> 13:45.160] if we can obfuscate keywords [13:45.160 --> 13:48.420] in the email, like MFA, like QR, [13:48.420 --> 13:50.800] like re-authenticate, like Microsoft, right? [13:50.800 --> 13:52.060] It's going to be much harder [13:52.060 --> 13:53.420] for the AI model to determine [13:53.420 --> 13:54.640] the context of the email [13:54.640 --> 13:56.540] and if it's legitimate or not. [13:56.540 --> 13:58.060] So the whole point behind this is [13:58.060 --> 13:59.820] I want to take a keyword, [13:59.820 --> 14:01.140] say re-authenticate, [14:01.140 --> 14:04.160] and I want to render that as an image. [14:04.160 --> 14:06.300] And then I want to turn it into a table. [14:06.300 --> 14:08.520] And then I want to replace the keyword [14:08.520 --> 14:10.680] in the email with that table. [14:10.860 --> 14:12.540] So there's no text there. [14:12.540 --> 14:14.900] It's a table representing the text. [14:15.420 --> 14:16.480] So there's no text. [14:16.480 --> 14:17.360] You can't select it, [14:17.360 --> 14:18.500] but it looks like a text. [14:18.500 --> 14:19.760] The end user will think it's text, [14:19.760 --> 14:20.520] but it's not. [14:20.980 --> 14:22.700] I went through this process. [14:22.860 --> 14:25.220] So basically, you give the Python script [14:25.220 --> 14:26.700] the email, the HTML email [14:26.700 --> 14:27.640] that you want to send, [14:27.640 --> 14:28.680] and then you tell it, [14:28.680 --> 14:30.340] hey, I want to replace the keyword, [14:30.340 --> 14:31.260] re-authenticate. [14:31.380 --> 14:33.340] The Python script will then render the, [14:33.340 --> 14:34.400] the Python script will then [14:34.400 --> 14:36.880] inject a marker in that [14:36.880 --> 14:38.700] as to handle that word. [14:38.700 --> 14:39.780] So it will inject like a box [14:39.780 --> 14:41.920] around the word in HTML, [14:41.920 --> 14:44.120] and then it will render the entire email. [14:44.120 --> 14:45.840] And then it will use image recognition [14:45.840 --> 14:48.380] to cut out that box. [14:48.580 --> 14:49.960] And then it will remove the borders [14:49.960 --> 14:51.780] and turn it into a table. [14:52.460 --> 14:54.300] And this is dumb and complicated, [14:54.300 --> 14:55.220] and you would never think [14:55.220 --> 14:55.880] this would work, [14:55.880 --> 14:57.040] but it actually works. [14:57.040 --> 14:58.360] So I'm going to demo that right now [14:58.360 --> 14:59.780] so you can see that. [14:59.960 --> 15:04.040] Hopefully, you can see my terminal now. [15:04.040 --> 15:05.360] Can you see a terminal? [15:05.440 --> 15:06.240] Great. [15:06.260 --> 15:08.740] I'll try to clear this [15:08.740 --> 15:10.920] and make it a bit bigger for you guys. [15:11.840 --> 15:14.180] Like, ooh, okay. [15:14.280 --> 15:15.540] So this is Crucible. [15:15.540 --> 15:16.800] This is the help menu. [15:17.180 --> 15:17.980] You give it a URL [15:17.980 --> 15:19.600] that you want the QR code data, [15:19.600 --> 15:21.360] the data you want inside the QR code [15:21.360 --> 15:22.360] doesn't have to be URL, [15:22.360 --> 15:23.560] but typically it's URL. [15:23.560 --> 15:25.380] You want to set a QR code size. [15:25.380 --> 15:26.800] You give it an input. [15:26.800 --> 15:27.960] So you give it like a typically [15:27.960 --> 15:30.420] like a phishing email template in HTML. [15:30.420 --> 15:32.340] And then wherever the word [15:32.340 --> 15:34.600] QR underscore placeholder is [15:34.600 --> 15:37.580] will be replaced with a QR code table or CSS. [15:37.620 --> 15:39.020] And then you give it an output path [15:39.020 --> 15:40.700] if you don't want a random generated name. [15:40.700 --> 15:42.440] You can choose if you want the CSS method [15:42.440 --> 15:43.480] or the tables method, [15:43.480 --> 15:45.920] and you can also generate output in straight EML, [15:45.920 --> 15:47.000] which is an email format. [15:47.000 --> 15:48.820] So you can just open it in Outlook afterwards, [15:48.820 --> 15:49.940] which is super nice. [15:49.980 --> 15:52.020] And then you have the obfuscate method. [15:52.020 --> 15:53.740] So that's what I'll be demonstrating now. [15:54.220 --> 15:55.560] So in this command here, [15:55.560 --> 15:57.840] I'll be linking to Defcon.org. [15:57.840 --> 16:00.440] I'm using my MFA or QR code template, [16:00.440 --> 16:02.680] and then I'm obfuscating the keywords MFA, [16:02.680 --> 16:04.060] QR, and Microsoft. [16:04.060 --> 16:06.860] So those words will be pulled out [16:06.860 --> 16:07.680] of the email template [16:07.680 --> 16:09.300] and replaced with images [16:09.300 --> 16:12.520] illustrated as tables in the new output. [16:14.720 --> 16:16.680] So it worked, hopefully. [16:17.200 --> 16:20.040] I have a backup if it doesn't. [16:21.040 --> 16:22.440] Open Sesame. [16:23.580 --> 16:24.640] Placeholder, I think. [16:24.640 --> 16:25.240] No. [16:26.320 --> 16:27.460] Oh, okay. [16:27.520 --> 16:28.860] Hopefully this works. [16:29.940 --> 16:31.060] Yeah. [16:31.840 --> 16:34.120] So this is a table QR code, [16:34.120 --> 16:35.340] and this is the... [16:35.340 --> 16:36.540] Fuck, it broke. [16:36.540 --> 16:38.460] Okay, it broke. [16:38.460 --> 16:39.420] Give me a second here. [16:39.420 --> 16:40.920] I'll go back to the demo. [16:42.760 --> 16:44.440] So it looks like this, [16:44.440 --> 16:46.340] if the demo worked correctly. [16:46.520 --> 16:47.840] And then this is the output. [16:47.840 --> 16:50.180] So this is the generated email. [16:50.180 --> 16:53.320] Can you spot the text that is tables? [16:53.480 --> 16:54.660] There is text. [16:54.660 --> 16:55.980] There are keywords in this email [16:55.980 --> 16:57.500] that is not text. [16:57.920 --> 16:58.980] Give you guys a second. [16:58.980 --> 17:00.240] Some of it is obvious. [17:00.700 --> 17:02.220] Some of it is not. [17:02.740 --> 17:05.480] And all of this is not text. [17:05.980 --> 17:07.400] This is tiny tables [17:07.400 --> 17:10.260] inserted into the email template, [17:10.260 --> 17:12.600] resulting in it looking like text, [17:12.600 --> 17:14.180] but it not being text. [17:16.160 --> 17:17.180] Round of applause. [17:17.180 --> 17:17.980] Cue that. [17:23.460 --> 17:25.020] And again, this works [17:25.020 --> 17:27.120] when you're not demoing it live at DefCon. [17:27.920 --> 17:29.860] And that's basically all I got. [17:30.160 --> 17:31.740] Thank you so much, Adversary Village, [17:31.740 --> 17:32.580] for having me. [17:32.580 --> 17:34.200] I got stickers for the project. [17:34.200 --> 17:35.560] Scan this QR code, if you trust me, [17:35.560 --> 17:36.760] to get to the project. [17:36.900 --> 17:38.320] And yeah, go out there and fish somebody [17:38.320 --> 17:40.180] and improve our defenses [17:40.180 --> 17:42.320] by some degree. [17:42.340 --> 17:43.580] Thank you so much for being here, guys.