Giter Club home page Giter Club logo

taomujian / linbing Goto Github PK

View Code? Open in Web Editor NEW
641.0 21.0 140.0 108.59 MB

本系统是对Web中间件和Web框架进行自动化渗透的一个系统,根据扫描选项去自动化收集资产,然后进行POC扫描,POC扫描时会根据指纹选择POC插件去扫描,POC插件扫描用异步方式扫描.前端采用vue技术,后端采用python fastapi.

License: MIT License

Python 67.92% CSS 0.07% HTML 0.48% JavaScript 10.02% Vue 19.81% Shell 0.03% Dockerfile 0.17% Handlebars 0.06% SCSS 1.13% Java 0.27% PHP 0.04%
aiohttp asyncio element-ui fastapi python3 vue

linbing's Introduction

临兵漏洞扫描系统

本系统是对Web中间件和Web框架进行自动化渗透的一个系统,根据扫描选项去自动化收集资产,然后进行POC扫描,POC扫描时会根据指纹选择POC插件去扫描,POC插件扫描用异步方式扫描.前端采用vue技术,后端采用python fastapi.

使用说明

扫描分为指纹探测、子域名爆破、端口扫描、目录扫描、POC扫描.如果选择所有扫描选项,子域名扫出的IP会传给端口扫描,端口扫描中识别指纹,扫描出的资产传给目录扫描和POC扫描,POC扫描会根据资产指纹去加载插件扫描,如果识别不到指纹,则加载所有插件,POC插件分为2种类型,http和port,http类型指发送http请求,port指发送socket请求,扫描出的资产如果是url格式,则加载http类型插件,否则则加载port类型插件.

修改加密key

存储到mysql中的数据是进行aes加密后的数据,登陆请求是用的rsa请求,目前是默认的key,如果需要修改key的参考下面,修改key信息需要重新编译vue源码

修改aes key

python这块直接修改/python/conf.ini中aes部分的配置即可,采用cbc模式,需要key和iv. vue部分则需要修改vue_src/src/libs/AES.js文件中第三行和第四行,要和conf.ini中保持一致

修改rsa key

需要生成rsa的公私钥(私钥1024位)参考地址 修改python/rsa.py文件中的公钥和私钥信息,vue部分则需要修改vue_src/src/libs/crypto.js文件中第77行的公钥,要和python/rsa.py文件中的公钥保持一致

修改vue部分后要重新打包,然后把打包后的文件夹dist中的内容复制到vue文件夹,vue原有的文件要删除.

打包vue源代码(进入到vue_src目录下)

npm run build(有打包好的,即vue文件夹,可直接使用,自行打包需要安装node和vue,参考https://www.runoob.com/nodejs/nodejs-install-setup.html, https://www.runoob.com/vue2/vue-install.html)

ubuntu部署

centos部署

自编译docker文件进行部署

从dockerhub中获取镜像

ubuntu部署

参考https://github.com/taomujian/linbing/blob/master/ubuntu部署.md)

centos部署

参考https://github.com/taomujian/linbing/blob/master/centos部署.md)

自编译docker文件进行部署

配置

首先下载项目到本地(https://github.com/taomujian/linbing.git),然后配置python/conf.ini中发送邮件所用的账号和授权码,然后修改python/conf.ini的mysql数据库账号密码,这个账号密码要和dockerfile中的设置的账号密码保持一致

编译镜像(进入项目根目录)

docker build -f ubuntu.dockerfile -t linbing .

启动容器(进入项目根目录)

docker run -it -d -p 11000:11000 -p 8800:8800 linbing

从dockerhub中获取镜像

docker pull taomujian/linbing:latest

docker run -it -d -p 11000:11000 -p 8800:8800 taomujian/linbing

访问

访问http://yourip:11000/login即可,默认账号密码为admin/X!ru0#M&%V

界面

登录.jpg

首页.jpg

目标.jpg

扫描.jpg

POC.jpg

CHANGELOG

[v1.0] 2020.2.28

  • 初步完成扫描器功能

[v1.1] 2020.7.28

  • 新增F5 BIG IP插件

[v1.2] 2020.8.12

  • 增加docker部署

[v1.3] 2020.9.13

  • 增加phpstudy_back_rce插件数量
  • 添加目标时可添加多行目标

[v1.4] 2020.10.18

  • 增加查看端口详情(端口、协议、产品、版本)
  • 增加子域名详情(子域名,子域名ip),子域名是用的OneForAll工具

[v1.5] 2020.10.30

  • 修改一些插件的错误
  • 扫描设置中可设置POC检测时协程的并发数量
  • 增加asyncio多协程功能,提高POC扫描速度

[v1.6] 2020.11.27

  • 修改默认头像,若想替换的话直接flask/images/default.png图片就可以了
  • 优化前端修复一些小BUG

[v1.7] 2020.12.5

  • 增加设置代理和扫描的超时时间功能
  • 优化前端修复一些小BUG
  • 优化文件结构,同步docker时间

[v1.8] 2020.12.11

  • 优化前端刷新后头像丢失BUG

[v1.9] 2020.12.18

  • 修改发送邮件的方式,使用postfix发送邮件

[v2.0] 2021.3.1

  • 前端ui框架由iview换为element,重构前端代码
  • 取消账号注册,改由内置管理员账号添加
  • 增加对url目标的目录扫描功能
  • 增加查看所有漏洞和所有端口信息的功能
  • 优化数据库表格数据结构和sql语句

[v2.1] 2021.3.5

  • 前端界面优化
  • 多个目标扫描同时扫描时,增加任务队列管理

[v2.2] 2021.3.26

  • 增加CVE-2021-22986插件

[v2.3] 2021.5.20

  • 优化扫描逻辑
  • 增加指纹探测,探测使用的框架
  • 优化Struts2 系列漏洞的检测

[v2.4] 2021.6.19

  • 增加指纹判断功能
  • 对扫出来的端口进行指纹识别,指纹识别后去加载对应的插件,减少发包数量
  • 对插件进行分类,分为http类和非http类
  • 点击扫描时提供自定义扫描选项功能,分为指纹探测, 子域名扫描, 端口扫描, 目录扫描, POC扫描
  • 扫描列表中增加暂停扫描、恢复扫描、取消扫描功能

[v2.5] 2021.7.10

  • 后端框架由flask更换为fastapi

[v2.6] 2021.9.21

  • 扫描时可选择POC插件
  • 增加POC列表
  • 修复已知BUG

[v2.7] 2021.10.11

  • 修复扫描所有目标时的错误
  • 增加XSS LOG功能(接收数据的url参考生成token后的url)

[v2.8] 2021.10.24

  • 目标管理和扫描管理中状态信息更新由Ajax轮询换成websocket

[v2.9] 2021.12.26

  • 集成dnslog.cn的功能,提供dnslog功能

[v3.0] 2022.5.14

  • POC插件扫描换成异步扫描方式,加快扫描速度

致谢

感谢vulhub项目提供的靶机环境: https://github.com/vulhub/vulhub, https://hub.docker.com/r/2d8ru/struts2

POC也参考了很多项目: https://github.com/Xyntax/POC-T

https://github.com/ysrc/xunfeng

https://github.com/se55i0n/DBScanner

https://github.com/vulscanteam/vulscan

感谢师傅pan带我入门安全,也感谢呆橘同学在vue上对我的指导

免责声明

工具仅用于安全研究以及内部自查,禁止使用工具发起非法攻击,造成的后果使用者负责

License

MIT

linbing's People

Contributors

taomujian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linbing's Issues

容器启动时候报错

[root@VM-0-3-centos ~]# docker run -it -d -p 11000:11000 -p 8800:8800 taomujian/linbing
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
956b6a8d34b9dfd6c7946fa50e2f4b3cc0e189da3f372bc7895c5aa886985b1e
[root@VM-0-3-centos ~]# uname -a
Linux VM-0-3-centos 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@VM-0-3-centos ~]#

docker启动报错

系统版本:Linux racknerd-1bd2a3 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

docker 版本:Docker version 23.0.2, build 569dd73
报错信息: exec /ubuntu_docker_run.sh: no such file or directory
截图:
image

docker编译镜像报错

Nothing to configure.
Ignoring colorama: markers 'sys_platform == "win32"' don't match your environment
Ignoring win32-setctime: markers 'sys_platform == "win32"' don't match your environment
Collecting cx-Oracle (from -r /root/flask/requirements.txt (line 2))
Could not find a version that satisfies the requirement cx-Oracle (from -r /root/flask/requirements.txt (line 2)) (from versions: )
No matching distribution found for cx-Oracle (from -r /root/flask/requirements.txt (line 2))
The command '/bin/sh -c service mysql start && mysql -e "SET PASSWORD FOR root@localhost = PASSWORD('123456');FLUSH PRIVILEGES;" && mysql -e "update mysql.user set plugin='mysql_native_password' where User='123456';FLUSH PRIVILEGES;" && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && update-alternatives --config python3 && pip3 install -r /root/flask/requirements.txt && chmod +x /ubuntu_run.sh' returned a non-zero code: 1

报错,无法访问

您好,今天看到您的这款项目后是非常激动的,打开电脑进行搭建完成后发现无法访问,pip3的模块库已经全部安装完毕,在您的安装教程中要求移动的文件我也已经进行移动,但是单纯访问ip地址是可以访问的,但是加上8000或者11000端口号后无法访问,数据库以及nginx也是已经启动并且配置好了,您方便帮我解决一下我的问题吗?感激不尽!

无法发送邮件

(535, b'Login Fail. Please enter your authorization code to login. More information in http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256') [pid: 291|app: 0|req: 1/1] 127.0.0.1 () {52 vars in 907 bytes} [Sat Dec 19 02:49:22 2020] POST /api/getchecknum => generated 62 bytes in 621 msecs (HTTP/1.0 200) 5 headers in 183 bytes (1 switches on core 0)

smtp的信息肯定是对的,但是就是无法成功“{'code': 'Z1003', 'message': '发送邮件异常', 'data': ''}”,建议内置一个帐号,因为这样的系统也就一两个人使用。

自己打包ubuntu.docker后运行登录提示404

根据ubuntu.dockerfile打包得镜像,运行后查看日志

  • Starting MariaDB database server mysqld [ OK ]
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    Starting redis-server: redis-server.

进容器验证mysql和redis密码都正常,通过页面输入用户名密码后提示404,post提交http://127.0.0.1:11000/api/login这个地址404,有可能是后端服务没启动?

进入容器手动执行了
nohup python3 worker.py > log.log 2>&1 &
nohup gunicorn -c gunicorn.conf main:app -k uvicorn.workers.UvicornWorker > gunicorn.log 2>&1 &
还是不行。
gunicorn.log提示
WARNING: configuration file should have a valid Python extension.
log.log无报错
14:07:33 Worker rq:worker:d15b52c542b640e7bb908c459e20a1c1 started with PID 417, version 1.15.1 14:07:33 Worker rq:worker:901f67bacdab4b5b8872ce8f4024b9f7 started with PID 416, version 1.15.1 14:07:33 Subscribing to channel rq:pubsub:d15b52c542b640e7bb908c459e20a1c1 14:07:33 Subscribing to channel rq:pubsub:901f67bacdab4b5b8872ce8f4024b9f7 14:07:33 *** Listening on high... 14:07:33 *** Listening on high...

报错,无法访问

您好,今天看到您的这款项目后是非常激动的,打开电脑进行搭建完成后发现无法访问,pip3的模块库已经全部安装完毕,在您的安装教程中要求移动的文件我也已经进行移动,但是单纯访问ip地址是可以访问的,但是加上8000或者11000端口号后无法访问,数据库以及nginx也是已经启动并且配置好了,您方便帮我解决一下我的问题吗?感激不尽!

使用Docker创建后查看日志发现数据库无法访问

作者您好,clone下来的内容中dockerfile文件中默认的数据库密码为1234567,mysql.py中保存的密码为123456,在创建镜像时已经将密码同一改为123456。
以下是遇到的问题:
创建镜像并运行后,可以正常注册并登录,但是添加目标后一直是扫描目录状态,访问docker中的uwsgi日志,发现以下内容:

*** Operational MODE: preforking+threaded ***
added /root/flask/ to pythonpath.
(2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 111] Connection refused)")
Traceback (most recent call last):
File "/root/flask/run.py", line 37, in
mysqldb.create_database('linbing')
File "/root/flask/app/mysql.py", line 54, in create_database
cursor.close()
UnboundLocalError: local variable 'cursor' referenced before assignment
unable to load app 0 (mountpoint='') (callable not found or import error)
(2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 111] Connection refused)")
Traceback (most recent call last):
File "/root/flask/run.py", line 37, in
mysqldb.create_database('linbing')
File "/root/flask/app/mysql.py", line 54, in create_database
cursor.close()
UnboundLocalError: local variable 'cursor' referenced before assignment
unable to load app 0 (mountpoint='') (callable not found or import error)

想请教一下该如何解决,十分感谢~~~

资产管理这一项没有数据

您好,请问 资产管理这一项应该怎么使用呢? 经过一些测试后发现还是没有数据显示。我是在ubuntu中手动搭建的环境
有测试案例可以提供下吗
image

Docker 启动报错

从DockerHub拉的镜像,起不来

报错信息如下:

WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
add8a68199e393920f0c2ec05076586fa5b2f47e3a65729a53b0c93095480ede

图片

Docker 日志

standard_init_linux.go:228: exec user process caused: exec format error

似乎是构建映像的时候没有加上linux/amd64平台?

你好作者我在部署的时候有几个问题需要你的帮助。

第一个问题,在ubuntu上部署之成功之后postfix也部署成功了,但是项目运行之后需要注册的时候收不到验证码查看了mail的log发现如下的错误 root@vultr:~# tail /var/log/mail.log
Jan 15 09:17:10 vultr postfix/cleanup[48911]: 197361FDB71: message-id=[email protected]
Jan 15 09:17:10 vultr postfix/smtpd[48908]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jan 15 09:17:10 vultr postfix/qmgr[48494]: 197361FDB71: from=<[email protected]>, size=782, nrcpt=1 (queue active)
Jan 15 09:17:12 vultr postfix/smtp[48912]: 197361FDB71: to=[email protected], relay=smtp.qq.com[203.205.232.7]:465, delay=2.1, delays=0.01/0.02/1.8/0.28, dsn=5.0.0, status=bounced (host smtp.qq.com[203.205.232.7] said: 501 Mail from address must be same as authorization user. (in reply to MAIL FROM command))
Jan 15 09:17:14 vultr postfix/smtp[48912]: 2C89B1FDC55: to=[email protected], relay=smtp.qq.com[203.205.232.7]:465, delay=2.1, delays=0/0/1.8/0.24, dsn=5.0.0, status=bounced (host smtp.qq.com[203.205.232.7] said: 502 Invalid paramenters (in reply to MAIL FROM command))`
我不知道这个[email protected]在哪里修改,按照你的配置教程所说在flask目录下的conf.ini来配置邮箱及授权码,可是实在是没看出来怎么配置的,conf.ini的内容如下:
[mysql]
ip = 127.0.0.1
port = 3306
username = root
password = 1234567

[Aes]
key = FejK34f214s03szb
iv = L9A242fGmJn9o1xn

[request]
proxy =
timeout = 5

应该如何配置呢,
第二点docker的我也搭建了一套也是同一个问题我不知道在哪里配置邮箱及授权码。
我是一个小白,请大佬指点一二,感谢~~~~

error

[error] 4102#0: *65 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: "POST /api/query HTTP/1.0", upstream: "uwsgi://0.0.0.0:8000", host: "127.0.0.1:8800",

不知道为啥出现这个问题

docker启动报错

系统版本:Linux racknerd-1bd2a3 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

docker 版本:Docker version 23.0.2, build 569dd73
报错信息: exec /ubuntu_docker_run.sh: no such file or directory
截图:
image

验证码有误

提示验证码,有误,试了多次还是提示有误

能不能添加一份操作手册

大佬能不能添加一份操作手册

使用流程是怎么样的?先添加好了目标之后,怎么添加想检测的漏洞等等

如果暂时不支持的标注一下

关于requirement安装psycopg2问题

Ubuntu 18
Python3.8
pip3 install - r python/requirement.txt
到psycopg2时,安装不下去了。
需要匹配相应的psycopg2版本吗?psycopg2==多少呢?
Collecting psycopg2 (from -r requirements.txt (line 46))
Downloading https://mirrors.aliyun.com/pypi/packages/aa/8a/7c80e7e44fb1b4277e89bd9ca509aefdd4dd1b2c547c6f293afe9f7ffd04/psycopg2-2.9.1.tar.gz (379kB)
100% |████████████████████████████████| 389kB 3.2MB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.