start	end	text
0	7580	Hi. Yeah, it's good to be back. Nowadays, virtual private network becomes more and more
7580	13640	prevalent. For enterprise, SSL VPN is the most convenient way for their employee to connect
13640	21900	the corporation network. For hackers, it's also the shortest path to compromise your intranet.
21900	29980	So, today, let's take a look at how your SSL VPN could be wrong. Oh, before that, let's
30000	40000	talk about security. Is there any NSA here? Okay, sorry for the title. Hi, I'm Orange. We
40000	46320	are from Def Core Research Team in Taiwan. I'm now a zero-day researcher and focusing on web
46320	53620	and application security. Apart from that, I'm also a speaker, CTF player, and a bug bounty
53620	61440	hunter. Hello everyone, I'm Mei Zhang. I'm a security researcher from Def Core Research
61460	73800	and I play CTF in Hikon and 217 CTF team. I mainly focus on binary exploitation. Here is the
73800	79440	highlights today. We will discuss pre-auth remote code execution on both Fortinet and
79440	86740	ProSecure SSL VPN. In the Fortinet cast, we will show you the hard-core but reliable binary
86740	93580	exploitation with the magic string to open the door. In the ProSecure, we will present the
93600	100980	out-of-box web hacking and how we bypass the two uh bypass the two-factor authentication on
100980	108400	Twitter and hack into their most important server. Last but not least, we will introduce how
108400	116280	we leverage a hidden feature to take over not only your SSL VPN but also all of your clients.
117160	125740	And this is the agenda. We first introduce the SSL VPN and why we focus on that. Most of the
125740	131940	SSL VPN don't provide a shell. We will elaborate how we jailbreak the app- appliance and
131940	138160	introduce the attack vectors to discover bugs. Of course, we will have case studies and
138160	146240	demonstration. And the last is the SSL VPN weaponization and recommendations. We will
146280	154200	start with SSL VPN. So, what is SSL VPN? Compared to the side-to-side VPN such as the IPsec or
154200	162540	PPTP, SSL SSL VPN is more ease of use and compatible with any network environments. All you
162540	169380	need is just a browser. Because of the convenience, SSL VPN becomes the most popular
169380	177920	remote access way for enterprise. SSL VPN are everywhere and protect corporation access from
177920	184260	internet exposure. They are trust to be secure and consider as the only way to your private
184260	194520	network. But what if your trusted SSL VPN are insecure? They will become your virtual public
194520	206020	network. Yes, public. So, that's why we focus on SSL VPN. They are important but a blind
206020	213100	spot. They are widely used by corporations of all size but only few vendor dominate the
213100	221180	market. According to our survey on Fortune 500, the top 3 SSL VPN vendors dominate about
221180	229200	75 percent market share. So, if you find a high impact vulnerability on one of the leading SSL
229200	238840	VPN, you can hack the planet. The most important is SSL VPN must be exposed to outside. So, it
238840	247860	must have direct intranet access. Due to its importance, even NSA is hunting for SSL VPN
247860	256680	bugs, such as the equation group leaks. SSL VPN is trust by large corporations, industry
256680	266880	leaders, and tech giants, such as the Facebook, Twitter, and Marvel. Yeah, the logo is very
266880	277840	cool. Even the NSA use the SSL VPN. They are everywhere but usually forgotten. Sometimes
277860	286040	even hacker knows your SSL VPN more. For example, we disclose a pre-auth remote code
286040	294480	execution on Palo Alto SSL VPN one month ago. We find a-we find a bug accidentally. However,
294480	301360	while reproducing on the latest version, we failed. So, we start to doubt if this is a
301360	307840	known vulnerability. We search all over the internet but could not find anything related.
307860	316180	There's no CVE, adversary, or any official announcement. Therefore, we believe this is a
316180	324060	silent fix one day. We surveyed all over the world and find-and find Uber suffered from
324060	331060	this. So, we reported their bug bounty program. This is not a fault on Uber. They are also
331060	337840	the victim. We also report this to the Palo Alto Peace Search, but we got a follow-up
337860	346760	reply. They do not CVE items find internally. So, that's the reason why there is no official
346760	362900	adversary. Okay, this is fine. There is no CVE, so there is no vulnerability. Anyway,
362900	371220	Palo Alto still assign a CVE for that. Just right after we publish all the story. So,
371240	378280	once we decide to research into SSL VPN, the next question is how to choose the target. We
378280	385940	did a little survey on leading SSL VPN. As you can see, even in the high-severity label CVE,
385940	393820	the ProSecure and Fortinet are-are still the most secure one. We want to challenge the
393820	401060	mission impossible. So, so we put our priority on ProSecure and Fortinet more. ProSecure is
401060	407760	the most famous VPN solution in the world and has the least high-level CVE. It's trusted by
407760	414340	large corporations, service providers, and government departments. Fortinet is more used
414340	422420	by end-users, uh medium-sized enterprise. It's common in Asia and Europe. Both vendors have
422420	429080	little high-level CVEs, so our mission is to find the pre-auth remote code execution on them.
430100	438500	So, let's start hacking. To kickstart a new research is always not easy. SSL VPN is a
438500	444780	black box and closing source appliance. They usually build their own architecture stack from
444780	452080	scratch and don't provide a shell to dive into. So the drawback is the essential step for
452080	459060	researchers to turn the black box into the gray box. As you can see, most of the SSL VPN
459080	468720	only provide a restricted shell. So, let's talk about how to jailbreak them. We are not a
468720	474880	hardware guys, so we start researching from the virtual appliance. All the virtual
474880	481840	appliance can be classified into the typical one and the encrypted one. It's trivial for
481840	487280	typical one, so we don't pay a lot of time here. You can just enter the single user mode or
487280	495720	mount a virtual disk on your box to modify the file system to get a shell. But what if you-
495720	502780	what if the disk has been encrypted? Without a booting process, we cannot see anything. So
502780	512390	today, we will show you a trick to bypass the encryption. Here is the Linux booting process.
512390	519290	The common way in past to break the encryption is to analyze or reverse the VM Linux kernel
519290	527390	to get the encryption key. However, we focus on another stage. Here we give an example to
527390	536620	show how memory forensics take us to the wing. As we know the booting process, it starts
536620	542400	from the BIOS, bootloader, and the kernel to drop the first process to initialize the
542400	551140	operating system. In Perl Secure, the initial process show you a prompt. Press enter to view or
551140	559400	update your appliance settings. And once we press the enter, the initial process spawned
559400	566320	another process to allow you modify and view the settings. So we suspend the virtual
566320	575060	machine at this time. And scan the entire memory to do the memory forensics on the host OS.
575620	581880	From the memory forensics, we observe that the spawned process is a Perl script. The name is
581880	591320	dsconfig.pl. And since it can be the weak point of whole the booting process. So, it's time to
591320	600380	show the magic. We will just patch a few bytes to pop out the shell. We patch the memory and
600380	609320	replace the dsconfig.pl to the bin sh. Once the modification is done, the only thing we need is
609320	622380	just press the enter. And we got a shell. Now, thank you. So now we have the full control of
622380	631960	the system and can do further debugging and analyzing. Okay, so now we can start hacking SSL
631960	639400	VPNs. But, where's the bug? There are many demons running on the server. They're usually
639400	647180	complicated and hard to analyze. Digging at the correct place is important for us. So we
647180	653360	propose some attack vectors specific for SSL VPNs. We'll talk about a special feature called
653360	661480	WebVPN. It's powerful but also vulnerable sometimes. We got lots of bounty from this feature. It's
661480	669480	like our slot machine. The next one is the native script language extensions on SSL VPNs and
669480	676420	how they can be dangerous. And we also introduce some multi-layered architecture problems.
678020	684840	WebVPN is a convenient proxy feature. It's portable and clandestine. It proxies all kinds of
684840	693980	traffic through the web browser. It supports various protocols like HTTP, FTP, and RDP. It
693980	701320	also handles many web resources such as WebSocket, JavaScript, and Flash. We don't need to
701320	708460	install any software. Only click on the browser and we can connect to other services. Sounds
708460	716920	powerful, right? Apparently it's not easy to implement this feature. Some vendors choose to
716920	722760	implement by themselves. However, protocols and web resources handling are prone to memory
722760	731300	bugs. Think about SSL VPN processing SMB or Flash. You know how hard it could be. We
731320	738380	also this requires high security awareness. For example, we found some debug functions and
738380	747820	sensitive data without encryption and information exposed carelessly. Some vendors decided not
747820	755140	to reinvent the wheel. They modify from an open source project directly. But they copy the
755140	763660	code and also copy the bugs. This kind of software are hard to maintain, update, or patch.
764380	770760	Or some vendors choose to call existing libraries. But the vendors often neglect to update
770760	785120	these libraries. We found libcurl and libxml from over 10 years ago. Implementing web VPN is
785120	791720	really hard. During our research, we found out most SSL VPNs have their own native script
791720	801160	language extensions. Like PHP extensions written in C or extensions written in C++. Vendors
801160	806840	like to use these extensions to do encoding, decoding, or other operations to improve
806840	814020	efficiency. Which may be vulnerable. And it's really prone to type confusion between different
814020	822140	languages. As we know, string operation is always difficult for C. Like buffer size
822140	829800	calculation, dangerous functions such as string copy, or misunderstood functions. For
829800	837140	example, do you really know how the return value of a smprintf should be? Can it exceed the
837140	848860	buffer size? Actually, it's possible. So calculation like this can cause an integer overflow. The
848860	854920	type of these extensions are also confusing. Although they seem the same, but do you really
854920	863700	know what type it is? Do you know if you are using it safely? Who knows? And this may cause
863700	870740	serious problems. The last one is the multi-layered architecture problems. When there
870740	876380	are different standards for processing the same thing, the inconsistency between them will
876380	883580	lead to problems. Such as the attack surface on reverse proxy and Java web backend. The talk
883580	892940	from Orange in DEFCON last year. And here we gave another case. This is also an SS control
892940	901480	bypass. It's on C web server and RESTful backend. The regular expression dot plus matches too
901480	911240	much, so we can leverage this to match the dot dot slash to access the privileged pages. Okay,
911240	918540	so here is the special attack vectors we found on the SSO VPNs. Following, we're going to talk
918540	925280	about two case studies. We will show how we get the pre-auth remote code execution on
925280	933240	FortiGate and PostSecure. Here's a disclaimer. All the CVEs mentioned below have been
933240	940040	reported and patched by Fortinet, PostSecure, and Twitter. So, please go update your SSO
940040	948520	VPNs as soon as possible. The case one is FortiGate. We first show you how FortiGate
948540	953380	works. First, we shall break the FortiGate and look into the binaries. We try to list the
953380	959400	binaries in slash bin and we found there are all symbolic links. Point to slash bin slash
959400	966720	init, just like this snapshot. FortiGate compiles all the programs and configurations into
966720	973420	one single binary. This makes the init program really huge and annoying. The IDB file of
973420	981220	init is up to 500 megabytes with 85,000 functions. And they are all stripped, no symbol.
981840	988900	It contains plenty of function tables to manage each programs, including the web daemon.
989820	996260	Through our investigation, we found the web service is modified from a patch. But it's a
996260	1003400	patch from 2002. So, the web server running on your SSO VPN, it's actually as old as
1003420	1013370	your grandmother. Compared to the admin page, the user login interface is the only one that
1013370	1021310	definitely exposed to the internet. It looks like this. A simple login page, no other buttons
1021310	1029450	or functions. So, we're gonna explore through this interface without authentication. We will
1029450	1035090	talk about three bugs today. First is the pre-auth remote code execution chain. We
1035090	1042490	combine two bugs. A pre-auth arbitrary file reading to log in and a post-auth heap overflow
1042930	1050630	to get a shell. We also introduce an interesting bug, the magic backdoor, which can modify any
1050630	1059110	user's password with a magic key. Let's start with the file reading part. It was a function
1059110	1065930	used to show corresponding language for users. It concatenates strings directly without a
1065930	1074450	dot dot slash filter. But, a JSON extension appended automatically. So, it seems like we
1074450	1082610	can only read JSON files. Think about it, can we remove the JSON and read any file we want?
1084430	1092330	The answer is yes. We can utilize the feature of smprintf. According to the main page, it
1092330	1099610	writes at most size minus one. The buffer size is fixed here so we only need to make it exceed
1099610	1109270	the buffer size. Like this. We fill it up with slashes. So, the path after smprintf becomes
1109270	1119570	like this. The appended JSON exceeds the buffer size and is stripped by the smprintf. Then we
1119570	1126790	can read however we want. After getting arbitrary file reading, we found something
1126790	1133390	interesting. We call it an SSL VPN mystery. It appears in many products, not only
1133390	1141390	FreudGate, but ProSecure or other vendors. The mystery is they hold an excessively detailed
1141390	1148930	session file on the SSL VPN. The file is called SSL VPN web session. What's the content?
1149430	1158790	Session token? Of course. IP address? Sure. User name? Indeed. Plantex password? Are you
1158790	1166650	kidding? You should never store any Plantex password. We really wonder how this become
1166650	1177450	popular. Let me guess. Maybe they learned it from Google or Facebook or Twitter. Who knows?
1177450	1184530	Just kidding. Anyway, these Plantex passwords are really convenient. We don't need to crack
1184530	1190870	password anymore and we can log in easily. Today, we're going to utilize the web VPN
1190870	1199010	feature. As you can see, it supports many protocols. Let's try the HTTP. We only need to
1199010	1208410	type the URL and we can connect to the website through a VPN. And we look at the URL. We can
1208410	1214510	see that we're still connecting to the SSL VPN. So, it proxies the whole website for us.
1215350	1223130	And if we look into the elements, we can find the URL of resources are also from SSL VPN. It
1223130	1232010	rewrites all the URLs for us. As you can imagine, this involves a heavy string operation. So,
1232010	1238310	here is the heap overflow. It occurs in JavaScript parsing and it's simply because lack of
1238310	1248030	check while memory copy. The buffer is only 0x2000 but the input string is unlimited. Generally,
1248030	1254730	we do some heap function to overflow a nice target and control a program counter and do code
1254730	1263970	execution. But the situation is difficult in FortiGate. We face something destabilizing. First
1263970	1271150	of all, the web daemon handles connections with EPO. So, it's a single thread process. And the
1271150	1278690	main process and libraries use the same heap. It means all the memory allocations of all the
1278690	1286850	operations in all the connections are the same heap. So, the heap is really unstable. Moreover,
1286850	1292430	there are some operations regularly triggered. They interfere the heap arrangement and it's
1292430	1299130	uncontrollable. Therefore, we cannot arrange the heap allocation carefully. That would just
1299130	1306390	make a mess. And there is something even more ironic. Apache implements an additional memory
1306390	1314910	management. So, there's no free until the connection end. We cannot arrange the heap in a
1314910	1322410	single connection. The allocator also limits our exploit. It's called Jemelo. Jemelo is
1322630	1329470	a block. It centralizes small objects. It calls a block of allocated memory or region and
1329470	1335950	then maintain these regions in a round with a bitmap. This effectively reduces the
1335950	1344250	interference between small and large objects. It's- it also limits our target options. It's
1344250	1352410	hard to put small objects nearby our buffer. So, we're stuck at that time and we cannot
1352430	1360470	and therefore we started to fuzz the server and it crashed. And we almost control the program
1360470	1372660	counter. And yet, this is why we love fuzzing. We crushed a function table pointer in an SSL
1372660	1378560	structure. This structure stores information of each connection. It's used for connection
1378560	1386580	handling and it's an ideal target for our heap exploit. First, every new connection allocates
1386580	1394500	an SSL structure. So, we can trigger it easily. And its size is close to our JavaScript buffer.
1394500	1401160	And therefore, it can be placed nearby our buffer with a regular offset. The most important
1401160	1408540	is, it ha- it has some useful structure members. It contains a function table pointer and
1408560	1416080	code method. And this is how we triggered the crash. But we found one even better. It's a
1416080	1423440	function pointer called handshake function. With this, the exploit can be much easier. We
1423440	1431520	don't need a whole function table anymore. We only need a function address. All the
1431520	1436540	connections are on the same heap. So, we can mess up connections and overflow the SSL
1436540	1443260	structure. So, we send lots of ro- normal requests and attack the server with an overflow
1443260	1451540	request in the meantime. If we look into the heap, there may be several SSL structures on the
1451540	1459120	heap. For example, here are 3 SSL structures for 3 connections. And the SSL structure is
1459120	1466260	like this. Some basic information and the function table. And the function pointer is now
1466260	1474880	pointing to an SSL function, SSL accept. Now, if we trigger the JavaScript parsing, and
1474880	1482960	the JavaScript buffer is located ahead of this SSL structures, then we can trigger the
1482960	1492740	overflow and override the SSL structure members like this. So, now we fill up the SSL
1492740	1502560	structure with capital A's and make the program crashes. What we need to do next is clear. We
1502560	1508360	only need to forge the SSL structure with a fake function pointer, like the address of
1508360	1515800	system. So, when the victim connection is trying to do handshake, the program executes whatever
1515800	1523880	we want. Anyway, the heap is unstable, so we need to send fuzzy connections to meet the
1523880	1530980	condition. The server may crash sometimes, but it's fine. Fort gate has a reliable watchdog. We
1530980	1538560	just need several attempts, taking about 1 to 2 minutes to get a shell. So, this is the whole
1538560	1544860	details of how we achieve remote co-execution. Maybe some of you are not binary guys, so you
1544860	1553080	may wonder, is there any other way to get into a server? So, why not find another door to make
1553080	1561700	your life easier? We found a magic backdoor in the log-in page. This function was originally
1561700	1569600	used to update outdated password. However, they failed to authenticate. So, we can simply
1569600	1580130	use this secret key, which is called magic, to reset any user's password. Now, we're going to
1580130	1592540	demonstrate how we pop a root shell from the only exposed HTTP export. We put our PHP exploit
1592540	1600200	on an HTTP server, and this is our export. In order to control the parameter of system, we
1600200	1607820	first do a stack pivot and make our buffer become the stack. After that, we do an ROP chain
1607820	1617000	to call system. And here is the reverse shell command. We use Python to build a reverse
1617000	1632440	shell. And we concatenate these strings to overflow the SSL structure. Now, we can start
1632440	1644400	hacking. In the first panel, we open a port to receive the reverse shell. And we start a
1644400	1657900	fuzzing thread to build multiple normal connections. Then we attack the server. We first
1657900	1669210	try to leak username and 10 hex password from the web session. As you can see, we found
1669210	1680200	an username, main, and password. This is password for main. We can use this account to
1680200	1693410	login and make a SSL VPN proxy or PHP export. We only need to wait a few seconds. Okay,
1693410	1720950	here we got the root shell. Thank you very much. Okay, the next test we talk about is
1720950	1727510	Perl Secure. Perl Secure is the market leader of SSL VPN and was from a diversity of
1727510	1734350	juniper networks. They are a Perl lover and built all the architecture stack from scratch.
1734570	1742670	The architecture is old but stable and secure. And it's worth to mention, Perl Secure hooks
1742670	1748270	all the process by LD preload. Due to the uh due to the monitor and security
1748270	1756750	consideration. Uh we will discuss this later. Here is the vulnerabilities we find. Among
1756750	1761130	them we will introduce a pre-auth arbitrary file reading and a post-auth command
1761130	1770430	injection. We train these two bugs into the pre-auth remote core execution. The first bug is
1770570	1778130	a pre-auth file reading. Perl Secure introduce a new feature called HTML5 access since
1778130	1787890	version 8.2. It can access the telnet, SSH, and remote desktop by browsers. In order to
1787890	1794230	adapt the new feature, Perl Secure create a new if condition to handle all static
1794230	1805290	resources. Thanks to the new feature, the original strict validation has been bypassed. So,
1805290	1812910	am I affected by this? All unpatched version except the end of life version are affected.
1813470	1820470	Here is the payload for you to check your SSL VPN. When there is a special pass in the end
1820470	1831170	of the URL, the pass validation become loose. And uh what can we get from this? We can get
1831170	1838050	numerous useful information such as the server private key to decrypt the SSL connection. We
1838050	1844110	can also get information configure uh we can also get important configuration such as the
1844110	1852550	radius and LL depth password. And all users password hash and sensitive cookies which are
1852550	1861150	cached in the web VPN like Google, Dropbox, and iCloud. The last and the most important
1861170	1873610	is the cached plaintext password. Yes, plaintext again. For now, we get a credential so we
1873610	1881030	are able to access the corporation network easily. However, our goal is to get co-execution for
1881030	1887930	persistent and first actions. So, here we send a command injection in manag- management
1887930	1896570	interface together. From this code fragment, it's very obvious and straightforward. If we can
1896570	1905130	control the options, we can inject arbitrary command to this Perl function. And of course
1905130	1914890	we can. We can control the options from the troubleshooting patch. So, is that simple? No,
1914890	1922310	I don't think so. In order to avoid potential vulnerabilities, Perl secure applied a lot of
1922310	1929650	hardening on their products. Such- such as the system integrity check and the read-only
1929650	1936530	file system to protect the backdoor from uh to protect from backdoors in Chrome tab or web
1936530	1944870	root. The most effective hardening is the DSF module. It's like the safeguard to protect
1944890	1955310	Perl from dangerous operations. The DSF is a Perl module which is written in C++. The
1955310	1961570	module implement its own command parser and hooks several dangerous functions such as the
1961570	1970530	system, open, and backstick. It also disallow numbers, bad characters, and re-implement the
1970530	1978410	DNS IO redirection in Perl. So, due to the hardening, we cannot perform any command
1978410	1987290	injection. We tried several ways to bypass the hardening. Of course, the first come out of my
1987290	1994970	mind is the argument injection. However, the TCP dump in Perl secure is too old. So, we
1994970	2002530	failed because it didn't support several juicy features such as the post load tab command.
2003710	2010610	While examining the system, we find Perl secure store the template cache in a directory. We
2010610	2017730	tried to write into this directory. But we can't use standard out because it's already directed
2017730	2026590	to the newer device. What we can do is only abusing the set file argument. But it seems there
2026590	2036310	is no way to generate a polyglot file in both Perl and PCAP format. So, it's time to dig
2036310	2044910	deeper. We dive into the DSF implementation to see is there anything we can leverage. We
2044910	2053470	found a flaw in the command parser. When there is an incomplete IO redirection, the rest of
2053470	2061950	the IO part will be truncated. However, also we can re-control the standard out, we still
2061950	2072490	can't find any way to generate a valid Perl. So, let's think out of the box. Standard out is
2072490	2081920	uncontrollable. But, could we write a script by a standard error? When you force the TCP
2081920	2090820	dump to open a non-existent file, it will show the error, no such file or directory. From the
2090820	2097880	error, it seems we can partial control the message. We try to pipe the standard error to
2097880	2107400	Perl, but we still get nothing. However, when we try to use another file name, such as the
2107400	2114760	print 1, 2, 3 with a hashtag, we try to pipe the standard error to Perl again, and the magic
2114760	2126600	happens. The Perl print out the 1, 2, 3 result errors. So, okay, the Perl 101. Perl
2126600	2134480	supports the go-to label, so the TCP dump with a colon becomes a label in Perl. And we use
2134480	2141800	the hashtag to comment the rest of the part. So, the standard error becomes a valid Perl now.
2143720	2151540	This is our final exploring. We will explain the payload one by one. The first is to make the
2151540	2158800	TCP dump open a non-existent file. The file name will be part of the error message in, in
2158800	2167520	standard error. And then we redirect the standard error into the cache directory. Here we name
2167520	2176820	the file as set cookie dot THT and error dot TTC. The last is the incomplete IO symbol. This
2176820	2183960	symbol abuse the command parser to ignore the rest of the IO redirection. Once our standard
2183960	2190440	error has been written into the cache directory, we can just fetch the corri- corresponding
2190440	2197660	patch to execute our command. By training these two vulnerabilities, we can get a reliable
2197660	2207700	pre-auth remote co-execution. We have a report all of our finding to Perl secure Pcert. And
2207700	2214940	this is the response from them. They fixed all the bugs within a month. Their reaction is very
2214940	2221180	quick and professional. It's a great time to work with Perl secure. They are such a really
2221180	2230610	responsible vendor. After Perl secure released all the patches, we kept monitoring the
2230610	2236870	internet to see the large corporations response time. Twitter is one of them. They are known
2236870	2244130	for their bug bounty program and nice to hackers. However, it's not good to exploit a one day
2244130	2251590	right after the patch released. So, we wait 30 days for Twitter to upgrade their SSO VPN.
2253810	2262950	This is the Twitter SSO VPN. It's just a simple login patch. From the reconnaissance, we know
2262950	2271830	the last time Twitter upgrade is in last December. So, Twitter is likely vulnerable. We
2271830	2280230	have verified the bug and got a bunch of user credentials in plain text. However, we
2280230	2288510	encountered some problems while trying to pop our shell from Twitter. Yes, the first
2288510	2296290	problem is the two fact authentication. Due to the two fact authentication, also we can
2296290	2302690	get a plain text password. We still can't do anything. So, the first thing we need is to
2302690	2310950	find a way to bypass that. We observe Twitter enable the loaming session. Loaming session
2310950	2318490	is a feature to enhance the mobility. It allows a session from multiple IP locations.
2319490	2325630	So, once we know that, we download the database and force the session to bypass the two
2325630	2336290	fact authentication. And finally, we log into their system. The next problem is the SS control
2336290	2344650	in management interface. As we mentioned before, we have a command injection here. However,
2344650	2352310	for security consideration, most of the corporation disable this interface on public. So, we need
2352310	2361090	to find another way to access the interface. We leverage the web VPN feature again to connect
2361090	2370830	to itself. It's just like the SSRF. We use the zero to bypass the SSR- SSRF protection and
2370830	2381400	access the management interface. And finally, we got there. However, the last problem is
2381400	2389380	that we don't find any manager's plain text password in cache. Practically, most of the
2389380	2396180	manager only log into their system at the first time. The only thing we have is the password
2396180	2408580	hash in sorted md5crypt and SHA-256 format. So, we launch a 70-code AWS to crack the hash.
2411620	2422460	And uh, see ours later. We crack the hash and s- and successfully log into their
2422460	2430140	management interface. We are lucky because the length of the password is only 10. And the
2430140	2438980	first character is capital B. It's a very early stage of our cracking queue. We exploit our
2438980	2448860	command injection and try to run the command ifconfig. And we got a shell. We report all of
2448860	2463920	our findings. Thank you. We report all of our findings to their bug bounty program. And got
2463920	2478880	the highest bounty from Twitter. Also, we cannot prove that. It seems this is the first remote
2478880	2487760	code execution on Twitter. Okay, the last is the bonus for you. Our company, Def Core,
2487760	2494900	provides the most professional rating service in Asia. So, let's talk about how to make the
2494900	2504820	rating more red. In a rating operation, the personal computer is more valuable. So, in order
2504820	2512120	to take control of all the clients, we need to weaponize the SSO VPN. There are several old
2512120	2520580	school methods before, such as the waterhole attack and repress the VPN installer. But here,
2520580	2527940	we propose a new method. It's the logon script. Logon script is the feature in almost every
2527940	2535160	SSO VPN. It can execute corresponding script to mount a network file system or change the
2535160	2542100	routing table. So, here we will show you a demo to show you that how we compromise the
2542120	2557340	VPN clients. Okay, this is our demonstration. As you can see, the exploit needs one argument.
2557340	2570140	So, we append our target right after the exploit. Here we got a username and hash of admin.
2570520	2576640	Also, we could not find the plain text password. We can still change our cookie to the session
2576640	2600530	ID of admin. Okay, once our modification is done, we can access the management in the
2600530	2618990	fast. And we have become the admin. Thank you. Here we leverage the feature on the user
2618990	2627350	loads and the VPN tunneling. We find a logon script section. Here you can see the logon
2627350	2635690	script supports not only Windows, but also Linux and Mac OS. So, we use the calculator as
2635690	2656900	our backdoor. And once our modification is done, we change to the laptop of our victim. Yeah,
2656900	2666560	it's cute. The victim launch the Perl secure agent and try to connect to the SSO VPN with
2666560	2677640	his username and password. And once the connection has been established, the
2677640	2694200	calculator will be popped automatically. Okay, here we finish all of our slides. But how to
2694200	2700620	mitigate such attacks? Here we give several recommendations. The first is to- is the
2700620	2706260	client sign certificate. Without a certificate, the malicious connection will be dropped
2706260	2713080	during SSO negotiation. The next is to enable multi-factor authentication. It can
2713080	2719900	decrease numbers of text service. And the last, remember to enable full log audit and
2719900	2727260	subscribe the vendor's advisory to keep your system updated. This is the end of our
2727260	2742310	presentation and here is our contact information. We will- okay. Okay. Okay, so,
2743050	2749770	we will post all the detail right after our talks. So, please check that and let us know if
2749770	2754570	you have any further questions. Thank you for being here. Again, thanks.
