start	end	text
0	6840	All right, we'll get started here. I hope everybody's here for this talk on the engine room at 1.30 for the
6840	10880	Hack to C. I'm Kyle O'Meara. I'm David Blasco.
11220	15900	And we'll talk to you about the tear down of a SATCOM terminal that we did.
16380	18460	Here's our CYA slide.
18640	23020	Unfortunately, due to responsible disclosure process, we
24060	29980	actually anonymized the vendor for this until a later date, and I'll talk about that on my high horse in a few slides.
31200	37500	So who we are, we both work on the reverse engineering team at the Software Engineering Institute, CERT-CC,
37500	43320	so like the original FFRDC that's been coordinating vulnerabilities since 1988.
44900	50760	Some of the skill sets that, you know, some of the things that we do, we do both the malware reverse engineering
51380	56400	type stuff, but also we do like all research into devices and things of all sorts.
58500	66160	So really the motivation behind this was that in 2015, IOACTIV did a presentation at Black Hat,
66160	71300	you know, where they took a bunch of different satellite terminal firmware, did some, you know, vulnerability
71300	74060	fuzzing analysis across all the different types of firmware.
75400	81900	And then in like 2017, you know, we do, you know, how we work, we do partnerships with the government and we, DHS
81900	86200	had reached out to us and said, hey, whatever came up of all that stuff, we know that the vulnerabilities were
86200	91220	coordinated, but did anything else find, did they, were things fixed is usually the question and that's usually
91220	96960	hard to answer. But, so one thing we wanted to do was that at that time, IOACTIV didn't actually purchase any
96960	101480	SOC comp terminals themselves, like physical devices, they just looked at the firmware themselves.
101480	107040	So we decided to buy one of the ones they spoke about and then dig a little deep into that.
107440	113760	Obviously, I can't tell you what it is yet, but really the methodology was like find vulnerabilities,
113760	118540	see if we can get any exploits and gain full control, obviously the typical way around doing stuff.
118580	124300	So we'll talk about really this device analysis that we did and the findings as well as the findings and analysis
124300	129520	of the firmware, right? So we looked at both of the devices, or sorry, both parts of the device.
130520	136920	So this is where I'll get on a rant real quick about what actual responsible disclosure is and a little bit how this
136920	143740	actually works. So back in April and May, I reached out to the vendor, submitted emails and like hit stuff on their
143740	150480	contact page because they didn't have a proper way to submit vulnerabilities to them. So I did my due diligence twice,
150480	156520	received no responses. And ironically, through helping out with Hack to C-Village, I met some of the other people
156520	161700	that were helping out and they happened to have a contact. So I said, yeah, everybody deserves a fourth chance, right?
163280	169660	So I decided to reach out. So this is like, you know, end of July, a few weeks ago, right? Not even a month ago.
169660	176960	The person did respond. I said, hey, here's a list of all the stuff. We're going to be going public on this date.
177440	182540	I reached out to you back here. Here's the actual attachment of the email to see that I actually sent you an email.
182540	188840	If you go back in your contact forms database somewhere in the black abyss, you'll probably see that I submitted stuff there.
189080	196880	Well, they got all on a pissy about this not really responsible disclosure. So what I want to say about that is that
196880	202060	responsible disclosure doesn't start when the vendor chooses to respond to you, like that timeline that you make.
202060	211060	So DHS has a 45 day timeline. We were giving them 90 days plus, right? So, but who we are and what we do,
211060	215920	we decided to anonymize this and we're pushing for a slated of September 10th disclosure date.
215920	222320	So that'll be on the vault notes on the CERT website, but you can also find it on the DHS website too, once it goes public.
222320	228580	So that's really the thing is that as a researcher, when you contact a vendor, that's when your timeline starts for yourself,
228580	232940	whatever that is, if that's 30 days, 45 days, because there's not really a guideline to do that.
232940	239380	And if there's problems with doing that, that's why CERT CC exists. So reach out to us and we'll try to help work that process.
239380	245820	I know DHS is also working with DEF CON and Black Hat as a whole to submit things anonymously and things like that.
246780	253340	All right, off of that high horse. So look at the device, basically take it out of the box. What did we find, right?
253340	259780	So what it, you know, it basically it's like an access point that has a SATCOM uplink, right, and downlink. That's sort of how it works.
259920	266800	So we looked at like how you connect to it wirelessly, right? There's some port scanning and analysis from that and then looked at the web application itself.
267600	273140	So by default, and this is in like, you can go on the, you know, they have it in their documentation, is that the password is the serial number,
273140	282380	which is just eight digits long, right? So if you create a text file of every possible eight number enumeration, six CPU, you know, machine I have sitting on my desk,
282380	290440	not even doing GPU would have cracked the password in four hours, right? You know, catching the traffic. The web app itself obviously didn't have HTTPS run in, right?
290440	297320	So you can just see anything as go. It has no default login password. So you can like, anybody that connects to the device can log into the admin portal, right?
297320	306020	And then that has like everything it can do, you know, it can port forward things and all that stuff. The root directory had no restrictions as far as like accessing files from there.
306020	312860	So, you know, think of it from an adversarial standpoint, right? If you couldn't get access to stuff, but you knew that if you got a file into the web directory.
312980	323160	So I knew what was in the web directory based on like looking at the firmware. So I would just do like, you know, just a simple, even in, you know, burp suite or just a get request for a file that I couldn't actually see in the web portal and I would be able to download it.
323160	333040	You know, your typical like X frame headers weren't turned on for the protection of click jack and your cross-site scripting, right? Simple things that could be easily implemented.
333040	342180	And then there has an asterisk server that does like the modem, you know, phone connections using one of the scripts, you know, that's out there for the Nmap scripting engine.
342180	350740	It basically semi DDoSed it when I executed against it. So it would like intermediately drop and then come back online, intermediate drop and come back online.
350740	359360	Obviously port scanning, you had some typical stuff, right? Obviously, you don't like to see telnet. Didn't know out the gate what 5454 is. We'll talk about that in a second.
360800	372120	You know, your SSH typically, you know, your port 80. But what's interesting about port 5454 is that you can actually log into it unauthenticated.
372120	383620	And then it basically, you had the ability to query it for about 86 different AT commands. So AT commands are the Hayes commands, a lot of modem, you know, interface with the modem itself.
383720	395080	What was interesting is that they had two shell possibilities there, right? That weren't the typical AT commands, looked like they were AT commands initiated by the vendor itself.
395080	404220	And from there, you know, you could get further access, but we didn't know, we tried everything, debugging as possible and fuzzing a bunch of different commands.
404220	412540	And so we weren't able to get further access, but you'd still be able to run all these different AT commands and see what type of modem it is, what software it's running and so forth and so on.
416140	425160	So most of my background before coming to CERT was doing embedded software development engineering for Booz Allen in Central Maryland.
425660	440200	And so I have a lot of background in looking at firmware things. And one of the things that I like to do when I talked to Kyle about doing this was to just get a sample of the firmware from the vendor and just break into it and kind of see what we can do with it right out of the box.
440200	450160	One of the cool things from this vendor is that you can just go directly to their website and tell them your first name and an email address and you have full access to all of the downloads for the firmware.
450160	453700	So it's super secure, going back from version 1 the whole way to the latest release.
454240	462700	Inside of every download is a manual of upgrade steps and then the firmware file proper.
462700	471740	And this one is called a TIFF file. I don't know if anyone's ever seen a TIFF file before, but the only person to ever ask Google was this guy back in December.
471860	477660	So someone else out there was interested in it at some point and nobody knew, nobody responded.
477660	482120	And then eventually that post just disappeared and then it fell out of Google cache.
482120	492660	So I thought that was interesting. It kind of just goes to show you that there's people out there looking into doing this sort of analysis besides us.
493740	500400	Looking at the TIFF itself, I like to use binwalk. It's like a firmware extraction utility for binaries.
500400	512700	It'll walk through the binary and try to pull out any squash files, zip files, anything that it recognizes as an extractable object from the binary.
512940	522460	And after executing binwalk on this sample, it drops out four different squash directories full of files and goodies for us to take a look at.
522460	529540	Most of the stuff that we're going to be looking at, or that we looked at, was the vendor software applications folder in the root zero folder.
530180	532400	So that's where I started.
534380	544000	Also to help out with the process, back when I originally started doing this analysis and looking at the firmware, I wrote a tool that's out there to help parse you and help you point down the different indicator paths.
544000	555580	I spoke about quickly that yesterday, but if you just look for trauma, basically it's just a Python script that allows you to look for different strings and file types that might lead you down some vulnerable paths of some sort.
555980	568660	Or maybe nothing, but it's still good to know that if this one file has the keyword root in it like 20 times, you're like, why does it have that? Is it hard-coding stuff? Did it comment out stuff? You'd be surprised how much stuff is left behind.
568660	576260	So specifically looking at some of the software on the firmware itself, the version right out of the gate had Whitey running, which is like a web server.
576420	584420	And there alone, it had seven known CVEs, and only one had a public exploit for it, and it basically DOSed the terminal.
584420	591940	So just using Dr. Google, going to exploit DB, pulling that stuff down and executing it, it worked flawlessly and DOSed the machine.
591940	596860	I actually had to unplug it, countdown 10, plug it back in for it to boot up again.
596860	603320	And then I was running an old version of BusyBox, too, that had six known CVEs, but no public exploits.
603320	609060	But obviously we all know just because there's no exploits that exist to this day doesn't mean that someone can't spend time to find it.
611060	625100	So as Kyle said, running trauma kind of gives you a good look at what the vendor has left behind in the firmware or any of the scripts that are remaining on the terminal or any device that you're looking at.
625100	637760	One of the interesting places for me to look was in the OEM scripts directory, and they left basically all of their development or unit testing scripts inside of this library in root zero.
639380	653920	The most interesting things out of there for me, you can spawn shells and communicate across subnets to different parts of the device, like the Wi-Fi can go talk to the BGAN, things like that.
653920	660840	There's also some development platform stuff. I'm not really sure what exactly that was, but it probably shouldn't be in there.
661100	668600	And then one here at the bottom is called TIFF. And just real quick, as I was mentioning, the shell scripts were mostly debug stuff.
668620	676600	You can move across the device with hard-coded passwords and usernames, ports. That was nice.
677040	682620	And then you can flip the mode. If you're an adversary, you can just execute the script and just start telling it to go do something else for you.
682620	687000	So that was cool. And as I mentioned, you can pull back all the firmware from the vendor.
687000	692860	In version 1, we found the proper root password just sitting there in plain text.
692940	705120	After version 2, they finally soldered it. So it's a little bit more difficult to pop out, but it definitely does match across versions from 1 to N so far.
708060	715960	So yeah, cool, we found some low-level hanging vulnerabilities, but so what? The idea was to get full control.
716720	721960	Yeah, and as we talked about, the root password kind of stops working at some point.
723840	733780	There is an authentication module that has authentication passed to it based on your login type.
733780	746320	And the shared object, without boring you to super excruciating painful details, basically generates a random number, MD5s it, throws it against a public key, spits it back to you and says,
746320	759360	this is your key, now go tell me what the real password is. So I'm assuming that means that the developers have a two-factor server somewhere else or GUI that they just pop that value in and they can log back in.
759360	765260	So it's basically the only protection from anybody getting into this box as root.
765660	777560	So one of the ideas that I had was, if I don't know this two-factor authentication mechanism or I don't want to just go try some other method to get on this box, like buffer overflow or something,
777560	789820	can I just maybe go take that configuration file, erase the part that says authenticate through this PAM shared object and just log in as root normally.
789880	798460	So my idea was to just rebuild the firmware. I'll make my own vendor firmware and push it to the device because it probably will work.
798460	806180	And inside of that scripts directory that I talked about earlier, we have two Python scripts. One is the tiff.py, one is the list tiff.py.
806720	815540	One will define every portion of the tiff and one will use that information to unpack the tiff recursively and pop out all the data that you're looking for.
815840	822360	As I mentioned, the classes that are used by this one script are all listed here.
822360	837800	The most important thing is the tiff blob types. Every section of the tiff is labeled with a header and the list tiff.py knows how to unpack each of these based on the tiff blob type.
837980	844570	Only four of them are used right now, but I'll give you a quick rundown of just starting from the top.
844570	857730	The tiff file has a header, a defined header that starts out with fit tiff and then just CRCs, versions, release numbers, header lengths, body lengths.
857810	864650	There's nothing on here that's obfuscated in any way. That's just the straight up definition of what that header file looks like.
864810	870630	So that's kind of like the visual breakdown of what it looks like in a hex editor.
872570	878510	Let's see here, what's next. So we have the content header. So now after we've defined the top of the file, we can start walking down the blocks.
878510	887670	So now there's a content section. The content section is defined as having a CRC type, a length for the header, a body length, a body name, and a body CRC.
887670	900130	There's, again, no secret sauce here to doing anything magical with this. This is another just straightforward, I'm going to match the data up to what exactly the enumeration is or the definition is from the tiff file.
900130	910670	And then we're going to start kind of pulling this apart. Once you get through the blob, now you can look into the content, and the content will dump straight up.
911070	920470	I'm going to skip ahead, I think. It's just all data. Probably not super interesting. As interesting as that.
921690	926950	So inside of tiff.py, we're just going to recursively walk through it on execution. It's basically like binwalk.
926950	933390	It's, as I said, just going to chunk up all the data and spit it out into one directory per image format.
933550	942030	And because there's no mainline inside of that script, I kind of have to do a little modification and execute Python on it.
942030	949330	And when it's executed, you have a whole output just telling you exactly what everything is on here.
949330	961070	And then we can use that information a little bit later. As it's saved off in something called a manifest, we'll go back and read the manifest and then walk back our rebuilding process.
961610	976450	The contents, once we've run the list tiff and run on squash, on all these squash directories, it breaks out a little bit better with names and kind of like a better direction of what you can be looking at.
976450	985870	For example, we have applications native to the vendor space inside of the applications directory. The image has additional tiff images including recovery binaries.
986290	992850	It has some Xilinx firmware in it that we didn't look at, the user manual. There's a USB configuration directory.
992850	999770	And then the other important, I guess, kind of neat thing was this zoom file, which I suppose means just properties in Latin.
999830	1006130	And it just tells you a little bit more information about the images if you want to do some development on them, I guess, from the vendor.
1007590	1012130	So knowing all that, I told you that story to tell you this story.
1012130	1018130	So we have, we can now think like an attacker. What is the nation state that hacker trying to do in this sort of space?
1018130	1029850	If it's me, I can sit a mile away on an antenna. I can crack the password and upload my own firmware because there's no default, there's no credential keeping me out of the administrative portal.
1030050	1038150	I can write any kind of traffic, interception. I can probably pull SMS records, call records, do some GPS spoofing, take down your box.
1038350	1043070	And we can do that all with a custom firmware that we can write knowing what the vendor told us.
1043070	1051690	And very simply, it's removing that PAMP configuration just as a simple POC.
1051890	1057990	We're going to re-squash each unsquashed image after we've done our modifications.
1058430	1063550	We'll repack the TIFF, keeping it all in the same order of contents. We'll make sure we correct the header lengths, the CRCs.
1064950	1067910	Make sure we align our bytes properly, too. That's very important.
1068310	1070250	And then just load it to the terminal.
1070970	1075950	Not anything super exciting, but I made a tool to do this that I talked about yesterday at the Buoy workshop over there.
1075950	1080990	If anybody got to stop by and see that, and if you want to see a little bit more detail about that, we can chat offline.
1081870	1091830	Just the basic test drive of this is tear down an existing patch and rebuild it and see if what I wrote in my Python after a couple weeks is good and works.
1092410	1098950	And the easiest way to do that is just MD5 it. And my MD5s ended up matching, so that's when I went to town and made my own.
1099410	1102190	My own firmware with a modification that I was talking about earlier.
1102410	1106830	And it's super simple. Like I said, you've got to be inside of the administrative portal.
1107070	1113450	We want to click the buttons. We can only downgrade one number or upgrade incrementally.
1113590	1118350	There's no... you can't re-release version 1 on top of version 1.
1118350	1124170	That's the only error checking that they seem to have or only prevention for this sort of an attack.
1125170	1131010	So we build it and we loaded it and then the system goes down.
1131110	1142870	It's not super exciting without videos or pictures, but when we go to load it and log in and we have root with a root password, there's no animation there.
1143150	1144310	Oh, and then what's that?
1145070	1149510	Yeah, yeah. And because the vendor's anonymized, I made sure I put my own logo at the bottom.
1149510	1153930	You can do this kind of thing. This is a real life attack.
1154530	1161430	Vendors, not just from this company, but Satspace in total, need to be aware of this sort of an attack.
1161430	1165890	And this is a possibility for real things. Whether they're working on something for mitigation or not, we don't know.
1166830	1170850	But that's actually my last slide. I don't know if you want to close up with anything.
1170850	1177190	Well, that's it. We'll take any questions or comments, concerns.
1187710	1198990	Yeah, so the question was, how do you kind of line up what you're looking at inside of the TIFF without having that TIFF-Python thing to pop everything out for you, right?
1198990	1203270	That's kind of what you're doing. So I'm having some experience. We've talked about this before offline.
1203270	1210410	But having been in that space before where I'm looking at firmware that I'm putting back together, you just have the inclination that there's CRC bytes here.
1210650	1216390	You look for the length stuck somewhere in a header. Or you just look for section lengths.
1216390	1223390	A lot of them have a name in ASCII that was readable in a hex editor.
1223390	1227530	So you can kind of see where your headers are starting and ending, and then you can kind of work from there.
1227530	1230930	So that's just kind of my process for doing that without knowing any better.
1242710	1257050	Yeah, so we did our own CRC recalculator. The question is, if you make a modification, does it impact what you're trying to put back into the TIFF file?
1257050	1260110	And the answer is yes. We had to always make sure that we were MD5-ing everything.
1260110	1264230	I didn't use anything that the manifest told me as valid truth for a CRC.
1264230	1268390	I always took my blob and I CRC'd it myself and attached it into the headers.
1272010	1273550	Yeah, one at a time, yep.
1278410	1284550	Firmware rewriting, once you kind of figure everything out and have some non-erroring script,
1284550	1288310	it probably only took like two weeks, I think, start to finish.
1289350	1297710	And that's not even a 100% dedicated task. We're both on the malware team and supporting malware analysis across DHS and DC3 and AFOSI.
1297830	1301390	We're just kind of poking this in our own free time.
1302890	1309270	Is your admin console, is that accessible via Wi-Fi or is it also accessible over the satellite?
1309570	1315590	So we didn't look at anything from the uplink, downlink yet. I've been told you should probably look at it.
1315590	1321530	So that alone tells me that it's probably unencrypted, uplink and downlink from the satellite itself.
1321530	1326570	But no, we just access it. You can access the device either by Ethernet.
1326570	1332030	It has serial, I think it has serial port on it. There's USB and then there's Wi-Fi.
1332030	1335370	Your typical way to connect to it is either hardwired in or Wi-Fi to it.
1335370	1343230	So the reason I ask is, is there actually a Wi-Fi range or is it via mobile? Is that phone range?
1343230	1350810	So, yes, but the caveat is that by default there's no port forwarding turned on on the device, right?
1350810	1356150	So you'd have to like probably either hope that that was already turned on for you to get past it.
1356150	1361630	But I think if, you know, I guess the real answer is I haven't tested it because we didn't do anything.
1361630	1366690	We bought a SIM card, right, and do it, but it was like 100 megs and we're like, oh, we'll wait until we're ready and stuff like that.
1366690	1370370	Plus it's like, you know, we're not RFI guys by day, right?
1370370	1376150	So we'd have to like figure out how we're going to capture it, you know, with a hack RF1 and using GNU radio and that's a pain in the butt.
1376970	1380930	But yeah, I would say the one would actually work because it's attacking port 80.
1380930	1384250	So that would be exposable. So I think that would be it.
1384250	1391510	I guess the port forwarding is like we wouldn't be able to like log into port 5454 and things like that and do the AT commands unless that was forwarded out.
1391510	1396230	But 80 would be open. So yes, theoretically, it should work from wherever you're sitting.
1396230	1399230	If you knew where the IP address of that machine was.
1403110	1407250	Any other questions, comments, concerns?
1407670	1409730	Oh, cool. Appreciate it.
1422190	1425810	It's anything like I mean, they're not like it was only five grand.
1425810	1428870	I know only five grand, but like so theoretically anybody can buy one, right?
1428870	1432550	It's used a lot on maritime. They advertise for like militaries and things like that.
1432550	1438970	So it's a pretty prevalent one. Like if you go to the IOActive like 2015 talk, he did it.
1438990	1443130	It's one of those five, right? I think he talked about five different vendors or four.
1443130	1446490	It's one of those four. So it's a prevalent one. It's a very prevalent one.
1446510	1451990	We picked one that was really easy to get and like in the easy to get as like I didn't we can't buy things off eBay.
1452050	1456150	So our purchasing department is like you buy things off eBay.
1456930	1461930	So we had to find like some third party vendor that was going to sell it and stuff like that.
1463890	1465310	Cool. Thank you.
