start	end	text
0	9280	Alright, so what I'd recommend for people in the back is to just move a little bit ahead so that you can hear the whole thing properly.
10100	11660	Apologies for the holdup.
11660	13480	We'll move on with the next session.
13580	19040	Up next, we have Vladimir, who is a Senior Security Researcher at Microsoft.
20080	23920	He's done some amazing research with the Quotesis framework.
23920	28400	He's also identified some bugs in the Windows driver of the SonicWall tool.
28920	39220	His topic for today is, from there to discovery, how OSINT and modern recon techniques uncovered a global VPN infrastructure.
39540	48120	This presentation has a complete attack chain that showcases some advanced recognition techniques and some live demos.
48460	65700	Here, we'll run some practical methodologies that can help us do improve our OSINT skills and put emphasis on the intelligence gathering process that can help you even proceed with other attacks.
65700	67620	So, please bring it up for Vladimir.
76580	79460	Thank you for joining me today.
79460	82380	Today, I'm going to talk about research I did last year.
82600	87320	From there to discovery, how OSINT and modern recon techniques uncovered a global VPN infrastructure.
89740	90260	Critical...
90260	91440	A little louder.
91440	93100	Okay, yeah, I'll try that.
93520	95180	So, let's begin.
95440	100620	It all began one night while I played Deep Rock Galactic with my friends.
100740	108840	And basically, it's a game where dwarves roam the cosmos, mining for minerals and killing bugs.
109140	112200	And I played with two friends, Nicky and Philip.
112200	113380	This is Philip.
113380	117980	And basically, Philip had some issues, some connectivity issues, some lags.
117980	120780	And I asked him what's going on.
120780	124820	And basically, he said he installed a new VPN, that one.
124820	127120	And ExpressVPN, maybe you heard about it.
127240	132220	And then we entered this chat about why should one use like VPNs, right?
132220	133940	Security, privacy, stuff like that.
133940	136360	And so, I didn't believe him much about that.
136920	139440	Sure, this is worth your while.
139480	143840	And basically, he dared me to prove him wrong, right?
143840	146280	To prove that something is not good there.
146280	155580	And so, basically, there I started, started looking at ExpressVPN drivers, and different files.
155580	171780	And one of the first things I found was the top driver, which is top adapter, which implements for Windows, basically virtual network card, which will basically get information, wrap it and send it through a tunnel to other endpoint of the VPN, for instance,
171780	172780	for the server.
173140	185920	And basically, I started reverse engineering it and opened the driver and found this nice piece of code, which initialized the MiniPort driver characteristics object, which has a lot of callbacks.
186560	191520	And then the initialization happens with the Andes register MiniPort driver.
191520	201820	And so, this object has a lot of callbacks that usually used for different actions in the driver, sending messages, receiving messages, and stuff like that.
202100	211840	One of them, one that I actually looked at was very interesting for me, was the MiniPort send that buffer list, which is a method that sends information, right?
211840	214020	And so, I dig into it.
214020	216520	And basically, the flow is pretty trivial.
216520	222020	First, we have the validation for the adapter that is ready to communicate.
222020	228000	Then we have retrieval of the first driver, sorry, of the first buffer.
228000	236620	And then basically, we will transmit this buffer in a loop for all the linked list of the buffers.
237540	241160	And this is the top adapter transmit function.
241240	248940	Basically, what it does is getting a net buffer structure and allocates its data length plus 24 additional bytes.
249580	261040	Then it gets the actual pointer from this net buff structure and copy the memory from this net buff object into the newly allocated data.
263120	264740	I'll try another mic.
264740	265400	Okay.
265400	266240	Is it better?
266240	267340	Oops.
267340	268620	Yeah, boom, boom, wow.
269740	271180	Yeah, let's do it.
271200	274020	And so, this is the prefix of the function.
274020	276040	And before the end, it's allocate memory, right?
276040	277160	Before this one.
277220	278400	And this is how it looks.
278400	282260	We can see the RS6 plus 18 extra and then another.
282500	283700	It's worse.
283880	284540	It's worse.
284540	285140	Yeah.
289020	289820	Cool.
290500	291420	Let's do it.
291960	293260	Defcon style, right?
293260	293840	Okay.
293840	297880	So, I hope they don't cancel each other.
298280	298800	Yeah.
298820	299960	Waves stuff.
299960	300360	Okay.
300360	303420	So, let me hold it like that.
303420	305640	And so, this is the prefix.
305640	312660	The idea is that we allocate a buffer and then we add 18 bytes for offset and then we add 18 bytes for size.
312660	317000	And so, obviously, if we'll give a big enough value, we'll have integer overflow.
317000	319280	And so, this is bad.
319280	321040	But it's not really bad.
321040	322980	Let's talk about what we can do with that.
322980	325160	And so, here we allocated the memory.
325160	330420	Then we have the ndisget data buffer, which is the pointer for the buffer that's been copied.
330420	336620	And then we actually do the memory move, which is the copy of the data on the newly allocated memory, right?
336620	341880	And so, the idea is that we will allocate 17 bytes and then write it with a lot of data.
341880	343880	And this is while kernel overflow.
344180	350360	Now, generally speaking, there are some explanations why kernel copy overflows.
350440	351640	But they are hard.
351640	352320	Why they are hard?
352320	358060	Because there are tons of mitigations in the kernel to prevent this.
358060	372940	And, like, modern HVCI, stuff like that, even page fall handler, device guard, stuff like that will make it very hard.
372940	379780	Now, the issue is that this will be hard even for simple overwrite.
379780	385860	For while kernel overflow, which basically will overwrite a lot of memory, it's even harder.
385860	392860	And so, in this case, I just left it on the side and went a few days without thinking about it.
392860	396680	And then I started looking at ProtonVPN source code.
396780	399900	Not source code, but on the driver again.
399900	401180	And find the same bug, right?
401180	403800	And so, I've already seen that.
403880	412300	And at this point, I asked myself, do we have, like, a one-off issue, or is it a systematic issue, something that is more bigger than two drivers?
412360	414600	And obviously, also a disaster, right?
414600	417920	Because if we can't search for it, we can't find a lot of leads.
417920	425900	And so, in this case, I just decided to create Yarrow rules to search for the problematic allocation of memory.
426620	430040	And this is the part we want to search for.
430040	431380	This is the assembly of it.
431380	438320	And we can see that it's using the tag, the pull tag here, noted in yellow.
438320	445020	And I just created a Yarrow rule to search for that, for 64 bits and 32.
446640	452740	And then I searched for it in Yarrow, and found 50 matches.
452920	458120	Now, the cool stuff is that there are a lot of drivers with the same issue.
458120	468840	And so, at this point, I just asked myself, or told myself, that it's probably something that is widely used by a lot of drivers, something to do with VPNs.
468840	474620	And so, the next question was, ChatGPT, what is the most popular VPN?
474620	477780	And obviously, OpenVPN is the answer.
478040	480380	And so, OpenVPN is really huge, right?
480380	489060	It's used by tons of different VPNs, by ExpressVPN, NordVPN, CyberGhost, ProtonVPN, whatnot.
489240	496140	And beside all that, it's a big, big repo in GitHub with a lot of sub-repos inside of it.
496140	508680	We have the OpenVPN daemon, we have the EasyRSA, which is their implementation for RSA, also the GUI, tap Windows 6, OpenVPN 3 Linux, which is the OpenVPN implementation for Linux.
509740	520540	And basically, at this stage, I asked myself, okay, so we found this bug in a number of drivers, Windows drivers, let's find some repo that's relevant to that.
520540	522560	And obviously, I started looking at tap Windows 6.
522780	528560	And basically, after some search, I found this nice method, which does exactly that.
528560	539260	And this is the issue we've seen with the assembly part, because it allocates the packet length from the buffer and then adds to it the additional error size with this macro.
539260	541000	And so, this is the bug, right?
541000	544540	This is the source of the of the bug that we found in OpenVPN.
544880	550640	And now, after we found the reason to look at OpenVPN, let's take a deep dive inside of VPN.
550680	553100	We'll find some cool stuff there, I promise.
553180	562600	And, okay, first, one of the most interesting repos of OpenVPN, obviously, is the OpenVPN daemon, which is the process that will execute all the VPNing.
563540	570420	Then we have the OpenVPN GUI, which is basically the GUI part that allows us to use OpenVPN on Windows.
570640	573540	And we have the tap Windows 6 that we've already seen.
573560	580120	And for current session, this is the repos that are relevant and interesting for us.
580120	584760	They have a lot more solutions and a lot more stuff to provide.
584760	588960	So, if you'd like to check them out, look at their GitHub page.
589760	592700	Now, the client server is pretty straightforward.
592700	595580	We have the client that will be connected to the server.
595680	605320	Obviously, SSL, MTLS, even if needed, and the classical handshake and stuff will flow on both ways.
605880	621160	Now, on the single machine level, on the client level, we'll have the kernel space logic that will create a virtual NIC, through which we will send data that will be roped and sent through the actual physical NICs.
621160	630340	And then, in the user mode, we have the daemon that runs OpenVPN and actually encrypts the messages and does all the VPNing.
631240	642700	And so, OpenVPN, in addition to being a big open source, it's actually a standard for protocol of communication between server and client.
642700	645760	And the structure of it, it's pretty straightforward.
645760	648140	It can be over TCP or UDP.
648240	650760	And first, we'll have the packet length, 16 bits.
650760	656760	Then, we have the key ID, the opcode, which is the thing we want to do.
656800	660120	And then, we have the payload, which is pretty straightforward.
660120	664980	This is an image of a handshake for OpenVPN protocol.
666360	677980	Now, another very interesting part about OpenVPN is that it's supported on almost every big or small operating system and different tools.
677980	683220	You basically can open a random router and find an OpenVPN binary there, right?
683220	689540	And so, it works on Windows, Linux, macOS, iOS, Android, whatnot.
689880	692160	And so, the question is how they achieve that.
692160	693860	It's pretty standard.
693860	707100	They have a lot of includes with different macros and a lot of implementations for a specific system, which allows them to be like dynamical and very fast and very efficient on the specific operating system.
710000	720220	They'll be using a lot of macros and then with different flows or different even functions and even different includes to do that.
721100	724600	And so, this is like the macro logic of OpenVPN.
724600	733480	Now, let's take a look inside other cool, open VPN, one of which is the OpenVPN plugins.
733500	747340	Now, OpenVPN have plugins to allow specific or additional credential validation or audition of the information or even creating ETW events on specific logic that we want to do.
747340	750300	All that can be implemented with plugins, right?
750300	760580	And so, the idea is that we have this DLL that can export some functions and can be called with, for instance, OpenVPN plugin OpenV1, which is the initialization function.
760580	763960	In this example, they are setting credentials.
763960	770340	And then we have the FuncV1, which will basically do the logic that it needs to be done.
770340	772960	And here, it will validate for credentials.
773180	777580	So, down the line of plugins in OpenVPN, they are cool.
777580	783780	They allow a lot of stuff, a lot of validation, auditioning, stuff like that.
784820	791920	Now, let's talk about the actual architecture of the OpenVPN service on Windows system.
791920	801500	And so, we have the OpenVPN server, which is the system-level running service that has an open name pipe called OpenVPN slash service.
801600	807680	And a process will connect to it and send information to this name pipe.
807680	815820	How this will look on the OpenVPN server side, creating name pipe instance, and then create intent to handle it.
815820	825100	And we will validate stuff and basically create the relevant security descriptor for it.
825260	827240	Then, we will wait for connection.
827240	838800	After connection achieved, the OpenVPN server will wait for get startup data, which is basically the way that other process communicate with OpenVPN server.
838800	847060	They will send a string that explains where they want to run the new OpenVPN process.
847060	850240	The actual daemon will do the VPN-ing.
850240	856500	OpenVPN server will just managing those and a lot of other instances of OpenVPN can be created.
856500	863280	And so, the startup data is the directory, configuration, and the log file that should be executed.
863620	870700	And so, this is an example for initializing execution of OpenVPN programmatically.
870840	883480	And after this startup data will be passed and validated and checked that it's okay, the OpenVPN server will impersonate the client.
883900	890300	And then, it will validate that this client is the OpenVPN group of users.
890300	900460	And then, we'll proceed to basically create another name pipe, which it will pass to the execution of the OpenVPN process.
900460	900720	Right?
900720	908520	And so, then it will run this OpenVPN as the user that he has impersonated.
908520	911240	And so, this is how it looks on Windows.
911240	920340	We have the OpenVPN server that through OpenVPN service got startup data and initialized and executed OpenVPN process.
920680	922960	And then, we have another name pipe.
922960	928460	For instance, here is service 1234 through which OpenVPN will communicate with OpenVPN serve.
928460	934660	And so, the travel question is why do we need this another name pipe or why so many name pipes?
934660	947240	And the answer is that, for instance, if we have a weak client that connects to OpenVPN service and it wants to change some DNS configuration, maybe add some routes, you need to be able to do that.
947240	949400	For that, and this is a weak user.
949400	955840	For that, it will send specific messages to the OpenVPN service and the service will do it on its behalf.
955900	956220	Right?
956220	959780	And so, this is how it actually looks like.
959780	968540	Through the same pipe, the data pipe, we will get some data and then, we'll convert it to messages based on the type they have passed.
968540	971660	Now, there are some logic that can be achieved with that.
971660	982240	The client can send address message or route message or DNS configuration message and then, the server will send back acknowledge message for that.
982240	984020	So, how it will look like?
984020	988360	The OpenVPN will send a route message, for instance, for open service.
988360	998680	The service will actually execute the logic for that, add another route, then send an acknowledge message back to OpenVPN to signal that it has finished the logic.
998680	1015340	Now, if we want to take a look on the broader side of Windows, we also have the OpenVPN GUI, which will basically send the relevant data through the OpenVPN service to OpenVPN service that will initialize the daemon for the user.
1016160	1023920	And now, in the, let's call it like the network level, this is the full architecture of the communication.
1023920	1031120	We have the server with the plugin inside the OpenVPN daemon and then, information will pass through the plugin.
1031120	1034580	The plugin can audit it, can log at it and stuff like that.
1034580	1040740	And now, we can talk about first cool discovery that found here.
1040740	1059540	It's relevant to the potatoes class of vulnerabilities in Windows and basically, potatoes vulnerabilities are vulnerabilities that allow, by exploiting some misconfiguration, some issues in Windows, achieve privilege escalation.
1059540	1065260	And for instance, we have the sweet potato, which waits for WAPT queries on the network.
1065260	1072280	It will answer the address for WAPT server, which will point to the attacker.
1072280	1080020	Then, the legitimate client will actually ask for WAPT that file, which is the file that defines proxy on Windows.
1080020	1089180	And then, the malicious attacker will answer bad WAPT file that points again to its controlled proxy.
1089180	1106040	And in this case, the Windows client will start sending through the proxy different queries and then, the malicious proxy can require NTLM authentication, execute NTLM authentication and do relay or crack or whatever they like to.
1106100	1110780	And so, this is pretty much what will happen here.
1110980	1115880	I'll show you a vulnerability and then how we can exploit to get local privilege escalation.
1115880	1125600	So, this is the logic in the service of OpenVPN that handles messages that received from the OpenVPN demo.
1125800	1127280	The logic is pretty simple.
1127280	1133000	First, we'll have the amount of bytes we want to read, the PICNAME bypassing.
1133000	1134320	Then, we'll handle a message.
1134320	1147400	In the handle message, we will allocate a struct on the stack and then, basically, we'll write onto this allocated struct the amount of data that we read from the pipe, right?
1147400	1153420	And so, here we can see on the left upper part the amount of bytes we want to read.
1153420	1160960	Then, we can see that message is a union of structs but basically, it will be just the longest of them on the stack.
1160980	1167160	And then, we have the read bypassing that will read the same amount of bytes onto the message struct.
1167160	1173820	And so, this is a stack overflow because if we can write more data than this message, we will overflow it.
1174060	1186560	For instance, if you have the message header here with tab type and message ID and then, we have the address message or even the DNS config message which is bigger, if we send more data than it contains, it will overflow it.
1186700	1197400	And if we'll do it, we'll have, we'll get fast fail stack cookies check failure which indicates that we have stack overflow but we had a cookie issue, right?
1197520	1198940	Which is good and hard.
1198940	1201940	So, let's think about what we can do with the canary.
1202620	1206620	This is the message, the handle, this is the function that handles the messages.
1208120	1209760	And this is its prefix.
1209760	1212640	And here, we can see the security cookie usage.
1213360	1218300	Now, basically, a security cookie defined here to be of value.
1218580	1227340	And then, what will happen is that we'll store it on the stack again and in the end of the function, we'll validate its value and see that it hasn't been changed.
1227580	1230680	Now, the actually interesting question is where it's being set.
1230680	1233120	And so, we have this security cookie function.
1233200	1236000	And this is the logic that happens there.
1236000	1241820	And basically, first run, we'll check if the security cookie value is constantly defined for first run.
1241820	1251060	And then, we do a lot of XORs with different information from the operating system such as time as a file, performance count, and stuff like that.
1251060	1255820	And the down the line here is that it will be very, very hard to guess this value.
1255960	1263660	And the only way, the only possible way to bypass that would be if we had rig primitive on the memory of this process.
1263660	1264860	But we don't have it.
1264860	1267560	And so, the underline here is that it will crash.
1267560	1271460	If we'll overflow, we'll basically crash the process.
1272200	1277240	Now, let's talk a little bit about some issues that are associated with name pipes.
1277240	1292940	First, we have the classical name pipe instance race condition, which means that if a client connects to a server through a name pipe, if somebody creates the same name pipe with the same name, before the server, the client will connect to it.
1292940	1300860	Now, another issue is the superfluous pipe connectivity issue, which basically says that the client don't really know who it's connecting to.
1301440	1311620	And so, the attacker that created the name pipe can do, for instance, malicious impersonation of the client.
1311960	1319440	Now, let's sum it up in the all of this together into a vulnerability and a local privilege escalation vulnerability.
1319800	1323540	And basically, what we'll do, we'll create a malicious DLL.
1323540	1328520	And then, we will load this malicious DLL in open VPN daemon.
1328520	1333180	And through the inner name pipe, we will crush the open VPN service.
1333180	1343100	And then, the open VPN daemon will create the malicious DLL in the open VPN will create same name pipe and export it to other users.
1343100	1352660	And then, the next user that will connect, it will connect not to original open VPN service, but to our malicious plugin, right?
1352660	1361120	And so, the DLL main basically will extract the command line argument and deduplicate the handle that was passed there.
1361300	1372400	And through that handle, we'll send a malicious packet that will basically kill the open VPN service, which is just long enough data that will overflow the stack.
1372400	1379300	And after that, it will create the open VPN service name pipe and wait for connection.
1379300	1383680	If a connection occurred, it will basically impersonate.
1384320	1387280	First, it will get the startup data because this is the protocol.
1387280	1389440	Then, it will impersonate the connected client.
1389440	1399720	If the connected client is strong enough, it will execute on its behalf, for instance, malicious application called driver communicator.
1399720	1403200	And so, this is the demo.
1404320	1409460	On the right, we have weak user that executes the logic.
1409640	1413060	And on the right, we have the client that connects.
1413060	1427320	Now, on the right side here, we had an exploit that actually sends malicious, that loads a malicious plugin and kills the open VPN service and then runs with the name pipe and waits for connection.
1427320	1439120	Then, on the left side here, a client connected to this unknowingly because, well, it's the same name of the open VPN service name pipe.
1439120	1447400	Then, here, we can see that we have a very strong level process, for instance, system level in this case.
1447400	1450600	And, yeah, take me a while to get there.
1450740	1453200	But, yeah, cool.
1453440	1457820	Now, this was cool because we got local privilege escalation.
1457820	1460020	But the question is, can we do it remotely, right?
1460020	1466380	And so, the question is, how do we use name pipes remotely?
1466380	1467980	And the answer is pretty simple.
1467980	1472120	Windows have different mechanisms for sharing resources.
1472120	1475780	In this case, name pipes are IPCs, resources.
1476060	1480580	And basically, the idea is that there are some protocols for that, SMB and SMB2.
1480580	1491960	And we will, to use a specific resource for a specific endpoint, we will use an endpoint server and then the path to the share and the path to the resource.
1492300	1495620	Now, we can do that, for instance, with net use.
1495840	1504340	And we can actually then see the IPCs process, which is good, which means that we could potentially connect to remote endpoint and use its name pipe remotely.
1504460	1508100	And so, how would an attempt like that would look like?
1508100	1513000	First, we'll see the tree connect request for the IPC on specific endpoints.
1513060	1519500	And then we also can see the request was declined because it's not that simple.
1519720	1530240	And the thing is that there are some Windows definitions, some set of rules that allow and disallow connection to name pipes.
1530240	1534080	For instance, we have the network access, name pipes that can be accessed anonymously.
1534080	1539600	By default, there are none such as that that could be accessed anonymously.
1539680	1549560	And another thing that we have is that we restrict anonymous access to name pipe, and this is enabled by default.
1549560	1557580	And so, the thing is that it means that it's very hard for us to do it without, basically, without credentials.
1558040	1560900	But don't worry, we can get those.
1561320	1566180	And basically, we should do that with reconnaissance.
1566180	1572260	We can wait on the network and sniff for different hashes and then break them and get the credentials.
1572860	1588960	And then this is not something new everybody uses, such as APT28 and then another processes exploitation by Mimikads, or even malicious plugins for different web browsers that do exactly that.
1589420	1596300	Basically, NTLM is a NetLAN manager, a set of protocols that allow us to connect securely.
1596360	1598940	And this is how it will look like.
1598940	1605320	First, we'll have the NTLM SSB negotiated request with the challenge.
1605320	1608360	Then the server will send the challenge.
1608360	1613220	Then the client will send back the NTL-proof STR.
1613240	1617400	And in the end, we'll have the full hash in the packet.
1618380	1622320	And we can capture that with tons of different tools.
1622320	1626280	And I used here the responder in Kali.
1626280	1635820	And basically, we can see that it captured the username, the domain, the server challenge, and the extra hash payload that actually hashes the password.
1636080	1639700	And the other question would be, how can we crack that, right?
1639700	1643840	And basically, there are tons of open sources there.
1644080	1651040	And the most two promised things that I found was Hashcat and JohnDeRipper because they're widely used and very good.
1651040	1654920	And I proceed with Hashcat because it's very good with GPUs.
1654920	1666060	And first, I started with my own laptop, my gaming laptop that have RTX 3070 with almost 6,000 CUDA cores.
1666060	1682980	And basically, 6,000 CUDA cores for net NTLM v2 hashes will allow me to break something like almost 2,800 million hashes per second, which is pretty fast.
1682980	1686760	And for starters, pretty good if you have a very short password, right?
1686760	1689360	If you have one short password, it will do it momentarily.
1689460	1695660	But if you have a long password, it will take something like a few years and we don't really have time for that.
1695700	1699000	Those are indeed rookie numbers.
1699240	1705480	And so, other thing I thought about was maybe we can build cool hardware to crack it.
1705480	1716300	And we can do that, but it will take a lot more money and a lot more time because to actually get a lot of GeForce, it takes a lot of time and a lot of patience.
1717060	1722000	And so, from here, I decided to find another solution.
1722000	1726800	Basically, I thought about how can I use cloud platforms for that.
1726800	1738720	And basically, there is this cool platform called Vast AI, which basically allows you to rent machines with specific GPUs on time for time.
1738720	1741480	And it's very, very easy to use.
1741480	1744780	You've got a Docker images that can run on those machines.
1744900	1746740	And it's pretty cheap, right?
1746740	1757140	For instance, here we can rent a machine with 18 RTX 4090 for $8.5 an hour, which is pretty cheap.
1757240	1770200	And now let's calculate quick math, as they say, the amount of CUDA cores and how much more such machine will give me in terms of tracking per hour, right?
1770200	1782900	And so, if my old laptop has almost 6,000 CUDA cores, the RTX 4090 have almost two and a half times more, and the 18 times have almost 50 times more.
1782900	1786980	And so, the question is, like, will the improvement be 50 times more?
1786980	1790420	And obviously not, because we have tons of different bottlenecks.
1791180	1801120	But in the end, I proceeded with the big lad, the machine with a lot of RTXs, and basically installed it and executed the tracking of a long password.
1801120	1807000	And it took me less than three minutes to track a nine char password, which is pretty fast.
1807140	1809320	And yeah, it's hell yeah, for sure.
1810200	1815420	And then now we have basically all the things that we need to create actual RCA, right?
1815420	1816520	Because we can.
1819260	1827740	Firstly, we used OSINT leads to find a basic issue, and then we keep digging into OpenVPN and find another issue.
1827860	1834420	And then we understood that we need SMB enumeration and hash tracking to get credentials.
1834420	1837420	And in the end, we cracked those hashes with cloud tracking.
1837420	1842000	All of this together allow us to actually get an RCA vector.
1842000	1849260	And the idea is that first we'll work on the network, wait for hashes, then recap them and track them.
1849260	1858360	And then we'll use them with Netuse to actually be able to access other PC IPCs.
1858380	1869620	And then what we'll have in our exploit is actually connection to the remote endpoint name pipe of the OpenVPN service that we try to attack.
1870000	1879880	After that, we will pass to it a malicious configuration and log on attacker controlled share, as shown here.
1880000	1890280	And so in the configuration of OpenVPN, we'll have the directive to load a malicious plugin, which is again located on the malicious share controlled by the attacker.
1891060	1900100	And so basically, first attempt, it didn't work because we need to allow anonymous access to the share and allow everyone to connect to it.
1900100	1907020	And after this configuration on the attacker controlled share, we got it working.
1907020	1909980	First, we have the request for tree for share.
1909980	1913000	Then we have the request for the configuration.
1913020	1917100	And in the end, we have the request for the malicious plugin that executes the logic.
1917360	1939280	And this is the example of the demo that we'll first execute on the attacker controlled share machine will execute the exploit, which will connect to the remote endpoint and through name pipe will load a malicious plugin from attacker controlled share.
1939440	1946600	And this is pretty cool because this allows me to actually remote execute on the remote endpoint.
1946600	1951660	In this specific example, it just dumped a lot of files on the desktop, which was pretty cool again.
1951860	1960920	Now the question is, can we mount those two logics together?
1960920	1965080	Can we execute the remote code execution and then the local provisioning solution?
1965080	1966000	And the answer is yes.
1966000	1971740	We just need to mount the LP logic onto the malicious plugin that we execute remotely.
1971740	1982360	And in this case, after the malicious LP executed, we will execute the reclaim and the file that called reclaimed the Dwarven Kingdoms of Erebor.
1982720	1987760	And after executing this, we have an RCNLP vector.
1987760	1990280	And the question is, what can we do from here?
1990680	1999700	And some travel attempts, some stuff that APDs love to do is bring your vulnerable driver.
1999800	2005160	And then again, it will be pretty easy in this stage because we have already APD.
2005160	2011140	We can actually use the SC manager and create service with our malicious driver.
2011140	2020880	For instance, we could use this one, which has read-write primitives into kernel memory, which make us very, very strong.
2021000	2027180	And another technique we could use is living off the land, which is again used widely by APDs.
2027180	2031560	Maybe find some install MSI and mangle with it.
2031920	2045320	And the classical approach could be even exploiting one day or even new zero day in Windows and Windows machines in the driver kernel.
2045400	2048680	This is actually what has been executed in this research.
2048680	2049980	And I took it as well.
2049980	2061280	Basically, the idea is to exploit and vulnerability which will change the previous mode and allow us to have arbitrary read-write into kernel memory.
2061520	2065440	And the other question will be, now what?
2065440	2074000	Okay, so we have remote code execution, and we have LPA, then we have even read-write kernel primitives.
2074000	2088680	Now, APDs would love that because basically, when you have executed some malicious logic on endpoint, you have a lot of anti-malware and anti-virus application that will hunt for you.
2088680	2093840	And what we would like to do, and generally, APD would like to kill those and bypass them.
2093840	2108080	And so, usually those come in the form of PPL, which is a Protected Process Line, which was invented somewhere in Windows 8, if I'm not mistaken, which allows us to protect processes.
2108080	2118620	The idea is that we will have a process that is digitally signed, and they have an hierarchy of different PPLs that are digitally signed.
2118620	2127080	And the rule is that the higher the process, it can mingle with lower processes, but lower processes can actually communicate with those processes.
2127080	2134000	And the regular processes, even if they system, can't actually affect the PPLs, right?
2134000	2140140	And so, what we'd like to do is abuse those redrive primitives to maybe un-PPL a process.
2140140	2141320	How would we do that?
2141320	2143240	Let's use WinDBG.
2143760	2151820	Basically, there is this struct called PSProtection, which indicates the PPL protection level of a system, of a process.
2151820	2170920	And we can use, for instance, a process directive to see the LSAS information, which is basically type-protected, and it's a protected sign on system, which is pretty high up the level, which means not much of different process can communicate with them and affect it.
2171580	2178940	Now, if we'll try to kill a process, which is a PPL, we will fail, even if we are a system, because, again, we are not a PPL.
2178940	2184500	So, if we have WinDBG, we could do it with actually overwriting the memory, right?
2184500	2200660	We can find the memory, overwrite it, and then basically we'll crash the process in this case, because if we'll overwrite the PPL field of Winint, it's a very high and important process, and it will basically crash the system.
2201460	2204320	And now, this will be our full chain.
2204320	2222720	We'll use the DRCE to gain code execution with a plugin, then the same plugin will execute the local provision escalation logic, the PLC, and then with that, it will wait and abuse the app ID sys flow to get arbitrary kernel read-write.
2222860	2233180	And in the end, it will, with those abilities, overwrite the PPL protection of specifically Winint for us to be able to crash it, right?
2233180	2235080	And so, this is the demo for that.
2235440	2262140	Again, this is a remotely executed exploit that will connect to the remote endpoint on the IPC, on the OpenVPN name pipe service, execute a plugin, the plugin will wait for a connection , and here we can see the log that means that stage one and stage two loading of the plugin were successful,
2262140	2281580	and then we'll have a user just execute the OpenVPN GUI, which runs on highly elevated privileges, and it will send the startup data to already our exploit, and then we'll have stage three and stage four, which allows us to actually overwrite Winint PPS protection,
2281580	2283980	and this gives us a full chain.
2284300	2289860	And the question is, as I said, why an attacker would love to do this?
2289860	2293160	Well, basically, they have tons of stuff they would like to bypass.
2293160	2305910	Security of OSes, anti-viruses, stealth attacks, maybe they want to hide something, rootkits, and so this could be a pretty cool vector for attacker.
2307080	2322140	And basically, the Rekon and the OSINT tools stack I used here was VirusTotal, Yara rules, Trudan and Zoom, I haven't talked about it in length, but basically those helped me to find how much OpenVPN is used and popular, which is pretty much.
2322140	2325500	And here we have the summary of the session.
2325500	2332100	Basically, the takeaways here is that first, one bug can be a pretty big deal.
2332440	2339620	In this case, the plugin mechanism was implemented not on the best side, but it allowed us to do a lot of damage.
2340200	2354440	And another thing is that currently, we don't really need to create a heavy hardware system with a lot of GPUs locally, we can just rent some cloud from some cloud provider.
2354440	2364340	And yeah, it's basically easier, probably more cheaper and available for everybody.
2364780	2375680	And the third thing is that security researchers will probably use OSINT and Rekon tools a lot because, well, we know that that makes our life easier.
2375680	2378660	And this is a real romance between the two.
2379660	2381380	And this is it.
2381420	2383500	Thank you for joining me today.
2383580	2385820	And I think we are finished.
2385820	2386780	Any questions?
