This is hacking.net applications, the black arts. I'm going to be attacking .net applications developed by Microsoft protected with third-party applications. These are applications that people don't want you to have their source code. They don't want you to do malicious things. This is why we're all here, to fuck them up, right? Good. Then you're in the right talk because that's all this is going to be. Unfortunately, I have developed some good things, but that's not what goes into a hacker con. Everything I'm going to be showing you is specifically malicious. I'm digitalbodyguard.com, and let's fuck some shit up. There you go. So, no matter whether you're just a hacker or you're an attacker, you're not going to be attacked. These are some of the nice tools that you're going to want. You don't have to be highly skilled and have all sorts of IDA and machine code. This speech is targeted towards the average developer that wants to mess applications up. They want to look inside of it and do critically bad things to other people's applications. I'm going to talk about how to attack .net applications. Tools and methodologies for attacking. Overcoming secure .net applications. .net applications. Overcoming secure .net applications. Overcoming secure .net applications. Building keys, cracks, malware, and reverse engineering for protection. Whether you're a company or a hacker, this applies to you. And I'm going to fuck some shit up. Okay. Cracking and attacking. I'm going at it in memory and on disk. Attacking on disk, you gain access. You decompile. You infect the logic, drop some shims in there to get you in. You hook the logic and test. You get to your life cycle. Attack in memory. Inject into the target application. Navigate the structure, edit and control the structure. Whether you're attacking in memory or on disk, the same conceptual paradigm applies. Do your reconnaissance. Understand what technology it's using, what you think that their mechanisms for hardening the application would be. And do a little bit of reconnaissance into the company. Find out what other products they use. Find the use and what other products they sell. Maybe they have a product that they don't particularly harden, go look at that and they probably use the source code over again. Reconnaissance is nice. Gain access to your target. Whether that's getting access to the executables or getting past any of their security methods, you want to gain access. You want to find the weak spots. The spots that let you get in and affect it and the security is weak or the checking is weak, but you want to get in where it's easy. You don't want to blow a bunch of time, right? And you want to control what you need. You don't want to drop a lot of stuff in there that's going to bloat it. You're in someone else's application. Be clean and efficient. So attacking in memory at run time. This is Grey Dragon, a tool that I'm dropping. Free, of course. Just another one. So this is another injector that gets you in there, developed mainly out of .NET, but it's targeted specifically against .NET. This is going to take care of a lot of the threading issues and get you into .NET, which a lot of the other injectors aren't targeted at .NET, this specifically is. You inject into a process. It spins up a C++ bootstrap DLL that spins up a .NET bootstrap DLL. This takes care of the threading and all of the issues that you would find if you injected into someone else's application and started doing shit. This helps it be more stable with less work on your part. And then it puts you in the application. That's where you drop in your payload. I also developed a few other mechanisms real quick. I'll cover that. I did a USB keyboard that types in. It goes into PowerShell, does a whole bunch of keystrokes, and then it drops Grey Dragon into your target and into the process. Straight from keyboard. So I'm going to touch and you're not going to have a lot of forensics footprint. It's really nice because you're going into memory, straight from keyboard, you're not touching disk and it's going to be real clean. Also, I did a Metasploit payload last year. Same exact idea. Metasploit gets you in. I'm a little bit demo heavy, so I hope you enjoy demos. This is Grey Dragon and Grey Wolf. Grey Wolf is a nice decompiler. You can drag any executable and it will get you your basic things, right? This is a program that destroys files on your hard drive. I'm going to cover injection first, but this is something that's going to be very important later on. Gray dragon gets you inside of your target. This is the oh. The target is running its admin. So instead of being able to inject from user land, I have to elevate it to admin in order to inject into my target, of course. So I'm not really doing exploitation. I'm more taking advantage that once you own the box, you can mess up any application however you see fit. Then use it on that box or use it on other people's boxes for practical reasons. Okay. So I drop into my target and here is the .NET payload that I talked about earlier. This takes any .NET executable and just runs void main on it. So this is an executable that has a void main. I will select the payload. And we have a payload inside of our target. This is old talks if you've been to my speeches before. This is going to be very, very nice later on. I can come down to this unlock button and I have went in, I have edited the events that this button fires. When you right click on it, it fires something new. It says what functions do you fire and here's the functions that that button fires. This is heavily obfuscated. So this would take you hours to dig through to get to this class and this function. This is what that button fires. And that's the unlock button. So you know that unlock button is pretty close to the registration check, right? So when you want to crack the registration check, instead of digging for hours through obfuscation, this gets you straight to it and it'll cut your time way down. So that'll be very important much later. And okay. So I really like diagrams and pretty things. I think it makes shit easier. When you are on disk and you run an executable, it spins up a bunch of valid DLLs. They all go through the security systems of Microsoft and .NET. This all becomes a process. All the security systems have already completed. You inject in and it drops in your attack. This is where you get your hacks, cracks, malware, and back doors. This is really nice, because I'm going to talk about security systems later and they've all finished. At this point you are injecting after – I've seen two security systems used by Microsoft and a lot of other software companies have used this. The ones that two companies that can do anything against this. Every security system I'm going to talk about for the rest of this you can basically add and injecting in memory gets right past it. So I kind of went app happy and I developed a whole bunch of payloads and supporting applications and just put out a lot of research and a lot of applications to support you in this endeavor and wanting to see how I did what I did. So attacking applications, you gain full access, you reverse engineer as much as possible, you attack it in memory and take out whatever security might be there and then you control the program. Injection. Why should I use it? How does it impact me? Fuck, don't be a prick. Just accept it and it works. It's gonna get you in. It's gonna wrap all of your threading. It's gonna inject you in. project, and it's all free. These are all tools that I'm encouraging you to use. I'm not going to be charging, I'm not going to be selling these applications to a company that they can tell you you can't use it. I'm developing this for hackers. So here's two applications. I'm going to show injecting into them, and then I'm going to show injecting the same payload into both applications. And this is interesting, because .NET gives you a lot of power for a little bit of code. And I'm going to show you how that power can affect applications in a slightly new way. Okay. This application is basically a low end back up piece of software. It takes a password and if you don't put in the right password, it's not going to give you access. This applies to major back up software, but I thought I would not punch any company specifically and I would just go after some small time companies. I mean, they're good software, but they're not a Norton ghost. So here's our payload inside of our target. We drop it in, load it, and here it is. This payload iterates through the application, finds the hash code of the password, and populates it. And this crack starts brute forcing that password using the logic of our target. I've reached inside the application, got the hash of the password, and started a brute forcer. Here's another piece of software that's similar to the first. Slightly different, of course. We'll inject into it again. Grey dragon searches because I still have a little more work to do so it brute forces. It finds it. It's 64 bit. It's going to drop in a 64 bit payload. And there we are. We're inside of the next application. Take the same payload, drop it in. So we have essentially the same payload. Of course, it's a different hash. I'll start cracking it. I had the same exact payload cracking both of them. It's not hard to write it for other applications. You can even write an adaptive one. So these two applications. This one was processing at 10,000 checks per second. This one is much slower. It finds the password. This is your plain text that it's testing. It then takes this and drops it into your target application because I thought that would just be pretty. It auto types it in. There it is. It's cracked. I've gotten the password. I've got the password. I've got the password. I've got the password. I've got the password. I know what it is and I have access. This one's still crunching away because this one has a much more processor intensive check mechanism. And the same thing. It finds the password and types it into our target. And again, gets us in. I have access to the encrypted material. A brute forcer that can be adapted quickly and easily by an average level programmer. That's the target. And that's the power. . A little bit of cleanup from the demo. All right. A lot of this injection I covered last year. Injecting at runtime has a lot more power than attacking on disk, but it's much easier. You don't have to worry about security methods. You can catch my talks. Hacking.net applications a runtime attack. From DEF CON I presented to Arsenal at Black Hat last year. And I got a lot of I have them up on my website and this will walk you in depth through attacking in memory. Pretty much the same talk now but an entire length on just attacking in memory. So attacking in memory and on disk. This is the other distinct half. Attacking on disk doesn't quite have as much power as attacking in memory but it is much more permanent and effective but requires a little more skill and finesse. Gray wolf is a decompiler I wrote specifically for attacking .NET applications. Not a decompiler that gets you access to the source code but a decompiler for attacking. These are including the mechanisms that I normally use over and over and over again. This is by no means complete. It was an internal tool that the best decompiler that was on the market was free, a company bought it. Said they would keep it free forever. They then started charging at phones home. You need to give them your credit card. And I no longer pimp their products. So I released my internal tool. And it's free. It gets you access into other people's applications and brings along a lot of the things you're going to need to attack on a daily basis. Gray wolf iterates applications of the .NET ilk specifically. And that's its sole purpose. You drag and drop an executable or a DLL. This is decompiling. .NET gives you source code. It is an intermediate language as long as it's unprotected, you're perfectly fine. You're going to see proper classes, name spaces, you're going to click on a function and see source code. Pretty much what the original developer wrote. This is very, very effective for making cracks. When you're trying to black box test something and you have the source code. As well as the ability to quickly manipulate it. That's what this is specifically for. And we'll do stuff like if it's an obfuscated or unobfuscated application, you might want to find main. So I wrote a find main button. It simply moves you down. And this is main. People can change the name of main and it can be hard to find. And here's their main. And then you can start seeing if they put any protection. And you can do stuff like change whether something is public or private and all that. I haven't completed everything you need like changing public and private for the classes but it's on the functions because I had a project where I needed to change the public and private on a function. So as I either receive people that want to support it with monetary funds or I need it, I add features. And then you get free features. That's Grey Wolf. So attacking on disk. You connect in and you access. You decompile it and get the code and base technology of your target. You infect it and change your target's code to accomplish whatever goal you might want. You exploit whatever logical vulnerabilities or technological vulnerabilities that might be there. And then remold your application and deploy. That is pretty much as simply as I stated it. That's about as simply as it's done that you'll see later on. The weak spots that you're going to go after in an application. You want to flip a check. You want to set a value to true. You want to cut the logic. You want to turn true. You want to access a value. Set a value to true. Registered equals false. Grey Wolf registers equals true. A check A equals B. Password validation. A equals B becomes A not equals B. Only invalid. Passwords will succeed. You can see how you might want to do that one. And it's about six clicks. Registered equals true on this function. You simply insert or return true at the top, negating any logic that might be in that function. Is valid key returns true regardless of what you pass in. SQL cleaning, cutting the logic, very scary. Imagine how many applications. Have only one function because that's what good developers do, right? And it just returns the original string. It's been cleaned and sends it up to the server. Who would not actually take advantage of that? Valid password accessing a value is much stronger than you might think. When you have access to the internal variables of your target, you can do awful things like show the value you're comparing against instead of just subverting that check, you show it. Or put it in the clipboard, save it out to disk, whatever you want. You can just iterate the whole program and show every variable. This is much stronger than I had anticipated. Registration checks. We want to make keygens, right? That's a question. Clap, clap, clap. There you go. Okay. So keygens and cracks. This is, from my experience, the top mechanisms that they use. They'll make a public and private key, they'll sign a XML and they'll push it down to your machine. Inside the application, it'll decrypt it and execute it. This is subverted by changing the key. You simply change the public key and it's yours. This is all of these things are from six clicks to five or ten minutes. They're pretty easy on unprotected applications. The next one is a little weird, but I see it so often. You take your name and the registration code, you do a little bit of math and you compare it to a known value. You ask it what the known value is and that's your keygen. That's it. Calling the server, you hack the call. You just mess it up. Whatever they're calling, whether it's a UDP packet or TCP connection, you just mess it up. Demo equals true. It could be false and it might. Complex math. Okay. Math, this is my favorite because it's like a Rubik's cube that someone meant you never to solve. You sit there and you chop it up and you break it with complex math. It's always fun. And 1% of the time, they'll actually ship the key generation with the product. I'm sure it made sense to someone to put the key generation inside of the application and ship that to you. You simply go there, you fire it up, you put in what you want and you get the key generation and you don't even have to write anything. And it's a little more than ‑‑ it's 1% of the time, plus or minus. So public private keys. Like I said, if you can beat them, why join them? You have some complex math that you would have to do to break it or you just set it to an easy key that you have. And then you ship the product and you can turn out as many keygens as you want because you own the key. Server call. It points to whatever you want. The system ID you put in some easy value to manage. You simply give them whatever would solve it and that's it. Registration code replay attack. This is just fun. You have a name that you pass into a function. It returns whatever that function would do to that name. It then compares this to your registration code. If these two match, if they don't, you're not registered. Like I said, replay attack. You take the value. And then you play the game again. Of course, some people add more things where it seeds with registration code or something complex math. And it, of course, works. Complex math, my favorite. You chop up the math into its individual sections and then you attack each one of them individually. I like to start from the weak ones, start going to the strong. And for dev purposes, I recommend that you put a brute forcer on each section that you haven't completed. And so as you beat the weakest one, the rest of them are brute forced and you can validate as you go through until you've removed all of the brute forcing and you have a pure key gen. We would like to see that, right? Well, as some company might be mad if I showed how they did their registration check, here is a white boxed application. Drag and drop it. You get access to the source code. And at home, at your leisure, you can look and see how this is done. So it takes your user name and your key and doesn't work. Of course, there's a key gen and it works, all of that. So you pop open the application that you want to key gen. You target into what that button does that I showed you earlier, which happens to be key check. Key check, because a lot of people use good naming, right? So a lot of them will put something like this is version 12 of our enterprise application and they'll tag that at the front of the key. They'll then do a whole bunch of string manipulation. I'm just walking you through because I would have liked to know what a common key validation sequence looks like. So I figure you would, right? When it gets to the complex math, okay. One half is IL. The other is source code. So it gets to complex math and it starts doing bizarre stuff like taking powers and then modding it. This is pretty common. This is a lot of the complex math that you're going to see. And oddly enough, a lot of the complex math is kind of similar. That they will go out and see how someone else did it or they will look at an old and they will reuse that same paradigm. So you could look at how I did the key generator and see how I overcame each key. And there are some types of complex math that are very hard to overcome. And I put in a brute forcer that brute forced just two digits out of the long key. The rest of it I overcame with complex math. You can see how I did it. Play it at your leisure. And for dead purposes, it is very nice to see a completed key gen and key easy to find. Not obfuscated. Not going to spend a lot of time hacking through bullshit. Okay. So the best key logger. I decided that I wanted to hurt this application for this speech. This is a bad piece of software that you should never use on something you like. It's pretty much malware pretending to be a valid application. So I'm going to fuck it up. Okay. So this application. It's a key logger. It sits on your system and it says you pay me $50 and I'll be a key logger for you. It has a password. You type in the wrong password and it doesn't let you in. When you take this key logger and you drag and drop it into gray wolf, going to overcome that real quick. So inside of gray wolf. We'll tunnel down through the, this is the core executable. These are all of the supporting DLLs that you might want to go into. And of course you can pull up all of their source code just as easily. But we are going to target the core executable tunnel into that. So here's the top name space. I have a piece of paper since my computer is being used right now. And there we are. So classes and unlock. Here we are. The password validation sequence. We'll open this up. I designed this tool specifically for demos in mind. So I could zoom up the code for you. Okay. So if you read .NET, it's pretty easy to see how you might get past this, right? It takes the value you enter. It takes the known value and it directly compares them. This is comparing plain text against what you typed in. This is the worst type of check that you could possibly conceive of other than return true at the top. We have some Dropbox users, huh? Okay. So like I said, this is attacking. We're going to insert into this application and we'll turn off the C-sharp. Okay. So this is IL. I'm going to pop off getting the value that you enter. This is the value that you type in. I insert some no ops. It's pretty easy to know what no ops do, right? This just opens up some room. So we have our value that we got out of the application on our stack. We'll call a function system windows forms message box show. That's going to do it. That's the call sequence. We put call down here. We target what we want to put in there. And now we've done a call. We're going to call to show that password out to the screen. So when I said get a value, that's it. It then returns something onto the stack. We pop that off. We then have a comparison operation that was done before. We'll destroy that and we're going to push true onto the stack because it would be nice that that comparison was still there. This is push one onto the stack. An easy to read lookup. And that pushes one onto our stack. Here's our C-sharp code. You're going to clap when you read this. Message box show password true. That's it. We then come up here. Save it out. An executable with an easy different tag name. It's saved out. It's on disk. Open it up. Type in true. Jibberish. This is the password. Win. Like I said, I'm going to fuck this application up. So here's the next demo. We're going to attack the key generation on it. So we open up gray wolf again. This edited copy that I don't want to type the password into. We're going to take this. Crack its key. So... Drag and drop it. And this compiles a good version of it. All that. So that took what? Probably might take you a minute to do. And now I'm going to crack the key. That is... I'm using paper like this. Like a luddite. Okay. System. Fuck this. System class is core. Core. Okay. Okay, key check pass, system core, constructor, okay. So here is exactly what you're looking for inside of your target. I went and did my reconnaissance, I now know what the key validation sequence is. This is a string that I did before this, I'm going to take this string, come in here, here's our target, I'll go through the IL, and here's our target. Replace it. Here's our C sharp code. So that little change is the rekeying sequence. That's it. There's no going through and doing something complex. This is a very weak key validation. It uses a have you been signed with the public private key that I talked about earlier, and if so, then I'm going to decode it and implement it. So here's our target, opening up, type in random. It's a little fast, and that's the power of this. This is now keyed to I'm alive. Ta-da. And it's validated. I mean, that seems a little simple, right? Like I replaced one string. And that's kind of the power. Like I can say in six clicks you can rekey an application. You don't have to know IDA pro and be hardcore. You have a validated full, it looks legit, like there's something hardcore going on, and it's at one string. This takes a couple of minutes to read through their code, see how their key validation is done. Oh, I have to replace that. I want to use whatever complex algorithm. I'm not going to disclose it, but when you read through their code, it's pretty easy to make that random string that I threw in there. So they do have something weird going on where they do crazy obfuscation, where they literally do crazy obfuscation, I'll talk about that, and they have taken bad coding practices and just started shoving code inside and ripping code off of other people. And so they lie to you about they're doing this, that, and there's a lot of just bizarre shit going on, literally crazy. So one of their classes, when you type in keys, it's encrypted. It uses a hard coded key, combines this with your password, it then does AES. And there's another one where when it writes out, it uses triple DES, a bunch of hard crypto. However, in some of it... Like the triple DES, it only uses a hard coded key, it uses zeroed vectors, and it stores your password in the plane. So it might be easy to decode, right? I was like, oh, I can do that in an hour for the conference. So a couple of days ago, me and some friends started coding it up. And here it is. Here's the decrypter. And I'm not going to give it to you because they're literally crazy. Instead of using any of that crypto I talked about. They simply used something obscure like ASCII to encrypt it. And then saved it out to a file. They have all of this hard crypto, and then they don't use it. So I spent a couple of hours for this to develop that application that I showed you, and then they don't encrypt it. So I mean, good obfuscation. Like that threw me for a loop. That wasted a lot of my time for no good reason. So, Grey Wolf. I want to talk about the power of being able to look through an application. So Grey Wolf has a key inside of itself. When you dig into Grey Wolf, you go find main. A lot of old applications from the C++ days do their key checking call in void main, and then they put the key checking algorithm right next to void main. And then there's the key checking. So, something that's nice about Grey Wolf is it's free. And it has key validation. I've showed you how to jump straight to that. Inside of Grey Wolf Pro, I've packed all of the source code that you're going to need for Grey Wolf itself. I'm running a little short. We're going to skip that. Okay. So IL. It's kind of the code of the matrix. It's kind of the code of the matrix. You're looking at C sharp, you're looking at VB.net. It's actually IL. Also, if you're looking at obfuscation, you're looking at IL. It's kind of a new version of assembly code. There's pushes, pops, and all of that. It's definitely worth learning if you're serious about attacking applications. If you're not serious, you can just get your Wikipedia page, put it up next to the application, and just do it one line at a time, and it will take you a few lines. So you don't actually need to know it. So this is the midpoint, Q&A and all of that. So I'm trying to include a little bit more audience participation. If you have a burning question and you think it's highly applicable, you're welcome to raise your hand. No? Okay. So it can't be that easy, right? We all know that computers are secure and Microsoft has done all of their work to stop us. We use secure dongles. We phone home and do registrations. We do looking for updates and DB calls and Twitter, whatever, and we have crypto objects on our secure application. These are all nice targets because programmers segregate their code nicely. When you do an upgrade call to the server, just like that key gen server call hack, you simply say, why don't you come to my server and use my key to pull the new payload to update and then install the new malware that I want to ship to you. You want to leak new data that when your application phones home, you're going to send a little bit of exfiltration data and add your back doors. That secure USB dongle, a lot of them use return true, which is really scary when you're showing an executive, here you go, here's your $30,000 dongle, and crypto, chop it off, replace it with your own, whatever you want. So security by obscurity. This is what every single person wants. Every single person that has heard the Microsoft, this is how we're going to protect you will say. There's code obfuscation. There's logic obfuscation or crazy obfuscation. There's unmanaged calls that Microsoft uses a lot of the time. There's shells, packers, all of these things. This all shuts down decompilation or slows it down to a lesser extent. Obfuscation. This is what it looks like. Instead of using a proper name, they just put something that's hard to read. Instead of returning true or false or checking some variable, they do something a little bizarre. That's obfuscation. And they'll say, well, doesn't obfuscation stop you from getting source code? It's like, yeah, but I mean, that's source code. I mean, that's not harder. I mean, it's going to take me five or ten lines and it's going to take me an hour instead of five minutes. Sure, it slows me down. This is obfuscation. You can find your target, but it might take a little bit of time. There might be 12 other ninjas. It's a little bit harder. You might be a little worried about something that you missed, but that's it. There is security by security. There's signed crypto code that Microsoft has put on your applications that can verify the creator, strong names, blah, blah, blah. This shuts down tampering. This is a strong name. This is what it's constructed out of if you actually don't know this stuff and you want to. Private key signing, 1024 crypto. This is impossible to break. It guarantees you that your author is the only person that has made the modifications to the blah, blah, blah. Protection on disk. Shells, packers, your secure application. You can't get to it because it's secure. It's not going to decompile. There's a C++ that runs crypto that then unpacks it in memory and they'll tell you how this is impossible to break. It would take the CIA a million years. And here it is. . Gray wolf spins up and here's that application that I brute forced earlier. We're going to drag it in here and it works. It shut down gray wolf. It did not decompile. It's like, I don't know, it's packed with something. It's encrypted. So that same thing, okay. And so gray dragon, I really like it. I hope you like it. Let me know on the internet if you do. It scans through all of the processes, identifies the target, puts it up here and it says, okay, 64 bit, drops us in. Oh, wrong one. Okay. Inject into the target. And as you can see, it found a new process. It's .net. I can inject into that. Okay. So back to injecting. Our payload's inside of our hard target, right? Like, you're inside of your target. And it's .net. But you don't have access to the source code. And we'll spin it up. We have access to our I did inject into the right application, right? Okay. I'll step back and run that one one more time. Just because it's really nice. Okay. So we have our payload. We inject into our target. Drop a target. Okay. Get our shim. Drop our payload. This edits the structure. Inside of every single payload, I've put a back door that talks over a named pipe. So that payload that I dropped in, it now reports into another application that says, why don't you run another payload? Because you can keep injecting multiple things. If you saw my talks or you look it up, you can shove as many applications together as you want. Just keep shoving applications together. And they'll mix and they'll be in the same memory space. So here's another payload. We have access to all of the objects in memory. And this iterates all of the source code. Here's the source code. This is all in IL. It's highly obfuscated. But as you saw, it was protected before. That would have shut down every single decompiler on the market. But now I'm getting their IL out of memory. Because like I said before, all of the protection falls away. This gets you straight into your target no matter how they I mean, they can move it down into C++. And they can put it in assembly. If they left it in .NET, you have their source code. Period. Always. They'll play some games. They'll try and move it. But you can always hunt them down. They can't hide from you. As long as you put it into memory and it's touched by the processor, you can get to it. So that's a hardened application. This is impossible. You can pay us a million dollars and we'll protect your secure application. And this is the pitch. Like you can develop your application for a hardened one. You can develop it for a friendly environment. And I've done other speeches where there's tradeoffs. Every single time that you add a protection, it adds a vulnerability. It can't be that easy. Of course it's that easy. I'm a hacker. Your public private key tokens, you simply steal them. You put them on an erroneously signed application. And at this point, it is still signed by the original key. And yeah, it's pretty much that easy. It's like the slide. It just moves it over. It moves it over to the erroneously signed executable because Microsoft leaves the sign code checking off. So there are 1,024-bit crypto that's going to stop you from attacking a core Windows DLL that's protected. It's off by default. So when that genuine Microsoft application runs, calls a DLL, you're inside of your target. This is how you turn it on. You can also add something to the manifest to turn it on. So it won't load. It will error out. However, you can still do it to the executable and the system will say, well, it's not signed properly. It's probably expired. And it runs. And so you're in just the same. So every single one of their mechanisms is subvertible. Pretty easy. Come on, Microsoft. Check it. If you ask for a password, don't tell people it's going to secure something if you're not going to check it. ASM, I'm not going to go into detail on this, but you can run assembly code inside a .NET application. And it's really fun. All you need is reflection or unmanaged calls. You can drop ASM. And I put this out there. GAC. You need to know what the GAC is. This is what the GAC looks like on disk. You take out desktop I and I. It's a regular folder. There's a bunch of GAC. There's a bunch of native images that you have to destroy. The GAC just goes on. And this is why you need to know about the GAC. When you call an executable, it puts its DLLs in the GAC. It then turns it into a native image. You delete the native image, replace it in the GAC, and then hack. So you destroy the native image. You have your application attacking in the GAC, not on disk. So it is calling into the GAC. It's attacking out of the GAC. They whitelist. They go through all of the program files. There's no changes. But you're attacking out of the GAC. Some random-ass application is being attacked instead of program files in Windows GAC. So it's a great place to hide and attack. Attacking from the same framework, same idea, becomes a process. You infect the framework. Every application calls a framework. And then you're in the process. So you're globally in every single application on the system that runs .NET. Visual studios, there's an exploit in Visual Studios to run arbitrary code. And it brings up, oh, you downloaded this off the Internet. You could be in danger, Will Robinson. So it runs arbitrary code when you open a form. That's what it does. So here's an application that it ran. I talked about this last year. But real quick, there's code inside of the constructor of a user control. It runs a constructor every time you view the form. And there's a payload that elevates past the UAC automatically, UAC hacks, all that. It would automatically elevate past the UAC and then shim and attack applications inside of Microsoft, those signed things that are hard to attack. Here's a payload that I developed to show that off. Something that should be hardened, say, PowerShell. I inject into PowerShell, modify PowerShell. This would all be completely silent. So you can imagine that the user opens the code, looks at the form, doesn't click run, opens PowerShell, and then something like this happens. . . . And of course, this is fun for an office prank. If it was a key logger, then we would be talking about some real danger, right? I mean, this is a great vector for doing viruses and malware. Because once you fuck up an application, you own it. You can do pretty much any viral thing you want. So you're not a hacker. You can defend your applications with this. You can harden them. You can verify your tools that you're downloading. Like you download my tools, how do you know that I'm not screwing over your applications in your system? You can look at my source code. This is very defensible. It's something we should do as a small part of our community for the rest of the community. When you look inside, you're going to be able to take control, don't be helpless, all that. You're going to find that all of the keys, you're going to find passwords, technology, weak spots, good code, bad code. You're going to find out what kind of security login. You're going to find out what kind of data leakage is happening. You're going to find out what kind of keys. You're going to find out what kind of crypto. It just goes on. You're going to understand what that application does. And here is Aircrack. Just because I thought I would show something positive instead of something negative. So here's Aircrack. It's just a little GUI that they threw together. And bam. It's prettier. It's better. It's a little more user-friendly. I can now upgrade Aircrack. And this is something that you can use not just to attack, but to make things better. So your malware. There's 1% of us that make malware. How do you hide? You use the same things. You use shells, cryptos, if they call unmanaged code, you break out and attack. You use office-gated code, signed DLL protection to make your target feel secure. You want to use intelligent names like your target. Coding style like your target. You want to blend in with your target. You want to do as much as you can to just look and feel as though you're the target. Because you're writing source code. You don't have to do ugly source code. Make it pretty. Don't use for loops. I mean, these people that are hunting malware are like, well, they're going to use a true. So I'm just going to look for a spinning loop and then I'll find the malware. Don't do it. Make it hard for them. Make them work for their millions of dollars that HBGary sells them. So all the tools, they're free. The source code, I'm going to sell for $80. Or you can decompile it and spend eight hours. You can join and catch my beta for $80. All of my new tools, they're coming out constantly. And you can see what's in constant development. And there's a bunch of tools that I'm holding back. If you join and you want specific things, I'll be more inclined to make them. And support the community. Because without community support, companies come along, buy this up, and then sell it to you. Or don't sell it to you and sell it to people that aren't you. So a root kit is vicious. Here's Windows media. Here's a Windows application. This is an application that auto elevates. When you have a shim inside of this application, this is just a little take my word for it. This is saying this is an administrator. So this is administration. This is an auto elevated application that you can inject into and do vicious things from. So story time. I thought that I would give a little bit of fun things from my experiences. So HBGary showed up at Black Hat. He didn't come here. But when he showed up at Black Hat, he was presenting things like his new shirt. Because we all know that HBGary pisses on anonymous, right? So he was giving away shirts and getting heckles from other vendors. I mean, these are corporate vendors that were heckling HBGary at Black Hat. How sweet, right? So if there's any last Q&A and if anyone wants this shirt, raise your hand. I didn't see any hands. Oh, there's a hand? Okay, okay. So that's the free stuff. I hope you enjoyed this shit because I worked hard. Thank you. Thank you.