So my name is John Oberheide and today we're going to be talking about antique exploitation and to give you guys an idea of what this presentation is about so that you guys can leave last minute if you want to. We're going to be talking about Arnold Schwarzenegger and his various escapades across cinema. So if you guys aren't interested in old systems like Windows 3.11 for workgroups and you're not interested in a presentation for shits and giggles, then you can go learn something from a useful presentation. Maybe go see Dan Kaminsky's talk on track one. But it looks like everyone is staying, so you're either asleep or you're very interested. So again, this disclaimer before we get started here. This whole presentation is essentially me complaining about myself making this presentation. I made this entire deck in paintbrush, which is not even as... Thank you, thank you, thank you. It's not even as capable as MS Paint. It's pre-MS Paint. It's the MS Paint that came with Windows 3.1. And I thought it would be a nice novelty to actually make the deck in the same program and platform that I was exploiting. So it's a little rough, but it actually doesn't look too bad, I think. I think I did a good job. So we're going to be talking about some old systems that you probably don't care about, but that actually is surprisingly still in use. And just to start off, the premise of this presentation is similar to the movie Terminators, where a machine or something is sent back in time to eliminate a target. And we are going to be doing the same thing, traveling back in time to eliminate the target, except in our case, the target is not John Connor or Sarah Connor or whoever. It is an older systems platform, which is related to this movie, another... of Arnold's escapades called Junior, which was released back in 1994. And this movie is really a crime against humanity. It's an abomination of cinema. And we have to go back in time to destroy it. There actually was an essay contest I saw when I was making this slide deck about Junior. It's like juniorbestmovieever.com. They held a contest to see who could write an essay about why Junior was the best movie of all time. And since this is like an absurd idea in the first place, it got all sorts of national press coverage, and yet they still did not get enough submissions to even cover the number of prizes they were giving out. So it's very obvious that this movie just...you can't even try to write about why it's the best movie of all time. But we're going to go back to 1994 when this was made and try to stop it from being made or released. So to give a little bit of context to you guys who don't remember that far back, 1994 was when O.J. got away with murder, literally. It was when Nas dropped the Illmatic album, the best hip-hop album of all time. It was also...I just heard this yesterday, but I heard that Spencer Pratt actually was rumored to invent return-oriented program back in 1994. So, you know, R.O.P. just keeps getting further and further back. People are claiming that they came up with it, but I heard that Spencer Pratt actually did. Oh, yes. Oh, thank you. Thank you, sir. And of course in 1994, Windows 3.11 was released. This is actually a lie. It was released December 31, 1993. But it's close enough to 1994, so we're going to call it that. So Windows 3.11 is our attack target. We're under the assumption that this movie, Junior, was made using Windows 3.1 workstations, which is probably also incorrect. But for the sake of the story, we're going to assume that. One was a 16-bit operating system, but there were some sort of hacks on top of it. Windows 32S and also the Windows 16 Enhanced Mode, which if you had a 32-bit CPU running in protected mode, you'd have 32-bit memory addressing. And also the good old Windows for Workgroups 3.11 was one of the first times that TCPIP was introduced via the Winsock interface. So it was a spectacular release and everyone still uses it on their laptops today, at least I do. So looking at what we would do if we actually were in this situation and we were going back in time, what sort of tools would we use to exploit this platform? If you remember the Terminator movie, I think when everyone gets sent back in time, they show up naked, so you can't really carry any sort of software tools on your person when you're going back in time. So we kind of have to deal with what we have in that era. Obviously, it was post ENIAC era, but some of the tools seem like they were written for the ENIAC. Obviously, if we're looking at debuggers, we would like to launch up our IDA Pro as usual. That's not gonna happen. Instead, we're stuck with these two abominations, Borderland Turbo Debugger, which has its pseudo-Encurse's interface, as well as Softice, which was a great program that, these were really the only, debuggers that were available for the Windows 3.X platform. So we're kind of hamstringed by that, or at least it makes it a little more complicated to look at some of these crashes that we'll get to. Second, if you pull a Win 3.1.1 executable off whatever image you have, and you wanna start poking around at it, and you pull up things like PE file, which is a Python extension to look at PE format executable, or something like PE Explorer, which is a nice little GUI thing, which will show you the IAT and EAT, and all the sections of the PE file. They will barf on these files, mostly because they're not PE files. The executables used on Windows 3.X are called NE, which ironically was called New Executable. It was new at the time, but obviously it's not so new anymore. And this was the executable format for Windows 3.X. Sort of in between these stages, you just hear the MZ format was the DOS executable format invented by Mark Z from Microsoft, I don't know his last name. Zybikowski. Zybikowski? Thank you. I'll drink for that. Every time you say Zybikowski, I'll drink. It's turning into SummerCon again. So, NE was sort of this evolution in the middle between MZ and PE. It had some backwards compatibility with MZ, if you see at the top there, there's an old style file header, which was the old MZ MS DOS header, which didn't allow it to interoperate with backward compatibility, but at least allowed it to output an error message. So that when DOS tried to load a NE executable, it would spit out an error message, the one you've probably seen, like this requires a Windows environment to execute. But if it was running in a Windows environment, the Windows loader would know to look for the new header, pointing to in that diagram there. And this was a pretty standard segmented executable layout, where you have the bottom of the pictures cut off, but you segment one, then dot dot dot dot through segment N for your data and code and whatnot. So, looking at what tools we would use for vulnerability discovery. Of course, if we're going to be fuzzing our target, which in this case is the paintbrush application, we would use any number of fuzzing frameworks out there, like Soli, or the BFF from CERT, or, you know, the, you know, Peach, the popular Python fuzzing framework. But since we can't actually use these tools, we can't bring them back in time with us, we're going to have to stick with what we can do. So taking another note from Arnold's cinematic history, in the movie Predator, after he loses all his advanced weaponry, he's forced to fight the Predator with, you know, sort of sticks and stones, where he coats himself with mud, and you know, starts making traps and spears out of sticks. So we have to do the same thing, except that in our case, the sticks are forks, and not FORTRAN. So, thank you, thank you. This is the first and last FORTRAN program I will ever write. I had no experience in FORTRAN before doing this, and it was a horrible, horrible experience. This code looks like it's somewhat nice, but it's really a nightmare. What this is, is a simple byte mutation fuzzer. It takes an input file, randomly changes one byte of a random offset in the output file, and obviously has some training harness to run and look for crashes. So in our case, since we were fuzzing the paintbrush application, we took some couple, you know, standard bitmap files, which is a pretty simple file format, and started, you know, spitting them through this fuzz.f90, which I believe this is all valid F94 TRAN, so it fits into our theme of 1994. I'm sure I could've done it in C, but that wouldn't be as painful, so it wouldn't have been as funny for you guys. So, of course, with any sort of, any sort of fuzzing run, the hardest thing is triaging all these samples. You know, normally you have tools like Bayonet Exploitable from Microsoft, or Crashlingler on OS X. And you have some sort of, you know, ability to automate this process somewhat. Unfortunately, in this case, you don't. So I had to, you know, dive into my Windows 3.11 VM, which amazingly still does run within VMware workstation, if you have it. And, you know, manually triage through all these samples to look at, you know, what type of crashes they were, if they were, like, you know, divided by zeros or general protection faults, and try to triage these a little bit so that I wouldn't have to do so much, you know, effort. But, you know, this borderland debugger is not the greatest tool on earth, so it definitely was a painful process. But, you know, there is obviously some evidence of memory corruption here. And it turned out some of these fuzz samples were trivially exploitable. They're simple, you know, StackBuffer overruns, which give us execution flow control. Some of the things you have to keep in mind, though, when you're actually exploiting Windows 3.11, Windows 16 as opposed to Win32, if you're doing the traditional popping your calc.exe, and you want to use your create process, create process doesn't actually exist in Win32, or in Win16, it was introduced in Win32. But we can use shell execute to pop the 16-bit calcs. Another sort of side effect of the Win30, or Win16 memory architecture is that there's this lack of isolation between processes. So if you hose one, application, your entire system goes down. So, you know, actually going through these crashes was just absolutely, absolutely ridiculously painful. So, we successfully eliminated the target by exploiting our MS Paint. I think they might have been designing the movie in MS Paint, or Paintbrush, I should say. Maybe it was like a flipbook style, kind of like my presentation here. So we've removed that from the past history, and no one else will have that burned into their retinas, anymore in the future. Thank you, thank you. Some other random bits, I submitted some of these vulnerabilities to ZDI. I wanted to cash in on these, you know, extremely high-severity vulnerabilities that I think should go for at least 100k, I mean considering how valuable they are, and considering how often, you know, everyone runs Paintbrush on their Win3.1 platform. And not only did I want 100k, but I also wanted the interest and inflation, since 1990, 1994, because that obviously makes sense. The vulnerabilities were discovered when I was back in time. So, you know, that interest should be adding up and inflating my payout. And the second question I have to ask for the developers at Microsoft, you know, what were you thinking? Why didn't you opt into DEP? I mean, you should have known that DEP was going to be created a decade later, and you definitely should have, you know, opted in permanent DEP set for PBrush, and you would have been set. None of this would have been an issue. And I don't know if you guys were at Black Hat, but Microsoft actually released their, geez, I don't even know what it stands for, exploit mitigation something toolkit version two, which, you know, sort of allows you to go back and change some of the DEP opt-in or other exploit mitigation mechanisms. So if you guys download this, make sure it works on all of your 16-bit binaries, and if not, call Microsoft nonstop and complain about it, because I want support to protect my Paintbrush app. So the only one serious slide I have in this entire presentation is about legacy systems. And if you guys caught HD's presentation, I think at B-Sides, and potentially, I think, tomorrow at the Sky Talks as well, he was talking about VXWorks, which is a very popular embedded platform, and some of the vulnerabilities that are still around in that. And that came out previously, previous to Windows 3X as well. I think VXWorks is from the mid-'80s. So, you know, these legacy systems tend to still be around. VXWorks obviously has a more significant footprint than Windows 3.1, and has more implications in terms of the vulnerabilities that HD uncovered. But the theme is sort of the same, that, you know, these systems are still out there. A lot of embedded systems actually do run Windows 3.1. A bunch also are, you know, Windows CE and so on, and XP embedded. But it turns out that Windows 3.1 was actually just recently end-of-lifed. It was in November 2008, which I didn't know at the time, but, again, when I was doing this presentation, I came upon this, and I thought that was fairly surprising that they were not only supporting this platform all the way through the end of 2008, but also still selling it. So it indeed is very popular for these embedded platforms, and it's not likely that any of these are going to be running Paintbrush or any of the other traditional applications that you would see on Windows 3.1 system, but it's something to keep in mind. When you're looking at legacy systems and sort of going back and saying, hey, what can we do with these systems that were around before we even were talking about the exploit techniques and the exploit mitigations that we talk about today at DEF CON and Black Hat. So, with that, I hope you guys had a good time. I doubt you guys learned anything, but if you do have any questions somehow besides how fast can you bong the beer, I'll be happy to take them. Thank you, guys. Steve Orin. I did look at some remote issues. There were some remote crashes in the LAN manager service, which is the same as WinPopup. So, you know, with a simple, like, one line SMB client's command, you could, you know, remotely crash the system, but I don't think that would be enabled on some of these Win 3.1 embedded platforms. It's possible. I don't know for sure, but I suppose I can post details about that if people are actually interested. It's only a DOS that I know of, so it's a DOS on DOS, no pun intended. Steve Orin, any more questions? . I would, but I don't have my Win 3.1 VM on this machine. I'll post a video for you later, though, if you want. . Yeah. . . . . . . . . . . . . . . . . . . . . . . . . . . .