安全矩阵

 找回密码
 立即注册
搜索
查看: 2371|回复: 0

Xray挂机刷漏洞

[复制链接]

991

主题

1063

帖子

4315

积分

论坛元老

Rank: 8Rank: 8

积分
4315
发表于 2021-5-8 08:36:40 | 显示全部楼层 |阅读模式
原文链接:Xray挂机刷漏洞


文章来源:渗透Xiao白帽

作者:掌控安全-happy0717

xray是北京长亭科技其下的一款漏洞扫描工具,工具很好用只是没有批量扫描的功能,今天就带大家一起批量扫描。

官方网站:https://xray.cool/

直接下载就好

xray使用:

cd E:\渗透工具\xray_windows_amd64.exe

基本爬虫扫描
./xray_windows_amd64.exe webscan —basic-crawler url —html-output 1.html

代理模式与浏览器联动
.\xray_windows_amd64.exe webscan —listen 127.0.0.1:8080 —html-output 123.html

批量检查的 1.file 中的目标, 一行一个目标,带端口 没有基本爬虫功能!!!
./xray_windows_amd64.exe webscan —url-file 60.txt —html-output 1.html
python pppXray.py -r target.txt

有这些就够用了



我习惯使用powershell运行xray,因为powershell颜色分明更好看一些。

第一次使用的时候要初始化一下。

cd 到xray的目录

比如:cd E:\渗透工具\xray_windows_amd64.exe

之后./xray_windows_amd64.exe webscan —basic-crawler {要扫描的url} —html-output 1.html

初始化完会出现config.yaml的配置文件

xray默认是不扫描edu.cn的,想挖教育src的需要手动更改




要更改的地方长这样,在config.yaml里,把edu.cn删掉就好了,应该一共有两处。
当然以上都不是重点
重点:github上有这样一款工具可以让xray批量进行扫描
下载链接:
https://github.com/Cl0udG0d/pppXray

运行需要python3的环境

pppXray和xray要放在相同的文件夹下

首先要pip安装click

cmd运行:pip install click






还有几个位置是需要手动更改的,在pppXray.py中





这个位置要改成你电脑里xray的名字

使用工具时输入

python pppXray.py -r target.txt

target.txt里可以直接放url,没有http:// 的也可以工具会自动加上。



运行时大概就是这样的




—basic-crawler是基本爬虫扫描会使用xray自带的爬虫爬取url进行漏洞扫描

—html-output

是以html形式输出漏洞报告, E:\渗透工具
\xray_windows_amd64.exe\save\a41c7ff9f598c880a1fa99ca9fbdc65a.html是输出文件路径和文件名,这一步是自动的。

之后我魔改了一下原版的pppXray
  1.     import hashlib

  2.     import re

  3.     import time

  4.     import os

  5.     import click

  6.     import config

  7.     import winsound


  8.     @click.command()

  9.     @click.option('-r','--readfile',default='target.txt',help='xray批量扫描读取文件名,按行读取',type=str)

  10.     @click.option('--plugins',help='自定义xray插件 plugins')

  11.     def init(readfile,plugins):

  12.     """pppXray : xray 批量扫描\n

  13.            https://github.com/Cl0udG0d/pppXray

  14.         """

  15.     try:

  16.     ifnot os.path.exists(config.saveDir):

  17.                 os.makedirs(config.saveDir)

  18.             config.targetFileName=readfile

  19.     if plugins:

  20.                 config.plugins=plugins

  21.             click.echo("读取文件 {} ".format(readfile))

  22.     exceptExceptionas e:

  23.     print(e)

  24.     pass



  25.     def xrayScan(targeturl,outputfilename="test"):

  26.         scanCommand ="xray_windows_amd64.exe  webscan {} --basic-crawler {} --html-output {}\\{}.html".format('--plugins {}'.format(config.plugins)if config.plugins else'',targeturl, config.saveDir,

  27.                                                                                              outputfilename)

  28.     print(scanCommand)

  29.         os.system(scanCommand)

  30.     return



  31.     def pppGet():

  32.         f = open(config.targetFileName)

  33.         lines = f.readlines()

  34.         pattern = re.compile(r'^http')

  35.     for line in lines:

  36.     try:

  37.     ifnot pattern.match(line.strip()):

  38.                     targeturl="https://"+line.strip()

  39.     else:

  40.                     targeturl=line.strip()

  41.     print(targeturl.strip())

  42.                 outputfilename=hashlib.md5(targeturl.encode("utf-8"))

  43.                 xrayScan(targeturl.strip(), outputfilename.hexdigest())

  44.     # print(type(line))

  45.     exceptExceptionas e:

  46.     print(e)

  47.     pass

  48.         f.close()

  49.     print("Xray Scan End~")

  50.         winsound.Beep(600,5000)

  51.     return


  52.     def main():

  53.     try:

  54.     print(config.logo())

  55.             init.main(standalone_mode=False)

  56.             pppGet()

  57.     exceptExceptionas e:

  58.     print(e)

  59.     pass

  60.     return


  61.     if __name__ =='__main__':

  62.         main()
复制代码

导入包

import winsound
扫描结束时
winsound.Beep(600,5000)
系统beep响5秒钟

扫描漏洞的时候人可以一边休息,扫完有提示音的时候再回来看就好了。

漏洞报告会在pppxray下的一个save文件夹里

之后漏洞报告是这样的


图中表示漏洞为XSS触发参数为colurnmid



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-9-21 05:35 , Processed in 0.012759 second(s), 18 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表