本文由 简悦 SimpRead 转码, 原文地址 mp.weixin.qq.com
公众号
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
import hashlib
import re
import time
import os
import click
import config
import winsound
@click.command()
@click.option('-r', '--readfile',default='target.txt',help='xray批量扫描读取文件名,按行读取',type=str)
@click.option('--plugins',help='自定义xray插件 plugins')
def init(readfile,plugins):
"""pppXray : xray 批量扫描\n
https://github.com/Cl0udG0d/pppXray
"""
try:
if not os.path.exists(config.saveDir):
os.makedirs(config.saveDir)
config.targetFileName=readfile
if plugins:
config.plugins=plugins
click.echo("读取文件 {} ".format(readfile))
except Exception as e:
print(e)
pass
def xrayScan(targeturl,outputfile):
scanCommand = "xray_windows_amd64.exe webscan {} --basic-crawler {} --html-output {}\\{}.html".format('--plugins {}'.format(config.plugins) if config.plugins else '',targeturl, config.saveDir,
outputfilename)
print(scanCommand)
os.system(scanCommand)
return
def pppGet():
f = open(config.targetFileName)
lines = f.readlines()
pattern = re.compile(r'^http')
for line in lines:
try:
if not pattern.match(line.strip()):
targeturl="https://"+line.strip()
else:
targeturl=line.strip()
print(targeturl.strip())
outputfile))
xrayScan(targeturl.strip(), outputfilename.hexdigest())
# print(type(line))
except Exception as e:
print(e)
pass
f.close()
print("Xray Scan End~")
winsound.Beep(600,5000)
return
def main():
try:
print(config.logo())
init.main(standalone_mode=False)
pppGet()
except Exception as e:
print(e)
pass
return
if __name__ == '__main__':
main()
导入包
import winsound
扫描结束时
winsound.Beep(600,5000)
系统 beep 响 5 秒钟
扫描漏洞的时候人可以一边休息,扫完有提示音的时候再回来看就好了。
漏洞报告会在 pppxray 下的一个 save 文件夹里
之后漏洞报告是这样的
学习更多黑客技能!体验靶场实战练习
(黑客视频资料及工具)
往期推荐
[
干货 | 23 个非常实用的 Shell 拿来就用脚本实例
[
用 Python 写了一个窃取摄像头照片的软件
[
实战 | 深入某诈骗团队
[
被勒索 15 亿,与黑客之间的佛系斗智斗勇,笑喷了……
[
Fofa+Xray 联合实现批量挖洞
[
【教程】局域网内截断别人的网络
[
真香实战:从弱口令到批量拿下服务器