關於Xray高級版破解:
不過好像新版本的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()
運行截圖為: