And I want to introduce, to make the introduction to Amir Alakani and Joey Muniz. So Joey happens to be a DJ as well, too. And Amir has been, gee, he seems like forever. So the last time you were going to, the last time you were invited, apparently you had to take the early flight home to the Philippines because of some things happened and you don't want to know. Okay, so without much ado, Joey Muniz, Amir Alakani. Thanks. Thanks, Ming. All right. How are you guys doing? Sunday. Yeah? All right. First off, I've been a DEF CON forever, and this is actually our fourth time speaking for this event. But I've never brought my daughter. So you can see I have the earmuffs on because we do use foul language at times, but this time we may not. So hopefully, hey. Oh, she can hear us. All right. She can hear us. We'll have to be careful with the language. But there will be an earmuff warning for this particular talk because of that. The other warning is, unfortunately, Amir and I work for big companies, and our HR departments got a hold of our talks before this. And because, hi, YouTube, and the recording of this, we had to cut off a little bit of the video we're going to show. It may be posted later in our blogs, but we want to apologize up front. We got censored by our HR people because we like our jobs, and some stuff we're going to talk about now is not necessarily legal. It's not hypothetically legal, right? This is all in our minds or something like that. We'll be using the term magic land. So when we say something happened in magic land, we're not admitting guilt to what we're going to talk about. Basically, the subject is, if you didn't see it on the talk, it's fishing for fishers, the enterprise strikes back. And the idea is, we're going to talk about fishing, which we've all hopefully have heard of fishing. Even Rialin's heard of fishing. We're going to talk about what you can do from a legal perspective to defend against it, and then we're going to flip to the dark side and talk about, well, what else can you do? How can you actually hack back, which is essentially not really legal. Basically, as we said, it's been four other talks that we've done. You can check out our other talks on YouTube. We've done a ton, but let's first introduce ourselves. Amir? All right. So first of all, I look much better in a suit, so I decided to put that picture up there. My name is Amir Lakhani. I'm actually a researcher, malware reverse engineer, and I do stuff in forensics. I run the Dr. Chaos blog, if any of you guys have heard of that. But yeah, it's me. I'm a hacker. That's kind of what I do, and a whole bunch of other BS, I guess. And then Joey, work for Cisco. I'm an architect. I have the security blogger. Again, on our blogs, either Dr. Chaos and or security blogger. We'll show the rest of this hopefully later. We're just told not to do it right now. Together, we've written three different books in one video class, and then we've also done books independently. Our latest book is investigating. It's basically forensics for a network engineer. And part of that book, we'll talk today about honeypots and how to create one, how to create a cuckoo honeypot. There'll be some details that we're going to leave out because it's just a lot. It's a long subject, but a lot of those answers can be found also in the book. So that's who we are. And let's get into the talk. So, phishing. We've all, I've likely seen phishing. As you probably know, it's not just email. A lot of times, it's email. It could be phone calls. It could be text messages. This is the classic PayPal phish. This one, I actually got over the phone. I don't know if this year, if you guys experienced this in the USA, but I had this spooky robot voice call me saying that I owe the IRS a bunch of money. And then when you call back, basically the scam is that either I can wire them the money now and not go to court, or I'm going to be forced to go to court. But that's a very popular one. And a lot of times, that's the case. The phishing attacks, they're timing it based on certain things. So, at Cisco, I'll tell you now, if you want to phish us, the easiest one is the UPS fake email. Because basically, it's Christmas time. You don't know if your husband or wife got you something. You're like, oh, what is this? And you just click it. So that's typical. The most effective one for us, when we phish ourselves, is the UPS one. Good news, though, is a lot of the vendors that provide email and communication are aware of phishing, and they have this thing called reputation security, where you'll get the flag that says, this email has been seen a bunch of times. It's probably not real. So, at least, like, the vendors themselves are offering something for you, but still, it's not enough. So, the 101 on phishing, and again, we're going to start with what is phishing, go into legal, then illegal. The 101 is first the training. And if you see English, basically, most likely, somebody's using a translator. You're going to find later in our talk, I mean, there's call centers dedicated to doing this in other countries, and they don't understand the native language. They just use translators. I've personally been busted on, like, Russian sites using translators. And they're like, you're not speaking proper Russian. You're using a translator. So, broken language is one. Other things. Other things to look for, public data. This actually goes back to our talk that you didn't show up for, because you had to go to the Philippines, you a-hole. But we were supposed to talk. I did it myself. But long story short, we did a social engineering attack, and it was based on a fake account. And a lot of the data we were using was all based on LinkedIn and Facebook. So, rereading what's already public against you. So, know what's public against you is the second concept. You know, on this one, I just thought I was talking about using information, and I was like, hey, I don't really trust you, remember that? And you're like, hey, you just looked up his common friend and saw that he was in New York, and said, I ran into Matt in New York in, like, two seconds. And the guy's like, oh, cool. You know, Matt, I guess I trust you now. Yeah. The story on that one was, ten years ago, you can see the guy's, like, job history. And ten years ago, it said he worked at Hungry Howie's Pizza. So, then I said, oh, yeah, I was, and we were, by the way, we were a blonde, hot girl named Emily Williams. But I was like, yeah, I was Derek. I was Derek's girlfriend. And you see Derek, current location, New York City. So, I was like, yeah, I ran into Derek in New York City, and we were talking about you. So, again, just the idea is you can look at people's public records or Facebook records, basically read it against them, especially if it's five or ten years old. They're not going to know, like, and remember all their friends of friends type people and just play that role. So, public data is another one. A lot of times when I'm doing this kind of stuff, I want to know what they're doing. I don't know what the intent is. There's always a trick. There's always a scam. So, figuring, I always ask what are they trying to get from you. Is it wiring money? Is it sending you data? The two hackbacks we're going to talk about, one was they wanted a document with sensitive data. The other one was to plant malware on our computer. And we're going to reverse that on them. And that's at the end of the talk. Final thing, don't be afraid to question people. If somebody does start phishing you, ask who are you, how do I know you. It's not really that offensive unless, like, you're a mayor. That, like, does it over and over to you. And you're like, you don't remember me, dude? We've been seeing each other, like, at work every week. You still don't know my name? Like, other than that, that's, like, kind of awkward. Typically, questioning somebody who are you is okay. Phishing, just to be clear on the language, there are two types of phishing. There is the smash and grab, which is basically you don't know the target. You don't care about the target. You're just blasting out a bunch of emails. Where spear phishing and your whaling is more targeted. So, be aware of that. A lot of the phishing is typically not targeted. So, you'll get the fake email that is going to everybody. That particular email, in most cases, you can copy and paste in Google. And you'll find that the same email has been sent and people are complaining about it. So, usually, smash and grab is really easy to find via Google. Where the spear phishing and whaling is not. Because now they're actually going to your Facebook, your LinkedIn, and creating a special present for you. So, again, you know, ground zero. That's what phishing is in spear phishing. Now, in general, I've given a bunch of examples. But these would be basically some technical examples. Beyond just the phishing email, a lot of times you have to know where it's coming from. And this kind of gets down to the security stuff, like DNS security, et cetera. A lot of times with spear phishing, people are going to buy a website that's kind of like yours. Or a source kind of like yours. And that's how they're going to send the information. Because most people don't check that Google has two O's versus zero. Yeah. Yeah, well, you know, we know this example is like pretty stupid, right? It's pretty obvious. That's fine. Most attackers are going to be a little more creative and not make it that obvious. But the other thing I want to point out is you can actually have websites that look exactly like the source site. Because what was happening is attackers were using ASCII characters or other character sets, different language character sets as well. So it actually confused the browser. So you did have something that looked like Google.com exactly like that. Now, luckily, most browsers have fixed, right? I mean, they came up with updates like the CR, I believe all of them did, and kind of fixed that. Yeah. All right. So the defenses. Here's the legal defenses before we get into the illegal. This is your standard blocking stuff. So if you want to know what I can do about phishing 101, the first thing is going to be reputation security. What is that? That is credit scoring where you connect to. So if somebody says they're a bank, they've been online for two hours, they're hosted from GoDaddy. They say they're a U.S. bank. They're really out of, like, North Korea. Obviously, it's not a bank. You drop it. Most security vendors offer this. It's hard to read, but the website Ihaveabadreputation.com. I challenge you all to go back to your company. Go to Ihaveabadreputation.com and see what you see. If you see this, like, Pac-Man ghost guy, that means you don't have reputation security. That means anybody can set up a site right now and send a bunch of crap to you. If you do have reputation security, you'll get a block page. And what that means is it's not 100% foolproof, but what that means is at least people have to, like, have some credibility. So they could hack a church and then attack you. They could be online for a while, but at least there's some credibility. So your first layer, reputation security. DNS security can be doing that or, like, Fortinet, Cisco, other vendors. You can get this with, like, the firewall technology. Second layer will be content filtering, which is basically reducing risky content. Because a lot of times your pornography and those sites will have the pop-ups and stuff. And those can also include ways to basically phish you. File integrity would be analyzing what comes from the sites. And then finally, training. So this is your legal stuff. If I was to consult on phishing, these would be the initial things to talk about. Now, if these fail, then you need breach detection. And that's where Amir wanted to do a little bit on his side since he does a lot on the research side on building honeypots. And some of the research he does. As well as how to catch when somebody compromises your network. So go ahead. All right. So first of all, does anyone use honeypot pots in their networks out here today? Anyone? Raise your hand. All right. We got a few people. Five people. Five people. Yeah. First of all, you might want to turn up the volume when I speak for our earmuffs. No. So for those of you that don't know what a honeypot is, it's basically a fake system that lures an attacker. And the idea for that is to kind of pick up attack techniques. You know, like, we both use that. And I use that, like, personally just in my research because I want to figure out what attackers are doing. What are the techniques they're doing? What are the, kind of, what is the malware that they're hosting? Exactly what are they interested in? Now, there's two types of honeypots. And most of the time, if you Google honeypots, you see some of the more popular software. You see low interaction honeypots. And they're cool. They give you, like, you know, basic shit. Earmuffs, earmuffs. All right. They give you basic stuff like SSH passwords, brute force, basic things. But there's also high interaction honeypots. And for most high interaction honeypots, you're probably going to do a lot of customization yourself. That's how you make the system look really real. And sometimes they are real systems. They're real WordPress sites, you know, elastic search engines. They're real things. And you're just setting up enough defenses to log to figure out what it is. Now, before I even get started, like, I run a lot of honeypots on different VPS providers, different hosting providers, like, all over the world. And you have to kind of be careful, right? Because, like, first of all, I can tell you, I've had my own honeypots, like, compromised. And all of a sudden, you know, I may be researching, like, this new malware that's being spread. And I'm like, crap, I'm the command and control server. Like, my servers. That's not a conversation you want to have with your boss. Right? And your boss is definitely not going to give you a high five and say, was that all the stuff you expensed out? So am I liable for that? So just be careful. So a couple of things. Just my personal best practices is try and find honeypots or VPSs that will give you two public addresses. And the reason I say that is because if you want to run a honeypot that's doing SSH honeypotting or web honeypotting, and you need a management interface, you want two addresses out there. Now, the other big thing that you want to do is you want to run a website. The other big thing is try to do no NAT. Now, this is very, very difficult to achieve with a lot of VPS providers because everyone does NAT. You may even look like you have a public address, but it's being NATed someplace. The reason I say that is because, you know, when you're running, like, you know, 20, 100, 200 honeypots, and they're all coming back into a logging, like, you're logging them all centrally, and they all have the same IP addresses, and you're usually, like, creating them on, like, templates, it gets pretty crappy. You're like, okay, where the hell did this come from? And you're doing a lot more digging than you need to. So just look at that. And then the other thing is don't tell your hosting provider what the hell you're doing because they'll probably cancel your service and just always act dumb. They're like, hey, were you hosting all this illegal software? Like, oh, I don't know. Works out really well most of the time. Anything you want to add to that? Oh, yeah. There's a term in the industry called resume-generating event. Don't just go to YouTube and type in honeypot and get a 13-year-old with acne that says, here's how to do a honeypot. We've had people with that in sandboxes. Basically, our incident response team come out and figure out what actually happened. In a lot of cases, people will basically put a honeypot on the network, and then malware gets on their network through the honeypot. And if you're responsible for the honeypot, that is a resume-generating event. So please don't do that. Now, with all best practices, like, I mean, we're pretty much already standing on the shoulders of giants. I mean, a lot of this is kind of best practice that's been out there. It's been documented. And with our experience as well. But there's a lot of different types of honeypots. And all of these I'm showing are low interaction type of honeypots. But they all run on different ports. Now, I'll tell you, like, a lot of people think, like, okay, well, what do I need to have a honeypot? I need to get, like, this awesome server. No, my servers are basically 2 gigs or a lot of times 1 gig of RAM, 20 gig hard drive. They're pretty shitty boxes. Earmuffs. Oh, okay. I'm supposed to do earmuffs before I cuss, right? Okay. All right. So just, and then you can run multiple honeypots. So, like, these ones that I have on port 80, they're all port 80. So don't run all of them. You can pick one of them. And then you can pick another one and pick another one. So this you can kind of use as a map if you want. And there's a lot of different options out there. There's different things. These are just some of the common ones that I use. Now, other things I do with my honeypots is I actually just set up servers, regular servers, like FTP servers. And sometimes my FTP servers have, like, pretty easy. Easily guessable passwords, you know, like admin and password, just to see what happens. And I just set them up just to see, like, the type of stuff that I'm going to get. And first of all, I will tell you this is the best way to get free porn by far. Just set up an FTP server on the Internet and you're good to go. Now, besides that, the coolest thing that I got was I actually got, like, every episode of Thundercats. And I don't know what happened, but, like, someone actually, yeah, someone just logged into my honeypot. And I remember, and I go, man, I set up an open FTP server and he's telling me, like, you did what? I go, no, no, it's awesome. I got every episode of Thundercats. I don't know what people were doing. And I did realize pretty fast because I was a fan of Thundercats when I was a kid. Man, I had this weird obsession with Chitara, man. I don't know what's happening there. All right. So go ahead and do that. One of the other things that I do with my honeypots, and this is, I've actually discovered zero days with this that I've done responsible disclosures. But I actually have an XP machine that I have fully patched, so 100% patched. And I do this with multiple operating systems as well, Windows 10 and Windows 8. And so these are fully patched. And I'm running non-admin modes. I'm not running as an admin user. And then I have scripts that are just downloading a whole bunch of URLs. I'm getting them from VirusTotal, malware sites, open intelligence sites. Plus just a lot of other stuff. Plus other sources. I'm just downloading, like, you know, hundreds of thousands of URLs through the system. And then what I do is I actually just compare the registry. Like, at the end of each day, has the registry changed? And if I find a change, right, that means that box is probably being compromised in some way. Now, if I'm running a fully patched system, and if I'm, you know, running non-admin, most likely I've found a zero day. And that has happened to me before. So that was kind of cool. Yeah, to be clear on that. That's how a lot of researchers find zero days. You just basically create your honeypot, put the system up there. It's fully patched. If it gets popped, that's what you got there. Let me just finish this up. Well, the other way, like, we find a lot of zero days is just, oh, shit, we found something. This is pretty cool, right? And who's the first one to publish this, right? That's a lot of times that's what happens as well. The last thing that I'll say is that I use PCAPs. I always capture PCAPs. And we'll talk about this a little later on. But the nice thing about this is, sometimes it's just so hard to just capture all this traffic, analyze all this traffic. Yes, with PCAPs I can actually run it against known signatures. I know signatures is an awful word, but at least it gives me at least the type of attacks that are going on. So if I know I'm setting up something in the Ukraine and all of a sudden I see a whole bunch of, you know, VPN filter, like as Cisco Talos discovered, or, you know, some other ransomware, at least I can say, hey, this is happening in this region, or something like that. I can analyze those PCAPs and just get a little flexible later on. Pretty much what I do, I'll let Joey kind of go into more details, but there's a lot of logging tools. One of the easiest ways to set up honeypots is to, like, use Modern Honey Network for low interaction honeypots. They have, like, a built-in logging interface. I use Splunk or Elasticsearch. And, you know, when you have just good files, you know, you set up a little bit of time, you can set up all your nice pretty graphs and make it look really nice and good as well. Yeah. So again, this is all the breach detection stuff. We spent a little extra time on the honeypots. If you want to learn more, check out our forensics book. Snort would be another one. So if your defenses fail, ideally you can have an IPS IDS. Hopefully you'll learn how to snort. But snort, you have to deploy, you have to tap and know where you're looking. If you want to have something where you don't really care where you're looking, then maybe a NetFlow would be another option. There's some security vendors out there that do this. Plixer, Cisco, a few others that do the idea of behavior analysis. Why do I see port scanning? Why do I see weird behavior? So those are your defenses. This is basically the end of the legal stuff. But basically, if we were to say help me with phishing, we would set up the defenses, perimeter defenses. We would then look at breach. So if the perimeters fail, your honeypot or your IPS or your NetFlow tool would alarm. Now, what happens when you want to actually strike back? That's the big question. Well, technically speaking, it's not necessarily legal as well as there's some things to think about. First off, think about what we just talked about. In a lot of cases, the attackers know there's reputation security. So they have to get around that. What are they going to do? They're going to hack a church, a school, something like that. So if you hack back, what are you hacking back at? You're hacking back at a church, school, or something. So don't necessarily see phishing and think, oh, I need to strike back right away. You may be hitting somebody who's basically a victim as well. And that's the first thing that we kind of discovered as we started researching this is we're not necessarily popping attacker's boxes. We're not necessarily hitting people who have been popped that are used as pivot points to attack people. So be aware of that. Second thing is, there are interesting laws which we'll talk about here in a minute. And you need to be aware of what country you're in. If you're traveling, what are the current laws of where you're at when you do this because, again, the laws are really iffy in this area of cyber, not to mention this idea of actually striking back. So everything from this point on, because, again, of legal purposes, hi, YouTube, is all in magic land. So this is hypothetically happened in a dream kind of thing. And we'll show you a video that we pulled out of our dream as well. I'm sure that EFF is going to be wanting to talk to us. You know, first of all, even if you're authorized to hack back, and hopefully me and him are going to do a talk about something that happened interesting where I was authorized by a DA to do hack back. And we did it. And we got the information. And we caught someone that was not a good guy. And he got us caught free because I had to go to the judge and explain what I did. And I was like, well, I hacked him. And don't tell a judge you hacked someone even if you got authorization and a warrant to do that. Mostly we failed because we didn't have a wiretapping warrant that was filled out wrong. So that really sucked. But I will tell you there are laws that are changing and being proposed like the ACDC. Follow the malware tech blog. Great, great Twitter feed. Great site as well. But it's pretty much, you know, no one has really thought about this law and just said, hey, hack back is going to be okay. It's a really, really It's a really shitty law that's out there. A really shitty proposal. It just takes into no account how computer security really works or what's going on. You know, today unfortunately most of the stuff kind of falls under the computer fraud abuse act. And things that shouldn't even fall there. In fact, you know, at this conference and we probably have known people that have been accused of breaking this law. It's not doing, it's being abused like any other law. So right now hacking or hacking back is not a strategy. It's going to get you in more trouble than anything else. I guess unless you're hacking a country that we don't officially authorize as a country. Alright, so again, here's the strategy of most phishers. They try to trick you in some form or fashion. A lot of times it's email or phone call. Their goal is to get you to do something. In a lot of cases it's to install something or it's to have you provide some information. And then once you are duped they do something bad. So our strategy in Magic Land is well what if we flip the script? Which means what if we basically then try to get them to do something and try to get them to basically be duped. So it's like almost reverse duping. The first story will actually be at the end which will be the second story. And the reason why is we weren't recording the first time and then after we made this happen it was kind of awesome. We're like alright let's actually prepare for this and then the second time we'll actually record something. So this is the second story up first. And the idea here is there was a phisher that was trying to get us to fill out some Dell form. So the story is this is Dell security support. I've seen this also with Microsoft security support. They call you and they say your computer is full of malware. And you're like really? Holy shit really? Who are you? It's Microsoft. Well I'm running a Mac. Well yeah that's okay too. It's like what? But it's seriously. So with Dell it's the same thing. Like we're running Macs and it's like yeah we're a contractor and we're just seeing malware so we're supposed to basically come and fix your box. What we found initially when we would just interact and not hack back. And then we would show oh look we're inside your box but that's the bad guys inside your box. Pay us now like an analyst service and we'll fix your computer. So we've had them try to sell us fake services which really you're selling services against them. We've seen it where they just ask for data or they've planted malware. Like install this viewing tool and we can view your box. In the two stories, this story here they try to get us to fill out a document. So the idea is well why don't we trick them and basically plant malware in the document and send it back and then when we open the document we pop their box. So that's the story we're going to tell now. And the other story, the idea was we played stupid and said well hey I'm trying to do what you're doing and this is frustrating me and I've seen the Matrix movie and the Black Hat movie this should be easier. Hey I have this thing called WebEx I can share my screen why don't I share my screen and I'll give you full controls. So then I gave them the WebEx agent but I weaponized the WebEx agent so then I popped their box with the WebEx agent and then I took over their computer. So they had control of my sandbox while I had control of their computer. So those are the two stories. So what we'll do now is we're going to walk you through story one which is the one we recorded which is the Dell story. So the story is basically you have to set up and we're going to walk you through the tools first but you need a sandbox because you want them to actually have something to have access to. In this case we got them to get the agreement letter you need to weaponize it and we're going to talk about different weaponization whether it's droppers or rats or something and then trick them to either open that file, open that program the exact same thing they're doing to us making us install things or click things but just do it to them. So we'll go ahead and we'll walk through this step by step. First part is building a sandbox. Cool and first of all I would say don't Cuckoo is complicated don't go to YouTube and put how do I install Cuckoo because you're probably going to get hacked. Not saying there's not a lot of good guides out there just be careful because a lot of sophisticated redactors will look for things like Cuckoo and of course everyone looks for VM tools no one's stupid enough to put VM tools that's not what all attackers are looking for they'll look at certain DLLs like the SPIE DLL and other things that it's kind of hard to get rid of on these boxes now when we're talking about sandboxes we're not just talking about something that you run and it gives you a report these are like kind of honeypot sandboxes as well so they're full interaction sandboxes that we can stop, we can play we can you know re-image as well I can't tell you how many times that I've seen people put in sandboxes and they've just gone and hacked themselves right I mean they just compromised their entire network so if you don't know what the hell you're doing just buy a professional sandbox right that's easier. One thing I just started playing around with a couple weeks ago and a good friend of mine, I don't know if he's in the audience Fred? Is there a Fred? Is anyone named Fred in the audience? Okay you can be my friend Alright well he told me about this tool called CloneZilla and actually using it it's like super awesome for like just ghosting stuff and putting things in so if you're like a malware author doing any type of malware testing look at CloneZilla it's actually kind of saved my ass a couple of times Yeah actually honestly I had a customer about a year and a half ago that built a sandbox and they were playing with walkie ransomware and they got themselves infected with walkie and when we did the investigation and we had to say well your sandbox is how you got infected resume generating event so again don't be that guy or girl when it comes to weaponization there's two different options in most cases that you can use. One is establishing a full tunnel which means you can interact you can actually pivot from that box and the other is a dropper which to be clear a dropper you don't get full interaction I talk to my dropper give me this information and it comes back so show me LS and a few minutes later I get back what's basically running in that folder kind of thing so in this use case we're looking at rats which means we want full access to the person's computer but no there's different options like empire you can put droppers out there easily and be more stealthy where a rat it's typically more chatty because it's a full tunnel so it depends on what you're looking to do. In our case you're going to find especially our first one was amateur hour there's a lot of things that we could have done better but we did it anyways so again full tunnel or dropper are your two options you're going to find also and the second story that I talk about here is wrapping and wrapping is the idea of actually taking a legit software and then wrapping it with malware true story with the challenge you guys know the packet capture village challenge one of the challenges was finding a hash that hash was my sock book that some a-hole on the internet wrapped with malware and literally we were in our sandbox our sandbox and I found I was just trying to find hashes of malware and I was like holy crap that hash is my book wrapped with malware so you can wrap anything and like here's literally a freeware where I can take a book or take a software or a music file or in this case the Webex installation client and wrap it with a back door so literally you take like a metatributor and metasploit you have that as your rootkit you create your whatever you want in this case your Webex actually I don't know we're being recorded your VPN client or shareware client recorded you wrap that and if somebody runs it boom you're good now the other thing though in this is obviously the antivirus will catch it you do want to do your modification to it your encoding basically to make sure that it doesn't get detected also by the way too if you are going to do this you probably want to have either like trident or peed but you're also going to want to have some kind of file detection piece and actually truly identify what the file is especially when they send stuff to you so in this use case when they send us the Dell file it actually did not have malware but a lot of times a fissure is sending us something usually it does have malware and the way to see it is you put in a sandbox and you first analyze and make sure what it is because it may be a zip file or it may be some other file even though the file type is different so not only should you build a sandbox we highly recommend for you to download some freeware and actually identify what the file is before you start analyzing it alright so some of the things that we started doing just to play around with you know how to get this malware on is we have to figure out that you know we don't want to really you know we both work for security companies we really know a little bit about how to bypass security devices and like everyone will tell you the way you bypass like security signatures and attacks is to use things that are already on the system right use PowerShell use Python, Python is great you can like put a full wrap Excel is just a really easy rat that I came across that works on Mac machines as well and then from there I mean it's pretty much like Metasploit or any of these tools you can write your own rats and your own deployment pretty easily as well and that's most of the time like you know when we're testing things that's what we do there's no signatures on something that I write on the fly right and also you know have a public server ready to go that's hosting stuff I think a lot of times when we came across this research and you'll notice when we talk about the video and exactly what we did is you know when we got the call you know really I walked into the house and my mom's like I don't understand this call it's like someone saying Dell tech support and you know I'm listening to this guy I'm like alright it's Christmas time Christmas has come early right and I'm texting him I go dude some guy's calling me claiming he's Dell tech support right and he's like shit he's like what are we gonna do and I was like dude I already got a Kali box set up in the cloud like we're gonna have some fun with this guy so like be ready to go you wanna talk about encoding more? yeah yeah so as we mentioned in a lot of cases what you don't want to happen is same thing with them if we're gonna hack back we're gonna phish them we don't want to trick them have them install the file and then like their antivirus blocks it like that's a complete fail so make sure you encode basically what we did was we had our system already set up on the fly and then we were just basically trying out the files against the known security vendors and you're never gonna get like 100% like bypass but long as you get like a high enough number in our case like 70% we're like this is good enough this is like a Dell workshop they probably have like a crappy computer anyways so yeah I mean pretty much make sure that you do test it before you send it and then finally there was the location piece you wanna talk to this one? yeah so you know a couple of things that when we started talking about is we started playing around a lot with like macros word macros and if a word macro is actually not sending information back it really doesn't trigger like any AV type you know triggers so you put a macro in just to like basically record the IP address and like save that on like a hidden document or a hidden sheet or you know like start putting in like basic location tracking so it was kinda cool one of the things people always talk about is the attribution but you know when we're writing the local IP address and then like pinging your local gateway and doing a trace route which we can all do in a macro and we'll have a little more detail on our sites on exactly how we accomplished that as well so you can see the code it's just VB code you know we know exactly what the attribution was and I'll describe it a little bit but at the end of the video I mean I saw the guy so I exactly knew exactly where he was from it was a little obvious at least at least I thought it was anything you want to add? alright so let me kind of set up this video just a little bit before we get going as I said you know this really started off with like me walking to my house my mom's like I don't understand what's going on here and I talk to the guy he's like I'm Dell tech support I go cool I have a Mac or you know BSD whatever I mean I fucking don't use a Dell and uh yeah and then you know I'm just talking to him and he's like you know of course he's a contractor and he wants me to get on TeamViewer he's like download TeamViewer and I'm like yeah no way I'm not downloading TeamViewer and he's like trying to scare me he's like well first of all you know you have all this malware going on and he's really putting it on he's like you're going to get arrested because you know you may not know what you're doing but now you're responsible for this malware and you're destroying people's lives and democracy depends on this man like pay me right and I'm like alright what do I do I don't understand and I was getting him really frustrated you know I was uh you know I was uh you know pretending like I didn't know much and he's like alright you know what here's a document and send me this document I'm like it's Christmas man it's beautiful I go you're sending me a document so of course he sends me a document put it in the sandbox I was like I'm so excited at this point I'm just like running this I'm like fuck it I'll re-image my box this is like and that's how I always get infected you know like you know you start off like I was fine I don't need to put in my VM and uh the document was clean it was completely clean right um so um so I did the most basic thing I set up the most basic encoder in MS Venom and why doesn't every AV just freaking catch this you know script kitty stuff right that's all we're doing is I'm setting up a local uh you know a local exploit and uh this is a payload um and uh and the macro that we put in now um you're not gonna put in the payload like visible in the document you'll see that I just have it like in the document here um at the very least just make it white just like make the color of the font white they're not gonna see it but you can put it on a transparent sheet there's uh there's other things you can do as well and yeah you know he's gonna like depending on the version of uh word he has he's gonna get some error out here it doesn't matter I mean as security people we always say like no one's gonna click on a macro everyone clicks on it they click on something even if he clicks end it doesn't matter and that's why I got the the shellcode here anyway so it's gonna bypass a lot of stuff anyways it's gonna run automatically so uh so I save it of course I told him my name he wanted to know my name my name is Eason Hunt so that's what I told him and he's like oh that's good that's good you know that's great uh so uh so of course I'm waiting for him to like open the document I'm waiting and I'm texting Joey he's gonna open it he's gonna open it and uh and of course like it takes him like five minutes to open it and uh finally bingo right I mean I get my reverse shell um back now what's funny is I actually didn't put anything in it so he called me up he's like the document's empty he's like did you not know what you were doing like uh what's going on yeah yeah in fact you can see like I'm like so excited because I'm like what can I do here what can I do here right I mean I even put in the wrong commands here and uh and uh and so uh once he opened up the document I could I could see his uh I could see his desktop running he's still staring at the empty document um I'll be it's going to be there the information is going to like like and this is the actual document that he sent right so you can see that uh that he didn't write it now um at that point like what I ended up doing was uh just like turning on first of all like snapshots like on the webcam so so that way the light wouldn't go on on the on the webcam and um and so just to see how he looked like but at the end I was like F it let's just turn on the webcam right and so this is the part like uh you know we were kind of a little afraid of just because there was a lot of there was a lot of people here it wasn't just one guy I mean it was uh there was like two or three people next to him um there was uh you know there was uh people behind it it was it was a call center type uh type uh thing and so uh that's why I didn't uh put that on there and then I'm talking to him I'm like oh yeah that's a really nice red shirt and uh you know like uh you know your your your turban's a little messed up here uh I'm not gonna tell you what country I think it's attributed from right but uh uh so like he's like what he's like not understanding me and I was like you know at that point I go hey bro so I start talking to him in Hindi right now and I go tell him exactly I go you know I go yeah this is really nice and these are the files oh you got he had WeChat he had AIM I think we have a picture we have a picture of his desktop we took uh but we he had we oh yeah uh so yeah yeah yeah but uh but you know every chat message uh like uh like uh known to the world so the video that I actually had um that hopefully we'll be able to put up is basically him running towards the camera and pulling it out before it freezes uh so uh so uh that was uh that was awesome and of course this is all hypothetical I'm pretty sure a wink is a defensible uh you know plea I hope so so yeah again we can't we couldn't show because the language on the desktop and uh the country of origin all this stuff our HR department's like don't show it but we hope to show it because again it's magic land but we hope to show this dream scenario that really didn't happen or did happen on our blogs at some point in the near future that's scenario two scenario one was the other one just to mention so this one we didn't have a recording this is like when we started actually first hacking back but this was my scenario where again I had somebody call me they were trying to tell me that I have malware on my computer so they're trying to walk me through commands to install stuff so all I was doing was acting really slow and saying I don't get it or I'm fat fingering it like and just kept saying I don't get it and that's what I offered well I have this shareware software made by uh I guess I can't use the word WebEx WebEx um and basically said I can share my screen and I can let you interact so I'll give you full control and you can do it for me and I can hear in his voice the excitement because he thinks he's won he's like I'm gonna full control this guy's computer this is awesome so I'm like sure just run this app so I'm I send him a link exact same trick he just did to me but I basically weaponized my WebEx and popped his box that way and same thing we started interacting with his computer and uh turned on his camera I basically just screwed with his computer to the point where his computer started acting funny then he got freaked out and then killed the connection so again same idea so the whole point of this here to summarize what we did is really if you think about it phishing in general is the idea of tricking people they're trying to trick you they're trying to make you do something uh we talked about today first the the legal defenses so hopefully again I have a badreputation.com try that website out think about reputation security think about content filtering firewalls that kind of stuff and then have breach if you don't have breach you're an idiot because how do you know if those defenses are working or not if you're not validating those you don't know if something's getting through we talked about honeypots today which you can learn more on our book we talked about uh IPS and NetFlow as legitimate tools but if you do want to hack back we did talk about how to build a sandbox you want to do this obviously on the net we talked about some of the legalities of it we talked about if you do hack back I mean we got lucky in these two cases some of the other cases when we do actually pop a box we find we're in a school or a church or some other system meaning it's a pivot point so you don't necessarily are gonna like hack back and always get the bad guy or girl you may get some some pivot points but if you do lucky enough like we got where you're actually talking to the person on the phone in a lot of cases now you're actually talking to the victim or the attacker so they can become a victim which basically is what we talked about which is think about tricking them using the exact same tactics you can use rats you can use droppers however you want to do it there's many ways of doing it we showed too and then the idea is if you do you know get them back post it somewhere and uh embarrass them because hopefully they'll stop doing it yeah the one thing I would like to add is once if this ever happens to you and you start laughing uncontrollably at them hit the mute button because it does make them a little suspicious but uh laughing you can also just tell them you were crying because you're so scared or something like that that'll work too laughing so again we do appreciate it we hope to publish more information about this as we continue to do this in magic land uh and if you guys end up doing some of this as well uh again I'm Joseph Muniz this is the mayor reach out let us know we'd like to hear about your uh fishing back or attack back adventures thanks for your time enjoy the rest of the talk applause applause music