[00:00.000 --> 00:05.740] We have a new speaker today, so please give him a big round of applause. [00:06.280 --> 00:10.520] The guy's name is called Ben Bolland. [00:10.520 --> 00:14.080] He's from England, across the pond. [00:14.360 --> 00:20.540] The talk we're giving today is called, Man in the Malware, Intercepting Adversarial Communications. [00:21.280 --> 00:22.920] So, it's his first time. [00:22.920 --> 00:24.220] Make him feel welcome. [00:24.480 --> 00:25.660] And thanks for coming today, guys. [00:25.660 --> 00:26.380] All right? [00:27.560 --> 00:29.000] There you go. [00:31.280 --> 00:33.040] Thank you, thank you, thank you. [00:35.240 --> 00:36.360] And welcome. [00:36.720 --> 00:40.220] As he mentioned there, yeah, this is my first DEF CON talk. [00:40.220 --> 00:42.240] This is actually the second time I've been in the States. [00:42.240 --> 00:43.620] The first was last week. [00:43.700 --> 00:44.700] I'm loving it. [00:44.700 --> 00:47.260] It's been an incredible event so far. [00:47.440 --> 00:52.380] And before I get started, I just want to say a massive thank you to everybody who's chosen to come to this talk. [00:52.380 --> 00:56.180] I know you've got super busy days, so I appreciate that. [00:57.380 --> 00:59.580] So yeah, without further ado, let's begin. [00:59.580 --> 01:00.880] Let's jump in. [01:01.500 --> 01:02.860] So, quick agenda. [01:02.860 --> 01:05.080] I'm going to start off with an obligatory, who am I? [01:05.080 --> 01:07.600] I'm going to talk about myself, what I do, where I'm from. [01:07.680 --> 01:12.060] And then we're going to make sure we're all have a similar level of understanding. [01:12.060 --> 01:17.080] We've covered the baseline knowledge surrounding info-stealers, malware, command and control. [01:17.360 --> 01:23.660] And we're going to look about different ways malware can achieve command and control and can exfiltrate data. [01:23.660 --> 01:25.960] And we're going to look at Telegram as an example. [01:25.960 --> 01:30.180] And we're going to look at the OPSEC issues this may cause. [01:30.480 --> 01:44.480] And then finally, we're going to finish off with a case study where we intercept some communications from a threat actor and there are some major, major OPSEC failures which lead to some awesome intelligence wins for us. [01:44.780 --> 01:46.260] So yeah, who am I? [01:46.260 --> 01:47.100] I'm Ben. [01:47.100 --> 01:49.300] I go by the online handle PolygonBen. [01:49.300 --> 01:52.540] I'm extremely fortunate to work at Huntress. [01:52.540 --> 01:53.640] I'm an analyst there. [01:53.640 --> 01:55.220] Um, in the UK team. [01:55.580 --> 01:58.480] Um, and I just want to take a chance to, to thank Huntress. [01:58.620 --> 02:01.140] Um, I wouldn't be here if it wasn't for them. [02:01.200 --> 02:02.780] Um, so thanks a lot. [02:02.780 --> 02:04.780] Um, and I love threat hunting. [02:04.780 --> 02:05.840] I love malware analysis. [02:05.840 --> 02:07.500] Um, I'm a big blue teamer. [02:07.660 --> 02:09.980] Um, I've got a blog, a YouTube channel. [02:09.980 --> 02:14.260] I got into security by doing CTFs when I was, um, a bit younger. [02:14.260 --> 02:15.560] But enough about me. [02:15.560 --> 02:17.440] Um, let's get to the interesting part . [02:17.440 --> 02:19.280] Um, so what's ahead, right? [02:19.280 --> 02:21.740] We're going to be looking at real malware, real info-stealers. [02:21.740 --> 02:23.600] I'm going to be doing some live malware analysis. [02:24.060 --> 02:29.640] Um, and we're going to look at this malware and figure, um, some mistakes that the threat actor made. [02:29.640 --> 02:32.220] And we're going to exploit these mistakes for intelligence wins. [02:32.560 --> 02:40.400] And as a result of these intelligence wins, we're going to be able to look at a whole cyber crime operation from the cyber criminal's own hacking machine. [02:40.760 --> 02:41.760] Um, so yeah. [02:41.980 --> 02:42.880] Let's get on with it. [02:42.880 --> 02:43.800] Let's take a step back. [02:43.800 --> 02:45.200] That sounds super exciting. [02:45.320 --> 02:47.980] Um, super interesting, but we need to cover the foundations. [02:48.440 --> 02:54.220] Um, so info-stealers, command and control, threat intelligence, OPSEC or operational security, malware analysis. [02:54.220 --> 02:56.640] We're going to go through the basics to begin with. [02:56.940 --> 02:58.380] Um, so info-stealers. [02:58.380 --> 03:00.760] Info-stealers is just a type of malware. [03:00.760 --> 03:08.080] They're, um, a specific type of malware which will exfiltrate data and steal, uh, credentials and sensitive documents. [03:08.080 --> 03:12.480] And it will send it back to an attacker owned location or an attacker controlled location. [03:12.480 --> 03:14.540] This could be an FTP server. [03:14.580 --> 03:17.220] Um, they could be exfiltrating data over DNS. [03:17.220 --> 03:22.380] There are multiple ways, um, uh, information can be exfiltrated. [03:22.720 --> 03:27.240] Um, and in terms of the malware we're seeing most in the wild, it's info-stealers. [03:27.240 --> 03:32.240] Um, we're particularly seeing a lot of info-stealers getting deployed via click fix and fake capture. [03:32.240 --> 03:45.920] This is the, uh, sort of new malware delivery technique which came around, uh, September last year and it's sort of blown up in prevalence where you just sort of trick a user to pasting a command into run box or Windows PowerShell or something like that. [03:45.920 --> 03:50.720] It's really simple but it's effective and we're seeing a lot of info-stealers get deployed as a result of this. [03:51.180 --> 03:55.460] Um, so command and control, um, all malware will communicate for the most part. [03:55.460 --> 04:02.240] It has to either receive commands from some threat actor and server or it needs to exfiltrate data or send data back to some server. [04:02.240 --> 04:04.540] So malware will typically communicate. [04:04.540 --> 04:14.460] There are some exceptions where there is no malware communi- there's no communication, there's no network traffic but for the most part, malware will communicate and there are multiple ways they can do this. [04:14.540 --> 04:26.040] Um, if we look at command and control, this just command and control describes the techniques by which malware or threat actors can communicate with a victim machine and a threat actor in location. [04:26.520 --> 04:29.200] Um, so how does this communication occur ? [04:29.200 --> 04:37.800] Um, traditionally we saw, uh, malware CTU over regular network protocols like HTTP, HTTPS, DNS, SMTP. [04:37.800 --> 04:44.940] This sort of blends in with regular traffic and you're not seeing let's say a network connection to port 31337 which is super dodgy. [04:44.940 --> 04:49.400] Um, but even this traditional CTU, it's not perfect and it has its issues. [04:49.880 --> 04:54.760] Um, so for example if you did want to do this, a threat actor or cyber criminal would have to buy their own domain. [04:54.760 --> 04:57.560] They would have to set up some hosting in the cloud. [04:57.640 --> 05:00.580] They would configure their CTU server, set up their firewall. [05:00.740 --> 05:04.240] Um, and this takes a lot of effort and there's, um, issues with this. [05:04.240 --> 05:19.620] You have to obviously buy the infrastructure and host that and that may cause OPSEC issues depending on how you're paying for the infrastructure and it's going to get burnt eventually and you're going to have to rebuild this and it's sort of a cycle for these cyber criminals of rebuilding new infrastructure after old ones get burnt, [05:19.620 --> 05:20.660] um, and so on and so forth. [05:20.660 --> 05:22.160] And this is hassle. [05:22.280 --> 05:32.200] Um, so we're seeing a shift in threat actors moving from this sort of traditional method for command and control where you buy your infrastructure and you set it up to using trusted infrastructure. [05:32.200 --> 05:41.940] Um, so living off the land, um, so adversaries use free trusted platforms for command and control and there is a massive variation of platforms you could use. [05:41.940 --> 05:44.380] So, um, we can see up there Telegram. [05:44.380 --> 05:47.740] Um, you can even see CloudFlare, CounterStrike 1.6. [05:47.740 --> 05:50.120] I believe you can proxy C2 communications. [05:50.140 --> 06:06.220] Um, there are loads of different trusted platforms which you can proxy your C2 communications through and instead of, let's say when the malware executes, it, uh, makes a network connection to a newly registered suspicious dot X, Y, Z domain, it would make a network connection to a trusted, [06:06.220 --> 06:15.140] uh, Gmail API domain or Telegram API domain and this is less likely to, uh, raise flags for the network defenders. [06:15.420 --> 06:32.220] Um, so if you are a cyber criminal, you're a threat actor and you want a cheap way to host your command and control which is high availability , it's free, it's quick, it's serverless, it's encrypted , um, it's trusted and it's relatively anonymous. [06:32.220 --> 06:33.520] What would you choose? [06:33.980 --> 06:38.120] Um, for a lot of cyber criminals, the answer to this question is Telegram. [06:38.260 --> 06:49.840] And instead of let's say buying a domain and setting it up, they will create a Telegram account and create a Telegram bot and use the Telegram API to send data and receive commands and so on and so forth. [06:49.840 --> 06:59.240] Um, and there is a massive variation of malware, everything from rats, um, developed by nation states to info stealers, um, which use Telegram as a way to communicate. [06:59.240 --> 07:02.000] Um, however, it comes with its issues. [07:02.000 --> 07:12.480] Um, so in order to actually, um, use C2 over Telegram and to proxy your sort of command and control communications, you need a, a bot. [07:12.480 --> 07:16.600] This is like an automated account and anyone can easily create a bot. [07:16.600 --> 07:28.840] You just need to go on Telegram on your phone or on your computer and message the person bot father and you can just use the commands new bot and it asks for your username and it asks for, um, and then it will give you a bot token. [07:28.840 --> 07:40.920] This is your credential, your API key, your authentication material and you can see there, um, after it generates your token, it gives the message keep your token secure and store it safely. [07:40.920 --> 07:43.700] So this is really important, really important. [07:43.700 --> 07:49.980] If somebody else gets the hand of my bot token, they can control my account basically. [07:50.100 --> 08:02.560] And, um, for malware to communicate with the Telegram API, um, it has to use, it has to be embedded with some sort of API keys and Telegram authentication material for a particular bot account. [08:03.080 --> 08:04.980] Um, so how does this work? [08:04.980 --> 08:11.940] Um, the malware developer will hard code within the malware, sometimes encrypted, sometimes obfuscated the Telegram API key. [08:11.940 --> 08:29.660] And then when the malware is run and it's executed, um, instead of making a network connection to, um, uh, suspicious IP address or a domain name, it will send a DNS request to api.telegram.org and then starts sending HTTP requests to, um, the Telegram API. [08:29.680 --> 08:35.440] Uh, but what API methods would be useful for a threat actor or a cyber criminal who is developing malware? [08:35.460 --> 08:39.580] And particularly if you're interested in developing info-stealers which exfiltrate data. [08:39.840 --> 08:42.820] So first of all, we can use the send message API. [08:42.820 --> 08:43.860] This is really simple. [08:43.860 --> 08:50.940] It allows us to send mess- uh, send a message as a bot to a group chat or a channel or a private DM. [08:51.180 --> 08:53.260] And all it requires is a chat ID. [08:53.260 --> 08:57.840] This is a unique identifier of a chat and it requires some text to send. [08:58.020 --> 09:01.700] Um, so once you've got the chat ID, you can send whatever message. [09:01.700 --> 09:19.960] If you were a malware developer, um, maybe once you've harvested the credentials during the malware's execution and you want to send this to a location, where you would use the send message API, um, and provide the chat ID being the, the cyber criminal's Telegram chat and the text being what you want to exfiltrate, [09:19.960 --> 09:21.480] maybe the stolen credentials. [09:21.740 --> 09:25.020] Um, another important, uh, API method is get me. [09:25.020 --> 09:28.760] This will allow us to validate whether a Telegram bot token is valid. [09:28.760 --> 09:34.100] If it, the, the token still exists, um, and it can also tell us a bit more about the privileges. [09:34.120 --> 09:38.880] Like, can we add this particular bot to a group or can we, um, add it to a chat? [09:38.880 --> 09:39.840] Can we message it? [09:39.840 --> 09:46.760] Um, and sometimes it has extra capabilities like webhooks, um, which we can be made aware of from this get me function. [09:46.760 --> 09:50.820] This can help us enumerate the capabilities of a particular bot account . [09:51.360 --> 09:54.680] Um, oh, that's not working. [09:54.820 --> 09:56.740] Let me, there we go. [09:56.740 --> 10:00.420] And finally, we've got the get updates, uh, method. [10:00.420 --> 10:04.480] This will allow us to, uh, figure out changes which has happened to a bot . [10:04.480 --> 10:08.420] So let's say you've got a bot account and you add it to a new group or a new chat. [10:08.420 --> 10:13.520] When you call the get updates method, it will tell us the ID of the chat it is a member of. [10:13.520 --> 10:18.840] And if there's been any new messages received, um, if there's been any new members , um, so on and so forth. [10:18.840 --> 10:27.720] So we can use this, um, get updates method to enumerate what chats, what groups this particular bot is a part of. [10:27.720 --> 10:33.740] And if this is a cyber criminal's bot, we can see who else this bot is part of, what other chats are it in. [10:33.920 --> 10:35.460] And this is a really useful one. [10:35.460 --> 10:39.140] Um, and we use this mainly just to find those chat IDs. [10:39.140 --> 10:46.240] So for example, um, in the screenshot there, we can see this bot is a member of two particular distinct, uh, group chats. [10:46.600 --> 10:50.840] Um, and what we can then do is forward messages from one group to another. [10:51.280 --> 10:54.380] And we can use the forward message, uh, method to do this. [10:54.520 --> 11:00.460] And we need to provide the two chat IDs, the source chat and the destination chat. [11:00.460 --> 11:04.100] And a chat like a, an ID for a message, a message ID. [11:04.100 --> 11:12.300] Um, we don't know, we don't always know what the message IDs are so we can sort of enumerate through all possible integers and forward all messages across. [11:13.120 --> 11:19.160] Um, so for actor OPSEC failures, um, I talked about OPSEC earlier. [11:19.160 --> 11:24.620] Um, we're going to talk about a big OPSEC failure in a minute but I just want to, um, go over this to begin with. [11:24.620 --> 11:28.640] Um, so operational security, we hear it, uh, in the security community quite a lot. [11:28.640 --> 11:37.720] Maybe we're talking about an individual who is over sharing at a pub or maybe they've got too much on their social media or maybe they use the same password across all their different accounts. [11:37.720 --> 11:41.120] All of these things would constitute poor operational security. [11:41.440 --> 11:50.480] Um, and we often forget, like any individual in this room, cyber criminals and threat actors also have some level of operational security. [11:50.580 --> 11:57.920] Um, and I'm going to go over a few operational security failures that threat actors can make and we see them make quite often. [11:57.920 --> 12:09.140] Um, so for example, like, um, your IT infrastructure or your own network, if you have weak or default credentials or it's vulnerable, um, this would all constitute poor OPSEC. [12:09.320 --> 12:14.560] Um, having open directories, um, containing malware and your toolkit exposed. [12:14.560 --> 12:22.640] Um, often times when we're analyzing malware or we're looking at some execution chain, um, additional payloads will be pulled down from a web server. [12:22.700 --> 12:23.240] Okay? [12:23.240 --> 12:31.900] And when the threat actor sets up this web server, they may accidentally share the whole entire directory rather than the one payload they were, uh, aiming to share. [12:31.900 --> 12:38.580] And this means when we visit this open directory, we can see the whole entire file system and, uh, move through it. [12:38.580 --> 12:48.840] If this was, let's say, on a Linux machine on the home folder, uh, the threat actor may expose their bash history, uh, file which would, uh, leak all the commands the cyber criminal has run. [12:49.220 --> 12:54.160] And then I've highlighted their embedded malware with important API keys and credentials. [12:54.360 --> 12:56.900] Um, I don't really need to explain why this is an OPSEC failure. [12:56.900 --> 13:02.500] If we've got our hands on cyber criminals, um, passwords and credentials, they're doing something wrong. [13:02.880 --> 13:18.900] Um, reusing online handles across campaigns in real life, we see this quite a lot in law enforcement wins, um, whether it's an individual on a cyber crime forum who uses, um, the same online handle that they use, let's say, on Twitter or on some normal clear web forum from years ago. [13:18.900 --> 13:24.400] Um, we sometimes see this used in, um, arrests and takedowns and so on and so forth. [13:24.400 --> 13:26.480] Um, command and control not encrypted. [13:26.480 --> 13:39.340] So, um, if you've got your command and control communications, um, not encrypted as it's being sent through the network, network defenders may be able to look at this and, uh, find interesting information which is being sent or received. [13:39.340 --> 13:41.620] Um, and they could potentially use this in detections. [13:41.660 --> 13:44.540] Um, I'm not going to go through and explain all of these OPSEC failures. [13:44.540 --> 13:46.520] Um, a lot of them are pretty obvious. [13:46.520 --> 13:48.180] Um, I just wanted to highlight these. [13:48.280 --> 13:52.720] Um, so, uh, let me, there we go. [13:52.800 --> 13:53.500] Awesome. [13:53.500 --> 13:56.840] So, yeah, we can exploit these failures for intelligence wins, right? [13:56.840 --> 14:01.940] It's, it's fun to do this and I'm not saying go out there and start pwning threat actor infrastructure, that's illegal. [14:01.980 --> 14:17.060] Um, but what we can do in some cases may fall under sort of OSINT, whether it's like open directories that accidentally leaving their front doors open and sharing all their malware and their interesting files or whether it's them using the same domains and infrastructure across multiple attacks. [14:17.100 --> 14:19.200] Um, these will constitute OPSEC failures. [14:19.240 --> 14:23.480] Um, and we can all use these in the SOC, in the blue team, uh, to help our detections. [14:23.480 --> 14:28.120] Um, I gave an example here which is a, a really, really effective one we use at Huntress. [14:28.260 --> 14:32.560] Um, and that's the threat actors rarely change the host names of their machines. [14:32.560 --> 14:39.220] So, um, let's say they've got a, a, they've spun up a, a VPS somewhere and this is where they're initiating their attacks from. [14:39.220 --> 14:52.000] They may use the same image and share that across, um, uh, multiple intrusions and they use the same sort of, uh, VM image and we see the same host name popping up in the logs across multiple intrusions. [14:52.000 --> 14:55.760] Um, so we know this is a super, super high fidelity indicator of compromise. [14:55.760 --> 15:01.800] If we see this weird desktop unique username, I know for certain it's linked to XYZ threat actor. [15:01.800 --> 15:03.400] Um, and this is an OPSEC failure. [15:03.400 --> 15:06.520] If they changed up every time, we wouldn't be able to use this for detection. [15:06.680 --> 15:11.960] Um, so we're going to actually go on to the technical part now where we're going to be doing some live malware analysis. [15:11.960 --> 15:14.160] Everything I'm going to show is real. [15:14.160 --> 15:19.680] Um, it was found in the wild and I am going to show fake, uh, I'm going to show InfoStealer log data. [15:19.680 --> 15:24.540] Um, however all screenshots, um, and all images shown are of the cyber criminal's own desktop. [15:24.540 --> 15:26.220] No victim data is shown. [15:26.540 --> 15:32.000] Um, so we've got some malware analysis and like a lot of malware, it was delivered via phishing. [15:33.680 --> 15:37.300] And here we've got a DHL phishing campaign. [15:37.300 --> 15:41.780] We can see it's sent from no reply DHL at wind HYM dot site. [15:41.800 --> 15:44.320] Uh, remember this domain, it will come up later. [15:44.620 --> 15:47.540] And we can see everyone in this room would obviously be able to see this is phishing. [15:47.540 --> 15:54.080] There's this weird dot seven, uh, seven Z attachment, um, relating to some sort of shipment arrival. [15:54.080 --> 15:58.940] So, um, as a malware analysis, we'll download this attachment, we'll rip it apart and we'll see what's going on. [15:59.200 --> 16:00.840] So we can do exactly that. [16:00.840 --> 16:05.520] Um, we can unzip it and we can see, um, this doesn't contain, um, some DHL document. [16:05.520 --> 16:07.740] This actually contains a JavaScript file. [16:08.140 --> 16:11.520] And I've trimmed it down a little bit and only included the important parts. [16:11.520 --> 16:19.300] But what we can see is going on is when this JavaScript file is double clicked, uh, a secondary PowerShell script is then downloaded. [16:19.860 --> 16:24.760] Um, and this is written to disk in the temp directory named D D D D D dot PS1. [16:24.760 --> 16:25.840] So this is obviously dodgy. [16:25.840 --> 16:27.260] Um, but what do we do now? [16:27.260 --> 16:30.460] We download this secondary PowerShell script and now we analyze this one. [16:30.660 --> 16:36.900] This one looks a lot smaller, um, but it actually contains a massive chunk of base 64 encoded text. [16:37.520 --> 16:39.620] Uh, so what we can do, we can regex that out. [16:39.620 --> 16:46.060] We can basically just cut open this PowerShell script, regex out the base 64 encoded blob and then decode that. [16:46.260 --> 16:56.660] What this PowerShell script is actually doing is it's just writing an executable X dot EXE to disk and the contents of the executable is the base 64 decoded blob. [16:56.700 --> 17:01.560] Um, so we can manually decode that and run the file command on Linux and say, yeah, look, this is a binary. [17:01.560 --> 17:04.680] This is an executable, which we were expecting to see. [17:04.800 --> 17:08.140] Um, and we can also see this is a dot net binary, a dot net executable. [17:08.140 --> 17:11.600] So, um, this is important and it's useful for me. [17:11.600 --> 17:25.240] I'm not a reverse engineer, but when we come across dot net binaries in the world, we can easily decompile them, uh, maybe using DN spy and get basically the full plain text source code, um , compared to let's say if I was analyzing a C compiled binary , [17:25.240 --> 17:27.880] I may have to open up in Ghidra and I don't know how to do that. [17:28.040 --> 17:30.180] Um, so I can look at the source code. [17:30.180 --> 17:37.960] I can do some analysis of this X dot AXC file, which was written to disk and we can see, yeah, look, this was, um, C sharp compiled dot net. [17:37.960 --> 17:41.540] And we can use the capital to enumerate the capabilities of the binary. [17:41.540 --> 17:45.420] And we can see some signs that maybe some process injection is going on. [17:45.420 --> 17:55.080] We see areas of memory being allocated, um, uh, permissions on memory change, all this stuff sort of hints towards process injection. [17:55.080 --> 18:00.440] Um, but we can see the full source code and we can analyze this and we can validate that this is actually the case. [18:00.440 --> 18:07.700] So this X dot AXC binary, when it is run, it will actually spawn a new process, reg asm dot AXC. [18:07.700 --> 18:09.780] And reg asm dot AXC is legitimate. [18:09.780 --> 18:12.260] This is signed, um, this is native to Windows. [18:12.260 --> 18:14.060] This doesn't raise concerns. [18:14.080 --> 18:17.840] But X dot AXC doesn't just spawn reg asm dot AXC. [18:17.840 --> 18:19.040] It suspends it. [18:19.040 --> 18:20.760] And then it carves its memory out. [18:20.760 --> 18:28.140] And then it dynamically decrypts and injects a final payload into the memory space of reg asm dot AXC. [18:28.140 --> 18:32.820] And then it resumes the process and runs the malicious pay, payload. [18:32.820 --> 18:40.240] Um, so we can dynamically sort of extract this final payload which is the stage 4 and this is what is injected into reg asm. [18:40.240 --> 18:44.220] And we can run strings on this and instantly we get sort of big wins down there. [18:44.220 --> 18:47.540] Keylogger dot AXC, username value, password value. [18:47.540 --> 18:53.280] And then we see some file paths to common chromium, um, browser locations. [18:53.320 --> 18:59.160] Um, so we can look into this a bit deeper and we can actually identify this is a sample of malware called Nova. [18:59.160 --> 19:00.600] Nova Info Stealer. [19:00.600 --> 19:05.100] And this was initially found in December, uh, 2024 by Anyron. [19:05.180 --> 19:10.900] Um, it was a fork of Snake Keylogger, um, which is also dot net based, um, Info Stealer and Keylogger. [19:10.900 --> 19:23.160] Um, Nova has the capability to, uh, take all the stolen information, credentials, files, everything gets gathered and it can either exfiltrate over Telegram, FTP or SMTP. [19:23.320 --> 19:27.260] Um, and you can control this in the configuration when you build Nova Info Stealer. [19:27.660 --> 19:34.360] Um, and as I mentioned, we can view that plain text source code of the dot net binaries, um, using DN spy. [19:34.360 --> 19:38.600] And, um, we can see at the bottom there that there's a Telegram bot token. [19:38.600 --> 19:41.380] And, um, this wasn't encrypted, it wasn't obfuscated. [19:41.380 --> 19:46.540] Obviously there was multiple layers of obfuscation and encryption that we unraveled during the analysis. [19:46.540 --> 19:53.460] But during this final, uh, payload we can see, um, down there the bot token and chat ID. [19:53.460 --> 19:56.340] So this is the cyber criminals bot token. [19:56.340 --> 19:59.040] And the chat where the data will be sent to. [19:59.060 --> 20:00.120] So now what? [20:00.120 --> 20:02.740] We've got the token, we've got the chat ID. [20:02.960 --> 20:06.600] If you recall, there was that forward message API. [20:07.320 --> 20:16.480] And, um, we can use some scripts to help us, um, basically intercept and copy the whole entire Telegram chat. [20:16.480 --> 20:21.920] Um, compromise their, their C2, uh , channel and take a copy of it. [20:22.180 --> 20:28.740] And we can do that using scripts, um, generate, developed by any run or just using the API functions in curl. [20:28.740 --> 20:30.120] That's a hassle, that's fiddly. [20:30.120 --> 20:31.920] Um, any run of develop some awesome scripts. [20:31.920 --> 20:35.000] So we can use the prepare bot scripts to get the chat ID. [20:35.000 --> 20:42.400] What this basically does in the back end is we add the fret actors bot, which we've, uh, got the bot token for. [20:42.400 --> 20:51.840] We add it to our own Telegram chat and then we get that get updates method and that will give us the ID of our Telegram chat with the fret actors bot. [20:51.840 --> 21:03.780] We already have the ID of the fret actors Telegram chat from the malware analysis and then we can start forwarding messages from the Telegram's chat, from the fret actors chat to my chat. [21:03.880 --> 21:11.460] And then as a result of this, over time, as it iterates through all the messages, we'll get a complete copy of the whole C2 channel. [21:12.140 --> 21:17.020] Um, and let me, we can, this is the prepare bot script. [21:17.020 --> 21:22.140] So we will run the prepare bot script, provide the bot token and it will tell us the username of the bot. [21:22.380 --> 21:26.400] Um, and then we add that username to a group. [21:26.920 --> 21:32.400] Um, and then once we've done that, we've now, we'll get given the chat ID of our chat. [21:32.400 --> 21:35.100] And here we can see we're running the forward messages script. [21:35.100 --> 21:40.160] We provide the bot token and we provide the source chat and the destination chat. [21:40.180 --> 21:45.140] And then it will start through iterating through the message IDs and forwarding all the communications. [21:45.460 --> 21:48.660] And, um, this is what it looks like here. [21:48.720 --> 21:51.680] Um, if you scroll down through the chat, you can see screenshots. [21:51.860 --> 21:54.480] Um, there's metadata surrounding the IP addresses. [21:54.480 --> 21:55.860] There's key log files. [21:56.040 --> 21:59.360] Um, and there's thousands and thousands of messages. [21:59.420 --> 22:02.920] And when I was doing this, I was expecting this to be victim data. [22:02.920 --> 22:06.480] We can see there loads of key log files and there's so much to go through. [22:06.480 --> 22:13.160] Um, so we've got hundreds of stolen screenshots and key log files from a threat actor's telegram. [22:13.160 --> 22:14.360] What do we do now? [22:14.440 --> 22:21.720] Um, so I downloaded all of the screenshots and just sort of sorted by time and looked what is the first screenshot which was uploaded. [22:22.120 --> 22:25.960] Um, and this is the first screenshot. [22:26.280 --> 22:32.280] And if we look at this, we can see it looks like they're writing some source code. [22:32.280 --> 22:34.180] Maybe there's some PHP going on there. [22:34.180 --> 22:36.140] But we can see this isn't legitimate source code. [22:36.140 --> 22:41.180] This looks like, um, the back end development of maybe a phishing web page. [22:41.200 --> 22:43.640] So this raises my concern straight away. [22:43.640 --> 22:48.920] And I was thinking, huh, maybe another cyber criminal has accidentally got infected by malware. [22:49.000 --> 22:51.560] So, uh, this infosealer somehow. [22:51.560 --> 22:55.640] Um, but I go through the screenshots and this is the second screenshot I see. [22:56.300 --> 22:59.620] This is the DHL email which we saw earlier. [22:59.620 --> 23:07.400] And we can see it's got the same subject and we can see information relating to the malware we analyzed within the telegrams chat. [23:07.760 --> 23:22.460] So I'm beginning to think to myself now that I've just compromised this threat actors telegram chat and I'm looking through all of what I was expecting to see victim data and I can only see so far screenshots from the cyber criminal's own desktop. [23:22.580 --> 23:40.120] Um, but we can go through again and we can see, look, there's that email using the Nova campaign and eventually we can see on Namecheap the cyber criminal buying the domain windhm.site which was then used in the future to deliver emails that I analyzed and then copied the chat and got this. [23:40.120 --> 23:41.400] It's, it's kind of weird. [23:41.440 --> 23:42.740] Um, but what has happened here? [23:42.740 --> 23:48.780] Why are we seeing screenshots of the threat actors computer when we were expecting to see victim data? [23:48.800 --> 23:57.500] Well, imagine you are a cyber criminal and you, you're doing these mouse spam campaigns and you're buying these domains, you're setting up this infrastructure and a lot of effort goes into this. [23:57.540 --> 24:02.100] And maybe you're sending mass emails to 30,000 people at a time. [24:02.180 --> 24:04.380] Um, you want to make sure your payload works right. [24:04.380 --> 24:12.180] You want to make sure after you've sent this 30,000 people that if they run it, that images and key logs and credentials are going to start being sent to the telegram chat. [24:12.180 --> 24:15.520] So we obviously just tested it locally but not on like a test machine. [24:15.620 --> 24:20.720] He tested it on his own production hacking machine and just compromised his whole operation. [24:20.720 --> 24:22.660] But, uh, we'll carry on going through. [24:22.660 --> 24:30.820] Um, I also had a look at the key log files and I want to, I saw that one domains, like if I pivot on that domain we saw within the key log files, what else can I find? [24:30.820 --> 24:37.840] And then I found an IP address which linked that main and I can also find an email address, Aaron Diskubrick at Hotmail.com. [24:37.840 --> 24:43.100] I'm hoping that's not his real name because I didn't want to dox him but if it is, hey ho. [24:43.100 --> 24:51.940] Um, but, um, and we can go and see more screenshots and this is him logging into his Cloudflare dashboard panel. [24:51.940 --> 24:58.400] And we can see that wind HYM domain or, I'm not sure if we can, but what we can see is additional domains. [24:58.400 --> 25:03.880] So these are other domains the cyber criminals bought, set up for other cyber crime operations. [25:03.880 --> 25:09.520] So it's not just this DHL one, we've now identified all this additional infrastructure and I can go pivot on this. [25:09.520 --> 25:11.560] I can start looking at biocon.com. [25:11.560 --> 25:16.360] I can see this first domain was used for DHL mouse spam, similar to what we saw originally. [25:16.360 --> 25:21.140] The second one looks to be for credential harvesting and so on and so forth. [25:21.140 --> 25:24.560] We can see this cyber criminal is trying all different variations of malware. [25:24.560 --> 25:31.100] He's not just sticking to Info Stealers and getting those logs and selling those, he's also doing phishing campaigns, credential harvesting campaigns. [25:31.120 --> 25:35.800] And it's interesting to see this from the Fratactazome, uh, computer. [25:36.340 --> 25:38.000] As I mentioned, I work in a SOC. [25:38.000 --> 25:39.860] Day in, day out, I deal with cyber attacks. [25:40.260 --> 25:47.240] Um, and when I deal with these, we deal from it from the perspective of our telemetry, our detections. [25:47.360 --> 25:56.400] It's extremely rare we see the adversarial activity from the own, like, initiating workstation, the Fratactazome machine. [25:56.400 --> 25:57.680] So it's pretty interesting. [25:57.680 --> 26:10.500] Um, but we can go through and look at the more domains he owns and link these to other campaigns and start building up a picture of this individual, um, and the activity he gets up to, um, in the cyber crime world. [26:10.500 --> 26:17.560] But so on and so forth, um, we can go through and there's, there's hundreds and hundreds and haven't included all, but we can start getting his root credentials for SSH. [26:17.560 --> 26:20.020] So he's just bought a VPS and set it up. [26:20.040 --> 26:23.920] He's probably going to use this in a few hours to start sending out mass phishing emails. [26:23.920 --> 26:25.400] But look, we've got his root credentials. [26:25.400 --> 26:26.200] We can log in. [26:26.200 --> 26:29.100] Oh, and by the way, uh, I was looking at this two weeks late. [26:29.200 --> 26:33.220] So, um, when I copied the telegram chat, I was looking back retrospectively. [26:33.640 --> 26:36.660] Um, I'm not looking at this in real time. [26:37.020 --> 26:46.620] Um, but so forth, we can go through and see like they're setting up fast panel, um, and we can see like even more credentials being set up and then they're not using a password manager. [26:46.620 --> 26:47.240] Come on. [26:47.240 --> 26:52.760] Um, they've got notepad TXT up with all their plain text credentials right there for me to read. [26:52.820 --> 26:55.500] Um, including the URLs for some when I need it. [26:55.500 --> 26:56.900] Um, so super useful. [26:57.040 --> 26:59.040] Um, and they're configuring DNS. [26:59.040 --> 26:59.820] They're setting it up. [26:59.820 --> 27:01.000] They've got issues. [27:01.000 --> 27:02.680] Here's quite an interesting one. [27:02.680 --> 27:06.140] Um, they're using, it's called mail dime or gamma mail dime. [27:06.140 --> 27:08.360] I can't remember and I can't see it on the screen. [27:08.540 --> 27:11.860] Um, but this is their software they use to send out mass phishing emails. [27:11.860 --> 27:16.780] And I think we can see, um, something like 35,000 emails being sent out at a time . [27:16.780 --> 27:21.220] And we can look at that particular attachment which is like a PO update. [27:21.220 --> 27:23.460] This is a different campaign to the one I analyzed. [27:23.460 --> 27:28.320] Um, but what we can see here is emails being sent out at mass. [27:28.440 --> 27:31.620] Um, and this one I believe is for the biocon domain we saw. [27:31.860 --> 27:35.480] Um, and then we can go again and go through and through. [27:35.480 --> 27:37.120] And I don't want to bore you with all of this. [27:37.140 --> 27:44.260] Um, but we seriously got so much information which we could go to fast panel, name cheap, um, cloud flare, so on and so forth and report this. [27:44.280 --> 27:45.940] And they probably did nothing about it. [27:45.960 --> 27:52.900] Um, so we can see even more credentials and we can see even more, um, sort of VPSs that this threat actor is using. [27:52.900 --> 27:58.480] We can see more email addresses, uh, more usernames, um, and so on and so forth. [27:58.860 --> 28:02.020] Here we see they've got SMTP issues which is lovely to see. [28:02.020 --> 28:03.580] They're doing some troubleshooting. [28:03.680 --> 28:05.600] They're checking if DNS is broken again. [28:06.380 --> 28:14.500] Um, so it's, it, I, I find it interesting to see them troubleshooting and, and doing all this stuff from the, the, uh, the cyber criminals own, own screen. [28:14.520 --> 28:16.700] Um, but yeah, so on and so forth. [28:16.700 --> 28:17.920] We can see DocuSign. [28:17.920 --> 28:22.220] This is, I can imagine, uh, credential harvesting AITM sort of campaigns. [28:22.220 --> 28:23.540] We see this a lot in the wild. [28:23.540 --> 28:26.620] Um, but it's interesting to see the threat actor trying to set it up. [28:26.620 --> 28:28.460] And we often see him testing this locally. [28:28.540 --> 28:35.120] So like sending it to test Gmail accounts to see if, um, they get flagged and also flagged up by spam, um, or not. [28:35.120 --> 28:41.020] And it's interesting to see all which, everything which goes into just like a basic boring sort of phishing campaign. [28:41.160 --> 28:47.900] Um, but like I could go on and on and on with all the credentials and everything we see. [28:47.940 --> 28:59.420] Um, it looked like he was doing some social engineering and some maybe, uh, emailing just people who've replied to his phishing and trying carrying them on and getting information and credit card information. [28:59.420 --> 29:01.600] Um, so it's interesting to see. [29:01.620 --> 29:04.440] Um, but yeah, there's a lot there. [29:04.440 --> 29:06.100] Let's take a, let's take a recap . [29:06.100 --> 29:09.200] So we started off with one email file, one email file. [29:09.600 --> 29:14.920] And from that we saw the email file had an attachment and it was a JavaScript file. [29:14.960 --> 29:21.420] And when that JavaScript file was run, it will download a PowerShell script and the PowerShell script write an executable to disk. [29:21.420 --> 29:32.420] And when the executable, uh, was written to disk and run, it will spawn a new legitimate process, regasm.exe, inject the info sealer code into regasm.exe and then run it. [29:32.480 --> 29:37.540] And then from that point on, uh, data will be exfiltrated over telegram. [29:37.540 --> 29:39.160] And we did that analysis. [29:39.160 --> 29:40.660] We were able to find that bot token. [29:40.660 --> 29:47.840] And from that one bot token, we were able to copy the whole chat and basically reveal a whole entire cybercrime operation. [29:48.220 --> 29:57.120] Um, from one OPSEC mistake, um, which then led on to discover more OPSEC mistakes like storing all your passwords in notepad. [29:57.420 --> 29:59.220] Um, so yeah. [29:59.320 --> 30:01.280] Um, how could you do this at home, right? [30:01.280 --> 30:06.420] If you wanted to go home and look for malware which is communicating over telegram, um, there are multiple ways to do this. [30:06.420 --> 30:13.220] If you've got a VirusTotal enterprise account which has the capability to maybe use the retro hunt or live hunt features, you could use a rule like this. [30:13.220 --> 30:14.120] Um, here's an example. [30:14.120 --> 30:21.580] We're just looking for, um, PowerShell files which have been tagged as malicious by VirusTotal which just communicating with API telegram dot org. [30:21.980 --> 30:41.380] Um, alternatively, you could do some Google dorking and go look for the domain or the string API dot telegram dot org and Google that alongside Joe's sandbox or any run or common other sandboxes, um, or even VirusTotal and you may be able to just by Googling find samples of malware which have, [30:41.380 --> 30:48.960] um, these API keys embedded within them and you can then use these to, uh, intercept communications. [30:49.280 --> 30:56.020] Um, so this is the example, um, this is actually how I identified the sample this talk is based on. [30:56.180 --> 31:04.600] And I was looking for PowerShell scripts and we can see on VirusTotal we didn't need to do all that fancy malware analysis and rip it all apart. [31:04.600 --> 31:08.860] On VirusTotal it gives us that chat ID and that bot token straight away. [31:08.860 --> 31:09.900] So you didn't need to do that. [31:09.900 --> 31:10.980] It's really, really easy. [31:10.980 --> 31:29.160] If I wanted to, I could have gone on VirusTotal, found this sample, gone on the relations tab and the, VirusTotal when it's running its sandbox and it collects its telemetry, it realizes there is a HTTP request made to telegram dot API dot org and then within that is the bot token chat ID which we can use. [31:29.160 --> 31:31.060] Um, so that's how I found this sample. [31:31.060 --> 31:37.780] And then once I found the sample I worked backwards and then I realized actually this came from a JavaScript file which came from an email. [31:38.020 --> 31:42.300] And then after the PowerShell, PowerShell file it, rip X dot AXC. [31:42.300 --> 31:48.080] So that's what I found initially and then after that I built up the whole picture and then intercepted the communications. [31:48.700 --> 31:53.920] So, yeah, to finish up, to conclude, for actors make mistakes, let's exploit them. [31:54.280 --> 31:57.120] Um, being really careful with that first point there. [31:57.160 --> 32:00.960] Um, you have to do, yeah, be careful. [32:00.960 --> 32:08.980] Um, so yeah, intelligence gains like these, uh, from OPSEC failures, uh, the massive, right, we found so much about, about this, this cyber criminal. [32:08.980 --> 32:12.100] We found out all the infrastructure they used to host out their attacks. [32:12.460 --> 32:14.840] Um, so, yeah. [32:14.840 --> 32:19.300] And it's not just this, um, and I did want to note this isn't a novel technique. [32:19.300 --> 32:21.400] This malware wasn't found by me. [32:21.400 --> 32:23.000] This isn't sophisticated or advanced. [32:23.000 --> 32:24.160] This is pretty simple stuff. [32:24.160 --> 32:26.320] This is just two API methods. [32:26.320 --> 32:34.640] Forwarding messages from one telegram to a telegram chat to another and then using the get updates, uh, um, API request just to find the chat ID. [32:34.640 --> 32:39.220] This is simple stuff but in this particular case study there was a really interesting finding. [32:39.240 --> 32:44.520] Um, and this stuff is done in the wild, in the CTI community, in the security industry already. [32:44.560 --> 32:46.600] Um, so it's nothing novel. [32:46.700 --> 32:53.880] Um, but the intelligence wins from this massive and we can use these in our detection enduring teams or for hunting teams. [32:53.980 --> 32:56.340] Um, so I believe that's it from me. [32:56.340 --> 32:57.680] I hope everyone enjoyed this. [32:57.680 --> 32:59.860] Um, I'm open up for questions I believe now. [32:59.860 --> 33:01.980] So, um, thank you.