Howdy, I'm Wes Brown, and this is Scott Dunlop, and we have been working on this really last year or so. Some of you may have seen last year's presentation where we had a Lua-based prototype, but we are FML security, and we conduct research, development, and engineering of very interesting solutions and products. Many of them are available openly with the option to purchase an unencumbered license for integration into commercial products. The stuff you will find on the internet are all GPO or GPL, so you can download it and try it yourself. What is Mosquito? Mosquito is a mosquito. It is a virtual machine environment with a lightweight framework to deploy and run code remotely and securely in the context of penetration tests. It makes the best effort to ensure that communications are secure because historically, exploits have not tried to make sure that the communication is secure, and it can't always do so. Deployed code in a virtual machine is not stored outside of the process space, meaning it never hits the disk. When you have an exploit, it will not hit the disk. You have a methodology, it will not hit the disk unless God forbid you manage to swap. It protects the confidentiality and trade secrets of code that is deployed and run on the target. This could be an exploit or a methodology. Why do all this? Often it is desirable to leverage zero-day code, but doing so in an uncontrolled fashion can have repercussions. Like if you use zero-day code and somebody at the target managed to get ahold of the zero-day code, you might spread that around with something. That's not good. Many processes have trade secrets and methodologies distilled in the form of audit or exploit code that they would keep out of the hands. And for that reason, they would tend to keep it on their own machines that they can control. What Miskito lets you do is deploy the code you want to control on a victim machine and have a reasonable precaution of it being secure and secure. It's not safe from being reverse engineered and tampered with. As I've said before, Miskito uses a very strong cryptography to ensure that communication between the target and the console is secure. And more interestingly, it provides a dynamic remote institution environment allowing the user to interact with it. It's like modifications of code. How does this approach compare to the others historically? Shell code. Shell code is static, inflexible, low level, and targeted to one environment. It can break with patches or environment changes. Many exploits I have seen break between Windows service pack levels. And so you would have to refactor your exploit target towards that new service pack level. We also have syscall proxies. They're more flexible than shell code and higher level. However, the driving logic is on the attacker's side. The target doesn't have any of the driving logic. Because the console is being targeted. It's pushing syscalls to the target. What happens when the network is unreliable, it breaks. And that happens a lot. And syscalls are great if you just want to get a shell. But syscalls are very clumsy if you want to actually implement a program to run on the client. We also have DLL injection. We can implement. We can implement higher level features easily. Logic can be placed on the target side and run. But it is still static. And it's Windows only. When you write DLL injection code, it will run only on Windows. And taking the next step up, we have exploit compilers that are often compilers, written and scripting languages. Target to two or three. With assembler of a target platform allowing some level of abstraction at programming time. But they are still static at compile time. Once you compile them, once you've got them on the victim, you can't easily change them. So we come to lightweight application virtual machines. It can be very small. Most of them. It's 128K binary size and Linux. That's the whole virtual machine with all the libraries you need to run it. It can be even smaller with executable compression tricks. I would say we could get 64 to 80K with executable compression tricks. And more interestingly, it's wipe once, run anywhere. Cold, it's not. Cold running on a Linux VM will run on a Windows VM unaltered. You don't need to write custom code for your different platforms. While I've seen exploit code or attack code, you have to write it specific to the platform. But if you write it using Mosfm, you don't have to. And with Mosfm, we can use languages designed for the task. We have a lot of different languages. We created our own language called MosquitoList. Because we have the flexibility of creating our own language, we can have a language that's custom designed for this sort of problem. It provides a very nice orthogonal development environment. Dynamic. Code can be altered and updated. Even on a remote region. If you get a remote VM on a target, you can continue altering code there dynamically. So if you have an exploit that doesn't quite work on your target, you can modify it on the fly on the target and maybe get root level escalation or attack another machine on the network. There are several major components to Mosquito. We've got the core virtual machine, Mosfm, the small core, which is 128K. We've got the language, MosquitoList environment and libraries. We've got the console, which provides the user with the interface to manage and deploy drones. And we have a drone, which provides a remote process that contacts its match console and executes byte code and statements on its behalf. The virtual machine is production ready and stable. We are in beta 3, meaning we think we're ready for production, but we don't like to say it. Because we have had hundreds of people hammer it. And I'm sure you will find bugs, which we will gladly fix. It's easily extensible. We were able to implement Regex in a few hours. We just pulled in the BSD Regex library. It's pure NCC. It will run on anything, pretty much. We, for our development environment, we used OpenBSD, Mac OS X, Linux, and Windows. Some other people ported it to the MIPS, ARMS, and NIOS 2. You can run it on your wireless router. The 128K I mentioned is the virtual machine stub. It's the actual binary executable target to tourist platform. And we can attach byte code to the stubs. Programs and applications can be compiled and attached to stubs. So if you have a stubs for four different platforms. In one pass, build an executable for every platform you have. And it allows standalone executables with no external dependencies. If you've got an XML library, you've got an HTTP library, you've got a Regex library, you can have it all in one executable without having to install anything else on your target system. Dependencies are automatically resolved. You don't have to install anything else on your target system. When you use an import statement, Mosquito will automatically figure out what modules you need, compile it to byte code, and attach it to the virtual machine. We have integrated very strong cryptography using ECDNs for key exchange and AES for the communication itself. Now, MosquitoLisp. The language. It's a network-oriented and compact Lisp with strong influences from Scheme. It's designed for network applications. It's highly concurrent and provides simple and efficient network and process APIs. Over the last year, we have implemented our library function. We have over 300 primitive functions or 200 library functions in the standard library. Not only that. We are not including additional libraries specifically to Mosquit. We are well documented, or at least I like to think so. We have a complete reference manual for the functions that we have. How many programming languages can claim that? The language is sufficiently developed that we wrote the compiler in it. It is the Mosquito compiler. It's written in MosquitoLisp. The compiler compiles itself as part of the build process. We got all sorts of nice goodies in the standard library. It can be available on the drone if you like. You can have XML. You can have an in-memory database, queryable database. We have Regex support. We have InstaDB. All of that in this tiny little drone you can put on a remote host. I'm going to show you how it works. I'm going to show you how it works. One of the more powerful features of our language and environment is channels. It allows for abstracted communication. A cryptographic channel is provided for easy encryption. We transparently negotiate on top of channels. And it provides a layer of abstraction from an actual communication mechanism in use. Right now we use TCP, but there's no reason we can't use UDP, CMP, or DNS. It will not change any of your higher-level application or functions. All you have to do is write a little library to do it to guarantee a network connection. And Mosquito will take care of the rest of it. Programmers do not care about how communication is done. Processes and sockets have read and write channels that can be mapped to other channels. Some people keep thinking that we could use that for distributed computing. Well, we could, but it's not our goal, our target. But I wouldn't stop anyone from creating a distributed computing with this. The drone is a virtual machine with crypto and drone fixes. Its functionality is highly optimized to reduce size. It does not include the Mosquito-less bytecode compiler. It cannot compile things by itself. It stores and executes bytecode programs sent by the console. It can pull additional libraries from consoles over channels rather than embed in drone stub, including the compiler. If you have a drone, you inject the drone. You can start pulling the drone. You can start pulling libraries over the link to meet your circumstances. So you would put the minimum function needed to establish a connection to the console in the drone. And once the drone is in, you can pull in all the libraries you want over the network. This is to keep the drone as small as possible. And right after we bootstrap, we can expand the functionality. Bytecode sent by the console is only stored in process memory. When the console sends it to the drone, we do not write it to the disk. It's kept in memory. And even more neat, a drone can relay for a drone to the console. So if you have a console and you set up a connection to a drone, you inject it using an exploit. Then you can upload the exploit program to the drone and then inject it into another drone. And the drone will talk to the console through the drone in between. It's useful for attacking intranets and VMZ networks from an external network. You can puddle hop very easily with Mosquito. We have a console. It's just a virtual machine. It's just a virtual machine. Plus crypto, plus console functionality. It provides a local process to control deploy drones. It provides the full MosquitoLisp environment. It includes the compiler to compile MosquitoLips and statements and programs for the drone on the fly. We have an interface to interact with drones. And we can create drones on the fly. So if you begin a penetration test and you have no idea what your target is, you find a Windows machine. You can create a drone for the Windows machine right there with all your libraries. What can you use Mosquito for? You can refactor exploits into MosquitoLips for secure deployment on a target. Network and host recon code management and results over secure channel. If you have a remote support scanner, we can make sure that the data you send back to the console is not eavesdropped. It makes it safer for the client, actually. It simplifies deployment of auditing tool to host. All dependencies are included with the drone. And then it's just the user. managed by the console. You don't need to implement a ton of dependencies for in-map work-alike. You just drop a drone and you've got it running on anything. And here's the demonstration. You do not have to wait to see the story when you do the demonstration. Oh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hmm. Well. Here, why don't you just, Wes, why don't you let me just have a virtual machine and I'll put a web server there. That's a really annoying beep, man. I'm glad we're not demoing VMware today. Yeah. Come on, let it go. Yeah. You didn't tell VMware to allocate a full gig for that image, did you? It's 3.84, but that's... Oh, wait, here we go. I'm going to do a little backup. Oh, wait. Oh. Oh. Oh. Oh. Oh. Oh. Oh. Oh. Oh. Oh. If you were a little closer, you could hear this thing paging like crazy. Yeah, I'm not a patient man. I'm kicking myself right now. They're asking, do you want to put the other laptop in the switch box? No. You started it loading out of their virtual machine? Yeah. Now Windows 2000's massively efficient boot up process is... Well, we'll give it an hour. Yeah. Yeah. Maybe you should shut down your BitTorrent clients. Well, at least the Linux image is being helpful. Well... Well... Well... It's still paging like mad. I don't think you can hear it. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. I do have a flashy cursor, that's enough. Back away, before I break something else. Bam. All right. As we were. I tend to use make repl, because I really like rl-repl, and I can never remember the exact symbols file. Let's see, tcp server. Okay. What we're going to do is create a little tcp server real quick. Nothing fancy. Let's hope I gave it a port. Before anybody gets any clever ideas, no, my wireless is not on. I need coffee. Can you get me coffee? All right. As you can see, we spawned tcp server. Lambda is a funny way of just saying an anonymous function for those of you not familiar with lisp. So we spawned it. It kicked a process off in the background to listen to port 9911 for tcp connections. We did define C. All we did was we told it define C, bind it to a new tcp connection to local host port 9911. Now, the first thing we have to do, because the connection is asynchronous, we have to check to see that it actually has connected. Connects. Good. Now, we can do another wait, get the by message that we sent earlier. Or not. Let's take a look at why. . . No, that should be okay. . Let's see. Huh? . Oh, actually, that is correct. The single quote there actually is lisp for do not evaluate. If I just sent close here, I'd be sending the close function or whatever is bound to close. It's a little weird. It's how lisp likes to escape things. . Somebody else wants to try it. Okay. All right. Let's try that again. This is a little bit of insurance. Timeout C. That's reasonable. 10,000. Oops. . . That gives us a timeout. Now we do another wait. Still no good. This is a good time for me to ask you what firewall policies you put on this thing. . You're sabotaging me. You know that, right? . Okay. That's no good. . Well, I've shown the interactive debugging capabilities. . . Did any of the other virtual machines manage to make it up? . That was a virtual machine that clashed. . Is the victim alive? . Oops. . . . . . . . . . . . . . . . . . . . . . . . About 190. What is that? 190, 130. Alright. Alright. 190. Got 130. You can tell he's got the eidetic memory around here. And we get a bad request. The website crashed. A testament to IIS's reliability here. Actually, no, I got a bad request directly from the server. Okay. Now you get to guess how it filled up all your virtual machines for your test. Okay, we're back at the MOSREP console. And these are all the commands that we have in the MOSREP console right now. We have copy. We have drone. We have create a drone. We have fork. For example, do plus three five. And that gives you eight. And I will evaluate a LISP expression. We have recreate a drone on the file. ID platform. So we can do drone. Linux drone. ID Ubuntu drone. And then Linux x86. And I will specify the platform. We can do Darwin. Or we can do Windows. Or we can do Windows. Linux. But why are we doing Linux? But first we have to define the address that the drone knows to connect back to. Which is one dot nine one two nine Let's create a drone. Now let's create the console is listening the and point two six o seventy. So all we need to do is drone running. So let's start another terminal. And then use the That's the file with the virtual machine itself with the drone functionality attached in bytecode. So we just modded it, so let's run it. And now the drone has a cryptographic connection to the console. Oh, sure, it behaves for you. Yeah. And we did key change and all that while we did the connection. The drone is given a key, a one-time key that is used when it's connected to the console. No other drone will have that key. So we have a drone named Ubuntu drone. And it's listed in the list of nodes. There's a node command which shows all the drones that are connected. So we have a special command called on Ubuntu drone. What's that? Do plus three five. This looks simple, but it's doing a lot of magic behind the scenes to let this happen. What it was doing was it was taking the Lisp expression plus three five. It was compiling it to bytecode. It was taking this bytecode, transmitting it over the cryptographic connection to be executed on the drone. And then the drone passed by the result eight. So we have some pretty neat functions like fork. And it will spawn a new window. This will work on Mac OS X. This will work on Windows. We have some sort of platform native way of spawning windows on each of these platforms. But we just spawned a new window for that particular context. Ubuntu drone. So whenever you type a statement in that, it will happen on the drone itself rather than on the console. So we have plus. Do plus eight. Do plus eight five. Three five. All right. Now, we can create a new drone. Drone. Ubuntu drone to Linux. Drone to Ubuntu. Drone to Linux. It's 86. Whoops. I forgot to set the address. Okay. And now the drone is lifting on that port. Not the console. The drone is lifting. The drone is lifting on that port. So let's make a new terminal window. Set it to suitable. And now, the drone connected to the drone. And through the drone, it's talking to the console. So let's check out the console. There it is. And now, we can do on Ubuntu drone to... . On Ubuntu. Do plus three five. And now, what happened here is the bytecode was compiled. It was transmitted to the drone through the drone relay in between. And further, the drone in between doesn't know what's going on. Because the channel between the console and the second drone is its own cryptographic channel. Only the console has the keys for the drones. So even if you have intermediary drones and somebody intercepts the drones in between, no good. You don't have the keys for any of the other drones. And then, this is new. We have a proxy. A SOX proxy. On Ubuntu drone to proxy. And now, we have a SOX proxy running. So let's fire up Firefox. Let's go to preferences. And then, we can connect manual proxy connection. Local host. And we got... . . It's 2-7-2-4-1. . 2-7-2-4-1. It's a SOX4 proxy. Just push OK. And then... . . . It's a little slow. . But this proxy was happening through two drones. So the proxy was originating from Ubuntu drone 2. . . So we can have a chain of drone, and you can proxy all the way through. . . . . We have a port scanner, too. . . . . . . to port 80 and then 192.168.190.130 and then 80. And then we got the port scanner. What it did was it sent a little program to the drone with an import statement to the drone's port scan library. And because our import is network transparent, it pulled the bytecode for the port scanner across the network to the drone before the drone didn't have a port scanner. But now it does. All we had to do was issue the client name. And we have the functionality on the drone that we did not have before. And then I wish I could demo you some of the really neat things that we have, a Win32 drone. But as you saw, the Windows VM crashed. But we have... Windows drones, we have Linux drones, we have Macintosh drones. And other people have compiled it for their wireless routers, too. So they could put a drone on their wireless router. And it was pretty neat to see. Hold on. You forgot to jump something. Okay. Go ahead. First of all, I hate having to type this over and over again. There. You do have NMAP installed, right? Maybe not. Nope. Boy, Ubuntu never has anything useful. All right. Thank you. Why do I need NMAP? I got the port scanner. I'd like to verify. Oh, you cheap little SOBs. You didn't actually use the standard N. All right. Well, that's in the wrong place. So you just do this, I guess. Or... Wanted. Wanted. Let's see. You're forgetting to put Alice on. Pardon? You did go back to your top and down. I suppose I could. Let's look at index HTML again. Oops. Need to get that failover code done. And it's right here. right there. The SH stuff works pretty well, but I wouldn't recommend trying to use VI through it. Anything that wants a pseudo-terminal, we don't support yet. And what you see is still an unfinished product. There's always features that we can add. So in the works, we have stuff in plans. We have what's just called FFI. And with the syscall FFI interface, we can abstract it out using Mosquito Lisp programs. So you have a form function in Windows that behaves similarly to a unit's postage call. We can just implement a Mosquito Lisp library to abstract that out. So when you write your methodologies, it will work on Windows and Linux, regardless of the platform difference. One of the neat things we're looking at is DOIL and SHARE library injection, so that we can insert a drone, and then we can pool additional binary level libraries over the wire. Right now, we can pool Mosquito Lisp bytecode, but we can't extend the functionality to a virtual machine. But we use DOIL and SHARE library injection. We can do that. We can add . . . We can add kernel drivers for packet sniffing and the like. One thing we're looking at is accessible compression techniques with a target size of a 64K payload for the virtual machine drone. Another thing we're looking at is additional transports, UDP, ICOMP, and CTP DNS. And of course, there are always core language and environment enhancements. Another thing we're looking at is in the work is Proboscis, which is the feeder tube of a Mosquito. Its only job is to pool a higher-level environment like Mosquito. We're thinking about making it a fourth virtual machine with an FFI syscall interface, and it abstracts out the low-level assembler, and it allows multi-architecture shell code, because fourth is very close to assembler. It's closer than C is, but it's still a pretty nice language to develop in. So we have a binary size of 2K binary around inline with exports, and we have hand-crafted assembler with relocatable code, so you can use it as any export. Okay. Another thing we're looking at in the works is iDubbbz. iDubbbz is a framework for network applications to generate, collect, and analyze network packets. It's a sophisticated library to classify packets and manipulating packet fields without forcing developers to resort to complicated structures and pointer arithmetic. It will extend multiple console drones with packet sniffer and generation functionality. These are our email addresses. And you can find us online at worldwidewebfmosaturity.com. All the code is available by LGP from worldwidewebfmosaturity.com. What you have on the DEVCON 614 CD is a beta 2. What we have on the site is beta 3, because we have been constantly improving it since we submitted it for the CD color. So, it's a beta 2. If you want to try Mosquito, I would encourage you to download it from our site. We also have a mailing list which you can find at our site for discussion and questions. Do you have any questions? Thanks. Thank you. As you may have noticed, Wes is deaf, so it's easier for me to handle the questions. He can't lip read from quite this distance, though I still think we should have brought binoculars. Hey. This is the first time I've ever heard of what you're working on. Sure. Sounds really cool. But I'm just curious, what happens if you lose the connection to a drone? Does it automatically try to reconnect back? Actually, I can demonstrate that it does not automatically try to reconnect. Let me see if I can safely find my way to another drone without causing another crash. Did leave the drones up, right? Yes. Let's see. Would the console please stand up? But actually, we engineered for that because it's fairly common. Oh, you killed it, didn't you? You caused me no end of trouble, Wes. All right. Okay, everything's running good, hunky dory. Now, on one, we will do exit, which is our brute force. I want to quit right now. That didn't work. What the heck? Yeah. Why is there a touchpad there? People should choose if they want a stick or a pad. Anyway. Okay. Anyway, now why are you scrolling? Wes, your console is drunk. All right, as you can see, we've lost connection because some bastard did a Control C. So what we do is we simply instruct the console that one will be reconnecting. We reinitiate. And as you can see, it's right there again. On one, do print, and as you can see down the corner, hi. The reason it does not re-affiliate immediately, and it doesn't automatically try to re-affiliate, is that each time a drone is reused on an untrusted network, it weakens the protections afforded. Because the first drone to successfully complete the affiliation wins. They're the one that the console will consider to be the actual drone. You have to do some verification. Afterwards, of course, just checking IP, config, or whatever. So if D1 goes down, if your drone goes down, and you do a recovery, it gives a new opportunity for an attacker and a man in the middle to try to complete the affiliation first. Thank you. So recover is a manual process. It's something you should do just when you know you're about ready to re-invoke the drone. OK. Well, so if you say, OK. You have a drone on a private network, and you're trying to connect, yet your console's externally accessible, and you lose a drone on the private network, and you have no way of getting back to it, it's pretty much a lost drone. You can't really . It is a lost drone, but you can get out there. Drones really don't store a lot of data. Any information that they report is collected and maintained by the console using an in-memory database. So for example, ports that you've found, other things. We have an expert system that we've been working on to implement a map-like functionality. And you can just go ahead and do the AIM app once you've managed to redeploy and re-establish a new drone. All right. Thank you. No problem. I was just sort of wondering, since you're running bytecode, and I know for some reason it might get mangled at the destination, what would happen if the bytecode would be bad? Like, would it crash? Is it a whole mess? Very possibly, the drone will crash. The console itself does not execute any bytecode on behalf of the drone. The console is pretty much insulated against that. The drone may crash, but first it would have to get past the integrity checks in the actual protocol. This is the CRC32 that's encrypted along with the rest of the stream. And that would be the first thing you'd notice, is that the actual connection would drop, and it would say that there's been an integrity problem, and that you need to re-establish the affiliation. Right. And that would mean that if the drone was in the middle of, I don't know, holding a certain resource at the destination or something, that would possibly lead to a deadlock or something? The console should handle it correctly. We use a cooperative multitasking system so that it's very hard to actually have a race condition in the console. Basically the commands are written in such a way that they constantly monitor for the event of a closed event. It says, okay, I've lost the TCP connection. The data I have is all I have. The command is incomplete. And all this is notified to you on the console. All right. Thank you very much. No problem. No problem. Anyone else? Do you have any questions? Sorry. Thank you very much. Thanks a lot. Thank you very much.