Commit 0bcd17ab authored by Jorge Lajara Ruiz's avatar Jorge Lajara Ruiz
Browse files

first commit

parent 85d7a1f1
import argparse
import re
def find_payload(filename, tags=[], events=[]):
with open(filename) as f:
payload_list = f.read().splitlines()
final_tag_list = []
final_event_list = []
if tags:
for tag in tags:
regex_tag = r'\<'+tag+r'\s'
for payload in payload_list:
if re.match(regex_tag,payload):
final_tag_list.append(payload)
if events:
temp_list = []
for event in events:
regex_event = r'\s'+event+r'[^a-zA-Z0-9]'
for payload in payload_list:
if re.search(regex_event, payload):
final_event_list.append(payload)
if tags and events:
final_payload_list = intersection(final_event_list,final_tag_list)
elif tags and not events:
final_payload_list = final_tag_list
else:
final_payload_list = final_event_list
return final_payload_list
def intersection(lst1, lst2):
return list(set(lst1) & set(lst2))
def main():
parser = argparse.ArgumentParser(description='Find suitable XSS Payloads.')
parser.add_argument('-f', '--file', help='file with the payloads', required=True)
parser.add_argument('-t', '--tags', help='array with allowed tags', nargs='+')
parser.add_argument('-e', '--events', help='array with allowed events', nargs='+')
args = parser.parse_args()
filename = args.file
tags = args.tags
events = args.events
payloads = find_payload(filename,tags,events)
print("\nPayloads found:\n")
for payload in payloads:
print(payload)
if __name__== "__main__":
main()
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment