关于Xray高级版破解:

https://www.cnblogs.com/Cl0ud/p/13884206.html

不过好像新版本的Xray修复了破解的BUG,亲测Xray1.3.3高级版仍然可以破解

因为Xray没有批量化的选项,在网上查了一下,fofa2Xray是封装好了的EXE文件,其他的好像需要配置代理之类的,反正挺麻烦,我只是想从txt里面按行读取URL进行扫描,所以昨晚上花半个小时自己写了一个小脚本实现Xray自动化批量扫描。

首先是一个大LOGO

def logo():
logo='''
_ __ _ __ _ __
| '_ \| '_ \| '_ \
| |_) | |_) | |_) |
| .__/| .__/| .__/
| | | | | |
|_| |_| |_|
__ __
\ \ / /
\ V / _ __ __ _ _ _
/ \| '__/ _` | | | |
/ /^\ \ | | (_| | |_| |
\/ \/_| \__,_|\__, |
__/ |
|___/
v1.0
author:springbird
'''
return logo

将Xray高级版破解之后路径配置在环境变量里,这样我们这个代码就不需要固定位置放置

核心是

def xrayScan(targeturl,outputfilename="test"):
scanCommand="xray.exe webscan --basic-crawler {} --html-output {}.html".format(targeturl,outputfilename)
print(scanCommand)
os.system(scanCommand)
return

os.system执行命令进行扫描,这样就实现了单个URL的脚本扫描,接着是读取TXT实现批量

def pppGet():
f = open("target.txt")
lines = f.readlines()
pattern = re.compile(r'^http://')
for line in lines:
try:
if not pattern.match(line.strip()):
targeturl="http://"+line.strip()
else:
targeturl=line.strip()
print(targeturl.strip())
outputfilename=hashlib.md5(targeturl.encode("utf-8"))
xrayScan(targeturl.strip(), outputfilename.hexdigest())
# print(type(line))
except Exception as e:
print(e)
pass
f.close()
print("Xray Scan End~")
return

这里的代码就是从文件里面读取URL,依次放在Xray里面进行扫描,放置待扫描URL的txt的名字为target.txt

最终完整代码为:

import os
import hashlib
import re

def logo():
logo='''
_ __ _ __ _ __
| '_ \| '_ \| '_ \
| |_) | |_) | |_) |
| .__/| .__/| .__/
| | | | | |
|_| |_| |_|
__ __
\ \ / /
\ V / _ __ __ _ _ _
/ \| '__/ _` | | | |
/ /^\ \ | | (_| | |_| |
\/ \/_| \__,_|\__, |
__/ |
|___/
v1.0
author:springbird
'''
return logo


def xrayScan(targeturl,outputfilename="test"):
scanCommand="xray.exe webscan --basic-crawler {} --html-output {}.html".format(targeturl,outputfilename)
print(scanCommand)
os.system(scanCommand)
return

# def test():
# pattern = re.compile(r'^http://')
# m = pattern.match('http://www.baidu.com')
# n = pattern.match('hta')
# print(m)
# print(n)
# return

def pppGet():
f = open("target.txt")
lines = f.readlines()
pattern = re.compile(r'^http://')
for line in lines:
try:
if not pattern.match(line.strip()):
targeturl="http://"+line.strip()
else:
targeturl=line.strip()
print(targeturl.strip())
outputfilename=hashlib.md5(targeturl.encode("utf-8"))
xrayScan(targeturl.strip(), outputfilename.hexdigest())
# print(type(line))
except Exception as e:
print(e)
pass
f.close()
print("Xray Scan End~")
return

def main():
print(logo())
pppGet()
return

if __name__ == '__main__':
main()

运行截图为:

其实这个批量的功能还是挺重要的,或许是Xray开发团队不想扫描器被滥用的原因才没有实现该功能,把代码放在了github上:

https://github.com/Cl0udG0d/pppXray

Xray批量化自动扫描的更多相关文章

  1. 你的应用安全吗? ——用Xray和Synk保驾护航

    一.背景 在当下软件应用的开发过程当中,自研的内部代码所占的比例逐步地减少,开源的框架和共用库已经得到了广泛的引用.如下图所示,在一个Kubernetes部署的应用当中,我们自己开发代码所占的比例可能 ...

  2. ARL资产导出对接Xray扫描

    使用ARL资产灯塔系统对目标进行资产整理的时候,能够对获取的结果进行导出: 导出之后为excel文件 想要将site中的URL导出为txt文件,再使用Xray高级版进行批量化扫描: https://w ...

  3. xray—学习笔记

    长亭xray扫描器 简介 xray (https://github.com/chaitin/xray) 是从长亭洞鉴核心引擎中提取出的社区版漏洞扫描神器,支持主动.被动多种扫描方式,自备盲打平台.可以 ...

  4. Xray学习

    Xray 目前支持的漏洞检测类型包括: XSS漏洞检测 (key: xss) SQL 注入检测 (key: sqldet) 命令/代码注入检测 (key: cmd-injection) 目录枚举 (k ...

  5. spring自动扫描、DispatcherServlet初始化流程、spring控制器Controller 过程剖析

    spring自动扫描1.自动扫描解析器ComponentScanBeanDefinitionParser,从doScan开始扫描解析指定包路径下的类注解信息并注册到工厂容器中. 2.进入后findCa ...

  6. Spring常用注解,自动扫描装配Bean

    1 引入context命名空间(在Spring的配置文件中),配置文件如下: xmlns:context="http://www.springframework.org/schema/con ...

  7. SpringMVC自动扫描@Controller注解的bean

    若要对@Controller注解标注的bean进行自动扫描,必须将<context:component-scan base-package="包路径.controller"/ ...

  8. Spring的自动扫描与管理

    通过在classpath自动扫描方式把组件纳入spring容器中管理 前面的例子我们都是使用XML的bean定义来配置组件.在一个稍大的项目中,通常会有上百个组件,如果这些这组件采用xml的bean定 ...

  9. 自动扫描FTP文件工具类 ScanFtp.java

    package com.util; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import ja ...

随机推荐

  1. git 的一些常用命令

    1. git clone **(项目地址) 克隆一个git项目到本地,将git项目拉取到本地 2. git status 查看文件状态,列出当前目录没有被git管理,以及被修改过还未提交的文件 3. ...

  2. 《<SPRING5高级编程(第5版)>_王净译》笔记-【目录】

    第一次写这玩意,不知道什么时候能写完,今天项目比较近,期望年底能看完吧. 先定个小目标 20201228 完成 第1章 Spring介绍 第2章 入门 第3章 在Spring中引入IoC和DI 第4章 ...

  3. Docker - 解决在容器内删除和主机映射的目录而报错 rm: cannot remove 'webapps': Device or resource busy 的问题

    问题背景 docker run -d --name tomcat7 -v /usr/local/tomcat/webapps:/usr/local/tomcat/webapps tomcat:7 使用 ...

  4. linux中几个文本文件查看命令

    Linux中,常用的文本文件查看命令介绍如下: 1. cat 用法: cat [options] filename options: -A: 显示全部. -E: 在每一行的后面加上"$&qu ...

  5. 剑指offer刷题(算法类_1)

    斐波那契数列 007-斐波拉契数列 题目描述 题解 代码 复杂度 008-跳台阶 题目描述 题解 代码 复杂度 009-变态跳台阶 题目描述 题解 代码 复杂度 010-矩形覆盖 题目描述 题解 代码 ...

  6. rbd的image对象数与能写入文件数的关系

    前言 收到一个问题如下: 一个300TB 的RBD,只有7800万的objects,如果存储小文件的话,感觉不够用 对于这个问题,我原来的理解是:对象默认设置的大小是4M一个,存储下去的数据,如果小于 ...

  7. xctf攻防世界——crackme writeup

    感谢xctf提供学习平台 https://adworld.xctf.org.cn crackme有壳,脱壳部分见文章: https://www.cnblogs.com/hongren/p/126332 ...

  8. 04.vue获取微博授权URL

    1.在Vue页面加载时动态发送请求获取微博授 权url 1.1 在 components\common\lab_header.vue 中写oauth动态获取微 博授权**URL // 获取微博登录地址 ...

  9. SpringBoot整合Elasticsearch7

    SpringBoot连接ElasticSearch有以下种方式, TransportClient,9300端口,在 7.x 中已经被弃用,据说在8.x 中将完全删除 restClient,9200端口 ...

  10. Codeforces Round #668 C. Balanced Bitstring (Div. 2)题解(思维)

    题目链接 题目大意 给你一个长为n的01串,要你使得每一个01串中0和1的个数都要相等,01串中有?字符,你可以使得这个字符变为0或1,要你求是否可以满足条件.输出YES或NO 题目思路 这个题目的难 ...