start	end	text
960	6160	Hello, DEF CON. Thank you for coming to our presentation.
6160	8920	We are excited to share our talk titled,
8920	13540	Watchers Being Watched Exploiting the Surveillance System and Its Supply Chain.
13540	18100	We'll talk about our vulnerability research on surveillance system devices.
18100	19460	Please enjoy.
19680	22700	First, let us introduce our research group.
22700	27460	I'm Chanhee Kim, and I'm currently working as an offensive researcher at S2W.
27460	34980	And he's Myungwoo Park, and he's a student attending a university in Korea enjoying offensive research.
36760	39780	And this is what we'll show you in this talk.
39780	46400	We'll be talking about a $30,000 bounty and a four-month journey to become a DEF CON speaker.
46400	49920	In our talk, we'll cover how we extract the firmware,
49920	52600	then the steps we took to analyze the vulnerabilities,
52600	59300	and after that, the various vulnerabilities that could be exploited in the world and their scenarios.
59420	63200	In the last, the impact of our research on the supply chain.
63200	65720	That's it. Please look forward to it.
67040	71400	This video will be the final goal, which happened in the real world.
71400	74660	We wanted to see why we're doing this research.
74660	77340	This was posted by an Iranian hacker,
77340	84180	and we would like to show that we have successfully demonstrated what the video is showing.
84180	85680	Let's watch the video.
104510	107490	That's like a hacker from a movie, isn't it?
108870	113710	Next, why is making our surveillance device more securely important?
113710	117510	We can see surveillance devices everywhere in our lives.
117510	120330	Because of the COVID-19 pandemic outbreak,
120330	125610	the demand of the surveillance devices has been surging for various purposes,
125610	130510	such as a men's store, smart cities, and for those access control.
130850	136510	Thus, the global surveillance device market is currently worth $4.1 billion.
136630	141390	So, in these circumstances, surrounding by such devices,
141390	146970	MVRs are taking on a more essential role in our lives and those users.
148490	150530	Next is our target.
150530	154890	Many people don't know much about MVR, but as we just highlighted,
154890	161470	MVR is more than just important since it plays a brand-like role in all the surveillance systems.
161490	164870	Therefore, we selected MVR as our target.
166730	168650	So, what is an MVR?
168650	175510	A network video recorder called MVR stores recorded video from CCTVs and eye cameras
175510	178690	and monitors or manages real-time video.
178750	183930	Due to the nature of managing these videos, many devices can access them over the Internet.
184390	187710	And the screen you see below is the MVR screen.
189830	193270	This is our detailed research motivation.
193270	202710	First, as we investigated enough online, there was not as much as studies on it compared to CCTV or IP camera system.
202910	211150	And as a result of showdown search, we found that more than 30,000 devices are exposed to the Internet.
211550	217090	However, there are cases where critical vulnerability have been discovered previously.
217090	222370	There was a case when the Mirai Bonnet became popular in 2021.
222370	228350	Hikvision's pre-auth RCE vulnerability was maliciously used for a DDoS attack.
228870	234410	So, we are motivated by such examples which are serious vulnerabilities.
236210	238270	Next is vendor choice.
238270	246430	We chose four vendors, Hikvision and Tawa, because they have the highest market share in the virtual surveillance system.
246430	251330	And we chose vendor A, which has the highest market share in Korea.
251590	259870	Lastly, regardless of market share, we also selected Shinology's surveillance station package as a target vendor.
259870	271810	This is because Shinology is famous for security and has an image of being safe, so we wanted to check whether surveillance-related packages were also the same.
273750	278070	Next, let us tell you about our firmware extraction methodology.
278070	285090	We tried a variety of methods to extract the firmware, and this picture is a list of what we tried.
286850	294090	Since three of these products had UART ports available, we tried to extract the firmware through UART.
294190	300030	And Shinology allows the root shell access via SSH, so no other method was needed.
301810	307570	Before that, let us tell you why we didn't perform the extraction via remote access.
307590	313230	Hikvision and Tawa supported remote access, but only limited shell access was possible.
313230	319950	We tried many ways to bypass it, but they failed, so we had no choice but to use UART.
321110	328750	We identified the UART port on the PC board and connected a cable to make it interactable with the UART shell.
328750	333950	However, all three devices were not regular UART, but modified UART.
333950	338270	So we couldn't use the UART shell, as shown in the picture on the right.
338270	341390	We started looking for a way to bypass it.
342970	351470	First, in the case of Hikvision, we couldn't bypass UART mitigation on the first NVR we purchased.
351470	358650	So we used the downgrade method of repurchasing an older version of the Hikvision device.
358730	366710	An older version device had lower UART versions, and there were differences from mitigation applied to the latest UART.
368730	377410	We were able to access the UART shell using Hikvision's UART mitigation bypass technique we could find on the Internet.
378630	384890	And last, we updated the older version of the product to the latest firmware.
386190	389630	The bypass technique already known in the older version...
405360	412920	On the latest version, there was no reaction even though we tried our best on giving command input.
412920	420940	But as shown in the picture on the right, which is the older version, using setenv and semicolons caused the command injection.
420940	424140	So we were able to insert the UART command.
425740	435540	Since we could use the UART command disk, we were able to obtain a kernel shell for the device by adding the shell to the RDNID argument in bootargs.
437320	439680	Next, the case of Dahua.
439680	447640	In Dahua, several UART command disks were available, but the most important command disk, such as printenv, did not exist.
447640	456840	So we used setenv to print the changed argument once again to check the value of the environment variable with the keys we know.
458500	461420	However, bigger problem awaited us.
461420	467120	We modified bootargs and booted the device, but we couldn't see the kernel output.
467120	471600	In order to use the kernel shell, of course, there must be kernel output.
471600	475280	So we looked for a way to check the kernel output.
476860	482380	First, we knew that the environment section exists using the mtdpart command.
482480	490600	And to print the contents of this environment section, we used the ntdump command to print the contents of the environment variable.
492300	498600	Now that we were able to check the key values of the environment variable,
498600	505260	we changed the value of each environment variable one by one to see if we could grab the kernel output.
505280	513040	We found out that there was an environment variable called dhkeyboard that specifies the kernel output mode,
513040	516500	so we could change it to 0 to get kernel output.
518440	520380	Next is vendor A.
520380	527520	In the case of vendor A, unlike the previous two cases, it was not possible to even use the u-boot shell.
527520	535140	As you can see, as soon as we booted the device, type password has appeared and we couldn't use any u-boot commands.
535280	542040	Vendor A was calling the secure UART and we started doing a lot of research to bypass this.
543420	550360	We learned about the glitching attack through a lot of research and led the u-boot code to perform this attack.
550360	558300	By reading the code, the booting algorithm in the u-boot system says that if the initialization process was successful,
558300	563120	all those launched the kernel, and if it fails, it restarts the bootloader shell.
563120	568240	We assumed that vendor A wouldn't have exception handling for this method,
568240	572080	and we found a way to make the initialization process fail.
573740	576540	Let us tell you how to perform this attack.
576540	581860	First, we will explain the process of loading kernel during the normal boot sequence.
583320	586900	First, load the kernel into RAM from flash memory.
587520	591700	Second, the CPU rests the kernel loaded into RAM and decompresses it.
593120	599400	If the decompression is successful, the CPU starts the kernel and terminates the execution of u-boot.
600300	606860	Now, let us tell you the boot sequence's difference between performing the attack and vice versa.
608100	612820	As with the normal process, load the kernel into RAM from flash memory.
613160	620420	At this time, we gave it an electric shock, which caused the kernel to be broken and to be loaded into RAM.
621140	626700	As the CPU tries to decompress the broken kernel in RAM, it naturally fails.
627920	633240	When this happens, the CPU restarts the bootloader shell as I mentioned earlier.
634360	643040	Through previous research, we learned that the attack is carried out by connecting the chip select and data out on the pad of flash memory.
643040	651240	Therefore, we checked the datasheet of the flash memory available at vendor A and found out which chip should be connected.
651240	654640	We are now all set, but how do we connect these two pads?
656100	665460	We created a specialized tool for performing this particular attack by attaching the heads of jumper cables together.
665460	667220	Looks very easy, right?
668220	670800	Here is a demo of this attack.
670800	683160	If we give it an electric shock, and boom, we can use the bootloader shell.
687520	693340	Once we had the kernel shells for all devices, we needed to extract the file system.
693340	698200	We ejected out the file system to our NAS using NFS and USB.
698220	706220	One thing we didn't know was that the USB had to be formatted as XFS for the device to recognize it.
708020	714420	As you can see, we were able to successfully transfer all devices' file systems to our NAS.
715800	722180	However, we encountered a big variable while configuring the AWS analysis environment,
722180	727940	because most file systems were read-only, so no files could be modified or written.
728080	735560	Now, even though we had a root shell, the shell becomes unusable once the device boots up, so we had to bypass it.
736420	746300	We found out that only the root file and device directory were modifiable, so we decided to use bind-mount.
746300	754180	We discovered that when we bind-mount an arbitrary file in a writeable directory, the file becomes editable.
754180	759420	We immediately bind-mounted ETC password to a writeable location.
760160	763180	Now, we can modify ETC password.
763180	771380	However, the main binary ran an integrity check and rebooted the device when changes to file contents were detected.
772780	775880	So we found a way to get around this.
775900	779680	First, we cloned ETC password to a writeable directory.
779720	786940	If you look at the picture on the right, you can see that the root shell is set to DSH, a restricted shell.
788700	798800	Second, bind-mount is performed in the RCS script after the initialization process is completed and immediately before starting the main binary.
800500	810200	Next, we ran the main binary, and when the web service becomes available, we changed the contents of the bind-mounted file.
811460	816040	Finally, we have a restricted root shell accessed via SSH.
816040	820000	Now, we can replicate the file system using NFS.
820000	831200	Additionally, this bind-mounting replaces the original file contents when the device is rebooted, so we created the previous process as a shell script and used it.
832540	840280	Next, we will discuss the vulnerabilities we discovered and the MBR hacking scenarios we created by linking these vulnerabilities.
840640	844700	Here, we will explain one scenario for each vendor we targeted.
846840	849660	First, let's look at the scenario for vendor A.
849660	854040	The code on the left is the query string parsing logic used in the web page.
854040	860780	It calculates the start and end of the parameters based on the equal and ampersand characters.
861920	867440	This parameter named length is used as the parameter for SDRN copy.
867440	873740	Therefore, since the length is a controllable parameter by the attacker, it can cause a buffer overflow.
875200	880820	So, let's insert a large number of characters into the query string parameter.
880980	888860	As you can see, the return address is overwritten because there is no canary successfully manipulating the PC register.
890480	893600	However, we encountered a few problems.
893600	898220	First, Annex was enabled, so we needed to perform the ROP.
898220	906100	Next, since the payload must be successfully delivered to the server, we could only insert printable characters.
906680	913580	All gadgets in the binary start with 1, so we could not use gadgets within binary.
913980	917600	For this reason, we also couldn't leak the libc address.
918780	921480	So, how do we write the exploit code?
921480	923480	We found several solutions.
923480	929440	First, we discovered that the R0 register holds a stack address at a certain size.
929440	935540	We confirmed that this stack address contains the string we inserted into the query string.
935680	941840	Next, since the main binary has a 32-bit address space, it has low entropy.
942600	949680	Lastly, the Lydie binary spawns a new child process whenever the child process dies.
950440	954800	What do you think? Doesn't it seem like everything is set for fault-proof?
955860	963080	Look here. As I mentioned, the R0 register holds a stack address containing the string we can manipulate.
963080	966740	At that time, we can control the PC register.
967420	974300	Now, we needed to reboot the binary until the PC register holds the libc system address.
975100	982380	Here is the method. We send a request that makes the R0 register hold the libc command payload.
982380	986980	Then, we send an arbitrary libc system address in the PC register.
987820	990820	Now, let's start the boot machine.
990820	992920	Before long, we obtained a share.
992920	1000480	Fortunately, we got the share within 600 tries, not the expected 2 to the power of 16 tries.
1001580	1005800	Great, we got a root share. But what can we do with it?
1005980	1017840	All critical files like video, account, user password were encrypted, so we found additional vulnerabilities in the device so we can take over the admin web page.
1018840	1024720	Unfortunately, since this vulnerability has not been patched yet, we cannot disclose it in here.
1025460	1033060	All right, we can now access the device management page with admin privileges. Now, we can do anything.
1034380	1040940	This is the real-time video manipulating scenario made by chaining the explained vulnerabilities.
1041000	1044660	The attacker infiltrates the MVR through RCE.
1047760	1054340	Then, using a vulnerability we cannot disclose here, the attacker gains access to the admin web page.
1057280	1061320	Finally, the attacker manipulates the real-time video.
1067670	1072090	Here is the demo video of this scenario.
1073090	1079850	When we send a payload, the MVR screen is tampered.
1084610	1090250	Next, let's discuss the machine authorization scenario for Synology.
1090250	1094850	Synology performs a load of MVR through the surveillance station package.
1094850	1099210	Let's look at the authorization code of this package's API handler.
1099210	1106210	First, it verifies if the user sending the request is logged in through the isAuthorized function.
1106370	1111790	Then, it checks if the user has permission to use the surveillance station package.
1111790	1114250	Doesn't it seem like something is missing?
1114250	1123090	It doesn't check if the user has necessary permissions to use specific features, whether the user is an admin or a guest.
1124190	1131170	So, we found that even with guest permissions, one could abuse all features of the Synology surveillance station.
1131170	1138070	We discovered that surveillance station features include reboot, shutdown, and package installation.
1138970	1142110	Additionally, we found something unusual.
1142110	1148350	Some requests usable in surveillance station are forwarded to the NAS's core package.
1148350	1156670	Regardless of how the requesters identify, these requests are forwarded to the core package as admin,
1156670	1163410	allowing a guest using surveillance station to request to the Synology NAS with admin privileges.
1164470	1170430	We received CVE with CVESS score 9.9 from Synology.
1172110	1175910	Next, let's look at the scenario of hijacking real-time video.
1175910	1182370	In a normal flow, guests do not have access to the camera, so they cannot view video on the front end.
1183690	1189010	However, due to the vulnerability, even guests can obtain video information.
1189030	1198250	Synology returns the RTSP server address and access credentials in the response, granting attackers unlimited access to the videos.
1199590	1201230	Let's look at the scenario.
1201230	1204910	Here, we included a request to terminate the layout.
1204910	1214410	The attacker sends a request to terminate the layout, disconnecting all live video layouts connected to Synology on all computers.
1218560	1225480	Then, the attacker sends GetLiveViewPass request to steal the video information.
1229240	1234620	And requests the video from the RTSP server using the stolen information.
1238600	1242720	Now, the attacker has hijacked the real-time video.
1245260	1246960	Here is the demo.
1247800	1257680	When we send the payload, the layout is terminated and we can watch the live video.
1258520	1259820	Thank you.
1271140	1275840	Next, we will introduce the vulnerabilities and scenarios of DAWA.
1275840	1281800	The first vulnerability is called reachable assertion, and we will explain how we found it.
1281900	1287020	While analyzing the login function, we discovered that there are many login options.
1287020	1292240	As shown in the table below, there are six types of assert time and password type pairs.
1293240	1297540	By default, the assert type and password type are set to default.
1297540	1304760	The data sent in the request includes the username, hashed password, session, assert type, and password type.
1304760	1309980	If the request is successful, a response containing true is received.
1310840	1322100	We are curious about what will happen when an attempt to log in with different authentication types will lead us to unable to analyze the login options.
1322240	1333220	During the analysis, we found a developer's mistake in the processing of the login request data, and were able to shut down the device with a reachable assertion as a result.
1333220	1335470	Now, let me explain the vulnerability.
1336300	1342900	First, before processing the login logic, the function's getPasswordType and its password value are called.
1342900	1353640	The getPasswordType function extracts assert type and password type by parsing, and compares specific strings such as default and default, respectively.
1354020	1358600	If the strings match, the function returns a type for their own.
1358600	1365800	If the type is both default, it returns 4, and if it is OTP and SSC, it returns 7.
1366380	1378960	Next function is called, isPasswordValid, and parses the login parameters based on the type value returned by the previous function, getPasswordType, and creates a string object.
1379020	1384200	The series of process enters when assert type and password type are set to default.
1384200	1395640	You can see that there is an exception handling logic that checks to see if those parameters are null before generating a string object for both parameters.
1395840	1401520	Most of the branches have this null exception handling logic, but not all of them.
1402340	1408100	The following code handles the case when the authentication type is OTP and WSSC.
1408100	1419340	As seen in the code below, string objects for authority input and password type variables are created, but there is no exception handling logic for these objects.
1419780	1428240	So, we remove the authority input parameter, set the authentication type to OTPWSSC, and send a request.
1428240	1439500	As a result, the authority input is set to null, which causes a retrieval assertion to be drawn when creating a string object for that parameter, causing the main binary to exit.
1439940	1447680	When the main binary terminates, the watchdog causes the device to reboot. This is a pretty simple vulnerability.
1448160	1454380	The following vulnerabilities are very important because they require the device to reboot.
1455380	1469120	The second vulnerability is Elf Injection. First, that will set permissions by group, and once creating an account, it can only perform tasks included in the permissions of the assigned group.
1469120	1476140	This group information is stored in a file named groupsec and is encrypted using ASCBC.
1476220	1483520	We tried analyzing the source code to find the key in Ivy, but it was quite complicated and eventually failed to find it.
1484380	1500600	However, since the configuration information must be decrypted and loaded into memory during the main binary boot process, so we performed a dynamic analysis of the boot process, and unfortunately we were able to find the decrypted data.
1502200	1510660	The structure of the decrypted groupsec file is as follows. The columns are ID, name, authority, and memo.
1510660	1516520	Each column is separated by a column, and each line is separated by a line feed.
1517680	1526940	When adding or modifying group information, the getline function is called as part of the process of saving the changed data.
1526940	1536300	This function generates a line with the ID, name, authority, and memo, extracted from the login request separated by columns.
1536300	1544640	We found out that there was no validation checking procedure of the input value until generating a line with the getline function.
1546180	1557260	So, we added a line feed to the memo to tamper the structure and restarted the device to see what would happen during the parsing process of the groupsec file.
1557820	1564880	As a result, the device entered the initialization routine and recreated the groupsec file.
1564880	1572520	When entering the initialization routine, the user can change the add-in password on the web and perform any actions.
1572520	1578380	We are curious if the initialization routine would still be entered if the file was deleted.
1578500	1585320	After deleting the file and rebooting the device, we found that it still enters the initialization routine.
1586200	1592440	Let me introduce the first scenario of DAWA using two vulnerabilities mentioned above.
1592440	1599820	By using retrieval assertion and alpha injection, an attacker can take over the device and obtain add-in privileges.
1600060	1606800	First, the attacker obtains an account with a user-managed privileges through credential stuffing.
1607480	1611920	Next, the structure of the groupsec file is tampered through alpha injection.
1611920	1619730	Then, the attacker reboots the device using retrieval assertion.
1623680	1634400	When rebooted, the device enters the initialization routine, allowing the attacker to change the add-in password and perform malicious activities.
1639150	1641970	Next is Stack Overflow.
1641970	1649070	First, this vulnerability occurs not in the main binary but in a background service called AOL.
1649070	1657130	This service is used to attempt online recovery when the device is abnormal, and it's open on port 8088.
1657650	1662950	Since this port is not forwarded, it can only be accessed from the same network.
1663090	1667930	It consists of 16 bytes of fixed size of headers and data.
1667930	1678110	And for header, the constitutional data byte index 0 indicates the function index, and the byte chat indexes 4 to 7 indicate the data size.
1678110	1685390	The data is then used as an argument for the input handler remitted by the data size defined in the header.
1685390	1690010	However, the pinpoint is that the data size can be publicated.
1690190	1694090	Now, let me explain the request processing procedure.
1697290	1700090	The following function is called per-message.
1700090	1708930	First, this function uses the structure with the VFT array, which consists of functions and variables related to each feature.
1709910	1724330	As shown in the table on the left, each structure includes the permission level, index verification function, parameter parsing function, handler function, parameter allocation free function, and next table pointer.
1724330	1726770	There are about 20 such tables.
1727670	1729890	Here is how it works internally.
1729890	1738910	The function iterates through a loop, calling the index verification function of each structure with the first byte of the header as an argument.
1738930	1751150	The index verification function, as seen in the code on the bottom right, checks if the value obtained by subtracting a specific constant number from the argument is not zero.
1751250	1757270	If the result is zero, it returns zero, or otherwise, it returns minus one.
1757270	1769650	Referring back to the code on the left, if the return value is greater than zero, or meaning a matching index is found, the count table pointer is told in the eight variable, and zero is returned.
1769650	1776170	If the matching index is found, minus one is returned, and the request is not processed.
1778290	1781230	Next, the dpStackParse function is called.
1781230	1787090	This function retrieves the table corresponding to the index and calls the parseFarm function.
1787270	1796730	As shown in the parseFarm function on the right, it appropriately processes the data according to the requested function, and then returns the result.
1797510	1807390	Finally, once all preprocessing steps are complete, the dpHandleQuery function is called to register the input handler and then execute it.
1808510	1816590	There are many different functions that could be called, including logWin, query, and update, but they all require the logWin.
1817270	1820770	So, we started analyzing the logWin function first.
1822030	1826170	The function is executed if the first byte is A0.
1826170	1833350	The data consists of username, password, and a random value with a double ampersand used as a delimiter.
1833350	1838530	The vulnerability occurs when parsing this data, which we'll explain in a moment.
1839850	1853410	As you can see in the code on the right, the strings for the username and password are set to 128 and 160 bytes respectively, and the memory is initialized with a memset.
1854490	1860990	Next, a stringString function is called to find the positions of the double ampersands and null.
1860990	1869970	The data before the first double ampersand is copied to username, and the data before the next double ampersand is copied to password.
1870050	1878410	The problem is that there is no length validation checking during the copying process, allowing us to input data of any size.
1878410	1881750	As a result, a buffer overflow occurs.
1881750	1892570	You can cover the return address by putting 156 bytes of random data, the desired value, and the password location, as shown below.
1893510	1899010	Since there was no stack canary, we couldn't manipulate the PC register.
1899010	1906230	However, we encountered an issue where we couldn't include a null in the payload, making our pain possible.
1906270	1910050	We didn't want to conclude with just a simple buffer overflow.
1910050	1913410	So, we began analyzing the source code.
1914050	1917410	Fortunately, we found some useful functions.
1917410	1926350	There were functions for rebooting, starting SSH, removing inter-settings, performing a soft recovery, and killing all MBR-related binaries.
1926710	1930670	Among these, the most interesting function was the soft recovery.
1930670	1936150	This function deletes the config directory, resetting all configuration information.
1936150	1948610	As seen in the previous vulnerability, if the groupsec file is deleted or tampered, the initialization routine is entered upon reboot, allowing the admin password to be changed.
1948610	1954650	Therefore, we manipulated the PC register to call the soft recovery function.
1954650	1961090	However, soft recovery deleted even the network files, making external access impossible.
1961090	1964050	Unfortunately, we faced another challenge.
1964950	1980310	After several days of analysis and contemplation, it soon came to my head that during the boot, there is a process where configuration files in the config directory are decrypted and loaded into memory.
1980310	1983630	So, we began analyzing the boot loads.
1983970	1992890	As a result, we found that the network configuration file is loaded first, and then the account file is loaded around 5 seconds later.
1994030	2004890	I was curious to see what would happen if the main binary center soft recovery failed within 5 seconds of loading the network configuration file.
2004930	2010130	The most fortunate point is that AOR is loaded before the main binary boots.
2011410	2017110	First, we kill the main binary using the recover assertion, causing the device to reboot.
2017690	2021730	Then, we wait until the network configuration file is loaded.
2021730	2026690	In our case, it took approximately 20 seconds for the device.
2027530	2034150	Next, we send the soft recovery failure to AOR, which deletes all configuration files.
2034290	2041230	Then, the main binary can't access the account configuration file and enters the initialization routine.
2041870	2045550	As a result, we are able to change admin account.
2045550	2052750	Let me explain the admin takeover vulnerability using recover assertion and stack buffer overflow.
2052750	2056710	First, we will reboot the device via recover assertion.
2058550	2063970	After rebooting, we wait for the network configuration file to be loaded.
2065530	2072570	And then, send the soft recovery failure to AOR to remove all configuration files.
2074800	2080520	In the process of loading account setting files such as groupsec,
2080520	2085040	it enters an initialization routine because the files do not exist.
2086840	2092000	The attacker changes the admin password and gains access to the admin page.
2093240	2094940	This is a demo.
2108390	2111130	The last vulnerability is from Hikvision.
2111130	2117250	Hikvision was much more solid compared to other devices, making it more challenging.
2117310	2121750	However, we found an interesting vector, a local subs component.
2121750	2127130	That is a plugin that must be installed for users to view video from the web.
2127130	2134890	This plugin runs with admin privileges on Windows and is accessible on port 33686,
2134890	2138170	meaning anyone on the same network can access it.
2138170	2144510	It was a very interesting plugin, so we started analyzing it and found the vulnerability.
2144510	2151670	Due to an entity associated with a bounty for this vendor, we can't disclose detailed root codes.
2151670	2157890	In short, it is a vulnerability that allows RCE by sending a crafted message.
2158330	2160390	Instead, we will show you a demo.
2160390	2164930	Through RCE, we can completely take control of Windows.
2164970	2168530	With admin privileges, we can perform any actions.
2176320	2179570	The next vulnerability is OS command injection,
2179570	2185530	which allows a user with admin privileges to execute arbitrary commands.
2186330	2192530	We create a scenario to take control of the internal network using these two vulnerabilities.
2192790	2197350	First, we obtain admin privileges through credential stuffing.
2198890	2203730	Next, we open a reversal through command injection to enter the MVR.
2205530	2213530	Then we perform network scanning to find Windows computers using the application named local subs component.
2214550	2222150	Finally, by exploiting the plugin RCE, we could take control of Windows and perform malicious activities.
2223530	2225530	Here is the demo.
2225530	2237120	By just pressing the button, we can automatically take control of Windows computer in the...
2252160	2259820	One of the things we learned during the project is the Hikvision and our Huzy OEM supplier.
2260720	2263960	Both companies also sell under their own brands,
2263960	2270160	but they are relabeled and sell to various retailers in the U.S., such as Lorex and Luma.
2270160	2276640	This means that devices are being used all around us without realizing that they are made in China.
2277700	2282020	First, OEM stands for Original Equipment Manufacturer.
2282140	2292840	It refers to the manufacturing method in which a company outsources the production of its products to another company and then sells them under its own brand.
2292840	2304320	If a product is made by Company A and is sold under the brand name of Company B, Company A becomes the OEM supplier and Company B becomes the OEM vendor.
2304320	2311280	The images below show DAWA's MBR and OEM's MBR. They look very similar, don't they?
2312260	2316000	This picture illustrates the OEM sales process.
2316000	2324480	Products manufactured by OEM suppliers like Hikvision and DAWA are relabeled by OEM vendors and sold to users.
2324880	2335180	If a vulnerability occurs in a product produced by an OEM supplier, it can affect the products sold by the OEM vendor as well.
2335580	2340480	This means that many devices can be impacted by the same vulnerability.
2341260	2347900	So, we decided to check if the vulnerabilities were valid for OEMs using the same firmware.
2347960	2355900	First, we ran bin-deep on the main binaries of DAWA and OEM vendor Bush and found that the logic was similar.
2355960	2360540	Hikvision also confirmed similar through deeping.
2361480	2369140	After confirming that OEM vendors use similar firmware, we decided to fault-trace devices and test them.
2369140	2375460	For Hikvision, we fault-traced Anki and Ampibis. Four out of six vulnerabilities each were valid.
2375840	2383020	For DAWA, we fault-traced Zhiyuan and EGPS. Four and six of the seven vulnerabilities were valid, respectively.
2383120	2391860	We confirmed that the vulnerabilities were validly exploited and reported them to Mitre, KISA, which is the Korean CNA,
2391860	2400320	to get CBIS and KBIS, which increased the number of recognized vulnerabilities by 61%.
2401460	2406860	Finally, we will show you a video of vulnerability testing on OEM vendors.
2406860	2410640	The first video is the OEM vendor testing for DAWA.
2410640	2415780	By sending DAWA's recover assertion payload, we could shut down all devices.
2418410	2422910	The second video is OEM vendor testing for Hikvision.
2422910	2432110	After sending the voice command injection payload, we could connect a reverse shell and input the shutdown command to turn off all devices.
2433310	2440050	Also, we are curious about how many devices were affected by the vulnerabilities we found.
2440050	2442850	So, we searched using Shoda.
2443870	2452890	In the case of Hikvision, most model devices' name or firmware versions were not present in the banner data.
2452910	2458350	So, we needed a different approach to identify as many as possible.
2458450	2465970	We found that for MBR devices, when accessing the login page, a config.json file is requested.
2465970	2471510	This file contains the configuration information related to MBR.
2471510	2482690	For version information, we used the web version and plug-in version coded in the C.js to search for devices with versions equal to or lower than the one we did our study.
2482910	2488870	As a result, we found that approximately 130,000 devices were vulnerable.
2489910	2495690	For Delwa, since the device name was present in the banner, we simply searched for it.
2495710	2500310	As a result, we found approximately 100,000 devices.
2501430	2504330	Finally, we came to the conclusion part.
2504330	2510870	First of all, this is what we would like to comment to offensive researchers in MBR field like us.
2510870	2515330	The vulnerabilities were discovered during our research period include.
2515330	2521210	Even when analyzing one-day cases, we found that these vulnerabilities were statically numerous.
2521410	2527490	So, when you want to analyze your MBR, we recommend that you focus on these vulnerabilities.
2528490	2541350	We conducted an analysis focusing on HTTP communication process of domain binary in order to achieve good results as much as possible over the project of four months.
2541350	2559610	However, MBRs have numerous attack surfaces, including private protocols with their cloud service, SDK communication with VMS, private protocols used to communicate with MBRs or IP cameras, and communication with other sensors.
2560090	2568990	Therefore, we recommend that you do not focus solely on analyzing the HTTP process, but analyze various attack surfaces.
2570350	2575050	The following is what we would like to recommend to users.
2575050	2584750	What we felt while conducting a one-day case study is that as long as MBR is not exposed to the external network, it is safe from these attacks.
2584950	2595490	Major MBR vendors provide solutions that allow external access using things like DDNS without exposing the device to an external network.
2595490	2601050	You can take advantage of these solutions to keep your devices safe from these attacks.
2603880	2610700	Thank you to people who helped us with the research. Especially, thank you to Dr. Junsang Yoo.
2612080	2618740	Thank you for listening to our presentation. And if you have any questions, please contact us on Twitter below.
2618740	2623400	More details of our research can be found via the QR code on the right. Thank you.
