当前位置: 首页 > news >正文

脚本判断Zabbix版本

web漏洞挖掘中遇到zabbix需要测试历史漏洞,不知道具体版本号。参考zabbix使用手册,发送特定请求获取版本号。附脚本

参考文档:版本icon-default.png?t=O83Ahttps://www.zabbix.com/documentation/current/zh/manual/api/reference/apiinfo/version

import requestsdef get_zabbix_api_version(target, use_https=False):protocol = "https" if use_https else "http"url = f"{protocol}://{target}/api_jsonrpc.php"headers = {"Content-Type": "application/json-rpc"}payload = {"jsonrpc": "2.0","method": "apiinfo.version","params": [],"id": 1}try:# 创建一个不验证SSL证书的sessionresponse = requests.post(url, headers=headers, json=payload, timeout=10, verify=False)response.raise_for_status()  # 抛出异常以处理非200响应return response.json()except requests.exceptions.RequestException as e:return {"error": str(e)}def main():use_https = input("是否使用HTTPS(y/n)?").lower() == 'y'target = input("请输入Zabbix服务器的IP或域名: ")result = get_zabbix_api_version(target, use_https)if "error" in result:print("请求失败:", result["error"])elif "result" in result:print("Zabbix API版本:", result["result"])else:print("未知错误,无法解析响应")input("按任意键退出...")if __name__ == "__main__":main()

使用截图


http://www.mrgr.cn/news/60882.html

相关文章:

  • Python | Leetcode Python题解之第518题零钱兑换II
  • jQuery Mobile 表单输入
  • 人工智能技术的应用前景:改变我们的生活和工作方式
  • Maven(13)如何更改本地Maven仓库的位置?
  • Apache配置案例三:基于SSL的虚拟主机搭建
  • 07 顺序表的插入操作
  • 如何在 MySQL 中创建一个完整的数据库备份?
  • ICM20948 DMP代码详解(104)
  • 如何在Windows系统上使用WSL2进行高效开发
  • 3.常见的线性规划应用实例
  • scratch繁星点点 2024年9月scratch三级真题 中国电子学会 图形化编程 scratch三级真题和答案解析
  • 直流电抗器的选择和计算
  • Nginx 的反向代理上
  • VictoriaMetrics 中文教程(10)集群版介绍
  • C++ | Leetcode C++题解之第517题超级洗衣机
  • 机器学习与神经网络:诺贝尔物理学奖的新方向
  • 学外语最快的方法是怎样的?
  • Three.js Shader 与自定义材质—深入理解与应用
  • 【大数据知识】HBase入门知识
  • C#实现word和pdf格式互转