1 00:00:00,000 --> 00:00:01,500 Let's start. 2 00:00:03,460 --> 00:00:04,840 Happy to be here. 3 00:00:04,840 --> 00:00:08,960 This is my second time in DEF CON and second time talking on the creator stage. 4 00:00:10,420 --> 00:00:18,780 I'll be talking about a mix of my favorite topics, which is network fingerprinting, honeypots, and AI agents. 5 00:00:18,940 --> 00:00:24,380 So I kind of mixed them all together and created an open source tool just a few weeks ago. 6 00:00:24,380 --> 00:00:26,300 I released it last week. 7 00:00:26,300 --> 00:00:35,420 And yeah, I'm gonna go through why it can be useful and how you can probably use it for different use cases. 8 00:00:35,420 --> 00:00:43,160 Because usually I start with a fun, crazy idea which doesn't have any production use case. 9 00:00:43,160 --> 00:00:47,440 And then it turns out that, okay, this is useful. 10 00:00:47,440 --> 00:00:49,500 Maybe I should release it to the rest of the world. 11 00:00:50,120 --> 00:00:52,140 It was the case with this one as well. 12 00:00:52,460 --> 00:00:55,220 So before we get to the slides, just a quick intro. 13 00:00:55,220 --> 00:01:03,840 I'm Adil, working on security detection and response for over 10 years now. 14 00:01:04,580 --> 00:01:10,020 Part of it in Google and now at an AI startup, AI chatbot startup. 15 00:01:10,740 --> 00:01:20,500 And yeah, outside work, I just work on random honeypot projects and things that I can easily release without getting approval from the company. 16 00:01:20,500 --> 00:01:28,020 So yeah, I don't want to be known just by honeypots and network finger-painting, but that's the easiest thing to publish. 17 00:01:30,540 --> 00:01:32,500 I have a bunch of open source projects. 18 00:01:32,500 --> 00:01:38,180 You can take a look at my GitHub repo, 0x4d31. 19 00:01:39,720 --> 00:01:42,700 That's my Twitter handle and also GitHub. 20 00:01:44,180 --> 00:01:47,460 I have a QR code and all at the end of the slides. 21 00:01:47,460 --> 00:01:53,780 So if it didn't work, I can just show you on my MacBook. 22 00:01:59,190 --> 00:02:03,570 Okay, so the initial motivation and why I created this thing. 23 00:02:03,570 --> 00:02:06,670 So what is even this thing we're going to talk about? 24 00:02:06,670 --> 00:02:11,610 So it's basically a fingerprint-based or fingerprint-aware reverse proxy. 25 00:02:12,330 --> 00:02:15,250 This is just a term I made up. 26 00:02:15,250 --> 00:02:17,110 It's not a known term. 27 00:02:17,110 --> 00:02:19,810 So if you don't know what it is, that's fine. 28 00:02:20,230 --> 00:02:31,570 So the idea was to see if I can mess with the attackers based on their client fingerprints rather than just IP or user agent and things like that, which can easily be faked. 29 00:02:33,710 --> 00:02:41,670 So I have a quick primer on the fingerprints and how they work, so don't worry if you don't know anything about the fingerprints. 30 00:02:42,490 --> 00:02:52,770 But yeah, that was the idea, like just to have a more intelligent way to waste attackers' time or dynamically route them to different systems or different honeypots and things like that. 31 00:02:54,490 --> 00:02:57,990 But why at the reverse proxy level? 32 00:02:57,990 --> 00:03:05,970 Why not just a passive system like Suricata or Zeek to just capture all these network fingerprints? 33 00:03:06,250 --> 00:03:08,050 Basically, I started from there. 34 00:03:08,050 --> 00:03:21,110 Like a few years ago, I had a talk about HoneyTLS, which was just a very janky Nginx SSL reverse proxy, which I kind of used as a honeypot. 35 00:03:21,110 --> 00:03:27,070 And I collected these TLS fingerprints and other network metadata using Zeek. 36 00:03:27,070 --> 00:03:28,670 It was broad at the time. 37 00:03:29,270 --> 00:03:44,730 And yeah, just my goal was to see if we can find more interesting patterns looking at these fingerprints and extra metadata rather than just looking at the source IP, user agent, and the request. 38 00:03:44,730 --> 00:03:56,590 Because if you attended some honeypot talks before, you see that all you get is just like, I set up this honeypot, and I got these 100,000 requests in a day. 39 00:03:57,130 --> 00:04:01,850 The top request was from this country, these ports, and these requests, and that's it. 40 00:04:02,730 --> 00:04:06,950 So seven years ago or eight years ago, I was working on this HoneyTLS thing. 41 00:04:07,050 --> 00:04:12,270 I captured logs for about maybe three months. 42 00:04:12,730 --> 00:04:16,730 And then I had this talk at the HoneyNet conference. 43 00:04:16,970 --> 00:04:22,010 As always, I was creating the slides and looking at the new data just a night before. 44 00:04:22,110 --> 00:04:34,030 And then I found a really, really interesting pattern in the logs, which I will hopefully show you later in the slides, which kind of proved that how useful these extra metadata is. 45 00:04:34,310 --> 00:04:48,150 So even if you don't want to use this as a kind of signal or as a mechanism to route the traffic to other systems, you can just have this as an extra metadata or signal for your analysis. 46 00:04:48,150 --> 00:04:50,410 It would be very useful for the Threat Intel stuff. 47 00:04:51,850 --> 00:05:05,850 And another reason that we do this at the reverse proxy level is, so with my previous setup, I was capturing these connections with Zeek, as I said, and you get just the TLS handshake at that level. 48 00:05:05,850 --> 00:05:08,150 You don't get the HTTP logs. 49 00:05:08,150 --> 00:05:22,770 So I had to collect the HTTP logs from the Honeypot, which was the NGINX I mentioned, and I had to join it with the TLS logs to get something useful, to have both HTTP and the TLS stuff there. 50 00:05:22,950 --> 00:05:26,730 But if you do this at the reverse proxy level, you just get that automatically. 51 00:05:26,730 --> 00:05:32,130 So you just have both TLS stuff, the HTTP stuff, it would be way more useful. 52 00:05:32,250 --> 00:05:37,330 You can also have the HTTP fingerprints in addition to TLS fingerprints as well. 53 00:05:40,630 --> 00:05:55,910 Okay, so another reason I was thinking of using fingerprints, and maybe it's useful for you as well, is relying on IP addresses and user agents or things that can easily be changed or faked is... 54 00:05:57,690 --> 00:06:03,330 Just a second, maybe my slides are recorded, so I can move on the slides as well. 55 00:06:04,950 --> 00:06:10,290 Yeah, so the reason is IPs and user agents can easily be faked. 56 00:06:10,490 --> 00:06:15,690 And so they just rotate IP addresses like 100 times per minute. 57 00:06:15,690 --> 00:06:28,270 And if you set up like honeypots before, you see that you get a lot of requests from different IPs, different ranges, but they all seem to be from one actor. 58 00:06:28,330 --> 00:06:34,090 You can't really prove it unless you have these additional data, which is like the fingerprints and a few other things. 59 00:06:36,110 --> 00:06:52,090 So instead of relying on user agents for blocking bots or crawlers or things that you don't like, or just going after this whack-a-mole of blocking IP addresses, you can just rely on extra things deeper into the packets. 60 00:06:52,090 --> 00:06:55,860 So for TLS, it's TLS handshakes, client hellos. 61 00:06:56,350 --> 00:07:08,650 And for HTTP2, there are these extra frames like settings and update window and priority that you can use, which is very unique for different clients. 62 00:07:09,150 --> 00:07:13,590 And even for HTTP itself, just like the order of headers are really cool. 63 00:07:13,590 --> 00:07:26,730 Like it can easily be faked again, maybe a bit harder than user agents, because like, for example, if someone uses like Python request, it always comes with these three headers in the same order. 64 00:07:26,770 --> 00:07:31,690 So they can change it, but it takes a bit more effort compared to user agents. 65 00:07:33,510 --> 00:07:39,870 But yeah, once you have these metadata or fingerprints, you can block easier and smarter. 66 00:07:39,870 --> 00:07:43,530 You can deceive better if you're into Honeypot. 67 00:07:43,730 --> 00:07:48,590 And you can find patterns that otherwise would be impossible to find. 68 00:07:48,590 --> 00:07:53,310 I will show you some very interesting patterns, which I found using these fingerprints. 69 00:07:54,910 --> 00:08:20,670 So just a question before we go further, can your WAF currently, like whatever application firewalls you're using or like AWS, whatever edge service that you're using in front of your production services, allow you right now to block things like Zap or Burp Suite or like other tools like that? 70 00:08:21,410 --> 00:08:22,730 No. 71 00:08:22,890 --> 00:08:39,330 I know like a few providers, like probably AWS and Cloudflare provide something like that, but it doesn't let you customize things and say like, for example, I don't want to see traffic from this specific TLS fingerprint. 72 00:08:39,330 --> 00:08:45,950 They just apparently have this checkbox that you can say, OK, protect me from known bad bots or things like that, maybe. 73 00:08:47,730 --> 00:08:55,850 But yeah, so because of that, I thought, OK, it might be interesting to just set up, like create a new reverse proxy. 74 00:08:55,850 --> 00:09:06,570 My intention was not to build something like huge from scratch, like Nginx or Caddy or things like that, because those are way more complex, harder to customize and things like that. 75 00:09:06,570 --> 00:09:09,990 But I wanted something very simple for my use case. 76 00:09:09,990 --> 00:09:15,930 And so, yeah, that's why I started building this tool. 77 00:09:15,930 --> 00:09:34,090 You can even do very fun things that I'm sure none of other application firewalls and those cloud-based services can provide, such as redirecting the request based on their fingerprints to honeypots or deceiving them by some other methods or targeting them, 78 00:09:34,090 --> 00:09:35,810 like slowing them down. 79 00:09:37,370 --> 00:09:41,390 OK, so at this point, we know most WAFs don't do that. 80 00:09:41,390 --> 00:09:43,490 So that was basically the reason. 81 00:09:44,190 --> 00:10:04,670 So Finch, this tool I released last week, is a fingerprintable TLS reverse proxy that lets you deny routes, tarp it, and deceive based on those client's fingerprints, and also other basic metadata like the request and the user agents and the other HTTP methods. 82 00:10:04,670 --> 00:10:10,210 Even something I added, I just remembered, was Suricata alerts. 83 00:10:10,310 --> 00:10:18,630 So without relying on the Suricata service itself, I added this parser for Suricata HTTP rules. 84 00:10:18,630 --> 00:10:24,450 It doesn't support all the keyboards and all the complex things, but it works for my use case. 85 00:10:24,450 --> 00:10:36,410 So you can just download the Suricata rules, put it there, enable the Suricata module, and then all the requests coming will be matched against those Suricata HTTP rules as well. 86 00:10:36,490 --> 00:10:40,570 And then it will be exposed into the tool configuration as well. 87 00:10:40,570 --> 00:10:46,610 So you can decide to redirect traffic or block based on the Suricata message as well. 88 00:10:46,610 --> 00:10:53,150 So you can say like, okay, if it matches with exploit message in the Suricata, just block it or redirect it to Honeypot. 89 00:10:54,610 --> 00:11:08,410 Okay, so in the slides, I had this example for ZAP web application scanner that I will show that you can customize the user agents from the tool setting, but that's it. 90 00:11:08,410 --> 00:11:13,510 Like you can't change anything about the order of HTTP headers or TLS or things like that. 91 00:11:13,510 --> 00:11:26,330 So you could just use these fingerprints in this easy to use HCL configuration, which I have in my tool and block these. 92 00:11:26,430 --> 00:11:33,790 So for the configuration, you can't see it, similar to platform configs. 93 00:11:33,790 --> 00:11:35,150 So very simple. 94 00:11:35,150 --> 00:11:43,830 It's not that messy compared to the other reverse proxies, which like it's always like when you change something, it breaks everything. 95 00:11:43,910 --> 00:11:51,110 And it's either like these complex JSON or like YAML or things like that. 96 00:11:51,110 --> 00:11:59,050 But yeah, I decided to go with, I did like a few iteration and at the end, I came up with the custom HCL one. 97 00:12:01,330 --> 00:12:10,290 Okay, so at this point in the slides, I will show an example for the zap scanner, which can slow down the attacker. 98 00:12:10,290 --> 00:12:11,750 It does the targeting. 99 00:12:12,230 --> 00:12:19,010 So whenever someone uses zap to scan your application, it slows down. 100 00:12:19,010 --> 00:12:25,350 And for example, NS scan, which normally takes like 20 seconds, like I tried it with Nmap as well. 101 00:12:25,350 --> 00:12:27,630 It takes more than 10 minutes to finish. 102 00:12:27,630 --> 00:12:32,510 So you can just waste attackers time or resources that way. 103 00:12:32,510 --> 00:12:38,830 I mean, it kind of wastes your resources as well, but I put some guardrails and protections and limits. 104 00:12:38,830 --> 00:12:45,430 So there can't be, for example, more than 16 simultaneously open connections to your proxy. 105 00:12:45,430 --> 00:12:46,990 You can customize that. 106 00:12:49,650 --> 00:12:59,710 Okay, so before the fun part starts, we need some basics about the fingerprints and how it works for the people who don't know what it is and what we're actually talking about. 107 00:13:01,630 --> 00:13:11,250 So where these signals, like you can find, like where are these signals on entropy we're talking about? 108 00:13:11,250 --> 00:13:16,870 So as I mentioned before, briefly in TLS, you can look at the TLS handshakes. 109 00:13:16,870 --> 00:13:25,090 And although like TLS is encrypted, but like that initial handshake, especially client hello and server hello are clear text. 110 00:13:25,090 --> 00:13:28,490 So you can just look at that, extract those parameters. 111 00:13:28,490 --> 00:13:32,390 And those are very unique for different libraries and clients. 112 00:13:32,410 --> 00:13:33,630 It's not a silver bullet. 113 00:13:33,630 --> 00:13:37,970 Like some people I've seen that use it as a signature for writing detections. 114 00:13:37,970 --> 00:13:41,470 It doesn't work well in that use case. 115 00:13:41,470 --> 00:13:54,230 I mean, there are a lot of command and control, like C2 agents and implants that use very specific TLS configurations, which is very unique to them. 116 00:13:54,230 --> 00:13:57,430 So in those cases, you can use it for like detecting those. 117 00:13:57,430 --> 00:14:01,530 Any network monitoring tools like Zeek in your network. 118 00:14:01,530 --> 00:14:10,490 But in other cases, I don't suggest to use it as like the only detection method because it would be very noisy, false positive, false negative and things like that. 119 00:14:10,490 --> 00:14:14,250 So I suggest using it just as another data point. 120 00:14:14,250 --> 00:14:22,910 So just something besides user agent and other metadata you have from the networks, just add these as well, which help you find very interesting stuff. 121 00:14:24,070 --> 00:14:30,450 For HTTP, as I said, the headers and the order that those headers appear is where you should look for. 122 00:14:30,650 --> 00:14:37,730 And HTTP2, same, like there are some frames, like settings, updates and priorities, which you can use for these fingerprints. 123 00:14:39,190 --> 00:14:42,850 So in TLS case, we'll start with TLS. 124 00:14:44,050 --> 00:14:46,510 In the client flow, we have multiple parameters. 125 00:14:46,510 --> 00:14:51,050 One is version, the other one is cipher suites and then extensions. 126 00:14:51,550 --> 00:14:57,370 These extensions and cipher suites usually come in a very specific order. 127 00:14:58,270 --> 00:15:04,470 Again, these are things which depend on the underlying library that the client uses. 128 00:15:04,470 --> 00:15:15,230 So for example, if Google Chrome uses BoringSSL and another tool uses the same version of BoringSSL on the same OS, you probably get the same fingerprints for both two. 129 00:15:16,330 --> 00:15:18,370 But it's nice. 130 00:15:18,470 --> 00:15:26,530 In some cases, you see some very unique things, especially if you combine that with other things, like for example, in HTTP, as I mentioned. 131 00:15:26,530 --> 00:15:30,250 That's why I really like to do this at the reverse proxy level. 132 00:15:30,250 --> 00:15:37,450 Because you can then cross-check like the HTTP fingerprints and info that you have with the TLS ones. 133 00:15:37,450 --> 00:15:43,890 So maybe the attacker tries to fake the TLS and forget about the HTTP and vice versa. 134 00:15:43,890 --> 00:15:52,850 So then by checking these two, you can say like, oh, this pretends to be Google Chrome by looking at the user agents and fingerprints. 135 00:15:52,850 --> 00:15:59,410 But then you look at the TLS stuff, it's like a CAV, for example, or some other random tools. 136 00:16:00,650 --> 00:16:20,570 OK, so I just skipped these slides because you can see that it's just a bunch of screenshots for TLS packets and handshakes, which shows where these versions and crypto algorithm exist. 137 00:16:20,570 --> 00:16:26,250 I will just share after the talk my slides in my GitHub repo, you can just download and go through them. 138 00:16:27,530 --> 00:16:31,630 So one of the most common fingerprint techniques is Jottery. 139 00:16:31,630 --> 00:16:33,670 You may have heard about Jottery. 140 00:16:34,890 --> 00:16:41,470 There's been a lot of TLS fingerprint and similar work like in the past, like 10 or 20 years. 141 00:16:41,470 --> 00:16:55,270 So this is not just a very new concept or thing, but it was very hard to use those previous fingerprinting techniques because it was not easy to share them or use them in the different tools. 142 00:16:55,270 --> 00:16:59,470 There was no support in different, for example, security products. 143 00:16:59,930 --> 00:17:06,450 But Jottery, created by one of my former colleagues back in Salesforce, is a very easy one. 144 00:17:06,450 --> 00:17:18,810 It's just a hash that combines versions, ciphers, extensions, curves, and elliptic curve format in a specific format, combine them together and create an MD5 hash on it. 145 00:17:18,910 --> 00:17:38,910 There's been also some issues with it because, for example, some legitimate tools like Google Chrome browser, they have this extension called Grease, which just randomizes these extensions, which kind of mess with these like Jottery fingerprints because if you capture traffic from Google Chrome, 146 00:17:38,910 --> 00:17:44,370 you see that, oh, it generated 20 different Jottery and that's why. 147 00:17:45,910 --> 00:17:53,730 But generally, it works pretty well, especially if you also log the raw strings before applying the hash to. 148 00:17:53,790 --> 00:18:03,310 Because the raw string, when you just put all these parameters together, it kind of shows you some interesting patterns, which the MD5 one doesn't. 149 00:18:03,310 --> 00:18:09,950 Because looking at an MD5, you just see a random packet, random string, which doesn't mean anything. 150 00:18:10,050 --> 00:18:20,630 But looking at those raw strings before applying the hash, you can actually see like, oh, this was like TLS 1.2 or this was like a list of cryptos and stuff. 151 00:18:21,270 --> 00:18:26,610 And that's why he created the next version, which is Jot4. 152 00:18:26,710 --> 00:18:31,850 So in Jot4, it's more readable, rule-friendly. 153 00:18:31,850 --> 00:18:38,270 You can just, for example, write a rule to look for the first few characters and then asterisks, the rest. 154 00:18:38,530 --> 00:18:42,370 Because the format is defined in a way that's easy to do that. 155 00:18:42,370 --> 00:18:48,430 And just by looking at this string, you can say that, oh, this was like a quick traffic or was it like TLS 1.3. 156 00:18:48,550 --> 00:18:51,190 And then you can see the rest of things as well like that. 157 00:18:51,190 --> 00:19:11,230 So it's way more readable and it's resilient to that Google Chrome randomization thing, as I mentioned, because it doesn't store the ciphers and algorithms in the order that they appear, but they actually sort it and then generate the hash. 158 00:19:11,230 --> 00:19:13,670 So it solves that problem. 159 00:19:15,950 --> 00:19:23,510 One quick other thing about TLS and then we move on to HTTP and other fun stuff. 160 00:19:23,850 --> 00:19:29,850 So QUIC is this protocol, which is like TLS 1.3 over UDP. 161 00:19:31,650 --> 00:19:55,710 So just like searching about it, because majority of web traffic right now is on QUIC and it's not like the normal TLS over TCP traffic anymore, especially if you use Google or Cloudflare or websites like behind Cloudflare, you have this QUIC thing, which there's been a lot of different versions. 162 00:19:55,710 --> 00:20:05,330 Google started that and then IETF standards did some standardization to make it available like to other people and folks. 163 00:20:05,390 --> 00:20:11,650 So the thing is, most of network monitoring tools are currently blind to this traffic. 164 00:20:11,650 --> 00:20:14,050 Like there are no parsers for QUIC. 165 00:20:14,050 --> 00:20:19,530 Wireshark has some modules by default, you don't need to install anything. 166 00:20:19,610 --> 00:20:27,990 So just spin up like Wireshark, search for QUIC and you will see the traffic. 167 00:20:27,990 --> 00:20:37,230 So the interesting thing about QUIC is it's not like the normal TLS traffic, which you can just look at the traffic and extract the TLS handshake, like the client hello. 168 00:20:37,230 --> 00:20:47,190 The problem with QUIC is that TLS client hello is protected by some encryptions which can be recovered and decoded. 169 00:20:47,190 --> 00:20:48,470 So it's not created. 170 00:20:48,470 --> 00:20:50,110 So no one can look at that. 171 00:20:50,110 --> 00:20:58,250 It's a specific standard that if you know it, you can decrypt and extract that TLS client hello inside it. 172 00:20:58,650 --> 00:21:05,470 So the thing I did, I add some experimental supports of QUIC to my tool. 173 00:21:05,810 --> 00:21:09,000 So I tested with Carol, it worked. 174 00:21:09,000 --> 00:21:12,980 With Google Chrome, it didn't work for some reason. 175 00:21:12,980 --> 00:21:14,440 So I need to fix the problem. 176 00:21:14,900 --> 00:21:18,540 But anyway, this is just like an experimental thing which I added support for and it's cool. 177 00:21:18,540 --> 00:21:28,620 So even if you have like HTTP3 QUIC traffic, you can do the fingerprinting, applying the same JAW3 and JAW4 fingerprinting to those as well. 178 00:21:28,620 --> 00:21:34,620 So I also included a client tool which you can use. 179 00:21:34,620 --> 00:21:42,080 It's in the repo that it monitors the QUIC traffic or the PCAP and it extracts these fingerprints from the QUIC traffic. 180 00:21:45,620 --> 00:21:54,520 Okay, so for HTTP, as I said, I really like HTTP1 because it's very simple and it's very effective. 181 00:21:55,060 --> 00:21:59,100 It's a very hard, strong signal for a lot of clients. 182 00:21:59,280 --> 00:22:03,440 Just looking at the headers and the order of them, that's it. 183 00:22:03,440 --> 00:22:10,980 I was using this for many years in my other open source tool called FAT which is like fingerprint all the things. 184 00:22:11,080 --> 00:22:19,580 It just collects metadata and I had this very simple HTTP fingerprinting based on just the headers and the orders. 185 00:22:20,000 --> 00:22:31,140 But if you want to have something like more standard, JAW4 also have a HTTP version called JAW4-H and I added support to my tool as well. 186 00:22:31,140 --> 00:22:36,940 So just out of the box, you see JAW4 beside the JAW3 stuff as well. 187 00:22:37,100 --> 00:22:39,940 It's a bit more than just headers and the orders. 188 00:22:39,940 --> 00:22:52,820 It also captures some cookies and referrers and things like that which you can specifically identify one specific clients or application versus like just in general, Google Chrome version X. 189 00:22:55,060 --> 00:23:01,500 And the last one in the list of fingerprinting 101 is HTTP2, as I mentioned. 190 00:23:01,500 --> 00:23:03,260 I don't want to repeat it again. 191 00:23:03,260 --> 00:23:25,940 But there's this method which someone from Akamai worked on which combines settings, window update and priority and creates these fingerprints which I also really like because combination of these HTTP2, HTTP and TLS gives you a very strong signal about the clients. 192 00:23:25,960 --> 00:23:29,860 Like you can do way more reliable fingerprinting based on those. 193 00:23:31,900 --> 00:23:36,540 And before we end this section, there is this part about evasion techniques. 194 00:23:36,540 --> 00:23:42,040 So as I mentioned, of course, these fingerprinting techniques are not like bulletproof. 195 00:23:42,040 --> 00:23:54,300 There are many ways attackers can like fake these or mimic, for example, in a specific known client application by just changing the way they create these clients. 196 00:23:54,300 --> 00:23:56,420 Hello, for example, for TLS. 197 00:23:56,500 --> 00:24:03,060 It's interesting, like a similar talk I had like five years ago, no known tools. 198 00:24:03,720 --> 00:24:06,120 Yeah, there was just one called UTLS. 199 00:24:06,120 --> 00:24:12,280 There's this library that you can use to fake HTTP TLS fingerprints. 200 00:24:12,380 --> 00:24:24,280 But now like just before the talk, I was searching to see if there are any new tools and there are like tens of other new tools because a lot more people started adopting Jottery. 201 00:24:24,280 --> 00:24:30,660 Like now Jottery and Jot4 is supported in like AWS, Cloudflare, many tools like Suricata. 202 00:24:31,360 --> 00:24:34,460 Zeek and other open source and commercial tools. 203 00:24:34,460 --> 00:24:41,180 And because of that, now they know the value of these fingerprints for defenders to detect bots or specific tools. 204 00:24:41,180 --> 00:24:45,400 So now they started using this mechanism to fake them. 205 00:24:45,400 --> 00:24:54,140 But even that, as I said, one thing you can do is to just have multiple layers of fingerprints, HTTP, TLS and a few other things. 206 00:24:54,140 --> 00:24:57,360 And it would be way harder to fake those for the attackers. 207 00:24:57,360 --> 00:25:04,640 They would probably miss to do like all of those because they already know that a lot of companies don't even collect like Jot3s. 208 00:25:04,720 --> 00:25:06,740 So yeah, they don't care. 209 00:25:06,740 --> 00:25:17,960 Like they just like maybe just maybe less than, I don't know, like I don't have a number, but less than 10% even know about these Jot3s like on the offender sites. 210 00:25:17,960 --> 00:25:19,220 And yeah. 211 00:25:20,360 --> 00:25:29,220 There was even one I found which was very interesting because one of the demos I had was I was fingerprinting Berp suite repeater module. 212 00:25:29,220 --> 00:25:37,420 If anyone wants to use like Berp suite to scan your website, do some bug bounty hunting and finding bugs, you can just block them. 213 00:25:37,420 --> 00:25:46,100 I mean, don't do that unless you're a very broke startup or you don't have like resource to fix your security. 214 00:25:46,100 --> 00:25:49,940 Like I mean, blocking security scanners is not the solution. 215 00:25:50,020 --> 00:26:00,560 But there is this module in Berp suite called Berp Awesome TLS, which you can install and fake the TLS fingerprint of the Berp suite as well. 216 00:26:00,560 --> 00:26:01,160 It's nice. 217 00:26:02,780 --> 00:26:06,980 Okay, at this point, I definitely need to have some slides. 218 00:26:07,440 --> 00:26:10,560 Otherwise, I can just show you the slides like this. 219 00:26:12,500 --> 00:26:18,160 Or something I could do was just to share these so you could all just look it in your phone. 220 00:26:18,160 --> 00:26:22,420 But I guess I will do it after the talk. 221 00:26:22,500 --> 00:26:24,820 So I have this graph, which is really nice. 222 00:26:24,820 --> 00:26:38,220 It shows how by just adding these fingerprints to the mix, you can uncover some very interesting patterns which otherwise would be impossible to find. 223 00:26:38,240 --> 00:26:46,020 So what I did was when I set up my high TLS project, I collected TLS fingerprints, as I mentioned. 224 00:26:46,280 --> 00:26:52,160 So I started visualizing these, creating some directed graphs with D3. 225 00:26:52,160 --> 00:27:03,960 And the pattern was very interesting because I was expecting to see like the source nodes are source IPs and the destination nodes are these TLS fingerprints. 226 00:27:03,960 --> 00:27:13,500 So what you expect to see is usually seeing one Jot3 fingerprint with a lot of source IPs around it, right? 227 00:27:13,500 --> 00:27:22,140 Which means someone used Nmap and a lot of other people use the same tool as well because it's a known tool. 228 00:27:22,140 --> 00:27:25,780 The fingerprint is the same and a lot of IPs used it. 229 00:27:26,060 --> 00:27:32,100 But what I saw instead, I mean, 80, 90% of the traffic I saw was following this pattern. 230 00:27:32,100 --> 00:27:43,560 But there was this very interesting pattern from three or four actors, which was like one IP address generating hundreds of Jot3. 231 00:27:43,860 --> 00:27:49,460 And it was interesting that this pattern was even unique to those actors. 232 00:27:49,460 --> 00:28:00,440 So when you were looking at this, like actor X, for example, you were looking at the raw Jot3 fingerprints like before adding the hash, you were scrolling. 233 00:28:00,440 --> 00:28:01,920 I mean, that's how I found it. 234 00:28:01,920 --> 00:28:04,100 It was very accidental before I talk. 235 00:28:04,180 --> 00:28:09,720 I was scrolling through this sheet which contained the raw Jot3 strings. 236 00:28:09,760 --> 00:28:11,580 And I found something very interesting. 237 00:28:11,580 --> 00:28:14,320 My eyes was like, oh, there's a very interesting pattern here. 238 00:28:14,320 --> 00:28:21,040 When we were scrolling, there was like this line, which was like, I had sorted it based on time. 239 00:28:21,040 --> 00:28:36,880 You could see that one IP address changing, like for example, removing one algorithm from the mix, the next one remove another one, in the next request, it removes another one. 240 00:28:36,880 --> 00:28:47,900 So it was doing obviously some sort of randomization or like rotation to avoid TLS fingerprint based detections. 241 00:28:47,900 --> 00:28:51,820 And it was interesting that this actually made them more obvious. 242 00:28:51,820 --> 00:28:57,440 Because after I visualized this and looked at the pattern, I was like, oh, these four things stand out. 243 00:28:57,560 --> 00:29:04,060 But probably a lot of other people didn't notice because they were not collecting these fingerprints. 244 00:29:04,580 --> 00:29:12,300 And yeah, so another interesting thing was a lot of these IP addresses was completely in different ASNs. 245 00:29:12,300 --> 00:29:14,980 They had completely different identities and everything. 246 00:29:14,980 --> 00:29:20,980 And without these TLS, there was almost impossible to create some connections between these. 247 00:29:20,980 --> 00:29:30,320 But what I saw was like, especially for one of them, there was this cluster with IP address and 100 completely unique Jotteries. 248 00:29:30,320 --> 00:29:33,500 And the same for four other source IPs. 249 00:29:33,500 --> 00:29:45,100 And the only way I could connect these four clusters together was that they apparently by mistake or something, they all four used two or three common fingerprints. 250 00:29:45,100 --> 00:29:50,920 So that common fingerprint was in the middle and it was connecting these four clusters together. 251 00:29:50,920 --> 00:29:57,480 So it was a very interesting observation, which you could only do having these fingerprints. 252 00:29:57,480 --> 00:30:04,520 So let's just move on to the actual, like talk about the tool. 253 00:30:04,520 --> 00:30:09,140 So as I mentioned, I released this tool last week. 254 00:30:09,140 --> 00:30:16,000 You can just go through my GitHub 0x4031 slash Finch. 255 00:30:16,000 --> 00:30:19,200 And just start using it. 256 00:30:19,200 --> 00:30:20,420 It's based on Go. 257 00:30:20,420 --> 00:30:26,780 It collects these fingerprints and other things and expose them into the rules. 258 00:30:26,780 --> 00:30:31,140 So you can decide what to do with those traffics based on those things that you collected. 259 00:30:31,140 --> 00:30:33,580 So basically collect, decide, and act. 260 00:30:33,580 --> 00:30:36,160 You can just block, do whatever you want with it. 261 00:30:41,420 --> 00:30:43,260 So demo time. 262 00:30:49,650 --> 00:30:53,870 I will upload the videos as well, because there are like really interesting ones. 263 00:30:55,290 --> 00:31:00,610 But yeah, so one of them which is more interesting, which is the deceive action. 264 00:31:00,610 --> 00:31:03,370 So I have these five different actions in the tool. 265 00:31:03,610 --> 00:31:09,170 Allow, deny, route, tar pit, and deceive. 266 00:31:09,210 --> 00:31:16,230 So the deceive action actually just made up HTTP response on the fly using LLMs. 267 00:31:16,310 --> 00:31:17,630 Because like, why not? 268 00:31:18,130 --> 00:31:27,210 Let's say you have a request receiving in your reverse proxy to a path that you don't know what it is. 269 00:31:27,210 --> 00:31:33,470 Like you don't have any production servers behind it or it maybe matched some Suricata alerts or something. 270 00:31:33,530 --> 00:31:36,470 And then you want to just redirect these to... 271 00:31:37,290 --> 00:31:39,930 Like you just want to respond to that, but you don't know how. 272 00:31:39,930 --> 00:31:43,010 Because maybe it's just even like a zero-day exploit or something. 273 00:31:43,010 --> 00:31:48,030 So you don't know how to respond to backslash underscore shutdown, for example. 274 00:31:48,310 --> 00:31:52,190 So what I do is I use this tool which I released last year. 275 00:31:52,190 --> 00:31:57,410 Like the talk I had last year here was about that, which is a LLM-based web honeypot. 276 00:31:57,410 --> 00:32:07,450 So instead of having the honeypots generate like with static responses, I asked LLM to generate the HTTP response. 277 00:32:07,450 --> 00:32:08,850 And it works pretty well, actually. 278 00:32:08,850 --> 00:32:09,830 I didn't expect that. 279 00:32:09,830 --> 00:32:16,530 It works pretty well, even if you don't use smart models and it just generates the response in less than a second. 280 00:32:16,530 --> 00:32:23,550 So what I do is I expose this project called Glow as a service. 281 00:32:23,550 --> 00:32:26,510 So now I use this service in Finch. 282 00:32:26,530 --> 00:32:40,490 So whenever you use this deceive action in your rules, it just calls Glow, it passes the HTTP request, and it waits for the LLM to generate the HTTP response and then give it back to the attacker. 283 00:32:43,670 --> 00:32:50,210 And I mean, you may say like, okay, why do I need to spend money on responding to attackers? 284 00:32:50,310 --> 00:32:53,470 I mean, you can just use a very cheap LLM model. 285 00:32:53,470 --> 00:33:03,450 And another thing you can do is to enable caching because I added this caching thing, which like when you first generate a response to a specific path, you don't need to do it again using the LLM the next time. 286 00:33:03,450 --> 00:33:04,950 You just use the cache one. 287 00:33:04,950 --> 00:33:09,490 But I even did something else just like a couple of days ago. 288 00:33:09,490 --> 00:33:24,830 So I leaked this fake LLM API key in a fake code snippet with fake custom OpenAI endpoint in Pastebin. 289 00:33:24,830 --> 00:33:33,790 And just a few minutes later, a bot took that, reached out to my Finch proxy with that fake API key. 290 00:33:33,790 --> 00:33:40,790 And what I did was to respond to that using a Markov chain-based junk response generator. 291 00:33:40,830 --> 00:33:42,650 So I didn't pay anything for that. 292 00:33:42,650 --> 00:33:47,210 This is like the simplest way if you don't want to use LLM. 293 00:33:50,000 --> 00:33:54,900 Again, more demos, more examples. 294 00:33:54,900 --> 00:34:13,380 I have these example, like I just pushed these example fingerprints to the tool repo containing real Jot3, Jot4, Jot4H fingerprints for some known tools like Zap, Nmap and Burp Suite. 295 00:34:13,380 --> 00:34:16,620 So you can just try that on your own. 296 00:34:18,400 --> 00:34:22,160 The tool also comes with admin API. 297 00:34:22,240 --> 00:34:27,560 So that's actually where makes this reverse proxy smart. 298 00:34:27,560 --> 00:34:33,400 And like you may ask yourself like, where was the thinking part in this reverse proxy? 299 00:34:33,400 --> 00:34:35,300 That was like the title of the talk. 300 00:34:35,460 --> 00:34:38,580 That actually starts from here. 301 00:34:38,580 --> 00:34:43,180 So I exposed this admin API to the reverse proxy. 302 00:34:43,180 --> 00:34:47,800 So you can just programmatically update these rules you have in your reverse proxy. 303 00:34:47,800 --> 00:34:56,860 So I added an AI agent on top, which constantly monitoring the logs that you generate, like the reverse proxy generates. 304 00:34:56,860 --> 00:35:02,600 If it finds something interesting, like a pattern or something, it automatically updates the rules. 305 00:35:04,420 --> 00:35:06,820 So yeah, that was one thing I added. 306 00:35:06,820 --> 00:35:11,200 And there's also this SSE endpoint, which streams all these events. 307 00:35:11,200 --> 00:35:21,360 So if you don't want to use the JSON log that the tool generates, you can just use this SSE endpoint, which generates these logs like real time. 308 00:35:21,660 --> 00:35:25,340 And I have an example client for that in the repo as well, which is very nice. 309 00:35:25,340 --> 00:35:30,280 You can just look at that and search and filter the logs. 310 00:35:31,240 --> 00:35:32,840 There's an echo mode. 311 00:35:32,840 --> 00:35:42,200 So if you want to generate a data set of fingerprints, you can run the tool in echo mode, like finch, space, echo, that's it. 312 00:35:42,200 --> 00:35:51,460 And then if you hit the root, you will see a nice UI showing you all those fingerprints for your client. 313 00:35:51,460 --> 00:35:57,620 If you hit like a slash FP, you get the raw fingerprints in the JSON format. 314 00:35:57,620 --> 00:36:06,380 So where this would be interesting is if you, for example, want to automatically generate this database of fingerprints. 315 00:36:06,380 --> 00:36:11,920 So you just create a tool which runs some Docker containers. 316 00:36:11,920 --> 00:36:19,860 It installs like different versions of TLS libraries and tools and hit this endpoint to generate those fingerprints. 317 00:36:19,860 --> 00:36:21,820 So it does this automatically. 318 00:36:21,940 --> 00:36:26,240 And like in a few minutes, you can generate a huge data set. 319 00:36:29,460 --> 00:36:31,060 So what's the use cases? 320 00:36:31,060 --> 00:36:35,860 Like if at this point, you're still not sure what is the real use case of this. 321 00:36:35,860 --> 00:36:38,100 As I said, it was just a fun for me. 322 00:36:38,100 --> 00:36:46,520 I didn't want to implement the Jottery fingerprinting and other fingerprintings into all the honeypots that I'm using upstream. 323 00:36:46,940 --> 00:36:55,700 I was like, okay, what if I just create this reverse proxy and log all those at that point instead of implementing that different honeypots that I'm using? 324 00:36:55,860 --> 00:36:57,460 So that was the main use case for me. 325 00:36:57,460 --> 00:37:07,980 And then I wanted to just dynamically mute or silence the annoying bots because like last year, I set up this API LLM usage, like 20 bucks per month. 326 00:37:07,980 --> 00:37:12,720 And I use my like, obviously, LLM-based honeypot. 327 00:37:12,720 --> 00:37:25,340 So although I had this usage limit, but someone hit my honeypot with a hundred thousand times in like five minutes, which used all my budget for the month. 328 00:37:25,660 --> 00:37:36,680 And it actually proves that that honeypot was actually useful because the reason they hit my honeypot that hard was they thought it's an open proxy. 329 00:37:39,120 --> 00:37:43,080 They wanted to use it as some sort of like ad fraud. 330 00:37:43,080 --> 00:37:50,700 So they just generated traffic that way because the way my honeypot responded to their request made it look like it's an open proxy. 331 00:37:50,700 --> 00:37:54,860 With static honeypot, you couldn't do that unless you knew about like these patterns before. 332 00:37:56,140 --> 00:38:00,600 But yeah, for other use cases, you can just deny unwanted traffics. 333 00:38:00,600 --> 00:38:15,220 Like you don't like wasting your resources on random sketchy bots, which just crawls through your website or server, things like that. 334 00:38:15,960 --> 00:38:23,100 which matched with Suricata to honeypots to learn more about them instead of letting them hit your application. 335 00:38:24,060 --> 00:38:28,060 And yeah, just targeting scanners is another good one. 336 00:38:28,060 --> 00:38:30,220 So just slow them down. 337 00:38:33,400 --> 00:38:39,340 Okay, so one last bit before we finish the talk is about the agents. 338 00:38:39,340 --> 00:38:49,380 So I had this section about the agents, which I first say like, okay, agents are basically just LLM plus tools, plus instructions, that's it. 339 00:38:49,380 --> 00:38:51,460 And they run just in a loop. 340 00:38:51,660 --> 00:38:59,380 They just observe, act, do it again and again until they're satisfied with the result. 341 00:38:59,500 --> 00:39:05,300 So I created this experimental agent you can see in the repo later today. 342 00:39:05,300 --> 00:39:13,220 Right now, I just included the report it generated last night with the new OpenAI model like GPT-5, which is amazing. 343 00:39:13,220 --> 00:39:16,340 Like it just went through 10 megabytes of logs. 344 00:39:16,340 --> 00:39:26,500 I provided like the exact same log I analyzed like seven years ago, like the same patterns I was just talking about, about the jaw trees, like rotating jaw trees. 345 00:39:26,740 --> 00:39:29,820 As I said, I accidentally found that. 346 00:39:29,940 --> 00:39:35,660 So I just wanted to experiment to see if they can find it, like the agent can find it. 347 00:39:35,660 --> 00:39:44,120 And it actually found it like in one minute in like 10 or 20 megabytes of the logs without providing any additional context. 348 00:39:44,120 --> 00:39:50,040 So the only thing I provided as instruction was analyze the attached JSON log. 349 00:39:50,040 --> 00:39:50,940 And that's it. 350 00:39:52,500 --> 00:39:57,360 So yeah, it was exactly the first thing it found about that jaw tree rotation. 351 00:39:57,820 --> 00:40:04,080 One thing I wanted to share was don't just throw data to LLM and expect it to analyze. 352 00:40:04,080 --> 00:40:05,180 It just lies to you. 353 00:40:05,180 --> 00:40:08,340 Like even if it says like, yeah, I did it, it didn't do anything. 354 00:40:08,600 --> 00:40:12,220 That's exactly the point of like how to use LLMs. 355 00:40:12,380 --> 00:40:23,160 I wanted to just use this as an example to show you if you want to use LLMs on agents in general for log analysis, for investigation or things like that. 356 00:40:23,160 --> 00:40:24,240 This is like a hot topic. 357 00:40:24,240 --> 00:40:31,160 I guess probably we have like hundreds of talks right now and startups and products out there doing this. 358 00:40:31,240 --> 00:40:37,920 But how do you know that when the LLM tells you that it did something, it actually did that? 359 00:40:37,940 --> 00:40:40,780 I'm sure in a lot of cases it didn't do. 360 00:40:40,860 --> 00:40:50,080 So the key is to use Python tool use or let the tool, let the LLM use the interpreter. 361 00:40:50,080 --> 00:40:55,140 So it can actually just like a human, which like, how do you analyze a 10 megabyte log? 362 00:40:55,140 --> 00:40:56,620 Do you just scroll through it? 363 00:40:56,620 --> 00:41:05,140 No, you just like probably use Python or bash scripts or something to just analyze, find patterns, aggregate, do all things. 364 00:41:05,140 --> 00:41:10,380 So without providing that to the LLM, how you expect it to do all these things? 365 00:41:10,400 --> 00:41:19,720 So in my experimentation, the AI agent I created, the only tool I gave the LLM to use was just the interpreter. 366 00:41:19,720 --> 00:41:25,500 Like it's called interpreter in OpenAI API, but it's basically just the Python tool use. 367 00:41:25,500 --> 00:41:37,600 It just spins off like a container in the clouds and uploads the data and let the tool just do whatever it wants for analyzing it. 368 00:41:37,600 --> 00:41:41,460 I uploaded the full investigation into the repo. 369 00:41:41,460 --> 00:41:48,600 So you can see the summary of the investigation and also the entire chain of thought, which is very interesting. 370 00:41:48,740 --> 00:41:50,160 I was looking at that. 371 00:41:50,160 --> 00:41:57,340 I was like, if I want to do this, it takes me hours and I still don't do all these queries. 372 00:41:57,380 --> 00:42:10,600 So it's probably done like 40 or 50 different queries and aggregations with, I guess, pandas or something like that and data frames and analyze the logs and generated the result. 373 00:42:10,600 --> 00:42:22,020 And then the rest of demo, I was showing that based on this analysis, it automatically uses another sub-agent to create these block rules for Finch. 374 00:42:22,020 --> 00:42:29,100 And it just applies the block rule based on the like foundings and using the admin API. 375 00:42:29,100 --> 00:42:36,500 So the case happened to me last year on like the attacker used all my 20 bucks usage. 376 00:42:36,540 --> 00:42:42,820 Can't happen with this agent thing because like it just like subscribe to that stream. 377 00:42:42,900 --> 00:42:48,440 If it finds this stream, it just like this pattern, it just applies a block rule. 378 00:42:49,220 --> 00:42:57,040 So I guess I had a few other demos, so it's useless talking through it. 379 00:42:57,040 --> 00:43:01,160 So I would instead like open the stage to you if you have any questions. 380 00:43:01,160 --> 00:43:12,100 Otherwise, I'm here after the talk and we can like talk about all these things like AI agents, fingerprints, and reverse proxies. 381 00:43:12,100 --> 00:43:13,020 Thank you.