start	end	text
0	6220	This talk is about VPN filter. The malware campaign. And because
6220	8960	this is the ICS village, we're going to focus about half the
8960	13160	talk on ICS specific component of this, which had some Modbus
13160	16720	capability and try and give everybody a better understanding
16720	21920	of exactly what that was. So this is I'm Patrick DeSantis.
22060	26140	This is Carlos Pacho. We are two of many researchers at Cisco
26140	30740	Telus that spent a long time working on this project. Many
30740	34620	months, many hours, lots of really smart people doing really
34620	38820	cool stuff with this. We're two small pieces of a much larger
38820	43580	group that probably did a lot cooler stuff than we did, but
43580	50380	you get to talk to us instead. So some boundaries I'm going to
50380	54700	set for the talk. I will talk about VPN filter and its
54700	58040	technical capabilities. We'll talk about the targets. And
58040	60280	specifically, we'll spend a lot of time talking about the Modbus
60280	63980	module. I will not talk about attribution. The US government
63980	66460	took care of that. I will not talk about any of our partners
66980	75240	or victims associated with this campaign. So no. So VPN filter
75240	80920	is a multi-year state sponsored, very sophisticated malware
80920	85500	campaign targeting primarily edge devices in the small
85500	90420	office, home office realm. It's been going on since at least
90420	95800	2016. 2016 was the oldest sample that we are aware of. So it's
95800	99000	been going since before that. And at the time we went public
99560	102340	in May, we estimated there were about half a million infected
102340	106000	devices globally. You know, that number can go up and down
106000	109020	depending on how active the actor is. So this is a nice
109020	112000	conservative estimate, at least half a million, which is still a
112000	115040	significant amount. And it's interesting because it's
115040	119100	cross-platform. This is malware that runs on multiple operating
119100	122940	systems, and even multiple architectures. So we've got, you
122940	127080	know, samples that run on MIPS, variant of MIPS, MIPS Electra,
127080	132460	x86, tile, more. And then within the specific architectures that
132460	136100	are targeted, the binaries that were compiled were specific for
136100	138080	the devices that we're going to run on. And there were a lot of
138080	144500	devices. So we're aware of over 75 distinct device models from
144500	147620	several vendors that have capabilities compiled
147620	152000	specifically for those devices, which is some pretty serious
152000	154960	effort on the part of the actor to go through and put that much
154960	158600	work into it. Especially when a lot of these are, you know, sub
158600	164420	$50 Soho devices. Other ones are like the MicroTik or Macrotic,
164420	167820	I'm not sure how the correct pronunciation is. Those are
167820	171060	rackmount, like enterprise grade network appliances. Most of the
171060	174900	rest are Soho devices. Some are basic like home wireless
174900	180660	routers. And then QNAP stuff that we saw was mostly pretty
180660	185000	sure was just network attached storage devices. So during the
185000	187580	time that we were working on this, a vast majority of the
187580	192180	activity was targeting MicroTik and QNAP devices. But that was
192180	194340	just during the time we were looking at it. If we had looked
194340	197860	six months before, there may have been more or less activity.
198540	200620	And you know, if we're looking six months from now, it may vary
200620	204660	also. So but at the time, we looked mostly MicroTik, mostly
204660	209420	QNAP, and lots of devices. So we needed to get into a position
209420	216920	where we could bait the actor into delivering some of their,
217440	221540	you know, some of those custom payloads for those other devices
221540	224380	to us without tipping off our hand that we were actually
225080	229920	working on, learning more about it. And so we were kind of stuck
229920	233120	in a position where we wanted to set up like a honeypot
233120	234940	infrastructure, leverage honeypots, but your traditional
234940	240280	honeypots are often limited in their capabilities. We couldn't
240880	244020	give any indication that we were in a, you know, in a honeypot.
244020	247680	So virtualized or emulated environment was a no go. So
247680	251240	often your honeypot configurations don't capture
251240	254500	full network traffic, we needed full PCAN. We couldn't deal or
254500	258280	we couldn't handle just metadata about the traffic. We needed to
258280	261580	be able to look at everything that the device has received and
261580	264660	pull files out of them. Because if the actor brick the device,
264660	267340	we lose all forensic artifacts. So we needed all network
267340	272980	traffic. So we had to set up our own, our own honeypot
272980	275740	infrastructure. And we did that using real devices. So there's
275740	280060	full interaction, honeypots, real devices, we bought about
280060	286560	40 of them. So in the diagram, we've got, you know, you get
286560	290660	your internet. And then in this area here is where we break off
291340	295040	onto our attack, or our target network. This is the target
295040	298640	zone. So these are real devices. And they're on the internet
298640	303620	using commercial or residential IP space instead of, you know,
303620	307460	Cisco IP, because that would kind of be a dead giveaway. Or
307460	313840	you know, like a virtual machine on AWS. So we had real devices
313840	318700	and they had to be not obvious that it was Cisco. And the
318700	321800	switch here, these devices can talk out and everything can talk
321800	324460	in. So it's like they're on the internet directly. But they can't
324460	327760	talk to each other, unless it goes out and comes back in. So
327760	330720	they don't see each other. And the switch has a mirror port,
330720	333840	spam port, that goes to a network tap, one way network
333840	337320	tap, which goes to our analysis workstation, which was very
337320	341920	locked down, and is set up to not allow any traffic out. So
341920	347240	we've got three places to block any outbound traffic from our
347240	351840	analysis zone here. It would not be a good thing if the actor
351840	355940	associated with this campaign were able to go from here to our
355940	360440	internal corporate network. I wouldn't be here talking about
360440	364380	it today if we did. I may be out there with you handing out my
364380	368220	resume. So we spent a lot of time and effort on this
368800	372260	component. Right here we had full network traffic. So
372260	375920	gigabytes of traffic a day associated with activity on
375920	378260	these devices was living here. And that's where we did our
378260	384060	analysis. So standing up this full interaction honeypot
384060	387320	environment has some issues, some challenges. There's a
387320	390280	reason why people use the limited interaction honeypots
390280	392840	and it offers a lot more convenience, especially when
392840	396400	you're spinning up VMs, you can just replicate them. You don't
396400	399360	have to actually manage the physical devices. We had 40
399360	403460	devices, 40-ish. Some of them we bought used, so you can't trust
403460	406180	them. So we had to go through each device, validate that it
406180	409740	wasn't already owned, set it up in an intentionally vulnerable
409740	413000	configuration, because we wanted them to get owned. So we had to
415400	418280	put firmware on there with known vulnerabilities and publicly
418280	424120	available exploits. We set them up for configurations. There was
424360	426980	a large volume of traffic and none of it was legitimate
426980	433500	because these devices weren't doing anything, but... Oh, that
433500	436020	didn't show up on your screen. Flamingo wants you to join their
436020	441200	Wi-Fi Larry. So all traffic going to these devices was
441900	445120	malicious, or even if it was benign, it was not legitimate.
445260	447840	So there's an old phrase looking for a needle in a stack of
447840	451460	needles. It applies very, you know, it's very applicable to
451460	455680	this because every bit of traffic was not legitimate. And
455680	457760	we don't really know what we're looking for. So we have to find
457760	463080	something bad in gigabytes and gigabytes of bad stuff. And then
463080	465300	there's the security versus usability. And I think Carlos
465300	468500	and I, well, we probably had each other in a headlock a few
468500	472440	times. As I'm advocating for security, as I said, if the
472440	477020	actor made their way into our network, bad stuff. But every
477020	479960	time I lock something down or like advocate for something to
479960	483300	be locked down more, it's, it's inconvenience and annoyance for
483300	485800	the researchers that need to be able to interact with the
485800	489400	devices and do analysis on the traffic. But because of the
489400	491740	sophistication of the actor, we had to err on the side of
491740	498880	security, much to my team and other people's, well, I owe them
498880	502680	some beer, I guess. And the device limitations. So you see
502680	505200	this is just like in control systems. These are often
505200	508640	embedded systems. The legitimate management
508640	511920	interfaces don't provide a lot of functionality for legitimate
511920	515240	users. So you can't just drop down in the shell and log in as
515240	518940	root and do whatever you want in Linux. You know, you might be in
519080	523060	a limited environment, or maybe the only administrative control
523060	526820	you have is through a web interface. So just like an ICS,
526820	530520	an attacker who owns the device has more control over it than
530520	533180	the legitimate user. So we found ourself in a position of
533180	537180	actually exploiting and owning our own devices just to find out
537180	539660	if they had been owned by somebody else, which is
539660	545640	interesting. So that was kind of how we dealt with the risk
545640	549580	associated with interacting with and having live targets
549580	553440	intentionally infected by a state actor. Now the mailer
553440	557920	itself that we're going to get with, there were several groups
557920	563980	that did reversing and analysis of the actual mailer. But I do
563980	566400	have to clarify one thing before we go into that. And there's
566400	570140	since we went public in May, there's kind of been, I don't
570140	573000	know how it started, but there was an initial misconception
574100	577560	about the relationship between VPN filter and black energy
577560	584740	malware. So black energy has a flaw in the implementation of
584740	588060	the RC4 encryption algorithm, where it fails to properly
588060	592980	initialize the S-boxes during the permutation stage. So it's a
592980	595900	very, very, very specific flaw. It's not just like, whoops, we
595900	600420	used the wrong library. The VPN filter has the exact same flaw
600420	604340	and the exact same part of the implementation of the S-boxes
604340	607580	in the permutation stage of the RC4 encryption algorithm. So
607580	611180	there's overlap there. And it's a very specific overlap. VPN
611180	615100	filter does not contain a full copy of black energy. So it's
615100	620020	just the overlap that was the only connection that Talos
620020	623060	identified and reported. So if you see anything else out there,
623800	632200	it's just this, just RC4. It's a multistage malware, very
632200	635060	sophisticated. I'm going to probably say that 20 times, but
635060	637260	you start with initial exploitation and the malware
637260	641000	drops a persistent loader that's specific for the target device
641000	645100	that it drops on. The loader in stage one is the only part of
645100	648660	the malware that has persistence that can survive a reboot. And
648660	651980	that depends on the device. Aside from being persistent,
652500	656700	stage one's only job is to find the stage two server, retrieve
656700	660720	and install stage two. It has some really interesting ways of
660720	664160	finding the stage two server. First is it'll look out and
664160	667900	grab some images off photo bucket within the exit data and
667900	672840	the images specifically in the latitude and longitude. You run
672840	676020	it through a decoding routine, which we, one of our guys
676020	679040	reversed, and you can pull out IP addresses out of the latitude
679040	683400	and longitude. It'll then reach out to the IP address and try to
683400	686160	get stage two. If it doesn't work, it tries a couple more
686160	688660	images. If it doesn't work, it eventually goes to a hard coded
688660	693220	domain. If that doesn't work, it does what I think is probably
693220	698200	the most interesting part of this stage. It opens up a raw
698200	703800	socket and listens for all traffic on all ports. And if it
703800	708100	receives a TCP SIN with a very, you know, with specific bytes at
708200	711680	a specific value, it'll grab another set of bytes and that's
711680	715960	the IP address for the stage two server. So it's basically, it
715960	719120	looks out, tries to get stage two, can't get it, it looks out
719120	721720	another way, can't get it, falls back into this passive
721720	725720	listening mode where the actor can intentionally task it with
725720	729600	this, but just by using one TCP SIN to give it the IP address of
729600	733460	the current stage two server. When it gets stage two, stage
733460	739580	two is your framework, it's the workhorse, closest equivalent I
739580	742080	can give you is like it's the meterpreter component and that
742080	744900	it has some baked in functionality and it also has
744900	747480	extensible and you can add other modules. So you can execute shell
747480	749720	commands, it's got some collection capability, it's got
749720	753440	some exfil capability. Some of the older stage twos we looked
753440	756180	at had a built in kill capability where it would
756180	760760	actually brick the devices. Talk about that in a second too. And
760760	764080	then it's extendable through these stage three modules and
764080	769440	plugins, which because it's extensible through modules, the
769440	772960	functionality is essentially unlimited. It's only limited by
773560	779900	what the actor actually develops for it. So Carlos is going to
779900	784160	talk about one of those stage three modules. This is a
784160	786620	diagram of what I described, the process of going from
786620	790660	exploitation to stage one, to stage two, to stage three. I can
790660	794800	spend an hour up here talking just about this slide. I can't
794800	798840	do that. I'm not going to do that. I don't want to do that.
799700	801320	But everybody that worked on this with me, we sat through
801320	803360	several hours trying to understand this from many
803360	808500	angles. This image is on the Telos blog, the initial blog
808500	812660	post that described when we went public with VPN filter. It's
812660	816460	very interesting, obviously very sophisticated. When the
816460	823420	takedown happened, there was essentially a photo bucket or
823420	830320	two in the wall angle had been taken down. The only thing left
830320	834600	was the raw socket. So the person that had the device was
834600	836820	infected. If you rebooted it, it would try to go to photo
836820	839120	bucket. This stuff wasn't there anymore. It would try to go to
839120	842120	wall, to no wall. It couldn't. So it would sit with the raw
842120	845600	socket. So it was still vulnerable, but the actor is
845600	848480	going to have to reach out and touch it manually at that point.
851060	854520	So some of the stage three plugins that we've seen. These
854520	856480	are the modules that come after stage two. These are the
856480	859580	extensions. There's a packet sniffer. This is the one that
859580	863020	Carlos is going to talk about. There's one that we refer to as
863020	867460	Esler, which is interesting because this module allows for
867460	870820	modification of traffic as it passes through the compromised
870820	874120	device. So you've got your perimeter device, your edge
874120	878800	router, all traffic on port 80 or going to port 80 is getting
878800	883920	man in the middle. And JavaScript can be injected into
883920	886280	the traffic that returns to the devices on the inside of the
886280	889560	network. So this module allows the actor to compromise devices
889560	892220	on the inside of the security perimeter without actively
892220	897700	scanning and exploiting them. It happens invisibly at the
897700	901440	router. There's a Tor module, which gives stage two the
901440	904080	ability to communicate with command and control over Tor.
904160	909600	And then the kill brick component that I mentioned was
909600	913960	in stage two. It meant the older stage twos we found had
913960	919440	baked in kill. The newer ones, it was missing and we had a
919440	922160	suspicion that okay, there's probably a stage three that does
922160	927020	that and later on we confirmed. So this this destroy will go
927020	931980	through and clear artifacts like indicators of compromise to try
931980	935420	and erase any tracks of its presence. And then it will brick
935420	941060	the device. Usually the brick is by overriding the first I think
941060	945300	5000 was the most when we saw 5000 bytes of flash. So it's
945300	948920	essentially wiping out the boot loader and the device is done
948920	952120	unless you can reprogram that flash memory, which you're not
952120	955560	doing on any of these devices. And 99.9% of the population
955560	959260	couldn't even do it if the capability was there. So brick
959260	966400	device bad. I said very specific or very sophisticated. So why
966400	967820	would somebody go through the trouble of actually building
967820	970860	something like this, spending several years doing it,
970860	974500	deploying it globally, obviously it probably costs millions of
974500	977940	dollars over time. This is a global intelligence
977940	981860	infrastructure. What we used to refer to as computer network
981860	985020	operations are now referred to as cyber operations. This gives
985920	988880	a massive distributed global network to conduct those cyber
988880	992460	operations from and mask attribution. So the any attacks
992460	994660	or traffic that comes through this network is going to look
994660	999420	like it comes from a SOHO device, you know, somewhere in
999420	1001780	wherever they choose to make it look like it comes from. It
1001780	1005000	makes it difficult to track people or track the attribute
1005000	1010420	attacks. It's also a data collection platform, passively.
1011280	1013180	What Carlos is going to talk about is going to mention some
1013180	1016280	passive collection and active. These devices have been used to
1016280	1019800	scan for other things, and then sometimes scan for other
1019800	1022340	vulnerable things and then exploit them and add them to the
1022340	1025800	VPN filter network. The destructive attack is the thing
1025800	1028240	that we were the most worried about when we had to decide
1028240	1030900	whether or not we were going to go public, or when we would
1030900	1034800	eventually go public, but this kind of drove us to go public
1034800	1039840	when we did. The actor had the ability to effectively knock
1040320	1044580	about half a million networks off the internet all at once. So
1044580	1047140	not half a million devices by knocking these routers off,
1047140	1049000	you're knocking everything behind the routers off the
1049000	1052500	internet too. So take a half a million networks off the
1052500	1054860	internet all at once. It's pretty serious stuff. And we
1054860	1057920	were pretty worried about that. Thankfully, it never happened.
1058520	1063380	Also, you've got the ability to exploit inside the network. If
1063380	1066460	the actor was on the internal network, and had been kicked
1066460	1070240	out, so they have a point of presence on the edge router. And
1070240	1072180	unless the incident response team actually went and validated
1072180	1074320	that they were booted off those edge routers, they can come
1074320	1076840	right back in. And then everything that the botnet can
1076840	1083260	do, this can do too. So it has a lot of value. So that's kind of
1083260	1087740	the big picture overview. The four hour discussion about what
1088340	1092800	VPN filter is distilled down into 15 minutes. This is the ICS
1092800	1095100	village, we want to talk about stuff that ICS people care
1095100	1099440	about. Carlos is going to talk about the technical aspects of
1099440	1103400	the VPN filter, Modbus module. Carlos.
1103400	1109520	Thanks, Patrick. Alright, so I'm going to talk about the VPN
1109520	1114640	filter packets and for module. The packets for module was
1114640	1117160	responsible for inspecting packets and logging certain
1117160	1120620	connections. Specifically, the packets for module would log
1120620	1123160	connection information about HTTP and certain Modbus
1123160	1126960	connections. The packets for module was targeting the R 600
1126960	1131260	VPN router, which is a five port SOHO router. When we did a quick
1131260	1133500	search on showdown, we found around 5000 of these devices
1133500	1136520	online. But I think it's safe to assume that there's a lot more
1136520	1139220	than 5000 devices these online, because showdown was just
1139220	1142320	showing us ones that were that had no mantra enabled and were
1142320	1146560	accessible on the internet. So this is the picture of the
1146560	1151080	device, the Qt Link R 600 VPN router. The malware was
1151080	1156400	specifically targeting this device. So the packet sipper is
1156400	1161200	compiled for Lexra. Has anybody here heard of Lexra? Cool. Two
1161200	1165700	people. Alright. This project is the first time I've ever worked
1165700	1168620	with or even heard of Lexra. It's really similar to MIPS, but
1168620	1172420	it's missing some instructions. Initially, when I started
1172420	1175680	working on this, I thought the device and sample were MIPS. And
1175680	1177400	this was problematic, because Patrick and I were attempting
1177400	1180200	to get compiled MIPS code running on the R 600, but we
1180200	1182340	kept getting seg faults. Eventually, one of our
1182340	1184900	co-workers found out it was Lexra and helped us out with
1184900	1189760	that. So it was good. So first off, I want to give a huge
1189760	1192800	shout out to Carl Hurd. He works on our team at Cisco Talos, and
1192800	1196420	he was the first one to reverse the packets for module. The
1196420	1200240	sample was first uploaded to VirusTotal in 2016. So this
1200240	1203360	module has been around for quite some time. I wonder how long the
1203360	1206500	module has been around, because 2016 is just the first time it
1206500	1210940	was uploaded to VirusTotal. The module is a Linux ELF. It's
1210940	1213300	stripped and statically compiled. The fact it was
1213300	1215140	stripped and statically compiled, made reversing a little
1215140	1217940	bit more difficult. We had no function names, even Lipsy
1217940	1223000	functions, they were unnamed, which was pretty annoying. So
1223580	1227640	the sample will inspect every packet. It will initially do
1227640	1229860	some checks. So it will first check to see if the packet is
1229860	1233980	greater than 150 bytes, if the packet is IPv4, and if the
1233980	1237920	packet is TCP. If all those conditions are met, then the
1237920	1244120	sample will look for Modbus NHDP. So in order for the packet
1244120	1247500	sniffer module to run, two arguments need to be provided.
1247660	1250740	The first argument is the logging directory. This is where
1250740	1254960	the logs will be stored. And the second is an IP address. If
1254960	1257560	these two arguments are not provided, the sample will just
1257560	1261000	exit. But if the two arguments are provided, we immediately
1261000	1267620	enter the packet's parsing loop. So in the packet parsing loop,
1267620	1271080	in the beginning we have some IP checks, checking for IPv4,
1271080	1275340	TCP, and the packet size. And if those checks pass, then we
1275340	1280680	will start looking for Modbus. And if the loop does not detect
1280680	1287800	Modbus, then it will check for HDP. So all network traffic
1287800	1291260	passes through this loop, and the loop is specifically looking
1291260	1295700	for Modbus and HDP, and it will discard anything else. So if
1295700	1298420	something doesn't meet the criteria for Modbus or HDP, the
1298420	1300540	packet will be discarded and the loop will be restarted with
1300540	1307200	the next packet. So for each packet, the loop is going to
1307200	1310340	check to see if the packet is greater than 150 bytes. Then
1310340	1313180	the loop is going to make sure the packet is IPv4 and TCP. And
1313180	1320000	finally, we start the Modbus and HDP checks. So first off, for
1320000	1322920	those of you that may not know, Modbus is an ICS protocol. It's
1322920	1328440	commonly used by PLCs, runs on port 502, and the protocol is
1328440	1331320	open so you can grab it from Modbus.org, and it doesn't
1331320	1337120	support encryption. So once the loop has done the initial IP
1337120	1340180	checks, the loop is going to check for Modbus. It does this
1340180	1342880	by checking to see the packet's destination port and seeing if
1342880	1347360	it equals 502. If it does, then the next check is if the
1347360	1350040	packet's destination address is the same IP as the IP provided
1350040	1353560	by the second argument provided to the binary. If both those
1353560	1357120	checks return true, then the sample considers this packet a
1357120	1363800	Modbus packet and login code gets called. So the log file is
1363800	1366960	stored in the location provided by the first argument. The log
1366960	1370080	file will be named rep underscore percent U dot bin, where
1370080	1374280	percent U is the time the log file was written. The only thing
1374280	1378660	that gets logged for the Modbus portion is the source IP, source
1378660	1384620	port, destination IP, and the destination port. So this is an
1384620	1387440	example of what the log file might be named and what it might
1387440	1391760	contain. So rep underscore and a time value dot bin would be the
1391760	1395360	name of the file, and then what's highlighted in orange is
1395360	1399380	what would actually be inside the file. So we have asterisk
1399380	1402940	Modbus asterisk new line, source IP, colon source port, with a
1402940	1411930	little arrow, to destination IP, destination port. So I wonder why
1411930	1413930	a sample specifically designed for a SOA router is looking for
1413930	1417190	Modbus. I don't know if this router will ever be in a
1417810	1421810	position to look at ICS traffic or Modbus traffic, and
1421810	1426170	additionally I wonder what value the Modbus log provides. The
1426170	1428650	log is a source IP, source port, destination IP, and
1428650	1432990	destination port. And the destination IP address and the
1432990	1436410	destination port have to be provided to the binary. So the
1436410	1439030	only thing you get really is the source IP address and the
1439030	1448020	source port. So, as loop continues, if the loop
1449420	1451760	determines that the packet is not Modbus, then it will start
1451760	1457300	looking for HTTP authorization. So just a quick recap, in order
1457300	1461720	for the HTTP checks to start, the packet needs to be TCP, IPv4,
1461720	1466240	greater than 150 bytes, and not Modbus. Then the HTTP checks
1466240	1471980	start. So, the HTTP checks consist of checking the
1471980	1475660	destination IP address, source port, length of the data, and
1475660	1480200	several strings checks. The destination IP must be the same
1480200	1481960	as the IP address that was provided to the sample when the
1481960	1483520	sample was initially started. So it's looking for a very
1483520	1488400	specific IP address. The source port must be greater than 1024,
1488400	1494640	but it can't be 8080 or 8088. The length of the data must also
1494640	1497260	be greater than 20 bytes, and then we move on to the strings
1497260	1502360	check. So, in order for the packet to be logged, the packet
1502360	1511150	must not contain any of the strings in that code block. And
1511150	1513610	additionally, the packet must contain the string
1513610	1517010	authorization basic, or a username and password
1517010	1519430	combination, but it can't contain both. If it contains
1519430	1522030	both, the packet will be discarded, and the loop will
1522030	1525970	restart with the next packet. So, in this code block on the
1525970	1530350	left, I have user names, or user parameters, and on the right,
1530350	1532670	password parameters, so you have to have one from each side in
1532670	1538350	order for the packet to be logged. If the HTTP logging
1538350	1544830	has been met, the entire packet is logged to rep underscore
1544830	1552930	%u.bin, where %u is the time of logging. And the log will be
1552930	1558530	stored in the location provided to the sample when you initially
1558530	1564590	ran it. So, it looks like the HTTP checks are looking for
1564590	1567210	credentials to a specific website. It's highly targeted,
1567210	1569950	as the destination IP address is already known, and needed for
1569950	1573010	the packet zipper sample. Additionally, the sample does
1573010	1576030	not send logs off the remote server, but maybe another sample
1576030	1583210	does this, I don't know. So, in conclusion, the sample is
1583210	1586590	targeting, specifically, the R600 bpen router, which is a
1586590	1589550	SOHO router. The sample is looking for a specific IP
1589550	1594470	address, and is grabbing modbus.http information. The
1594470	1596650	sample cannot modify traffic without a significant code
1596650	1599450	rewrite, but we have, as Patrick said, we've observed other
1599450	1605770	samples that are able to modify traffic. So, thanks for coming
1605770	1607230	to talk, hope you guys enjoyed it.
1614040	1619420	I just want to reinforce, it's very, very targeted. Just that
1619420	1623240	model of device, you have to give it the destination IP
1623240	1628800	address. It's logging just the source IP and source port of
1628800	1632400	modbus traffic, nothing else. And it's got a bunch of filters
1632400	1636220	in place to discard a lot of the HTTP auth stuff. And it's
1636220	1639620	storing the whole packet, but the filters in place will ensure
1639620	1643140	that only a few of the packets that contain HTTP authentication
1643140	1647860	stuff actually get saved. So, the question is, in what
1647860	1652880	environment are you going to find this router? And what ICS
1652880	1660320	device would be on the target of this? Where somebody would be
1660320	1662700	on one side of this router and there would be an ICS device on
1662700	1666340	the other, and both modbus traffic and HTTP traffic are
1666340	1669080	passing to the same device, because the IP address is given
1669080	1676100	as an argument when the module is run. So, that is the question
1676100	1682560	of the day. Where is this device being used? And what ICS
1682560	1687200	device receives modbus traffic and gets authentication over
1687200	1691060	HTTP? We'll take questions.
1691060	1695540	I was wondering, is it common at all for ICS type environments
1695540	1699860	to use SOHO routers? Has that been found? Is that possible that
1699860	1702420	the attackers have a very specific configuration in mind
1702420	1706180	that they're going for somewhere that uses that sort of setup?
1706180	1710440	So, in this case, this is obviously intended to target
1710440	1713560	either a specific individual or a specific group that does
1713560	1717340	things a certain way. This specific module isn't going to
1717340	1720220	work on any of the other. It won't work as a plug-in to
1720900	1724160	stage two on a different device. It only works on the TP-Link
1724160	1729420	R600 VPN, and you have to give it that destination IP before
1729420	1733340	it will log anything. So, when the actor dropped this, it's
1733340	1735940	obvious that they were looking for certain stuff and only
1735940	1738440	certain stuff, because it filters out everything else. Even
1738440	1741520	things that would be valuable, like other HTTP connections.
1743200	1745380	I mean, it's hard to say, but they might have had something
1745380	1748120	specific in mind. Yeah, and whether or not this device
1748120	1751140	should be an ICS environment? No, but whether or not it is?
1751140	1757280	Yeah. So, I think some figure, like oil companies and stuff,
1757280	1760060	backhaul their ICS communication back to their
1760060	1764600	condition. So, you can considerably see that suit on
1764600	1769810	someone's desk. I don't have a question. What type of...
1772740	1777200	I would like to, and this is for you guys, if you can think
1777200	1782220	of any field devices that may be what the actor was looking
1782220	1785800	to receive the information about, if you want to, let me
1785800	1788500	know. Let me know. Otherwise... It's not like a module for
1788500	1794160	another industrial hardware type device. What do you mean?
1794240	1796500	Well, you know, like, would they use that same core for
1796500	1800700	another industrial hardware device? For the TV link? Not to
1800700	1805520	my knowledge. It's just that, yeah, as far as I know. And
1805520	1807480	it's that weird, like Carlos said, it's that lecture
1807480	1811080	architecture. So, as we were writing our own proof of
1811080	1816120	concept code and executing it on the device, we were getting
1816120	1819180	psych faults all day long. And it turns out we needed a
1819180	1822680	custom tool chain to compile code for this device. So it's
1822680	1825320	not like it's, you know, the code may be portable, but it's
1825320	1828040	still got to be compiled specifically for this. I don't
1828040	1831160	know of anything. And there's strings in the binary that
1831160	1834780	say R600 VPN. You know, so even if there was something else
1834780	1838020	that, you know... Using that more... Right. Incorporated
1838020	1842820	with it. Yeah. So just to be clear, is the package going
1842820	1847060	through it? It looks at every packet that travels through it,
1847060	1849780	and then it goes through the checks that Carlos explained to
1849780	1852980	filter out the stuff that it doesn't want. And if it meets
1852980	1856720	all the checks for Modbus, it just logs stuff that it already
1856720	1859720	knew. Like it knows the destination IP because it's an
1859720	1863480	argument that was passed to it when the module was executed.
1863660	1867340	It doesn't log any of the Modbus data. It just... The IP
1867340	1869940	address that the traffic came from and the port that it came
1869940	1873080	from, and the IP address that it was going to, which we know,
1873080	1875840	and port 502, which we know. So the only thing the actor
1875840	1880140	learns that's new is source port and source IP. And then
1880140	1885200	any HTTP traffic that meets all those filters going to the
1885200	1888460	same IP address as the Modbus is going to, it'll log that
1888460	1891700	entire packet. Yes?
1903840	1906860	So in this instance, I would imagine they either did it
1906860	1910320	manually, especially since it's so targeted, or there may have
1910320	1914680	been capability at the C2 node that would connect and pull,
1914680	1922860	right? No. Stage 2 had the ability to execute shell
1922860	1924840	commands. So it'd be just like you're logged in to the
1924840	1927160	terminal, you know, as splitting through.
1927660	1931680	Were you able to do any analysis just where, you know,
1931680	1934900	say there's 5,000 routers, you know, was there any, hey, that's
1935040	1939500	a lot. Were there any kind of geographic trends you could see
1939500	1943520	in certain countries or in certain areas? Nothing that
1943520	1946340	stood out at the time, but we have the map and slides. We can
1946340	1951280	put it up on the, and if you can zoom into it. Yeah. Most of
1951280	1957580	the U.S., so almost 900 in the U.S., 600 in Russia, Brazil,
1957580	1961280	Portland, Uruguay. And this is just specifically the TP-Link
1961280	1967240	R600 VPN with remote management enabled. My first thought was
1967740	1977740	it was oil and gas. Oil and gas. Not a lot of evidence.
1977740	1981980	Right. Yes, sir. Piece into the breadcrumbs together.
1982920	1985100	Following the breadcrumbs, you all piece into the breadcrumbs.
1986660	1987660	Yes, sir.
1987760	1990160	Yeah, the first stage, the raw socket.
1993740	1997000	Easy way to take over the whole box. Yeah, so anybody that
1997000	2003020	knows what that SIM packet is can own any device that is in
2003020	2006580	that passive raw socket mode. So you just have to send a SIM
2006580	2009960	that has the right magic bytes, and then it's going to pull
2009960	2013380	out an IP address, and it's going to reach out, and you're
2013380	2015540	going to have to deliver stage two to it. But I mean, if you
2015540	2017580	know, so yeah, you could do it.
2026150	2032510	For this module, because it's set up to just log the data
2032510	2035650	about what goes through, it would be, it would need to be
2035650	2040270	seriously modified to intercept. So instead of just looking at
2040270	2042650	the packet and allowing it to go through, it's going to have
2042650	2046030	to stop it, change it, pass it through. This module doesn't
2046030	2049730	have any capability to do that, but that other module does. So
2049730	2052850	they definitely have the ability to modify traffic. This
2052850	2055730	module does not, but it's still possible.
2058750	2061970	How alarming is this behavior? Has there been any sort of
2061970	2064270	effort to go out and be like, have you seen this router to
2064270	2066890	like potential industrial use cases or anything? Or is it
2066890	2070990	kind of still pretty passive collection? Like, maybe...
2070990	2076930	I'm here asking you guys. It's intriguing because it's so
2076930	2083030	targeted, but because of the wide range of vendors and
2083030	2089510	devices that were also known to be used, this type of activity
2089510	2092070	could be used on any of those other devices. They just had to
2092070	2104930	pile for the device and push it out. So it depends on which
2104930	2108610	stage it's in and what device it is, and there's a whole bunch
2108610	2114030	of weird ways to figure it out. If it's in that raw socket
2114030	2119050	mode, you can detect it. CyberX put out a script a few
2119050	2121970	weeks ago. It's up on GitHub, where it'll send the SYN packet
2122530	2128130	and it'll reach out to an IP that the script gives. Also, I
2128130	2132490	think on Sys or Mac, if someone corrects me if I'm wrong,
2132490	2153660	Symantec had a tool that would let you know if... I think it
2154600	2164260	was just a module. I did my damnedest to get live devices...
2164260	2167520	If they had live devices, established connection and
2167520	2171560	control, they just never had that module pushed out. So one
2171560	2174980	of the interesting things about the Stage 3 modules, the device
2174980	2178620	has to be tasked to pull them down. There's no list of modules
2178620	2182980	in Stage 2 that it knows. You have to know the name of the
2182980	2186360	module. The device has to be told, reach out and get this
2186360	2188780	module, and then it will reach out to Command and Control,
2188780	2193680	request the module, retrieve it, and execute it. So yeah, I'd
2193680	2196680	like to be able to say, like, I just requested all the modules
2196680	2198920	from Command and Control. I don't know, but without knowing
2198920	2202760	the names of them, they could have had it and just... we never
2202760	2205860	saw it. They were selective about what they deployed and
2205860	2209200	where they deployed it. I saw another hand.
2209200	2214200	So, you said that you got a virus code on 2016?
2215040	2216740	This module did, yes.
2216980	2221680	And what was that? Was that somebody uploading firmware?
2223100	2224980	I'm wondering what was the circuit?
2224980	2230820	So this specific binary is ELF executable, so Linux executable,
2230820	2233600	and they uploaded that executable.
2233600	2234940	I'm wondering how they got it.
2234940	2237340	Did you ask Iris to upload it?
2238780	2241320	I mean, should you?
2241620	2242480	Right.
2244620	2247140	I'm just wondering how they would have gotten it.
2247140	2250560	I would love to know. I would love to know who uploaded it.
2250560	2255600	So, in order to get it off of the device, you've got to own
2256120	2261380	the device. Some of the older TP-Link R600s had a backdoor
2261380	2267380	web shell that was known, so somebody could have used that and saw that
2267380	2269280	they were in fact pulled it off and uploaded it.
2269280	2271040	The actor may have uploaded it.
2271680	2273920	Some people will trade graphics a little.
2274220	2276000	Everybody's been known to make mistakes.
2276280	2277300	So maybe they...
2277300	2281040	Other than that, it would have either been pulled out of network traffic
2281040	2283380	and uploaded, pulled off the device and uploaded,
2283380	2284800	or uploaded by the actor.
2287180	2289100	Well, all that seems very unlikely.
2291440	2292160	I mean...
2293560	2298280	No, I would love to hear ideas and scenarios for...
2298280	2301920	And this is just one of countless modules.
2302300	2306840	So, we know how many we've seen, but theoretically,
2307700	2310540	it's up to the actor. They can just write it in the file and push it out.
2310840	2312500	Those are their plugins.
2312920	2316020	You mentioned there's a possibility this is a control, right?
2316300	2318900	So that's one thing. I don't know if you mentioned it or not,
2318900	2323600	but it's in the realm possible that the actor put that in there
2323600	2325520	to distract you.
2325520	2327460	Like, oh shit, they're looking for Modbus.
2327920	2328500	You know?
2328920	2329720	Yeah, exactly.
2331040	2331760	Right.
2333640	2334940	Were they really looking at Modbus?
2334940	2336840	Or did they want us to think they were looking at Modbus?
2338980	2340180	If you guys know.
2340800	2341680	I'll buy you a beer.
2344440	2345200	A sample?
2346100	2346580	So...
2347200	2347920	No.
2349800	2350920	Well, I mean,
2350920	2353280	if you have a paid account with Wirestotal,
2353280	2354800	you have access to all that stuff.
2354800	2357660	So, anybody in this room could search.
2361850	2365570	So, Talos is working with several partners,
2365570	2366510	external to Talos,
2366510	2369450	and that's one of those things that I'm not going to get into.
2369790	2372890	But the blog post that initially disclosed this
2372890	2376910	will tell you as much as we're comfortable releasing.
2376910	2378950	But we work with people outside of Talos.
2387430	2393730	I don't remember, do you remember the VPN function in that?
2393730	2394290	I don't remember.
2394290	2396130	I'm pretty sure it was just using OpenVPN.
2396130	2399490	It was BusyBox and OpenSSL and OpenVPN.
2399490	2401310	We're pretty sure.
2401310	2402550	I can double check.
2403930	2407590	But if anybody has any other questions or follow-ups,
2407590	2410610	you can just hit me or Carlos up here or afterwards.
2436510	2439710	So, if you specify any IP address,
2439710	2441270	it's the destination IP address,
2441270	2442790	and then as the traffic passes through,
2442790	2446350	it'll log the actual credentials going to that IP.
2447590	2449230	Is that what you're saying you found?
2454730	2457210	We think there's a couple, yeah.
2457370	2463010	So, it can take three parameters or arguments,
2463010	2464350	but it only takes two.
2464350	2465630	So, what's the third?
2465630	2468950	What was the other?
2468950	2471430	So, it'll accept, it'll log the traffic,
2471430	2473770	if it has HTTP basic authorization
2474270	2476750	or a username and password combination.
2476750	2480050	But if both are present, it ignores it.
2480570	2482090	So, I mean, there were a few things where...
2483350	2486650	My theory was that they were eliminating as much noise as possible,
2486650	2489430	because if you start logging everything that matches HTTP basic auth
2489430	2491550	and everything that matches Modbus,
2491550	2493730	the device is going to fill up and you're going to have a break.
2493730	2496670	So, they wanted to filter out everything except
2496670	2498730	what they were specifically looking for.
2498730	2500650	That's just my theory.
2500870	2503650	And, yeah, I think there's a couple coding mistakes too.
2506070	2508270	All right, thank you. Appreciate it.
