mirror of
https://github.com/danielmiessler/SecLists.git
synced 2026-08-12 16:57:40 +00:00
Made files robot friendly
This commit is contained in:
Regular → Executable
+26
-3
@@ -2,9 +2,9 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
import xml.etree.ElementTree as et
|
||||
|
||||
if not sys.argv[1]:
|
||||
if len(sys.argv) == 1:
|
||||
exit(0)
|
||||
|
||||
files=sys.argv[1].split(" ")
|
||||
@@ -15,4 +15,27 @@ for i in files:
|
||||
exit(2)
|
||||
|
||||
for i in files:
|
||||
ET
|
||||
xml_file = et.parse(i)
|
||||
|
||||
contents = []
|
||||
|
||||
for j in xml_file.getroot().findall("attack"):
|
||||
xss = j.find('code').text
|
||||
|
||||
if not xss:
|
||||
continue
|
||||
|
||||
if "\n" in xss:
|
||||
print("Xss have newline in it.")
|
||||
print(xss, "\n")
|
||||
|
||||
contents.append(xss)
|
||||
|
||||
file_dir, file_name = i.rsplit("/", 1)
|
||||
file_name = os.path.join(file_dir, file_name.rsplit(".", 1)[0] + ".txt")
|
||||
|
||||
open(file_name, "w").write("\n".join(contents))
|
||||
|
||||
print(f"Wrote to {file_name}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user