start	end	text
0	10780	Good afternoon everyone. It is 3 p.m. at DEF CON 31. Welcome to Village Talks. This
10780	17660	next talk is presented by the Packet Hacking Village. The Packet Hacking Village talk,
17660	24460	the whole premise is, is to give information and content that people can grasp and use
24460	33960	immediately. This next talk that we're going to present, remember when we did the CFP for
33960	43820	this, and it caught our attention right away. And Riverside said, we have to accept this
43820	50100	talk. This talk looks really, really good. And it is my pleasure to introduce to you
50100	61720	someone who I've gotten to know pretty well within the last, what, 24, 48 hours. Jared
61720	68720	Stroud, who is a security lead at the MITRE Corporation. And one of the things is, is that I
68720	74240	will want to let everyone know here, who here is this is your first DEF CON? Is this is your
74240	83540	first DEF CON? Welcome. And please take advantage of your learning opportunities. But I also
83540	90980	warn each and every one of you as well too. And Jared is, sir, gave, served as a really, really
90980	97000	good warning. I don't know if you all know, but the tech and the secure, the tech and
97000	103900	especially the security community is extremely small. Do you know how they say, what is that
103900	109060	thing that they said about the uh, the six degrees of Kevin Bacon is it? Is that what it's
109060	116060	called? Something like that? Here, if you're at DEF CON, like the degree of separation is not
116060	123680	even six. It's like more like one or two. And it is just absolutely crazy to hear, you know,
123680	132180	that former students and friends have while working with Jared. And it's just like
132180	138080	absolutely and this is, and I've been at DEF CON for many, many years and this has been, it
138080	143840	just happened each and every year when I'm here. So just to let you know is that, you know,
143840	148520	you don't even, chances are you'll probably know who you're going to be talking to or you
148520	152600	probably have, you know, a little bit about the person next to you. So just be careful that the
152600	158320	degree of separation is extremely small. But nonetheless, it is my pleasure to introduce to
158320	165080	you, Jared Stroud, who's going to talk about line pairing with malware. Take it away.
169960	174600	Alright. Well thank you Ming and thank you Packet Hacking Village for having me. DEF CON,
174600	180440	this is awesome. That was a really nice introduction. Hope this doesn't suck. So, how's
180440	187520	everybody doing today? Alright, not hungover at all. Exciting. Cool. So, my name is Jared
187520	192160	Stroud. On the internet, I am DLO Cool J. And today we're going to be talking about line
192160	197880	pairing with malware and some fun we can have across the way. So, fun disclaimer, but
197880	203260	since it's DEF CON, we don't read those. I am a lead security engineer at the MITRE
203260	207820	Corporation. I'm also an adjunct lecturer at the Rochester Institute of Technology. Go
207820	214040	Tigers. And additionally, recently I actually just was a finalist in the Sentinel 1 and VX
214040	218860	Underground Malware Analyst Competition. And that's where a lot of the talk is going to come
218860	223420	from. Some of the side work that I do at home in my home lab and some interesting things
223420	228660	around malware. And additionally, after this, come swing by the contest village. I'm
228660	232960	helping run a contest called Battle of the Bots. Also Hack Fortress. Would love to chat more
232960	238740	later. Cool. So, why are we here? Right? And again, thank you all for coming. We're going to
238740	243160	talk about what wine is. So, if you've never heard of wine, don't worry. But out of
243160	249620	curiosity, how many people have heard of wine? Awesome. A lot of hands. Also out of
249620	256440	curiosity, how many people have had issues with wine? Somehow more hands went up. I'm a
256440	261020	little confused about that. But excellent. Hopefully I can shed some light into this. So,
261020	266080	we're going to talk about how wine works and why we care about using wine for both offensive
266080	270300	and defensive purposes. And my big goal is to get you to walk away with some actionable
270300	277600	evidence today that makes sense for both, again, offensive and defensive things. Cool. So,
277600	282800	this all got started because, again, I have a home lab that I'm super passionate about and I
282800	287300	call that Arch Cloud Labs. I blog about silly things related to malware. Now more than
287300	292700	ever, anyone can go and grab APT samples from a VX underground or a mal share and start
292700	296940	digging in and doing their own reverse engineering, their own blue teamwork or red
296940	301440	teamwork where they're trying to emulate threats. That's really cool. Never has that
301440	306800	happened before. And along with releases like Ghidra and various other open source tools
306800	311960	with Yara, you can really build your own blue team D4 home lab and get those skills up for
312560	318080	whether it be like contests or employment, whatever the case may be. But something that I
318080	323140	was running into in my home lab, if you get a big old batch of malware, going in and
323140	329220	executing this to get those initial artifacts is a super big pain. I want DNS requests. I
329220	333660	want outbound TCP and UDP. I want all that good data. But I don't want the overhead of
333660	338280	actually managing that infrastructure. I don't want to have to run an ESXI cluster and
338280	342560	then install cuckoo and manage my base images. And then after I run the malware, take
342560	347440	snapshots, store those snapshots, and at some point I finally get the PCAP and go, okay,
347440	351140	here's the domain that this cobalt strike beacon was calling out to. This seems like too
351140	355400	much. This is all too much. I want initial artifacts that I can immediately start digging
355400	362500	into. So with that, I started to take a look at wine. Right? And again, seems like a lot of
362500	366280	people in here know wine. I'm going to take a shot in the dark and say that some people may
366280	372240	know that from valve and steam and their fork of it called proton. But if you've never heard
372240	377580	of wine before, wine is a recursive acronym that stands for wine is not an emulator. It does
377580	382960	not do emulation of win 32 API calls. It does translation from whatever is happening in the
382960	388420	windows world and DLLs and kernels and so on and so forth into the posit calls equivalent. So
388420	394940	it's actually executing him on the underlying Linux kernel. So this is really cool. Right? So
394940	400000	with this, it's a open source project that's labeled or that's under the GPL license and
400000	405880	there's a couple of commercial backers. Notably valve and their proton release of that which
405880	412320	is really just focused around some fixes of graphics drivers and more intense things to run
412320	416960	triple A games. And then there's also code weavers. And code weavers has a tool called
416960	421160	crossover and crossover is just trying to help you run whatever your windows software of
421160	428660	choice is on Linux a little bit easier. That being said, the core of wine is a free open
428660	433640	source product that is getting all of these contributions rolling in all the time. There's
433640	437900	three different staging branches of excuse me, there's three different branches of wine. You
437900	441880	have your staging branches where some bug fixes are coming in. It's not quite stable. You
441880	446320	have stable and you have some release candidates as well. So this is a very active project
446320	451200	that's constantly getting new patches submitted upstream and this example that I have on the
451200	455380	screen here is just to show, hey, folks from valve are submitting their upstreams. Folks
455380	459380	from crossover are submitting their upstream patches and overall that wine project keeps
459380	465340	getting better and better over time. So with this, let's go ahead and take a look at how wine
465340	469640	actually works underneath the hood and how we can start thinking about ways that we can use
469640	475740	it for our workflows. So when you run wine and then whatever exe, like malware.exe or
475740	480660	Microsoft office.exe, what's happening underneath the hood is a separate service is getting
480660	485520	spun up, excuse me, a separate process called wine server. Wine server is going to go ahead
485520	490700	and create a Unix socket that your main process is going to talk to it over. This wine server
490700	495640	is then going to load its DLLs which are really just Linux shared objects that are going to do
495640	503180	all of that translation to the underlying Linux API calls from the Windows 32 calls. As an
503180	509800	example, up here to my right, we see the MSDN documentation for git native system info. It's
509800	514440	going to go ahead and take in some pointer to some struct, populate that data and return it
514440	521060	to you. And then the wine equivalent over here, you take in some struct of sys info, you
521060	527240	start populating it as we go down the path. So all of the magic of that actual translation
527240	531820	where that's occurring is in these DLLs. That's going to be an important thing to keep in
531820	538300	mind that we'll circle back on later how we can use that to our advantage. So at this point
538300	542320	we're thinking, all right, that's pretty cool. We can start seeing like you can execute
542320	549400	maybe an interpreter shell or something like that on a Linux system and start getting those
549400	554760	artifacts. But naturally I'm not the first person to think of this. Doing a little bit of
554760	559720	deep dive in both the academic and open source research, the earliest document I could find
559720	565960	was from 2005 and it was a Linux.com article talking about running Windows viruses on
565960	573340	Linux. And this was all getting done via wine. But the overall result was, hey, this sucks.
573440	578060	We don't have, you know, the spammers aren't spamming, the worms aren't worming, it looks
578060	583920	like Linux wins again. And that was kind of all you saw for a pretty long time. Then, excuse
583920	594130	me, but it does pose the question of as wine got better over time, does Windows malware pose a
594130	599770	threat to Linux servers, right? Now, any Linux admin or Linux user over there is probably
599770	603630	thinking right now, well, wine's not installed by default. I'm not super concerned about
603630	608510	that. But that is a lot of the angles that academia take of, hey, can we run these Windows
608510	615950	samples on a Linux machine if wine is installed and will the damage be equivalent? And the
615950	621270	overall result from these papers was maybe and a lot of that came out from the samples that
621270	625870	they were picking. And when I say samples, I'm referring to malware samples. Largely this
625870	630450	was just an arbitrary selection of whatever malware dump the researcher had to them at the
630450	635070	time. In a lot of situations, the malware they were executing was dependent on external
635070	641450	services that wine did not spawn. For example, with Mimi cats, there is no LSAS process. So
641450	645150	if you have some kind of precompiled binary that's going to try to dump from LSAS, it's
645150	649070	immediately going to fail. That's not the fault of wine, that's just the service doesn't
649070	653890	exist. Same thing to be said about trying to poke at an active directory server. You know,
653890	658250	you can go from there with the other dependencies that may exist. Additionally, a lot of
658250	663370	these academic research projects were using open source projects that wrapped wine but did
663370	668670	not use wine directly themselves. And these open source projects were largely abandonware. A
668670	675510	paper from 2018 was leveraging something that wasn't last updated from 2013. But I'm here to
675510	680410	talk to you today about saying not all hope is lost. We can actually build our own
680410	687030	execution environment with thinly wrapped wine wrappers to execute malware. So this is
687030	691970	where my talk title actually kind of comes full circle here. This is the wine pairing with
691970	696830	malware. We have to pick our samples appropriately to make sure that we're not going to be
696830	702350	dependent on some kind of foreign service that isn't going to run in wine. Now, that doesn't
702350	707930	mean you need an aged cobalt strike to pair with a newer release of wine. You can just go
707930	714190	ahead and grab the latest version of wine off the website and execute it against the samples
714190	720210	that you have today. Looking at the threat trends, we're seeing from a SOPHOS report
720210	724770	released about last month, we're seeing that Meterpreter and Metasploit and its associated
724770	730290	projects and payloads are kind of on the rise, right, to the surprise of no one. Criminal
730290	735510	groups and APT actors alike, maybe a shell code runner's difference, but Metasploit gets used a
735510	740710	lot. It's very scriptable. It's very easy to make to use into whatever offensive workflow you
740710	748090	have. Looking at a 2013 report from Red Canary, they said that cobalt strike and Metasploit
748090	752570	continue to be the most popular C2 framework with a couple of other open source and
752570	757990	commercial vendors on the rise. Those include Brute Radle, Sliver and Mythic. But again,
757990	761750	we're seeing the usual suspects here, right? We're not surprised at what we're seeing. We're
761750	766430	seeing Metasploit, we're seeing cobalt strike and a handful of offensive frameworks. So
766430	771490	with that, why grab all of these random old ransomware samples or old malware samples? Why
771490	776610	not test what is likely going to end up at some point in the ticket queue for your SOC? And
776610	782150	then what can you do with that information? So for my research, I picked these three
782150	790850	frameworks largely because of their ubiquitousness in the APT and crimeware world as well as the
790850	795130	ability to kind of make a little lab for everybody to test out afterwards with Metasploit,
795130	800790	right? So cobalt strike, no surprise there. Human operated ransomware groups continue to use
800790	805930	this. Same thing with APT groups. Empire is getting picked up more by APT groups and
805930	810830	notably it has C sharp functionality. So that's a nice little twist at Metasploit because
810830	817550	again, Metasploit. So let's go ahead and start talking about why we're using wine and not just
817550	821950	spinning up a Windows VM to actually do this execution, right? We love Linux because of its
821950	826090	flexibility. We want to pipe set and awk and grep our way to victory. We want to get those
826090	830670	initial shared objects. Again, I don't want to have to instrument a whole ESXI workflow to get
830670	836650	these artifacts. And what we're having shown here is a very, very, very simple example of
836650	841530	instrumenting this execution with a container. I go ahead and spin up a container that simply
841530	847410	copies my malware over, runs wine and then on the underlying host, I'm capturing that data
847410	851990	with wire shark, a TCP dump, whatever you may have you. And then also I'm getting the rest of
851990	861430	the host based artifacts in what's known as a wine prefix. Looking at, you know, scaling this
861430	868150	execution, we can go ahead and actually take our container with pod man and generate the YAML
868150	873490	to get it to execute in Kubernetes as well. So while we're doing basic example execution with
873490	877410	just one sample, that's not to say that you can't actually scale this to handle all of the
877410	882830	daily dump that you're getting from virus total mal share or VX underground. But I talked
882830	887830	about a wine prefix a moment ago and we're going to dive deeper into that. Your wine prefix is
887830	893970	effectively your C drive or a wrapper for the C drive for the underlying wine environment. Here
893970	900010	we see DOS devices end up being your com objects, drive C is the C drive and then you have a
900010	905330	handful of registry files that get created as well. When you're executing a malware sample
905330	911590	with wine, you can go ahead and create a unique wine prefix per sample. Suddenly you have N
911590	916350	number of wine prefixes for N number of samples and again you can sed, awk and grep your way
916350	922470	for those artifacts and start looking at what's going on there. Looking at the two files
922470	928270	that we have here of user def dot reg and user dot reg, these are the, excuse me, the
928270	933090	difference here is that user def dot reg is the default registry keys that get created and
933090	938310	user dot reg are the registry keys that get created after execution. So if a malware sample
938310	942750	goes and creates registry keys and is trying to do a UAC bypass, you can easily diff these
942750	948430	files and see the changes. That's pretty sweet compared to using red shot, taking snapshots
948430	953210	and reverting. That's very fast. That shortens your workflow for basic samples that you may
953210	960250	be pulling in from a virus total or what have you. Looking at this in a slightly different
960250	965050	light, if we went ahead and got an interpreter session through wine, started executing
965050	972730	commands and dumping data to files like we see here at 1, malware does a thing, I'm just
972730	979410	listing the contents of a directory, we can jump down to the host machine, in that wine
979410	984830	prefix we can grab whatever files are getting dropped. So again, that wine prefix ends up
984830	989450	being a pretty neat thing that we can tar up and move to a file system without having to
989450	996870	juggle VMDKs and any big virtual disk images. That's pretty neat. The same can be said about
996870	1004550	the registry. As I stated earlier, we just go ahead and can cat user.reg, pipe grep for
1004550	1009830	HKCU and start looking at newly created registry keys. Up at the top here, I'm simply
1009830	1015970	using a post exploitation module from Metasploit to create a run once key so on boot I will
1015970	1020410	get my session restored. Nothing super crazy but a demonstration of how this could be
1020410	1026850	beneficial to you. Cool. So you didn't just come here for me to tell you, hey, run wine
1026850	1032370	and then evil.exe and get your IOCs. That's not why we're here. The real magic is in the
1032370	1038810	DLLs as I said earlier. What you can do is effectively build your own DLLs to get loaded at
1038810	1044050	run time and then start instrumenting your execution. What do I mean by that? Well, if
1044050	1049150	there's specific API calls you want to capture more data on dynamically, you can go ahead
1049150	1054210	and grab that data, send it to a sim, write it to a file or otherwise ingest it into your
1054210	1060150	workflow to start gathering more valuable intelligence information. Additionally, wine
1060150	1066110	has the equivalent of an LD preload where you can say, hey, look here for my shared
1066110	1070470	objects. So you don't need to recompile wine every time you want to suddenly get say
1070470	1075110	registry keys like I have on the screen. You can simply have a directory for your custom
1075110	1079510	shared objects, load them when you need them to get that data and then otherwise execute
1079510	1084430	wine normally. So this is super powerful especially when you start thinking about
1084430	1091570	altering return values and really controlling the execution of malware as a whole. But it's
1091570	1097410	not perfect. Wine again is trying its best to go ahead and provide a one to one translation
1097410	1102170	for these calls. But when things go awry, you can't just say, oh, this is broken, this isn't
1102170	1106050	good. You have to dig a little bit deeper and look at the source code. For example, the
1106050	1109970	anti-malware scan interface at the time of this recording of this talk, if we go ahead and
1109970	1114990	look, all this simply does is return, hey, there's no malware here. Everything's good. Just
1114990	1119750	go ahead and execute that. So this is an example of where you need to dive deeper and
1119750	1124230	understand what these return values are going to be from wine. But the neat thing about this
1124230	1129810	also is that, well, if AMSI is always returning, hey, this isn't malware, maybe this is an
1129810	1134330	opportunity to start looking at fuzzing targets and playing around with other Windows
1134330	1143710	software that leverages AMSI, right? Could be a neat thing to explore. But for my red team
1143710	1149170	focused friends, there's also hope for you as well. If we go ahead and take a look at an
1149170	1154890	example offensive development life cycle up here, right? Maybe you leave DEF CON, you're on
1154890	1160170	Twitter, X or Mastodon, pick your social media site and you get a new idea for some blog or
1160170	1163630	some talk post and you're like, hey, this is a pretty cool thing I want to integrate into my
1163630	1167510	offensive workflow and I want to start messing around with it, right? So then you start
1167510	1172730	developing that POC, integrating it with whatever offensive framework you get. Then you test
1172730	1177350	in your range, you test in your VM, so on and so forth. Double check all the things and you
1177350	1181950	finally get to the stage where you're ready to go and use that in an engagement. All of this is a
1181950	1186990	fairly long cycle, right? You don't want to get caught as a red teamer. Well, I'm here to talk
1186990	1192170	to you about shortening that churn zone by having faster feedback loops, right? Don't
1192170	1197070	wait until your SCP or file share, your malware sample copies over, you can kind of execute
1197070	1201050	everything on one host. So that's pretty powerful when you start thinking about shell code
1201050	1207110	runners or looking at making sure that your tunnels are working the way that you expect them
1207110	1210690	to. Simply running line and then whatever you're building, making sure that those tunnels
1210690	1216550	exist and you're getting those callbacks is a quick way to avoid issues down the road.
1217790	1223370	Additionally, it allows for much easier adoption for CICD for shell code runners. If I can go
1223370	1227770	ahead and not have to spin up and maintain and patch and host a Windows service or Windows
1227770	1233170	machine, excuse me, I can go ahead and just leverage a docker container, run wine with my
1233170	1238150	shell code runner, verify that the output said, hey, you got a shell, you got execution and go
1238150	1241810	on from there. And this is how you can start adopting software engineering practices into
1241810	1246090	your offensive work flow. That's super powerful when you start considering maybe you want to
1246090	1249970	play around with different frameworks or seeing how other frameworks are going to integrate.
1249970	1253770	There's always a new thing written in rust or whatever the framework of the day is. Last year
1253770	1257790	at DEF CON NIM was the hotness. This allows for a little bit easier integration and
1257790	1265610	repeatability. And then looking for my friends that are leveraging more in memory execution,
1265610	1269810	talking about beacon object files. If you're unfamiliar with beacon object files, they're
1269810	1275250	made popular by cobalt strike. Effectively what they are is a way to execute a payload in
1275250	1281530	memory without writing to disk. However, they're tricky to write. They have a limited C API.
1281970	1285210	And if something goes wrong and they crash, well, you lose your beacon because it's
1285210	1291310	executing in the process of beacon. That being said, Metasploit has its own beacon object file
1291310	1296150	loader. And because we can execute Metasploit generated payloads with wine, we can
1296150	1301330	suddenly create a feedback loop of writing a potentially complicated or maybe it's new to you
1301330	1306990	boff file. Executing that in the meterpreter session via wine and ensuring that you're
1306990	1312030	getting the output that you expect. So here with my meterpreter session, I'm leveraging trusted
1312030	1318150	sex cough loader and there's situational awareness boffs to go and get the ARP information
1318150	1324530	of the host that I'm executing on. Pretty neat. Furthermore, you can grab all of this output
1324530	1328690	through Metasploit because of its easy scriptability features, making sure that you can
1328690	1334610	or excuse me, allowing you to integrate it into your CICD workflows. But again, the world
1334610	1338830	isn't perfect. It does fall short, right? I'm not suggesting you go and blow away all your
1338830	1343430	Windows VMs and just go, hey, wine's great, let's do that from here on out. But this does
1343430	1350290	shorten that initial proof of concept phase to get to the point to go and test as close to the
1350290	1355730	target host as possible. Some of the issues that I've personally found is anything in
1355730	1360970	kernel land, so doing direct sys calls, that's not a great time. And again, we have some
1360970	1365330	issues with everything not being one to one with our API call implementations. For example,
1365330	1369030	with those AMSI returns, we're always returning, hey, this isn't malware, this isn't a
1369030	1376110	problem. So taking some time to look at the code base is super important. And wine by itself
1376110	1381130	does not provide any sandboxing capabilities. So you still need a dedicated machine to
1381130	1386490	execute malware on and isolate it appropriately, making sure that you're not about to run
1386490	1391070	something on your host machine or machine you carry about. Additionally, for the folks
1391070	1395330	that are interested in this from a how do I detect or evade this, there's a lot of very key
1395330	1400130	artifacts that would show that you're running in a wine environment. Such as the name being
1400130	1407110	such as some of the process names being wine. Additionally, wine for this is executing
1407110	1413550	x86 and 64 bit PE files. So if you have some kind of old DOS binary or something like that,
1413550	1417230	that's where you're going to start looking at DOS box and your results may vary there. And
1417230	1421610	again, it is an evolving project. There are bugs. So there are unknown unknowns that you may
1421610	1426030	run into. But for the vast majority of malware that is getting reported on by these
1426030	1430950	threat intel companies as the most commonly seen, you can easily instrument an execution
1430950	1435230	environment for the situations where maybe you don't want to upload that sample to virus
1435230	1442810	total or maybe you don't have a cuckoo or the equivalent execution environment locally. So
1442810	1448170	with all that being said, I will have a handful of key takeaways that I want you to go away
1448170	1451390	from this talk, right? Because Packet Hacking Village is very much structured around
1451390	1458190	actionable talks and being able to take something from them. Wine can execute trending
1458190	1463650	malware in 2023. Absolutely a fact. You can go grab some cobalt strike off the shelf
1464330	1469970	mess plate or grab some cobalt off the shelf artifact from mal share and execute it to get those
1469970	1475670	DNS and host artifacts. You can also build custom DLLs to instrument your execution, grab
1475670	1480590	additional artifacts or maybe some neat instrumentation that you're looking to do. And
1480590	1484910	then Wine can also shorten the red team testing for our friends that are looking to do proof
1484910	1490630	of concept stuff related to new ideas. I really want to give a shout out to everybody coming
1490630	1494530	here to watch this. This means the world to me. So thank you very much. And then if any of
1494530	1498710	this was interesting or you're looking at recreating this on your own, go ahead and take a
1498710	1503630	screenshot of this. The slides and then some walk through examples of leveraging pod man and
1503630	1508170	docker for creating these environments and doing the execution. They're all on GitHub as of
1508170	1513450	about an hour ago. So definitely check these out. Create Git issues if you run into them. And
1513450	1517930	I'll be around after this talk to chat more. Thank you all so much. I really appreciate it.
1524550	1529670	Thank you, Jared. I can tell you right now, I can tell you're a good teacher. I can just tell. I was
1529670	1535030	watching this whole thing. Now, if anyone actually have any questions for Jared, you can feel
1535030	1541190	free to use the microphone. Yeah. If anyone will have a question for Jared, you can feel
1541190	1544030	free to use the mic. Feel free. Yeah. It should be open.
1547560	1555280	Hey, thanks for the talk. Just wondering, in your experience, as you mentioned, it's not a new
1555280	1561660	thing to run it under wine. Have you seen malware that's either looking for wine to do
1561660	1566560	something benign instead of its true payload? Or have you seen things that are actually looking
1566560	1574590	to actively burn it down? Hello. Okay. Great question. So the question was, have I seen any
1574590	1579330	malware samples that are looking for any wine artifacts that then do something different? I
1579330	1586270	have not. I think largely, you know, a lot of socks have the ability to throw data to a virus
1586270	1590230	total or equivalent. But for the situation such as home lab enthusiasts or people just getting
1590230	1598590	started, wine provides a pretty neat opportunity to execute those payloads. I'm quite lazy and
1598590	1604190	don't like running my own instrumentation or compiling my own stuff. Would you recommend any
1604190	1609370	like L trace or S trace equivalents built into wine doing the dynamic instrumentation you
1609370	1616170	recommend? I think I heard you. I think you said that you're looking for any kind of L trace
1616170	1621070	or S trace equivalents built into wine. Cool. So wine does have a debugger that you can use to
1621070	1625470	go just like GDB or win debug that you can go forth and start poking at memory addresses to
1625470	1631170	dump it. Your results may vary on the success that you have there. But also in the same vein
1631170	1635450	of things, because all of those syscalls are getting translated to the POSIX equivalent
1635450	1640550	syscalls, you can check out S trace. Furthermore, two years ago I actually gave a talk on
1640550	1645270	leveraging S trace for Linux binary analysis at hacking village that you will also find on
1645270	1655100	that GitHub. So definitely check that out. Similar vein of question. How easy is it to
1655100	1665010	like compile the shared libraries? Hello? Hello? Okay. How easy is it to compile the like shared
1665010	1670950	libraries for wine to like do any kind of analysis on the things you? I'm sorry, I cannot
1670950	1678470	hear you. I think I'm backing away. Okay. For yeah, for the shared libraries, is it like
1678490	1683950	you compile it and it's like a Linux shared library that wine then loads or? Yeah, great
1683950	1689070	question. So yes, it absolutely is a Linux shared library. And then you can get it to execute
1689070	1696890	or return data or whatever you want to do. Yes. Hi, thanks for the talk. So you tried it out
1696890	1706390	on Metasploit and Empire. These are both pretty well supported malware. Well, malware or
1706390	1712950	red team tooling project. Have you tried this out on just random samples on VX underground,
1712950	1720490	for example, that are often less or those samples support less Windows versions, for
1720490	1727030	example? Yes, those are great questions. The question was, tried it out on Metasploit,
1727030	1731150	Empire, Cobalt Strike. Have you tried it with other samples that you just kind of grab off of
1731150	1736230	VX underground? So going back to kind of the home lab story here, I pull in daily dumps
1736230	1740030	from MalShare. Those MalShare samples end up largely being Cobalt Strike and Returpreter
1740990	1747830	samples. So my big target base is that. I haven't tested it on all or a bunch of VX underground
1747830	1753970	samples, but I have thrown in some random things that are kind of custom built and I've had
1753970	1760290	success. But your results may vary. All right. Thank you. Sounds cool. I'm going to try it
1760290	1769640	out. All right. So you've made a bunch of changes to the Wine source code to do various
1769640	1776980	things. Have you sent anything back upstream? And if so, how did that go? Yes, that's a
1776980	1780660	great question. So the question was, you've made changes to the Wine source code. Have you
1780660	1784700	submitted anything back upstream? So most of the changes that I've made have been to capture
1784700	1788540	specific parameters that are getting passed into, say, like a reg query to then log off to
1788540	1793220	the side. So these changes don't improve the overall functionality or support of Wine.
1793900	1798220	WineHQ.com has an excellent breakdown on how to submit upstream patches, how to double check
1798220	1802260	their bug tracker, so on and so forth of everything related to development. And I would
1802260	1806760	highly encourage you to check that out. But for the small samples, or excuse me, for the small
1806760	1810800	changes that I've made, it has been nothing substantial to go forth and contribute upstream.
1825540	1836720	Anyone else? If I may, then sure, if there's time. So how easy is it to make changes to Wine in
1836720	1842540	such a way that it behaves like a sandbox? Because many sandboxes do not only have the
1842540	1850180	functionality of being a Windows box, but also making memory dumps, taking dumps of the
1850180	1857800	network traffic, stuff like that. Test. So I think the question was, how easy is it to make
1857800	1863900	changes to the underlying Wine source code? Did I hear you correctly? Yeah, so either the
1863900	1870920	source code or just setting up... Sure. Just all of the things. Sure, sure, sure. So cool. So
1870920	1875420	like, let's run through that really quick. So one of the things in the, like, lab repo thing
1875420	1879600	that I have up here is I'm leveraging Podman over Docker. And the reason for that is you can
1879600	1885600	actually pause containers when you're executing containers with Podman. So with that, if
1885600	1889400	we're running a malware sample in Wine in a container with Podman and I pause that
1889400	1893040	execution, we can go ahead and dump that memory and start taking a look at those artifacts
1893040	1897440	that may get decrypted, decompressed, so on and so forth, right? Same example for a
1897440	1903040	packed or encrypted sample or region of memory. For the situation of how easy is it to
1903040	1907440	capture Wireshark data, it's as easy as literally spinning up Wireshark and selecting the
1907440	1911780	interface and capturing it from there. But again, and I just want to double stop this, you
1911780	1915300	know, Wine doesn't provide any kind of sandboxing features, so you still need that host
1915300	1920280	to make, that host hardening and sanitization process to make sure that you're not about to
1920280	1922920	run malware on a host you care about.
1927200	1929700	Dan Shroud, everyone. Have a drink.
