SecCrawler 一个跨平台的方便安全研究人员获取每日安全日报的爬虫和机器人推送程序

admin 2022年3月2日12:48:46评论480 views字数 4221阅读14分4秒阅读模式
https://github.com/Le0nsec/SecCrawler

一个方便安全研究人员获取每日安全日报的爬虫和推送程序,目前爬取范围包括先知社区、安全客、Seebug Paper、跳跳糖、奇安信攻防社区、棱角社区、洞见微信聚合,持续更新中。

SecCrawler 一个跨平台的方便安全研究人员获取每日安全日报的爬虫和机器人推送程序



Table of Contents

IntroductionFeaturesInstallConfigDemoContributingLicense

Introduction

SecCrawler 是一个跨平台的方便安全研究人员获取每日安全日报的爬虫和机器人推送程序,目前爬取范围包括先知社区、安全客、Seebug Paper、跳跳糖、奇安信攻防社区、棱角社区、洞见微信聚合,机器人推送范围包括企业微信机器人、飞书机器人、钉钉机器人、Server酱、HexQBot(QQ群机器人)、WgpSecBot(微信机器人),持续更新中。

程序使用yml格式的配置文件,第一次使用时请使用-init参数在当前文件夹生成默认配置文件,在配置文件中设置爬取的网站和推送机器人相关配置,目前包括在内的网站和推送的机器人在Features中可以查看,可以设置每日推送的整点时间以及是否开启API。


  _____            _____                    _           
 / ____|          / ____|                  | |          
| (___   ___  ___| |     _ __ __ ___      _| | ___ _ __ 
 ___  / _ / __| |    | '__/ _    / / / |/ _  '__|
 ____) |  __/ (__| |____| | | (_| | V  V /| |  __/ |   
|_____/ ___|___|_____|_|  __,_| _/_/ |_|___|_|                                 
SecCrawler dev

Options:
  -c file
        the config file to be used, or generate a config file with the specified name with -init (default "config.yml")
  -help
        print help info
  -init
        generate a config file
  -test
        stop after running once
  -version
        print version info

使用-h/-help查看详细命令:使用-c指定使用的配置文件,或者配合-init生成指定文件名的配置文件使用-test参数执行一次程序后退出API文档注意请求API需要带上Authorization头

如果开启了定时任务,程序使用定时任务每天根据设置好的时间整点自动运行,编辑好相关配置后后台运行即可,示例运行命令:

nohup ./SecCrawler >> run.log 2>&1 &
# 或者使用screen
$ screen ./SecCrawler
$ ctrl a+d / control a+d # 回到主会话

注:由于在爬取先知安全社区时程序使用了 Selenium,用户需要手动下载ChromeDriverChrome浏览器。

ChromeDriver镜像站:http://npm.taobao.org/mirrors/chromedriver/

Windows和Mac用户在下载Chrome并安装后,下载对应chrome版本的ChromeDriver并在配置文件config.yml中指定ChromeDriver的路径Linux用户在下载Chrome(链接如下)并安装后,同上编辑配置文件Debian/Ubuntu(64位.deb)Fedora/openSUSE(64位.rpm)

Chrome浏览器可以访问chrome://version/查看版本

命令行可以使用google-chrome-stable --version查看版本

程序旨在帮助安全研究者自动化获取每日更新的安全文章,适用于每日安全日报推送,爬取的安全社区网站范围和支持推送的机器人持续增加中,欢迎在issues中提供宝贵的建议。

:rocket: 目前 SecCrawler 已在MacOS Apple silicon 、Ubuntu 20.04运行测试通过。

Features

支持的爬取网站列表:

 先知安全社区 安全客 (安全知识专区) Seebug Paper 棱角安全社区 跳跳糖 奇安信攻防社区 洞见微信聚合

支持的推送机器人列表:

 企业微信群机器人 HexQBot (QQ群机器人 自建) Server酱 飞书群机器人 钉钉群机器人 WgpSecBot pushplus

Install

你可以在Releases下载最新的SecCrawler。

或者从源码编译:

$ git clone https://github.com/Le0nsec/SecCrawler.git
cd SecCrawler
$ go build .

Config

config.yml配置文件模板注释:

# 设置Selenium使用的ChromeDriver路径,支持相对路径或绝对路径(如果不爬取先知社区可以不用设置)
ChromeDriver: ./chromedriver/linux64

Proxy:
  ProxyUrl: http://127.0.0.1:7890
  CrawlerProxyEnabled: false # 开启爬虫代理
  BotProxyEnabled: false # 开启请求机器人代理

Cron:
  enabled: false
  time: 11 # 设置定时任务每天整点爬取推送时间,范围 0 ~ 23(整数)

Api:
  enabled: false
  debug: false
  host: 127.0.0.1
  port: 8080
  auth: auth_key_here # 请求api需要带上Authorization头

Crawler:
  # 棱角社区
  # https://forum.ywhack.com/forum-59-1.html
  EdgeForum:
    enabled: false
  # 先知安全技术社区
  # https://xz.aliyun.com/
  XianZhi:
    enabled: false
  # SeebugPaper(知道创宇404实验室)
  # https://paper.seebug.org/
  SeebugPaper:
    enabled: false
  # 安全客
  # https://www.anquanke.com/
  Anquanke:
    enabled: false
  # 跳跳糖
  # http://tttang.com/
  Tttang:
    enabled: false
  # 奇安信攻防社区
  # https://forum.butian.net/community/all/newest
  QiAnXin:
    enabled: false
  # 洞见微信聚合
  # http://wechat.doonsec.com/
  DongJian:
    enabled: false

Bot:
  # 企业微信群机器人
  # https://work.weixin.qq.com/api/doc/90000/90136/91770
  WecomBot:
    enabled: false
    key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    timeout: 2
  # 飞书群机器人
  # https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN
  FeishuBot:
    enabled: false
    key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    timeout: 2
  # 钉钉群机器人
  # https://open.dingtalk.com/document/robots/custom-robot-access
  DingBot:
    enabled: false
    token: xxxxxxxxxxxxxxxxxxxx
    timeout: 2
  # HexQBot
  # https://github.com/Am473ur/HexQBot
  HexQBot:
    enabled: false
    api: http://xxxxxx.com/send
    qqgroup: 0
    key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    timeout: 2
  # Server酱
  # https://sct.ftqq.com/
  ServerChan:
    enabled: false
    sendkey: xxxxxxxxxxxxxxxxxxxx
    timeout: 2
  # WgpSecBot
  # https://bot.wgpsec.org/
  WgpSecBot:
    enabled: false
    key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    timeout: 2


Contributing

如果您有高质量的安全社区网站希望被爬取,或者想推荐被广泛使用的推送机器人,欢迎联系微信和邮箱:leonsec[at]h4ck.fun或提交issuePR

SecCrawler 一个跨平台的方便安全研究人员获取每日安全日报的爬虫和机器人推送程序

License

GNU General Public License v3.0


原文始发于微信公众号(洞见网安):SecCrawler 一个跨平台的方便安全研究人员获取每日安全日报的爬虫和机器人推送程序

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年3月2日12:48:46
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   SecCrawler 一个跨平台的方便安全研究人员获取每日安全日报的爬虫和机器人推送程序http://cn-sec.com/archives/810406.html

发表评论

匿名网友 填写信息