1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
import os import hashlib import re import datetime import random from time import strftime
def get_url(): f = open("url.txt") lines = f.readlines() pattern = re.compile(r'^(https|http)://') for line in lines: try: if not pattern.match(line.strip()): targeturl="http://"+line.strip() else: targeturl=line.strip()
now=datetime.datetime.now() outputfilename = now.strftime("%Y-%m-%d_") + str(random.randint(1,1000000)) do_scan(targeturl.strip(), outputfilename) except Exception as e: print(e) pass f.close() print("Xray Scan End~") return
def do_scan(targeturl,outputfilename="xray"): scan_command="xray.exe webscan --basic-crawler {} --html-output {}.html".format(targeturl,outputfilename) os.system(scan_command) return
if __name__ == '__main__': get_url()
|