Python deployment rad+xray automation

Write in front

Running automation is usually one of the options for digging holes, so it is definitely an indispensable part to scan with a missing scan tool, but the tool must not be run locally. The first is to prevent the IP from being banned due to excessive packet volume. , The second is that you want to sleep, you can’t. After one run, you manually select the next target to run (oh I’m lazy, that’s okay)

Speaking of it, I have "magically modified" a project of other people before, but the reason why I put a double quotation mark is that I later discovered that I didn't change anything at all. .

This script is for the xray advanced version, the community version will talk about it later, I am a lazy dog

Body

surroundings

First install rad

rad github:
https://github.com/chaitin/rad
download link:
https://github.com/chaitin/rad/releases

Execute commands in the server

wget https://github.com/chaitin/rad/releases/download/0.2/rad_linux_386.zip && unzip rad_linux_386.zip && mv rad_linux_386 rad && chmod 777 rad

If your server does not have unzip, you need a separate

apt install unzip -y

Then install xray

xray github:
https://github.com/chaitin/xray
download link:
https://github.com/chaitin/xray/releases

Execute the following command to download xray and give permission

wget https://github.com/chaitin/xray/releases/download/1.3.3/xray_linux_386.zip && unzip xray_linux_386.zip && mv xray_linux_386 xray && chmod 777 xray

Then put the xray-license.lic file in the same directory (lic file of the advanced version)

My script reads the domain name from result-1.txt, that is, you put the domain names you need to scan in batches into this file, and then run it

Put this script together with xray and rad

import subprocess
sub_list=open("result-1.txt",'r',encoding='utf-8')
num=1for i in sub_list:
 result_save_filename="result-"+str(num)+".html"
 i=i.replace('\n','')
 dd="xray webscan --browser-crawler "+str(i)+" --html-output "+result_save_filename
 cmd=[dd] #dd is my cat, he is very cute, so I named it
 rsp = subprocess.Popen(cmd ,shell=True)
 rsp.wait()print("Subdomain: "+str(i)+" is Done!")
 num+=1

When you run, remember to enter the screen to run. If you don’t do it, then you only need to disconnect ssh, then the session ends, and the things you are running will also end. This thing is not detailed, Baidu is more detailed than me, only The essential

screen -S <session_name> #Create a session named xxx
screen -r <session_name> #Go back to the session named xxx

If -r can't get in, you can consider

screen -d -r <session_name>

When running, if you don’t want to watch the full screen swipe, you can consider

python3 elapse.py > shell.txt &

then

tail -n 10 shell.txt

Can

Finally, a big integration

mkdir xray && cd xray && wget https://github.com/chaitin/rad/releases/download/0.2/rad_linux_386.zip && unzip rad_linux_386.zip && mv rad_linux_386 rad && chmod 777 rad && wget https://github.com/chaitin/xray/releases/download/1.3.3/xray_linux_386.zip && unzip xray_linux_386.zip && mv xray_linux_386 xray && chmod 777 xray

Recommended Posts

Python deployment rad+xray automation
Python and scrapy deployment in centos environment
Some Centos Python production environment deployment commands