All right. Our next presenter is Brett Moore, CTO at securityassessment.com, who today will be presenting Shoot the Messenger using window messages to exploit Win32 applications. Without further ado, here is Brett. All right. So they told me I was going to present in the tent. I thought it was going to be really, really hot, but it's nice to be in Vegas. You actually go inside to cool down. You can't hear me? All right, that's cool. Okay. Okay, first of all, we're going to talk about some stuff, just to put it into context. When the first real shadow attack was made public back in 2010, so everybody can hear me? Sorry, everybody can hear me? Okay. Back in 2002, when the first shadow attack was made public, it was not really a huge security issue. Even Microsoft themselves took some time to realize that there were some problems here. If we look at the... I'll try again. All right. If we look at the Windows operating system, it's not historically been considered secure enough to be used in... highly secure networks. While other operating systems have gone through this vulnerability discovery phase, this was something new to Windows, and like any new system, it had holes big enough to drive a bus through. Does this make sense? Everyone can hear me? All right, okay. Next slide. Now, like most new exploitation methods, shadow attacks are maturing. It's now acknowledged they no longer just effect the WNB, it's now becoming a time of message. And the scope of the shadow attack problem is widening. We are starting to see some very solid moves from Microsoft towards security. They're releasing operating systems with default settings off. You've got built-in firewall now, and, of course, there's XP Source Pack 2. So with this advance in Windows security, there are going to be more and more Windows machines inside secure networks, and that's more and more untrusted users. Okay, so the shadow attack exploitation problem is going to widen in scope, and hopefully this presentation will discuss and demonstrate some of the areas in which it is heading. It will happen one day that the Windows operating system will be considered secure, and as such, they will be deployed everywhere throughout secure networks, and the restrictions that are put in place on the workstations will be considered enough to control the access to the network and the data, as well as restricting the user's privileges and what actions they can take. All right, okay. So shadow attacks or GUI attacks, Win32 messaging attacks, they affect more than just the core operating system. Any third-party application or service running with an elevated privilege may be vulnerable to these types of attacks. This means that even if Microsoft patched every vulnerable instance in their products, like, yeah, sure, your workstations that are running the Windows operating system may still be vulnerable. Excuse me. Now, it is possible that Microsoft will apply a fix at the core of the problem, the messaging system, but this is very unlikely, and even so, it would not be ready anytime soon. So in a real-world environment, how can shadow attacks affect you? Now, of course, privilege escalation is the major impact of these attacks, and in general scope, the most important. And there goes the jet. Now, currently they are restricted. I say currently they are restricted to local exploitation. Now, this also includes remote desktop sessions, as well as the possibility of worms, trojans, and other malicious programs utilizing these attacks to increase their access to a system. Now, commonly programs such as the personal firewalls, antivirus systems, and other monitoring software, that run invalidated rights, they have all been found vulnerable to these attacks. Most third-party applications, especially in the antivirus industry, are vulnerable to these attacks, so we will eventually see viruses that attack antivirus programs to gain system rights. Now, yes, so successful attacks can allow untrusted users to elevate their privileges to a higher level, allowing them to install a malicious program. Yeah, that's what I wrote. Keyloggers, sniffers, et cetera. Okay, so we talked about if an application runs at a higher rights, higher user account, a malicious person can gain elevated rights. All Windows programs include default handling for messages such as WM close, WM quit, NC destroy, et cetera. So this can allow people to shut down firewalls, personal firewalls, antivirus monitoring, so once again, we're going to find, we're going to have viruses that gain elevated rights, shut down antivirus software, and of course then spread. Now, other attacks can involve the manipulation of controls to allow access to thick client area, within thick client areas of the applications that are restricted by having a disabled button, disabled toolbar or a menu. A user can simply send an enable message, and then this could allow them to have access. We'll talk a little bit about thick clients later. If data from a user input is used, or data from a GUI controller is used, it could cause ESCAL injection attacks, file reading, file access attacks, and of course textbook buffer overflows. And now we're done with that. So the Windows operating system uses a mechanism known as Windows messaging. This is used to communicate events such as user input, system notifications, and control information between Windows. Unlike the old days, I was going to say the good old days, but I'm old, where an application would stop and wait for user input, Windows messaging allows an application to process input only when there is input waiting for a window owned by the application. Every window created on the desktop has a unique window handle, which is used to identify it within the system. Messages are passed to the system, which in turn directs the messages to the appropriate window to handle the message. The window then processes this message, depending on how it was sent and what parameters were passed with it. Now every control, such as the text box, a list box, or a form, it's all derived from the base window class. So throughout this presentation, when I'm referring to a window, I'm referring to any type of GUI control. So the problem with this method of sending messages is that the operating system allows any user to send any message to any application. And in most instances, the application will blindly accept the message and act on it accordingly. So by exploiting known weaknesses in the messaging system, an attacker can manipulate applications for an arbitrary advantage. So how does a message get from point A to point B? So there are two main API calls that are used to pass messages to windows and various sub-APIs underneath these. Like I said before, all of the API functions, they pass the message to the system, which in turn directs it to the appropriate place. Now post message and its related functions, they pass the message data to the message queue of the thread that owns the destination window. And the sending application then continues without awaiting a response. A thread's message loop is constantly called the message queue, removing and dispatching any messages to the appropriate window procedure for the window identified by the unique window handle passed through the API function. Now the send message family of functions is passes the message directly to the window procedure of the target window. And after the window procedure processes the message and returns, the sending application then continues execution. Cushion. Cushion. Okay, we're back. Right. Now the window procedure is where the message contents are processed. It is in this function where the decision is made based on the message type to handle a message or to ignore it and pass it up the handler chain. Every window has a window procedure and it's just derived from the base window procedure for the class of the control. Okay, it's going to eventuate that you can overwrite class structures, subclass classes before they're defined by the system, create your own window procedure, which are then going to be derived throughout the system applications. Every thread which uses a GDI function has a message queue and therefore every thread that creates a window has a message queue. So we need to keep this in mind when thinking about what sort of applications are vulnerable to these attacks. Some applications or services which do not normally have a window can be enticed to create one. We think about the net send, system will pop up a message box, the printer, print spooler, a system level window is created by that and various other services do the same sort of thing. I hope I'm making sense, because I can really hear my accent coming back at me. So to help with the understanding of how a message becomes exploitable, I broke them down into three categories. We have a type 1 message. Now, a type 1 message, the data is marshaled correctly, everyone behaves properly, it works. If we think about a WM set text, we pass a text string, it sets the caption of a window, etc. The data goes from one application to another one and everything works correctly. Now, a type 2 message, the data doesn't need any marshalling. It's a long value, it's a pointer, it's used directly. Sorry, excuse me, it's not a pointer, because they'd be marshalled. So these type of messages, they can be used to control GUI, properties, sizes, etc. And in some cases, they too can be exploitable. If we think about the WM timer message, it worked properly, everyone behaved, the data didn't need marshalling, it just was written in securely and allowed you to pass an address that was then used as a callback. So a type 3 message can be used to override arbitrary memory. It does not go through this marshalling process, but it should. A value is passed as an offset to a data structure, and because it is not marshalled, it allows us to control the area in memory where the receiving application writes the returned data. So what is message marshalling? So, message marshalling is the process of taking message parameters from one thread and passing them into another. Now, generally, messages between the same application, sorry, are passed between the same application, so accessing of memory is not a problem. When messages are passed between applications, though, from one to another, memory addresses, they need to be modified so that the data from the sending application is valid in the receiver. So I found this on MSDN, and it says any message with a value less than WM user is marshalled automatically by the system. There are system-defined messages, and the operating system is aware of what parameters need to be handled and how it should be modified. And as you can see here on the slide, any message above WM user is not marshalled automatically. If you think about the list view control, the tab view, the tree view, all the new common controls, all their messages are above WM user. So, yes, it's not surprisingly that there are a large number of these messages that are not marshalled. And some of them can be used for various methods of exploitation. So we've got a couple of examples here. Yeah, I think you guys probably all read better than me at the moment. We have the common control, we have HTML first, 1,200, man, that's way above WM user, and you've got the item rigged. Way up there. You can find text with a rich edit control, WM user plus 56. If you've got Visual Studio, just look through your libraries, your includes, they're all there. Okay, so, so if the messages were an ID of less than WM user, marshalling depends on the function of the message. Like I was saying before, if the message is passing a numeric value, it's like a type 2 message, no marshalling is required. And we've got here an example of the WM timer. The timer proc is passed directly. It doesn't need updating, it doesn't need marshalling. But if the message is passing a block of data, such as a text string, then the block of data and the relevant pointer need to be managed so that the receiving application can access the data. If you think about it, if we've got one application here, and it's got a text string, and it wants to pass it over to this application, it can't just pass a pointer, because this application can't access the first application's memory. We did a bit of research to try and find out where this went. Okay, so the GDI shared handle table, it's a block of memory that is shared between all GUI threads. This table holds the handles of all opened objects from any GUI thread, and has enough space for 4,000 entries. And we thought that was really interesting. It's like, oh wow, so we can access a handle from any application for an opened control. We thought, oh, what if we start writing in there and overwriting stuff, but we found out it was read-only. So at this point, someone's got to look in there further. Anyway, so a pointer to this location can be found in the process environment block at 7FFDFO94. And at 60,000 bytes up from there is the start of the process mapped heap. Now, it was in this heap block that we found, that the system marshals the data into. Now, because every GUI thread has this heap block mapped into their address space, the system can copy the data into here, and any other GUI thread can, or any other GUI thread application process can then access this shared heap to retrieve the data from it. So what happens is, the system, the first attack application sends a message to the system. The system takes it, and it takes the data, and it moves it into the shared heap, and it updates the pointer, and it passes that pointer parameter to the receiving application. Okay, so every GUI thread, like I said, it has this memory mapped into their address space, but it's at a different base location. But the actual data remains at the same offset within that heap space. So... The process mapped to you, but it appears to be mapped at a static location per application, which allows us to calculate an offset between two applications. So what I'm trying to say is, your utility manager might have the base heap here, and the print spooler might have it here. But because it's a shared heap, so it's the same size, so if we can find the data in one application, by adjusting it, we can find the data, the exact location of that data, in another application. So, of course, this removes any guesswork involved in getting data into another application, and allows for exploitation of more complicated messages. So, I hope it's pretty self-explanatory. So in the attacking app, we've got the mapped heap at 49 hundred thousand, and the target app is up at 53. So that's the difference of A0000. But if we found our data at 53 SEO, we just simply add A0000, and we know exactly where it is in the other application. Okay, so we'll come back to that in a sec. Well, I don't know, man, this is going really fast. Okay, so, we'll mention some points on shellcode. When I'm talking about shellcode, it's any data that's been used in an exploit, structure block, text string, bytecode that runs a command shell. Now, if it is a command shell that's required, the exploit, the shellcode, it only needs to call the system API to give you a system shell. You can make it more robust by calling load library, and load the appropriate DLLs. But because the shellcode is there, and it was created and executed locally, any relocatable addresses can be correctly assigned before sending the exploit. Now, this removes the need for a function address lookup code, which is normally found in remote exploits, and it allows you to craft, you, allows an attacker to craft an exploit that is completely operating system and service pack independent. Now, all the APIs that are used to pass messages, they have wide character or Unicode equivalents. So this means that complete byte arrays can be passed, and in most cases they can contain null bytes. Now, the set window text W function, it's a wide character wrapper for the send message API to send the WM set text message. So this can be used to set the title caption of Windows, and it's an ideal way to pass our shellcode. Once again, I hope the slides are self-explanatory. Of course, the string is terminated by a wide character null. If the two nulls are in the wrong place, it's null termination of the string, and it won't be passed. The set window text W, it will use the same address space if the length of the text string is the same or less than what was previously used. So if it is required that we need to write shellcode, bytecode, or data structure into an application's address space that does contain wide character nulls, we can do it in a reverse manner. We can see here we want to write a wide character null, so we do it by writing the last part of the shellcode first, and then by sending smaller and smaller bits. The shellcode will be created properly as we need it. So there's been various methods that are used to locate the shellcode for shadow attacks, and while these can all be successful, there have been downfalls in the past. So this guessing the address technique makes it difficult to exploit messages that require even the simplest of data structures. There's been brute force, arbitrary byte writing, memory reading, et cetera, et cetera. Now, Chris Padgett, he released something I think last year at Black Hat, and he knows that when you create a message box, that text in the message box is copied to every application. Now, what I think he was saying, or what I think he was seeing, was the process mapped heap that I explained before. So we can use the process mapped heap to pass our data, our shellcode, into another application and find the exact location of it. So for the target application, we simply open the process, read it from the PEB, and adjust it. Now, of course, this requires debug rights, but so does it when you're creating a remote exploit. So that's done on a computer under control of the attacker. Like I said before, the application has the base mapped at a static location. So if we find it on our computer, it's the same on that computer or that computer. The base address for the exploit or the attacking application can, of course, just be read locally at run time from the PEB and adjusted. And this thing gives us an offset between the two applications. All right. So like I said before, using the set window text, W function, it's a great way to place our shellcode into the map's heap. Now, on this graphic, we've shown the set window text, W message being sent to the target application. That's not necessary. We're going to send it to ourselves and set our own caption. Either way, the data will be in the map's heap and therefore accessible to all GUI threads. The attacking application then simply looks through its map's heap, finds the offset of the data, adjusts with that offset that we discovered on the previous slide, giving us the exact memory location in the target application where our data is. So to recap, we can now place arbitrary data containing any values into a known location in any application. So this forms the basis for all messaging attacks going forward and allows us to exploit messages that require complex data structures, including pointers into pointers. So the callback attack is the classic shatter attack back in 2002, WM Timer. These sort of attacks exploit messages that pass a function address to be used as a callback. That's why they're called callback addresses. Okay, so Microsoft denounced this was a problem with the WM Timer and they released a patch. Their patch was we won't accept messages for addresses that are not previously registered. So far, it seems to be working. But since then, a number of other messages have been found vulnerable to these attacks. So, of course, we've got EM-set web break proc, LVM sort items, and we've got a few others that accept a callback within a structure. So it should be realized that any message that takes a callback as a parameter is possibly susceptible to these type of attacks. So the attack starts, yeah, we get the shellcode into the known location of the application. And as we explained before, we can use the process map to eat, and then we simply just send the callback message passing the address that we want to send that we've discovered, and that's it. There's no guesswork. It's all, it's all sweet as. Yeah, so the callback message is sent, specifying the location of the shellcode as the callback function. And in most cases, the application will blindly accept it, and the shellcode is executed. So, not too long ago, I, I video mailed, I released a package under the name of EasyShatter. And I thought this was, this was quite funky when I found this. What I realized was that the callback message was a callback function for the emsetwordbreakproc ex message. It took a pointer to a text string as its first parameter. And he realized that the load library function also took a pointer to a text string as its first parameter. So his, his exploit involved typing or pasting the name of a DLL file into a text box and sending the emsetwordbreakproc ex message with the address of the load library function as the callback address. So what this meant was that any DLL that he had sent typed into this text box was then loaded by the app, the target application and any initialization code in the DLL was run. So this removes the need to write or find any shell code in the target application. And it's pretty much your typical return to libc type exploit. Sorry. So if we look for other APIs that sort of fit this mold, we've got set unhandled exception filter and the system API. Let me quickly spring to mind now. The set unhandled exception filter would involve sending the shell code to a text box and then sending the callback message with the address of the set unhandled exception filter as the callback. That would then set the top level exception filter to the address of our shell code would then cause an exception and the shell code is run. The system API would be much easier to use and simply involve typing command exe in a text box and sending the emsetwordbreakproc ex message So this is what we've done here to exploit the emstreamin message. Now the emstreamin message takes a pointer to an edit stream structure that holds a cookie value and the address of the callback function. So using the setwindowtextw API we're able to create this valid structure in the process map heap and find the exact location of it. Now the actual callback function is passed the cookie value as its first parameter. So by setting the cookie in the edit stream structure to the address of the string to execute and the callback address to the system function we're able to cause the rich text box to open a command shell. Now the chance of a system application having a rich text box is about zero but what we're trying to show here is that it's now possible to exploit more complicated messages that require complex data structures even including putting pointers into themselves. So back in 2003 it was discovered that various messages could be used to write arbitrary data to memory locations. The exploitable messages revolved around the use of two different types of message. You know the set the size retrieve the size into a into a location. So some people discovered that the get item structure or message it was not martialed properly so it could be used to write a structure to arbitrary locations. This was used in conjunction with the set column width message to achieve arbitrary writing. So what we've got here is a head on the screen but behind that if we set the width of the first column that adjusts the left member of the second column. So by setting the width to five and then retrieving the structure of the second column we can have five written wherever we like. It's all documented in papers. So by using multiple calls we can write our shell code to a line location. So that's all right but we use the process map heap now so we know where our shell code is so it's not that important anymore. So we've got a whole lot of messages. These are all public exploit code and you can see it affects quite a few mainly the common control, the new one, common control 32. But right down to the buttons under XP, we thought it was really neat when Oliver released that code where a button allows you to write arbitrary bytes into an arbitrary location. All right. Okay. So like I said before, we use process map heap now to find out where our shell code is. So the arbitrary byte writing is not such a big deal. But we still need to get our code to execute. So what can we execute? What can we overwrite to gain execution? So the top level exception handler or the unhandled exception filter is commonly used in remote exploits. So we can use the same method. We write our shell But in some cases the SEH method may not work. So an attacker can overwrite memory locations such as the PEB lock and unlock pointers. But we are not able to overwrite the PEB byte by byte because it will be used between our message sends. So what we need to do is write it to a location in the heap that contains the lowest significant word of the original PEB pointer. And then by overwriting the third byte we will have zero automatically written to the end. So I hope that makes sense. We write our shell code to the heap somewhere that you can see like a 7 9103 and then we use the original 9103 of the original PEB pointer and just overwrite the other part. So we have a graphic here, messages flying around somewhere. All right, but in some cases you can't overwrite the PEB. They don't exist on some operating systems. So we can overwrite the GDI dispatch table pointer. This point is the location of a table of functions and can be overwritten in a similar manner. put our shell code somewhere and into the heap like using the lowest significant word of the original GDI dispatch table, we write a whole block of pointers to our shell code. And then we overwrite the GDI dispatch table. The system will come back and say I want to make a GDI call at user land, so give us the table, where's the function, call our shell code. It's also possible to overwrite the C run time terminators. These are called from the exit routine on normal or abnormal application shutdown. So even though we're talking local attacks here, these pointers can be overwritten by remote exploits as well. As you can see here, these are static pointers. Okay, so what happens if we overwrite the address of our shell code, like we write it to 7803014C, then when the app shuts down, either by sending it WM close or causing an exception, abnormal or normal shutdown, our shell code will once again be called. Okay, so we can place our shell code at a known location. There are multiple ways of having execution, either through arbitrary bite writing or callback attacks. There's not much more to go. Just like any of the numerous security vulnerabilities that are present be safe from exploitable conditions. So the buffer overflow in user 32 DLL could be caused by sending a large directory name to a list box through the message. So sending this attack against the list box with the utility manager allowed an attacker to escape the privilege. You can get root, get your system, that's cool. So, yeah, I don't know how many of you have ever read, written, if you've read writing secure code from Microsoft, which is not too bad, includes a couple of paragraphs about some dangerous messages. Michael Howard stresses that if you're going to use any of these messages, that you need to send the get text or the get length messages, the What makes these messages stand out is that there's no way to pass the length to restrict the data, the length of the data that you're getting back. That's all cool, that's good advice, but as you can see, they're all above WM user anyway, so most of them can be used for arbitrary byte writing. So this whole thing about the request the length, allocate your buffer, and then request the data, this is just like race condition stuff. So if you go into lengths to try and protect your applications, you need to be aware that if you request length and then create a buffer of 100, it's too late because the attack has already increased the length of the text to 500. If you read that through one of those messages, you have text book buffer overflow stuff. So spy plus plus, which comes with Visual Studio, that's probably the utility we've used the most during our research. It allows you to quickly list all the windows that are open, find out the thread, the process that owns them, and grab the window handle. It also shows you a few various window properties, which are starting to get interesting. This whole thing about how you can look at a window that any application owns and start discovering stuff about it, that just sounds wrong already. So there's a lot of stuff there to look at, but someone just needs to look at it. So on Windows 2000, the task manager doesn't show you what user the app is running under. But if it's running under system, you can't close it. Under Windows XP, of course, it does show you the user the application is sort by user. There's still a dozen service-level apps. So once a target window has been acquired, you can run a message fuzzer against it. A message fuzzer is just like any other type of fuzzer. It should be on the CD or on the website. There's a whole lot of code. So it iterates through a range of messages, one, one, one, one, one, And it's really quite interesting because you can kill anything. Every application is vulnerable to a message fuzzer. You just run it and things start dying. Now, if you do want to write a fuzzer, messages because it's shut down. And also your fuzzer might send messages that cause local exceptions. If you send WM set text with one as the parameter, well, it's not going anywhere. And check the event log. The MSO 3045, I think it was, we ran the fuzzer against the list box on utility manager and it was like, oh, wait, man, utility manager died? What's happening? And we couldn't work it out. Have a look at the event log. It's like crash, crash, crash, crash. Sweet. So you've got to sit your bugger on it and start reverse engineering. What's going on? Have a look at it. So it's kind of what we did here to exploit the WinHelp 32. I think, yeah. Okay, so I haven't got notes on this, so I'm going to try. What happened is we realized that the context-sensitive help from utility manager, the context-sensitive help from utility manager was that tooltip that pops up. It's actually WinHelp 32. And that's what task manager is. We could see that it was WinHelp 32 has now been loaded as system. It's like, oh, great. So what it is, it's like another attack avenue. We've got another app that's running a system that shouldn't be. So we ran a fuzzer against it, just passing one. Oh, we found this message. We passed one as the parameter. So, yeah. So what you can see is, you can see that it's running. It calls an exception. Pretty basic stuff. Trying to access a four. Jesus. Which is like EDI plus three. So that's cool. It's like we passed this message and we control EDI. But EDI didn't get your execution. So what we did, we wrote a whole block of ones up in the PEB and we updated EDI to point to our block of ones. And then we continued running. And then we got another exception. And this time, we got the registers over there. And you see ESI points to 11111. So it's like, oh, we're cool, man. We loaded ESI with the value from our block of data that we pointed EDI to and we control EDI. So in theory, we control ESI. But it still doesn't help us. So what we then did is we updated ESI to point to our block of ones again and continued running. And as you can see in the call stack down there, execution ended up at 11111. And it's like, aha. So we control EDI. And then we さ property . And through that, we control ESI. And through that, we now control EIP. So right. So, what we—what we try to craft is it's a callback attack using undocumented message against an application. Yeah. So what we had to do is create an exploit structure consisting of a block of pointers pointing to another block of pointers, pointing to the shell code. And we get that up in the the process map to heap, find out where it was, send a message passing the address of our structure, so we're sending EDI to the address of our pointer 1 block, which would be accepted, great, and then it would show the previous slides, ESI would then be loaded with the address of the pointer 2 block, and then as before when it does the call ESI plus 36, it loads the address of the shellcode, the shellcode is executed. That was great, Cesar Ceruto, he does really cool stuff on following up with this, and he's found this much easier, you just need a WM command help message, but we thought this was, it was kind of strange because what we were trying to do was find new stuff, yeah, and this is like undocumented messages against applications, so that's what I'm really trying to say here is like there's more messages out there than just the ones that are in the library, every application can have its own custom messages, and of course this opens up the avenues for more and more and more attacks, okay, all right, so another thing that programmers or hackers, all of us, need to be aware of is default behavior that some controls exhibit. Okay. So you've got things like the list box and the combo box, for example, I mean, I like utility manager, I mean, Microsoft are finally one day going to kill it, but by default, the LB do and the CB do message can be used to display a directory listing, so what we've got here is got the list box of utility manager, I mean, we've sent messages to resize it, so that's cool, but we've got sender and LB do, and we can read any directory as system, whoopee, you know, but it's things to be aware of that that's a list box that we can use to view any directory. What about when you get stuff that you can like load files, so you're like loading files as system? Okay. So you've got like system apps that display an about screen with a hyperlink, you know, come to our website, they might load the browser as system. Okay. Because then you can browse local drive. Right mouse clip, open with command XE, you've got a system-level shell again. Any system application that allows you to load files, right mouse clip, open with, blah, blah. Okay. We've got ‑‑ we tested one recently, and they tried to avoid this problem by using the older file dialog type box, which is the one down the bottom left there, but guess what? You know, your right mouse clip has got what's this, that's a tooltip, that's one help 32, loaded as system again, exploit it. So I don't know if you guys are ‑‑ any of you do write system-level applications you want to protect, but these are some of the things that you may want to be aware of that there's more to this stuff than what meets the eye. There's a lot of stuff in the background that just happens by default. And like I said before, Cesar Ceruto, I mean, we talked about it, but ‑‑ what was his latest exploit that he put out, it's pretty much any system-level app that has a context-sensitive help, you can send this exploit against it, give you a command shell. I had something but I forgot. What was it? Anyway, we'll keep going. Okay. Okay. So what happened, just a bit of history on that problem is, you know, like I said before, we discovered that utility manager was loading one help 32 as system, it could be exploited, Microsoft patched that, but all they did was they removed the question mark button, I mean, they forgot about this default behavior. All forms will accept a W command help message. Okay. And give you tooltips help, if there's a help file set up when you compile your application, I mean, because Microsoft just removed the question mark, it's like, yeah, we'll just hide it. And I mean, it took him like 20 seconds to re‑break it. But what was kind of interesting about his thing was that, first of all, you had to send a ‑‑ I can't remember exactly what it is, but it's just a message to pop up the system menu, you know, like right click on the control button. Control bar. But you had to like post message that. And then send message the W command help. So that's something else. I mean, if you're running fuzzers and whatnot, you've got to be aware that, mate, different messages will have different effects maybe used in conjunction. Okay. All right. Okay. So where are we going to go with these GUI-based attacks, right? The scope is going to widen. The attacks will ‑‑ they will become public. They will no longer depend on these controls and messages. Exploits, they'll focus on the APIs that can be used to manipulate GDI data, not just Windows messages. We've done some research into the cross‑wind station desktop tech, you know, if you've got an IOM user shell, can you get system? So far, not. We're running out of time, and that's kind of boring. Okay. So we looked at these other APIs, these other manipulation ones. Okay. Oh, you can read. Sorry. MSDN states, you know, the set parent, the new parent in the child window must belong to the same application. That's not right. You know, any application become ‑‑ can set the parent of any other window. Now, like I said before, you know, we haven't been able to exploit this against a system‑level app yet. We haven't been able to exploit it against just apps running, you know, our test apps, and normal apps running on our desktop. But, yeah. This is the theory. You know, the exploit becomes the parent, the window or the application, requests the parent through a get parent, and then asks the parent for some data. So the exploit just returns corrupt data, causing exploitable conditions. All right. So Windows properties, yeah, I mean, every window can store a whole list of data that's relevant to itself. I've got an example, it's like an MDI application might store a unique ID associated with each window. That's a link back into the database. See our get prop and set prop. Now, it's the same problem. Any application can get and set ‑‑ can get and set the properties of any other application's window. So we weren't able to exploit this against any core Windows OS services in our one week of testing before we came here, but the first third‑party application we tested was vulnerable. As can be seen here, Windows subclasses, all non‑FC‑derived Windows, to have a command or specific activation issues, again, it stores it in a window prop, we can overwrite the window prop, and it's chained because it's the subclass thing. So we simply overwrite the window prop with the address of our shell code, which is in the process map tape, and once again we're getting control. And this is like through a non‑message‑based GUI attack, or shatter attack, or whatever the name's going to end up being. So we've got some thoughts on protection. You know, there's been discussions about, you know, filter messages, only allow some, don't allow others. It's not just messages. You know, I mean, these things are going to expand, hopefully, you know, I want people to go out there and look for stuff. It's like, it's not just this, man, it's now this, that, that. So there's a lot of stuff out there to look for. Windows shouldn't be created with prior privileges, blah, blah, blah. Application to find messages. If you write your own application that uses custom messages, can they be exploited? MSDN, again, service should talk to GUI using RPC, sockets, name pipes. That'll be fine. All right, and we've got a registry sitting here. You can turn off interactive services. Yeah, I thought, I mean, I found this, I had to fill in some slides before I came here, and I thought it was, it was kind of a cool way, you know, you turn this registry setting off, and what happens is you now have services popping up error boxes with system‑level access. I mean, what's the point in that? And understanding the threat, the problem, getting out there and finding some stuff. That's it. Okay. Sorry. Are there any questions? Okay. Are there any questions? That's it. Okay. So we've got time for questions and we'll be continue on. One more question. One more question. Where are you going to go next? Okay. Thank you. .