thorns_project 分布式异步队列系统

admin 2021年4月2日20:29:52评论24 views字数 2048阅读6分49秒阅读模式

thorns_project 分布式异步队列系统

猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-02-06 16:50

演示地址:http://thorns.wuyun.org:8080/workers

项目地址:https://github.com/ring04h/thorns

详细安装&使用说明

https://github.com/ring04h/thorns/blob/master/README.md

thorns_project 分布式异步队列系统,wydomain分析目标系统信息后,返回给thorns控制台进行任务调度下发至redis队列系统,worker客户端从redis队列系统获取任务给wyportmap执行,将结果存入后台数据库。

运行流程

* 启动redis内存服务器,作为队列存储数据库使用

* 配置芹菜(celery)运行环境,并连接redis队列内存,读取执行任务,并返回结果存储到后端MySQL数据库

* 配置任务控制台花花(flower),并连接redis队列内存,管理所有worker客户端与执行的任务队列

* 通过run.py脚本调用celery向队列压入任务

* 通过flower的http api脚本调用api向队列压入任务

* 任务执行的结果自动存入后端数据库

运行环境

* CentOS、Kali Linux、Ubuntu、Debian

* Python 2.7.x

* Redis

* MysQL

* Celery

* Tornado

* Supervisord

使用说明(可客户端发起任务也可http api发起任务)

命令行调用

在你的任意一台worker客户端,或者thorns服务端
$ cd /home/thorns/
$ python run.py 42.62.52.1-42.62.62.254 188
$ python run.py 42.62.52.1-254 189
均可以向redis压入nmap扫描任务,worker客户端的分布式集群会自动分发任务执行,并存储到后台数据库
记得修改wyportmap.py里面的扫描结果,存到你自己的数据库

reinhard-mbp:thorns reinhard$ python run.py 42.62.52.1-254 189
--------------------------------------------------
* push 42.62.52.1 to Redis
* AsyncResult:23147d02-294d-41e5-84e5-5e1b15e72fc4
--------------------------------------------------
* push 42.62.52.2 to Redis
* AsyncResult:542984a4-4434-475f-9a62-bfc81206ea57
--------------------------------------------------
* push 42.62.52.3 to Redis
* AsyncResult:7d005661-d719-41ef-babc-4c853b2c49cc
--------------------------------------------------
* push 42.62.52.4 to Redis
* AsyncResult:ddcf9486-09d9-4dd2-9bb4-2618e6a161b8
--------------------------------------------------

wyportmap相关帮助: https://github.com/ring04h/wyportmap

HTTP API 远程调用

重启 worker 线程池:
$ curl -X POST http://thorns.wuyun.org:8080/api/worker/pool/restart/myworker

远程调用HTTP API启动一个nmap扫描任务:
$ curl -X POST -d '{"args":["42.62.52.62",2222]}' http://thorns.wuyun.org:8080/api/task/send-task/tasks.nmap_dispath

强制结束一个正在执行的任务:
$ curl -X POST -d 'terminate=True' http://thorns.wuyun.org:8088/api/task/revoke/a9361c1b-fd1d-4f48-9be2-8656a57e906b

[原文地址]

文章来源于lcx.cc:thorns_project 分布式异步队列系统

相关推荐: 分享 CentOS 下 shadowsocks 一键安装脚本

分享 CentOS下shadowsocks一键安装脚本 雨路 (ส็็็็็็ส็็็็็็ส็็็็็็ส็็็็็็ส็็็็็็ส็็็็็็ส็็็็็็ส็็็00000็็็0ส0็็็็0็็ส็็็็็็ส็็็็็็ส็็็็็็ส็็็็็…

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月2日20:29:52
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   thorns_project 分布式异步队列系统https://cn-sec.com/archives/317526.html

发表评论

匿名网友 填写信息