海康威视综合安防后渗透利用技巧

前言

网上很多上传shell就完事了,昨晚上跟朋友正好遇到了,连夜看了下代码补充下后渗透利用方法。

利用工具:wafinfo/Hikvision

后渗透

image-20230629125348467

配置信息

1
运行管理中心地址:http://xxxxxx:8080/center/login

image-20230629112127871

1
运行管理中心数据库配置文件路径:/opt/hikvision/web/opsMgrCenter/conf/config.properties

image-20230629112000042

1
运行管理中心后台登陆用户: 数据库opsmgr_db 用户表:center_user

image-20230629112655547

其余各种数据库配置文件包括redis等,密码都加密了需要进行解密,需要的自行看。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/opt/hikvision/web/components/ntp.1/conf/config.properties
/opt/hikvision/web/components/activemq514linux64.1/conf/config.properties
/opt/hikvision/web/components/cluster.1/conf/config.properties
/opt/hikvision/web/components/lm.1/conf/config.properties
/opt/hikvision/web/components/ls.1/conf/config.properties
/opt/hikvision/web/components/lsm.1/conf/config.properties
/opt/hikvision/web/components/mps.1/conf/config.properties
/opt/hikvision/web/components/nodejslinux64.1/conf/config.properties
/opt/hikvision/web/components/ntp.1/conf/config.properties
/opt/hikvision/web/components/openjdk11linux64.1/conf/config.properties
/opt/hikvision/web/components/postgresql11linux64.1/conf/config.properties
/opt/hikvision/web/components/redislinux64.1/conf/config.properties
/opt/hikvision/web/components/reportservice.1/conf/config.properties
/opt/hikvision/web/components/svm.1/conf/config.properties
/opt/hikvision/web/components/tomcat85linux64.1/conf/config.properties

配置文件解密+后台用户添加

可以看到用户登陆的密码是被加密并且附带盐,直接找加密代码位置com.hikvision.center.module.usermanage.service.impl.UserServiceImpl代码很清楚可以看到password构成password=sha256("password"+md5)

image-20230629113109466

image-20230629113304989

随机数生成。

image-20230629113339143

image-20230629113442749

image-20230629113430542

注意:先备份原先用户密码和盐以便后续恢复密码

然后将生成的密码和盐进行替换登陆就可以了。

image-20230629124721370

image-20230629124752106

image-20230629125126369

数据库配置文件密码被加密。

image-20230629112820467

解密核心代码Identify.dll提供了解密接口直接调用就行了,或者也可以直接dump内存获取数据库密码,尝试了下好像该系统加密都是用的这套加密算法。

image-20230629124508270

image-20230629143040210