I want to ask.
- url = [domaina.com/def, domainb.com/abc, domainc.com/]
- payload = [abc, def, ghi]
how to call url and payload together using regex if match, for example:
- domaina.com/abc
- domaina.com/def
then
domainb.com/abc
domainb.com/def
import re import csv import collections def log_file_reader(filename): f = open(filename, "r") #log = f.read() #payload = a.read() for url in f: a = open("xss.txt", encoding='utf-8') for payload in a: #regex = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' ip_list = re.findall(payload, url) return ip_list #print(payload, url) if __name__ == "__main__": log_file_reader('url')
call url and payload together using regex? Judging from your code, the expected result will be the list of url which matches the payload:domaina.com/defanddomainb.com/abc, correct?