start	end	text
0	6340	Okay, so my name is Hedlo Seek, Ricky Lausche, and this is my
6340	15220	talk, Micro Hard More Like Micro Easy. Pause for laughter. And
15220	20340	off to a great start. Okay, so yeah, first off, let me
20340	24360	introduce myself. I'm a principal security researcher at
24360	29160	Keysight Technologies. I'm based out of Austin, Texas. I focus
29160	33780	mainly on offensive IOT research. And I've been doing
33780	37640	this kind of stuff professionally since 2009. And I
37640	41600	speak at conferences fairly regularly. I've spoken at DEF
41600	46460	CON like five times on the actual stages and this is my
46460	51040	first time speaking at IOT Village. And then I have
51040	56140	several hobbies. Most of them involve me drinking whiskey.
56920	62060	Okay. So that's who I am. Let's talk about who Micro Hard is.
62060	67020	They're a Canadian based device manufacturer. They make
67020	73600	basically cellular bridges for Ethernet and serial devices.
73860	77740	They're used in lots of different environments that
77740	82180	people really care about. Such as like, you know, power
82180	87180	utilities. I see unmanned vehicles listed on their list of
87180	91660	industries. You know, just basically everywhere you could
91660	95880	possibly think of needing to remotely access a device. They
96480	102080	claim to be involved in some way. Okay, so that's Micro Hard
102080	106340	as a company. Let's talk about the device that we're going to
106340	111880	be looking at today. It's called a Bullet LTE-NA2. NA is for
111880	116500	North America. So yeah, this is an LTE bridge for adding
116500	123300	cellular connectivity to serial and Ethernet devices. You know,
123300	128380	it's meant for managing installations remotely. This is
128740	132940	a quote from their website. Connect any device, old and new,
132940	136620	serial or Ethernet and provide cellular remote access using the
136620	141820	Bullet LTE-NA2. You know, what could possibly go wrong?
142520	145840	So I actually got this device because I was doing a security
145840	151760	audit for a utility company. And they were wanting to deploy a
151760	155000	bunch of different devices and wanted us to check the security
155000	158820	of the devices and this was one of them. And I did not end up
158820	164500	recommending that they deploy this in the field. And you'll
164500	171300	see why. Okay, so first off, from a hardware perspective,
171790	177120	it's a 32-bit ARM Cortex A5 processor which you can see in
177120	180360	the top view. This is kind of like the top of the board and
180360	186080	the bottom of the board kind of picture. It's got down in the
186080	189960	bottom of the top view next to that orange-ish, yellow-ish
189960	201280	thing is expansion flash firmware chip, 128 megs. The
201280	206220	it's also got 256 megs of RAM. And then on the underside of the
206220	213000	board, they've got this QuekTel modem, EC25-AF. And then they've
213000	219620	also got connections for a SIM card slot, PoE, Ethernet, USB
219620	224340	and serial in addition to a couple of programmable I.O.
224340	232420	ports. And then from the firmware perspective, the
232420	236740	firmware updates are completely unsigned and unencrypted so you
236740	241740	can pretty easily forge your own if you wanted to. And they were
241740	247220	also easy to extract with bin walk. Inside the firmware
247220	251060	updates, it's got the boot loader, it's got the Linux
251060	255280	kernel and it's got a full squash FS file system. So
255280	259320	basically you could fully emulate the system if you were
259320	267810	so inclined pretty easily. And then the software itself, the OS
267810	276690	is based loosely on open WRT running a Linux 3.6.9 kernel. In
276690	281750	the version that I'm going to be demonstrating today, they were
281750	287270	using UHTPD for web. They changed to that in the subsequent
287270	292930	version and you'll see why they decided to change it. And then
292930	298170	yeah, they use DropBear for SSH and TelnetD for Telnet, kind of.
298170	301730	They actually have whenever you log in with one of those
301730	306850	services, they end up dropping you into like a jailed debug
306850	313850	environment which we'll talk about extensively later on. And
313850	318410	then on the UDP side, they've got a discovery service that
318410	323090	basically depending on the type of device you're using, will
323090	327750	send out a discovery probe or will answer a discovery probe on
327750	331310	one of these three ports and give you a lot of information
331310	339650	back. So it wouldn't be one of my talks if I didn't discuss a
339650	345390	discovery protocol because I love discovery protocols. So on
345390	349950	this one, like I said, it listens for broadcast UDP
349950	360930	messages. Port 2077 or 20,077 is for 3G devices. 87 is for IP
360930	365110	based devices and 97 is for LTE devices. So this one would
365110	373150	respond to broadcast messages it gets on port 20,097. The magic
373150	377990	probe is the same across the board. And let's look at what
377990	382870	that looks like. So you can see this is a scanner that I wrote
382870	386470	where I just like send out that broadcast packet to each one of
386470	391390	those three ports and then I listen for responses. And so
391390	395670	this is what the response looks like on the wire. One kind of
395670	404010	annoying thing is they will respond to you from a random
404010	408250	port on their side to your source port but on the broadcast
408250	413730	address which makes it really hard to correlate responses.
413730	419950	There you go. Okay. So that discovery response contains a
419950	424510	lot of useful info. It's got the MAC address and the IP address.
424550	428190	It's also got the host name and the SSID for any kind of
428190	434870	wireless stuff. And then it has the model name and the firmware
434870	441030	version. And then it's got this thing called NMS. That's the
441030	444310	network management software. It's like their cloud based
445370	448210	thing where you can register all of your devices and track the
448210	452310	GPS location of all of them. It's got the domain and password
452310	455990	hash but I'm not going to be talking about NMS today because
455990	462890	that's not part of this talk. Okay. So and yeah, I wrote a
462890	466210	scanner and response parser and I'll put it up on my GitHub
466210	473730	which I'll link to later. Okay. So let's actually get into the
473730	477550	bones. So the web management portal, this was kind of the
477550	481150	main focus of my audit when I was originally looking at these
481150	487830	devices. Like I mentioned earlier, it's UHC2PD based on
487830	494010	the version from open WRT in 2014. It's used for configuring
494010	498990	basically every aspect of the device. And it is also reachable
498990	504050	from LAN and WAN side. And that's enabled by default and
504050	507530	you have to actually turn that off if you don't want it
507530	512870	reachable from the WAN side. But the best part is it's all shell
512870	519990	scripts. So like this is the directory listing and it's
519990	523890	literally like every single page is a shell script wrapped with
524050	529950	a GUI. So you know, of course, there are multiple command
529950	535030	injections throughout this thing. They're all post off. So
535030	540730	you need a valid user account in order to access these pages. So
540730	544170	yeah, multiple command injections. My example that I'm
544170	549690	showing today is with the diagnostics page because, of
549690	553710	course, it implements ping and if it has ping, it has command
553710	559430	injection every single time. Oh my God, is that really my time
559430	565030	warning? Okay. I have to really book it. Okay. So yeah, it has
565030	568650	ping. So they tried to sanitize input but it failed pretty
568650	572290	horribly. They just sanitized the host name and didn't worry
572290	576590	about any of the other arguments that you put in there. So yeah,
576590	580310	just leave host name blank and then put whatever command you
580310	586250	want all in the account parameter. And let's show a demo
586250	594770	of that real quick. Okay. I'm not going to go into lots of the
594770	598170	details of the exploits because I'm about to run out of time
598170	605250	already. But yeah, so this is post off. So you need a valid
605250	614490	user name and password. But then you run that and eventually you
614490	620330	will, hey, you got a root shell. Because you injected, you know,
620330	623250	whatever command you wanted to run and it has net cat on it so
623770	626950	I was able to get a root shell pretty easily with that one.
629430	638740	Okay. We're going to hurry up. Okay. So yeah, like I said,
638740	643720	those phones were all post off. But I really wanted something
643720	647780	that was pre off because that's so much sexier. So I started
647780	651100	looking at the authentication, the way they handled
651100	656740	authentication. And as far as logging in, it was vanilla open
656740	663840	WRT. They used basic off. So basically base 64 encoded user
663840	671080	colon pass. And so since this is, you know, UHC2PD that's
671080	674960	part of open WRT, you'd think it would be very well vetted and
674960	678800	everything. But it is an open source project so they were able
678800	684660	to make their own modifications. And so logins were generic log
684660	689840	outs was where they made a mistake. Basically they wanted
689840	695020	to set the basic off header to log out colon log out. And then
695020	699560	they did like a stir copy of that buffer to a statically
699560	705560	sized buffer. And then they could compare what it was to
705560	710780	log out log out and, you know, log the person out that way. But
710780	716120	yeah, they didn't do any bounce checking or anything. So yeah,
716120	718880	you can see, I'm just going to skip past this because I'm
718880	724820	running out of time. But yeah, you can see, you know, stir
724820	733280	copy and yeah. Okay. Let's do another demo. I am actually
733280	736100	going to talk about the code of this one because it was a very
737220	744480	pat myself on the back kind of thing. This was my first ever in
744480	754020	the wild ARM ROP exploit. So basically, yeah, so they do have
754720	760020	ASLR and I wasn't able to find like a memory leak or anything
760020	769440	to leak the base address of lib C or UC lib C. So I, for the
769440	774040	purposes of this demo, I disabled ASLR but it is the lame
774040	778900	version of ASLR where they only randomize the top part. So in
778900	785980	theory, you could brute force by just like picking an address for
785980	789460	the base of UC lib C and then just trying over and over again
789460	792460	and it will just crash the website if it doesn't work and
792460	796160	if it, you know, if it eventually works, then you get a
796160	802940	shell. But yeah, so basically just, you know, calling a system
802940	811340	from UC lib C and passing this command as the argument to UC
811340	821560	lib C. And this one, hey, that was really fast. So yeah, no
821560	825360	authentication required for that one because it's exploiting the
825360	835150	authentication protocol. So there's that one. And this one,
835170	847430	and, okay. Okay, so I disclosed those back at the, when I was
847430	855310	doing the audit originally. They fixed it in R1112 by adding
855310	862090	more sanitization and then they switched from using UHT TPD to
862090	867630	using light TPD. So they no longer use UHT TPD. But it's
867630	872450	still all shell scripts. So yeah, that was the end of the
872450	877150	audit and I kind of stopped thinking about the device. This
877150	880910	release note still burns me to this day though because that was
880910	884330	the extent of the release note that they used for fixing all of
884330	887590	my critical vulnerabilities. It was miscellaneous housekeeping
887590	894410	tasks that really, really bugged me. Okay, so cut to like a few
894410	898330	months ago I decided to dig this device back out and look at it
898330	901490	again. And this time around I was looking at the telnet portal.
902090	908330	So like I mentioned before, it's a jailed environment but they
908330	914170	give you lots of access to like QT commands for that, not QT, AT
914170	918290	commands for the quick tail modem. So yeah, you can see they
918290	923410	give you lots of commands. And that's handled by slash bin slash
923410	928490	CLI test. That's spawned every time you log in as the admin
928490	934510	user. And that defines all of the AT commands but not all of
934510	938970	the AT commands were documented. Okay. So yeah, there was an
938970	943210	undocumented command called ATM bash command that lets you run
943210	951890	two bash commands. PS and cat. And that's it, supposedly. But
951890	956690	the way they verified that is by using certain case compare. And
956690	960770	they were using the length of what they were comparing from
960770	965970	either PS or cat. So as long as the string like began with PS or
965970	970390	cat, then you could put whatever you wanted at the end of it. So
971290	975510	basically, yeah, you just do like PS semicolon and then
975510	980430	another command and there you go. Okay, one last demo and then
980430	999310	I'm basically done. Okay, so again, post off. All right,
999310	1007810	there you go. Okay, so let's just blast through these last
1007810	1012530	couple of slides to wrap up. Okay, so that one was actually
1012530	1016170	coincidentally fixed like the month before I found it, which
1016170	1021550	was also kind of annoying. But the fix like I mean, it was it
1021550	1025670	was basically just bash command, they removed that one and didn't
1025670	1029490	touch anything else. And may have also added in some brand
1029490	1034050	new command injection forms in the latest firmware. But yeah,
1034050	1039470	so you can see where they were trying to secure things and then
1039470	1043890	they just failed miserably every single time. They need actual
1043890	1049790	like, you know, secure development processes. And also
1049790	1053290	I get really pissed off about the vague release notes because
1053290	1056890	in my opinion, it like minimizes the impact if I saw something
1056890	1060670	that just said, you know, miscellaneous housekeeping tasks
1060670	1064370	and I'm running in a critical environment, I'm going to
1064370	1067790	completely ignore that update. Because it seems like it's
1067790	1071070	something I don't have to install. And so it's just
1071070	1075050	leaving me still vulnerable. But yeah, and then if it has
1075050	1079590	command, or if it has ping, it has command injection. And
1079590	1083190	that's how you get in touch with me on headless eek on most
1083190	1090490	things. And that's my GitHub. And yeah, that is it. Sorry if I
1090490	1094090	went over time. That's it.
