From f3ae29b9f79b57b58ac3599395ad646aee5e6324 Mon Sep 17 00:00:00 2001 From: ox01024 <52460705+ox01024@users.noreply.github.com> Date: Sun, 29 Nov 2020 08:24:38 +0800 Subject: [PATCH] =?UTF-8?q?2020=EF=BC=9A11=EF=BC=9A29=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E7=89=88=E6=9C=AC=20=E5=85=B3=E4=BA=8E?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E5=92=8C=E5=85=B3=E9=97=AD=E4=B8=BB?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=8D=B4=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD?= =?UTF-8?q?xray=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- Scan.py | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9be0fe0..ec708a1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Xray_Rad_Fusion -只需配置xray和rad的路径 +~~只需配置xray和rad的路径~~ +需将xray和rad与Scan.py放置同一目录下并更改Scan文件中关于xray和rad的名字 -并添加目标到**target.txt**中使用python3.8运行即可开始享受吧! +~~并添加目标到**target.txt**中使用python3.8运行即可开始享受吧!~~ ###logs: 2020:8:22 输出html结果添加时间戳,不用使用前删除之前的results文件 + 2020:11:29 修复上一版本 关于时间戳和关闭主程序却无法关闭xray的BUG diff --git a/Scan.py b/Scan.py index 2315d79..0f6410b 100644 --- a/Scan.py +++ b/Scan.py @@ -1,18 +1,20 @@ import time import subprocess -#rad路径(建议使用相对路径) -radPath="./Rad/rad.exe" -#xray路径(建议使用相对路径) -xrayPath="./Xray/xray_windows_amd64.exe" +import os +#rad名字(必须将此文件与rad程序放在同一目录) +radName="rad_windows_amd64.exe" +#xray名字(必须将此文件与rad程序放在同一目录) +xrayName="xray_windows_amd64.exe" #xray代理地址 xrayProxy="127.0.0.1:7777" -def Scan(target,startxray): - cmd = [radPath,"-t",target,"-http-proxy",xrayProxy] +def Scan(target): + cmd = [radName,"-t",target,"-http-proxy",xrayProxy] rsp=subprocess.Popen(cmd,start_new_session=True) rsp.communicate() with open("target.txt","r") as targats: - result=time.strftime("%Y-%m-%d/%H:%M:%S",time.localtime()) - xrayShell = [xrayPath, "webscan", "--listen", xrayProxy, "--html-output", result] - startxray = subprocess.Popen(xrayShell) + outputPath=time.strftime("%Y%m%d%H%M%S",time.localtime()) + xrayShell = "start cmd /k "+xrayName+" webscan"+" --listen "+xrayProxy+" --html-output "+outputPath+".html" + os.system(xrayShell) while targat :=targats.readline().strip("\n"): - Scan(targat,startxray) \ No newline at end of file + Scan(targat) +