So I'm Charles Edge, and I'm doing 10 ways how to not get caught hacking on your Mac. Most of this is a little rudimentary, but hopefully you're doing it. And if not, hopefully you'll start. Who here's got a Mac in their lap right now? Sweet! The first year I came to DEF CON with my 540C, I was the only one. So I sucked. Now I suck less, but I still suck. Anyways, I don't actually... Never mind. All right, so a little bit about my company, which nobody cares about. So the talk. First, I'm not condoning doing anything that requires that you need to use any kind of covert channels or anything like that. I'm just... That, by the way, is the best covert channel ever. So, wow. All right, so the more collaborative, the better, although we've got like 10 minutes left. So never mind on that. So the first thing that I was going to talk about, you know, is timestamps. So obviously, anytime that anyone goes to do any forensic work on your machine, one of the first things they're going to do is probably plug it into NCASE, and NCASE is going to catalog everything based on timestamps, right? So, you know, clearing out those timestamps helps to make it more difficult for anyone to prove that you did anything based on what time you did it. So you don't have to worry about the logs of that type. So this isn't just dates, files created or files modified, but both of those. So two different variables there to make sure to take into consideration when you're trying to hide your tracks or whatever. Don't touch it! Don't touch it! Don't touch it! Ah! So... I didn't throw the ball at that guy. I didn't just do that. Tell me your tracks. Yeah, tell me about it. Time stamps. All right, so my laptop just crashed. Oh, wait. Cover your tracks. All right. So we're going to do this like low budge style. All right, so when changing the time stamps on every file, make sure to do it on everything. Basically, the concept here is you're never going to remember to change the time stamps, so cron it out. Or if you're running tiger or above, make sure to launch d it out because cron's deprecated. Having said that it's deprecated, it still works if you invoke it, but you have to reboot after you invoke it for the first time to undeprecate it. Apple's great. They're great at deprecating services in that manner in favor of better services like launch d, which is what they replaced cron with. So basically, you build a shell script, you add an XML file into launch d, and you tell it to run every night. If you don't feel like learning how to use launch d because you're only using the Mac for certain types of things, then you can actually just use a program called Lingon, which gives you a graphical interface for running launch d. It looks a lot like the MS config screen of a Windows computer. How many people have seen that screen? So nobody? Yes, I've removed spyware in the past. All right, so if there's no history on your computer of what you've done, then it's going to be very difficult to trace what you've done. So clearing out those history files, not just removing the timestamp, but removing the actual history, specifically your shell history, and that's not just your shell, but your root user's shell and any other users that you happen to log into, and also the shell of the remote node that you might happen to be tapping into. Many of the GUI tools that you run, like if you're running ARD and you're sending a shell command out to 100 machines or something of that nature, you're actually running shell commands, and sometimes you can actually go into the root user's shell history and see what's happening, which is a great way to reverse engineer what Apple's doing, because they'll write a Cocoa interface, and then they'll write these shell scripts underneath, and they just won't call them .sh, they'll just have a name like discarbd or something of that nature. So clearing the history files from your system is a great step. And this, what did I write there? Oh, well, whatever. So keep the trash empty, and when possible, do a secure empty trash. Personally, on my machine, I have it tabbed out so that every night it does an SRM of my machine, um, which is just the actual command. The SRM is just the com... Is that better? Why didn't you say something sooner? You didn't want to be that guy that says, speak up. Anyways, sorry about that. Dude, it's Intel. Never mind. All right, so just throwing a file away doesn't get rid of it, blah, blah, blah. Emptying the trash is basically, in an Apple, you can go, and under, um, well, not under that. But there's this whole secure empty trash. There's actually a command line shell for that, SRM. So, um, SRM has a dash F. If you're going to script it out, make sure to put that in because it forces the emptying. Otherwise, if you have a script that runs at, let's say, 3 a.m. or, if you're like me, 5 a.m. because you're still up at 3 a.m., um, then the dash F will force it in case there's a file in use or hidden or something of that nature. So, you can also use the dash M flag, which you can use with the dash F flag, which will do seven passes of random data. And hopefully, whoever's doing forensics on your machine doesn't have an electron microscope because otherwise, I don't think they're going to find it. Right? Um, does anyone disagree with me on that, by the way? No love. Come on. Anyways. All right, so, um, while you're looking at your logs and your history, don't forget to trash your firewall logs. Apple, um, has ipfw.log, which will often log outgoing requests as well as incoming requests. It definitely logs everything from a, um, from a stealth mode perspective, so anytime it kicks stealth mode in, it goes ahead and logs that. Um, so, don't forget to delete your log archives, although if you're deleting your log every night, that won't really factor in, but that's still something to remember. Um... How am I on time? I got 10? Sweet. Halfway through. Um, okay. So, who here uses FileVault? Um, who here's managed to actually decrypt a FileVault? Okay. So, if you're using an Apple and you're not using FileVault and you're doing anything that you don't want anyone to intercept, what's the logical conclusion of the fact that no one raised their hands that they've been able to decrypt a FileVault? Uh, use FileVault? Yay! All right. So... I got one extra question. Yeah. Who's ever used FileVault and lost it? And who backs up? Okay. So, you didn't actually lose more than, what, a day's worth of work? Which totally sucks if you stayed up until 6 a.m., but... That's aside from the point. Um, yeah, I've lost my FileVault, too, but not since 10-3. Um, and I still haven't lost any sparse images that aren't automatically created. So, um, another thing is you can actually create a sparse image inside of FileVault. Therefore, you need two separate discrete passwords to actually unlock it. Um, FileVault can be unlocked using one of two different passwords. Is that better? Um, using one of two different passwords, a master password and your regular password. So make sure that both are strong, blah, blah, blah. Um, your root password will not unlock the FileVault. So... Um, so I use encrypted disk images for everything, especially hiding prawn from the wife. Um... Bad joke, sorry. I couldn't help it. Um, so, like with FileVault, the encrypted disk images store the files in an encrypted manner. Um, it's all pretty much AES. Um, by the way, is there anyone from Apple? I asked that same question at Black Hat, and no one raised their hand. And then after my speech, two guys came up and said, hey, you know, so anyways. Um, but at least you admitted you're a contractor, right? And by the way, Apple's got great security, I think, across the board. I mean, there are some holes, but they're proactively, um, doing things in their own labs to try to approach that. So I think that's, um, that's pretty strong for someone with, what, 4.5% of the market share? So... Um... So, um, FileVault stuff's easy to use. Um, if you don't use encrypted disk images, you can always also, or in addition to using encrypted disk images, you can use secure channels. Um, the metadata in music files, um, which, who here has seen Johnny Long talk? Not nearly enough. It's, it's, his latest talk is pretty, pretty funny. So if you haven't seen him, make sure to hit that. Um... And then, you know, steganography, um, hidden images in iPhoto and things of that nature. And then, um, something that some of us like to do is actually add false positives into your secure channels. So create secure channels that don't actually go anywhere. Um, nothing will make things take longer in forensic investigations than finding something in a file and just trying to, you know, track it down for months on end. Um... Once again, I guess I put clear those logs. Um, although before I wasn't talking about regular log files, I was talking about histories. Um, most of the files on an Apple system are in private var log. That's one of those funny things about the way that Apple's done, done this stuff. You don't typically CD into var unless you're running OS X server. You typically CD into private and then var and then logs. So, um, if you buy a Mac and you open up, um, and you double click on the hard drive and you're like, where's my var, where's my etsy, you know, that's, that's where it's just going to private. Um, from the GUI level, you can actually hit Apple shift G and type slash library and it'll pop up with all those folders that you're thinking are missing, so. Um... So once again, run scripts nightly to remove those logs because you're never going to remember yourself. Um, and then always, you know, SRM. The next thing is secure virtual memory. If I were to grab a machine and go to do forensics on it, I would probably also look at the RAM and what was on the RAM when the machine was shut down last or before the RAM got, um, wiped. So, um, virtual memory is a place that, that people often look for that stuff as well. So, um, when you do a secure, um... When you, when you use the secure virtual memory feature in Apple, or in OS X, when you shut down, it clears out all that stuff. So, um... And by the way, the reason I decided to give this talk is because last year I noticed that, like, about 10% of the people here were running on Macs. So I thought that it would be kind of, kind of good to, to say, it's not Linux, it's not BSD. If you edit your rc.local or your rc.com in file, those edits will get overwritten. So use launchd when you're making these scripts. I would steer away from using cron. You know. So, um, other forms of volatile data can obviously be accessed as well. Um, RAIDs. This is, this is my favorite thing. Um... I store, from, from my non-speaking machines, I store my encrypted home folder on a XAN volume. And basically, the XAN volume has two USB jump drives, and it splits all the data half between the two jump drives. So the fact that I've got... I, I can't imagine that anyone would actually be able to restore that data unless they had both jump drives, even if they knew my, my password to decrypt it, because all the data's encrypted, and it writes 64k slices to each drive. So reassembling that data would be quite difficult. Without running XAN, you can plug two, two jump drives into your computer, and you can just use that as a, um, as an encrypted disk image or a, a file vault home folder. Um, but when you use XAN, you can specifically drill down, and you can determine how many slices go to each LUN or USB drive. And XAN is written to run on fiber channel, but if you label the LUNs as free space, you can actually then take use of them inside of the XAN software with a couple small hacks that are available on xsanity.com now. Um... So... And if you're doing that, I can't fathom that anyone is ever gonna be able to decrypt your, your file vault, provided that they don't get ahold of both of your USB jump drives, even portions of files, because... because the, they would never be able to actually... Anyways. Does that make sense? Sweet! All right. Um... So the, the last thing is just don't keep stuff. Um... It's hard to get in trouble for having something that you don't have unless someone is able to trace it back directly to you for sure, no matter what. Um... Physically destroy system disks and RAM, if you have extra system disks and RAM, that is. Um... Don't keep data on your system. Doesn't mean that you don't have to keep data at all. There's lots of different ways to maintain data that aren't on your system. Um... Peer-to-peer networks are, funny enough, becoming kind of popular for that. Um... Secure channels on untraceable remote systems, which peer-to-peer networks, um... And then if you don't compromise the system too far, no one's probably gonna find what you've put on the system. So if you're running an FTP server on an unsuspecting system, then people probably aren't gonna notice. People typically in the Apple community especially only notice that their systems have been rooted if their ISP calls them and says, hey, you're running this website that announces itself as though it were eBay and is asking for people's passwords. I'm not sure what that type of attack... Never mind. Um... But... But there's not a lot of security analysis that's done on most MAC networks. So if you find a MAC system and you compromise it and you just don't go too far, then chances are no one will ever notice. Unless they hire me. Um... But anyways. So, um... And then even in most small businesses, which is Apple's core market, entertainment industry, small business, um... If someone finds something, chances are it's not enough of a monetary damage for, you know, any Feds to step into the situation. So they're probably just gonna delete it, reimage the system. So, you know, it doesn't become quite as big a deal. Um... Anyways, that's... That's it. TurboTalk. Um... I kind of did it a little fast because I didn't have that much time. So, um... I think we got a few minutes for Q&A. Are you aware of any analysis of Apple's file vault for the encrypted disk images in terms of its security? It's all AES. You know? I mean... Well, that's just for the algorithm they're using for the encryption. It doesn't say how well they could do it. Oh, you mean from the... I haven't... An analysis of the implementation. An analysis of the implementation. So decrypting and re-encrypting as opposed to the actual act of... of the encryption on the files? Is it secure? I haven't been able to crack it. And I've been trying for about a year. So, um... And... Has anyone else? It's as secure as both your passwords. It's as secure as both your passwords. I mean, in transit... Well... One exception is, if you're using network home folders and you're not using a public key infrastructure, then there are times when the passwords are submitted over the network, but that becomes more of a networking thing rather than a localized troubleshooting thing. But... The disk image isn't encrypted with the actual password. It's encrypted with the key, and then the password's encrypted. So the actual password's only encrypted in small parts of this image. The rest of the AES is actually being done through the actual key that's encrypted with the password. Right. That's why you have two passwords. That's the way Ubuntu handles... Um... I mean, if... Has anyone been able to crack encrypted home folders in Ubuntu yet? Right. So, I mean, it's the exact same algorithm and practically the exact same implementation, to be honest with you. Um... Any... Um... L.A. County District Attorney. I'm not a great forensics guy. I've gotten called into a few things for entertainment stuff in Hollywood, but outside of Hollywood, I haven't gotten... I work in Hollywood, too. Oh. It's like DRM and also, like, you know, possibly saying, like, hey, you stole this data, and you're using it on your site, and, you know, we've given you the citation, and we'll see you in court on said day. How are you going to serve? With a John Doe award? Or because... I'm tracking your IP address. The way... Okay, the way that it's come up in the past, with me, is I've found things, and then I've gone to the L.A. District Attorney. I've handed them an IP address. They say, we'll get you a John Doe warrant, and then they come back with the physical address of who it was. I mean, and in a lot of my cases, it's high profile, and not necessarily high profile like DRM, but high profile like, um, someone famous as Blackberry got hacked into, or stupid crap like that. And I don't know exactly what happens on their end, because I'm not a law enforcement person, but I'm a pretty decent MAC person, and when those kind of things come up, L.A. County sometimes calls me, or sometimes I call them, and that's when it's come up. Maybe there's a technical term that they use that they don't tell me, you know? I mean, not that they would be hiding it, but that maybe they think, oh, well, he's not a Fed, so he wouldn't care. But, you know. But if there's a better term that I should replace that with, not that I'll ever give this presentation again, you know, then I'd be happy to. I mean, if there's a better way for me to ask for that that makes them think I'm smarter, then that would be rad, too. It's a very common term. John Doe Warrant. It's a very common term he says. Federal state, local level. What the? Someone on TV. And a second one. I saw something about your jbot that you erased. Um, I don't know if that'll ever happen. Adaptec is pretty good. Where do you use it for hardware? Adaptec sucks. On the MAC. I mean, Adaptec is awesome on Windows 2003, on, you know, but on the MAC, their MAC support has just gone, I mean, if you use SCSI, go ADO, period. On a MAC, you know. What are you using for RAID host controller, on hardware and on software? Hardware? For the RAID host controller, usually ADOs. Wait, you mean on my iBook? Or my MAC Book? On my MAC Book, I'm using software-wise, XAN, and hardware-wise, I'm just using my USB interface. Hardware-wise? I think you might use, like, Apple went straight to Fiber Channel. Apple pretty much did go straight to Fiber Channel as far as their... And really, you know, in an XServe, you're gonna get a promise with a SATA connection, so it's not really necessarily as, you know. But you can totally use USB 2.0 with XAN. Am I all done? Yeah. Sweet. Bye, guys. Thank you. Oh. Do I have one more thing?