人人都可入侵的网络摄像头,监控背后到底是谁?

dev 2022-07-24 19:13:05 #网络安全 #物联网 1435

2013 年,Black Hat 大会上一篇名为《EXPLOITING NETWORK SURVEILLANCE CAMERAS LIKE A HOLLYWOOD HACKER》的简报首次大规模披露了被部署在家庭、企业、酒店、赌场、银行、监狱,以及军事和工业设施中的网络监控摄像头的安全问题。成千上万的消费级、企业级、政府级的网络监控摄像头终端存在 0day 漏洞,远程攻击者可轻易借此获得终端的管理及 root 权限。同时,在 Open Ip Camera 论坛上,人们已经实现远程控制监控摄像头的步进电机

国内,在披露后的一年后,央视与知道创宇(ZoomEye)联合出了一期节目报道了此次网络摄像头安全问题,节目在 2014 年 3 月 27 日于 CCTV 13 频道播出:https://news.cctv.com/2014/03/27/VIDE1395889399816869.shtml

令人不安的现状

如今十年已逝,其众多问题中最容易被利用的一点依然存在于许多摄像头终端中:弱口令。未经修改的出厂默认设置,或极为简单的密码,使得"入侵"摄像头仅需通过网络资产搜索引擎找到对应设备的 IP 地址,直接访问登录即可。即使不依靠网络资产检索,也能通过 Google Hacking 轻易"入侵"访问。

其次,在这十年所谓的技术升级潮中,他们的确修复了一些问题,但也不免因此造成了一些新的问题。当然,在这些无意造成的漏洞之中也不免有部分厂商故意放置的后门。这些不安全的网络监控摄像头除了用于满足某些人的偷窥欲与整蛊心理,更多被网络黑产利用以开展他们的僵尸网络,进行 DDOS 等活动。

更加恐怖的事实被暴露在 Verkada 被攻击导致的约 15 万个摄像头访问权限外泄后,来自黑客组织 APT-69420 Arson Cats 的成员 Tillie Kottmann 声称对 Verkada 黑客事件负责。在其暴露的影像数据中,包含了医院、诊所和精神卫生机构的内部运作流程,以及银行、公安、监狱、学校,还有特斯拉和 Cloudflare 等公司。

当被问及他们如何能够入侵 Verkada 时,Kottmann 声称他们找到了来自互联网公开数据中的管理员帐户凭据,且该凭据具有“超级管理员”权限,这使他们可以访问属于任何公司组织的任何摄像机。在报道出来后,IPVM 发文称,一名知情人士披露了这一事实:Verkada 的所有员工均有“超级管理员”权限,可随时在客户不知情的情况下查看任何客户的摄像机镜头。

Verkada 作为以安全著称的硅谷初创公司,小蔗认为他们的行为背后,一定藏着更大的利益,例如可以从客户那获取大量数据用于各种训练用途,关联信息以得到其内部资料、机密情报等。

实例

为了增加真实性以提高大家的重视程度,小蔗在这里以海康威视品牌作为例子,为大家实际演示一次简单的入侵流程。

首先,我们需要借助网络资产搜索引擎获取整个网络上所有海康威视牌网络摄像头的 IP 地址。在这里小蔗借助 Shodan 并通过国家字段检索出国内的所有匹配网络资产,你也可以使用 Zoomeye 通过 iconhash: "89b932fcc47cf4ca3faadb0cfdef89cf" 字段以精确查询。

u_1_62dd116e35d5e_1946x1514.jpeg

如上图,可以在左侧边栏中看见,目前有 191,963 台海康威视的联网监控被暴露在公网而上被 Shodan 索引。右边主内容则为相应的网络资产,默认按其被引擎爬虫发现的时间先后排序,图中 IP 星号段为小蔗手动屏蔽,这其中绝大多数都是海康威视的 Web 管理地址。

小蔗随机选择一个资产,例如 61.166.13.***,一个位于云南省临沧市临翔区的网络资产。随后小蔗使用 MASSCAN 扫描出其所有开放端口,发现其有多个相关服务端口,应该是一个网络监控摄像头组。于 84 端口登陆其 WEB 后台,发现是较新产品的后台 UI,所以基本可以排除海康威视之前 12345 默认密码的可能性。便通过 CVE 关键词检索,得到以下公开漏洞:

Description
CVE-2022-28172:The web module in some Hikvision Hybrid SAN/Cluster Storage products have the following security vulnerability. Due to the insufficient input validation, attacker can exploit the vulnerability to XSS attack by sending messages with malicious commands to the affected device.
CVE-2022-28171:The web module in some Hikvision Hybrid SAN/Cluster Storage products have the following security vulnerability. Due to the insufficient input validation, attacker can exploit the vulnerability to execute restricted commands by sending messages with malicious commands to the affected device.
CVE-2021-36260:A command injection vulnerability in the web server of some Hikvision product. Due to the insufficient input validation, attacker can exploit the vulnerability to launch a command injection attack by sending some messages with malicious commands.
CVE-2020-7057:Hikvision DVR DS-7204HGHI-F1 V4.0.1 build 180903 Web Version sends a different response for failed ISAPI/Security/sessionLogin/capabilities login attempts depending on whether the user account exists, which might make it easier to enumerate users. However, only about 4 or 5 failed logins are allowed.
CVE-2018-6414:A buffer overflow vulnerability in the web server of some Hikvision IP Cameras allows an attacker to send a specially crafted message to affected devices. Due to the insufficient input validation, successful exploit can corrupt memory and lead to arbitrary code execution or crash the process.
CVE-2018-6413:There is a buffer overflow in the Hikvision Camera DS-2CD9111-S of V4.1.2 build 160203 and before, and this vulnerability allows remote attackers to launch a denial of service attack (service interruption) via a crafted network setting interface request.
CVE-2017-7923:A Password in Configuration File issue was discovered in Hikvision DS-2CD2xx2F-I Series V5.2.0 build 140721 to V5.4.0 build 160530, DS-2CD2xx0F-I Series V5.2.0 build 140721 to V5.4.0 Build 160401, DS-2CD2xx2FWD Series V5.3.1 build 150410 to V5.4.4 Build 161125, DS-2CD4x2xFWD Series V5.2.0 build 140721 to V5.4.0 Build 160414, DS-2CD4xx5 Series V5.2.0 build 140721 to V5.4.0 Build 160421, DS-2DFx Series V5.2.0 build 140805 to V5.4.5 Build 160928, and DS-2CD63xx Series V5.0.9 build 140305 to V5.3.5 Build 160106 devices. The password in configuration file vulnerability could allow a malicious user to escalate privileges or assume the identity of another user and access sensitive information.
CVE-2017-7921:An Improper Authentication issue was discovered in Hikvision DS-2CD2xx2F-I Series V5.2.0 build 140721 to V5.4.0 build 160530, DS-2CD2xx0F-I Series V5.2.0 build 140721 to V5.4.0 Build 160401, DS-2CD2xx2FWD Series V5.3.1 build 150410 to V5.4.4 Build 161125, DS-2CD4x2xFWD Series V5.2.0 build 140721 to V5.4.0 Build 160414, DS-2CD4xx5 Series V5.2.0 build 140721 to V5.4.0 Build 160421, DS-2DFx Series V5.2.0 build 140805 to V5.4.5 Build 160928, and DS-2CD63xx Series V5.0.9 build 140305 to V5.3.5 Build 160106 devices. The improper authentication vulnerability occurs when an application does not adequately or correctly authenticate users. This may allow a malicious user to escalate his or her privileges on the system and gain access to sensitive information.
CVE-2017-14953:** DISPUTED ** HikVision Wi-Fi IP cameras, when used in a wired configuration, allow physically proximate attackers to trigger association with an arbitrary access point by leveraging a default SSID with no WiFi encryption or authentication. NOTE: Vendor states that this is not a vulnerability, but more an increase to the attack surface of the product.
CVE-2017-13774:Hikvision iVMS-4200 devices before v2.6.2.7 allow local users to generate password-recovery codes via unspecified vectors.
CVE-2015-4409:Buffer overflow on Hikvision NVR DS-76xxNI-E1/2 and DS-77xxxNI-E4 devices before 3.4.0 allows remote authenticated users to cause a denial of service (service interruption) via a crafted HTTP request, aka the SDK issue.
CVE-2015-4408:Buffer overflow on Hikvision NVR DS-76xxNI-E1/2 and DS-77xxxNI-E4 devices before 3.4.0 allows remote authenticated users to cause a denial of service (service interruption) via a crafted HTTP request, aka the ISAPI issue.
CVE-2015-4407:Buffer overflow on Hikvision NVR DS-76xxNI-E1/2 and DS-77xxxNI-E4 devices before 3.4.0 allows remote authenticated users to cause a denial of service (service interruption) via a crafted HTTP request, aka the PSIA issue.
CVE-2014-4880:Buffer overflow in Hikvision DVR DS-7204 Firmware 2.2.10 build 131009, and other models and versions, allows remote attackers to execute arbitrary code via an RTSP PLAY request with a long Authorization header.
CVE-2013-4977:Buffer overflow in the RTSP Packet Handler in Hikvision DS-2CD7153-E IP camera with firmware 4.1.0 b130111 (Jan 2013), and possibly other devices, allows remote attackers to cause a denial of service (device crash and reboot) and possibly execute arbitrary code via a long string in the Range header field in an RTSP transaction.
CVE-2013-4976:Hikvision DS-2CD7153-E IP Camera has security bypass via hardcoded credentials
CVE-2013-4975:Hikvision DS-2CD7153-E IP Camera has Privilege Escalation

通过漏洞执行脚本,小蔗发现该资产命中 CVE-2017-7921 及 CVE-2021-36260,通过前者便可直接获得管理员密码。通过 WEB 登陆后,由于小蔗使用的 MacOS 无法安装海康威视官网上的插件,所以无法通过浏览器直接看到监控实况,页面显示如下:

u_1_62dd1b489deaa_1944x1344.jpeg

随后小蔗发现 DevinZ 曾在他博客发布了一篇文章《海康威视 Hikvision iVMS-4200 Mac 监控客户端切换中文语言的方法》,如今该途径仍然有效,只是软件版本与链接位置发生了改变,截止最新版本为:v2.0.0.14 build20210122,Mac 使用上优化仍然很差,软件主界面如下(没错它的字体渲染就是有这么糊):

u_1_62dd1e374c9b7_1536x1195.jpeg

借助 WEB 后台查看管理配置里网络管理下的端口配置,当然也可以直接自己扫,服务端口段通常为 8000-8008。最后,通过 iVMS 新增 IP 设备进行连接,即可查看实况画面:

u_1_62dd21f9b9d7a_1536x1195.jpeg

其他方法

除此之外,小蔗观察到在 WEB 端登录时,海康威视平台的密码尝试次数是基于 IP 区分的,一个 IP 在一定时间内有 6 次试错机会。通常一个符合国人密码设置规律的字典条数在 2,400 条左右,仅需 400 个代理即可在数秒内完成一轮字典的尝试。特别的,在支持 IPv6 的终端下,若其并未按照 /64 网断对 IPv6 进行禁止,那么依靠一台在 IDC 处购买的支持 IPv6 的服务器,即可得到 2^64 个代理。因为大部分服务商会直接提供一整个 IPv6 /64 级别的子网,有的甚至可以申请到更大的网段。

这般靠数量取胜的方法实例不在少数,包括之前的 Instagram 验证码暴力破解,其提出通过足够多的 IP 在 10 分钟内尝试 100 万次即可破解 ins 的 6 位验证码,被证实后得到 Facebook 的 $30,000 漏洞报告奖励。

十年前的联网监控,十年后的万物互联。在科技日新月异的发展高速上,我们作为普通的使用者,一定不要忘了提高自身的安全意识,以怀疑的态度去自我审视。

写在最后

这几天接触这个方向,还得追溯到唐山精神卫生中心(唐山市第五医院)爆出的社会恶性问题,具体可移步知乎查看。当时异想天开的想:若扫描唐山市所有 IPv4 的网段及端口,并将联网监控设备汇总后通过脚本批量漏洞检测与弱密码爆破。遂把所有设备的监控存储数据拉至本地通过机器学习进行标记,将其中所有谈话内容转为文本进行 NPL 情感分析,最终会在这座城市下挖掘出怎样的信息?

当然,这仅只是一个想法而已。