completed tag class def
This commit is contained in:
parent
9e0ea55f29
commit
196ffdcd4f
17
language.py
17
language.py
@ -8,6 +8,23 @@ class HTMLTag:
|
|||||||
self.attributes = []
|
self.attributes = []
|
||||||
self.children = []
|
self.children = []
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
tag = ""
|
||||||
|
if self.self_closing:
|
||||||
|
tag = f"<{self.name} "
|
||||||
|
for attr in self.attributes:
|
||||||
|
tag += f"{attr} "
|
||||||
|
tag += "/>"
|
||||||
|
else:
|
||||||
|
tag = f"<{self.name}"
|
||||||
|
for attr in self.attributes:
|
||||||
|
tag += f"{attr} "
|
||||||
|
tag += ">"
|
||||||
|
for child in self.children:
|
||||||
|
tag += f"{child}"
|
||||||
|
tag += f"</{self.name}>"
|
||||||
|
return tag
|
||||||
|
|
||||||
|
|
||||||
class HTMLTagAttributeType:
|
class HTMLTagAttributeType:
|
||||||
TypeText = 0
|
TypeText = 0
|
||||||
|
8
xzzuf.py
8
xzzuf.py
@ -10,6 +10,14 @@ from tags import Attributes
|
|||||||
|
|
||||||
# WAFBypass class
|
# WAFBypass class
|
||||||
|
|
||||||
|
from language import HTMLTag, HTMLAttribute, HTMLTagAttributeType
|
||||||
|
|
||||||
|
t = HTMLTag("form")
|
||||||
|
i = HTMLTag("input", self_closing=True)
|
||||||
|
i.attributes.append(HTMLAttribute("type", HTMLTagAttributeType.TypeText))
|
||||||
|
t.children.append(i)
|
||||||
|
print(t)
|
||||||
|
|
||||||
|
|
||||||
class WAFBypass():
|
class WAFBypass():
|
||||||
code = "window.alert_trigger = false;window.alert = function() {window.alert_trigger = true;}"
|
code = "window.alert_trigger = false;window.alert = function() {window.alert_trigger = true;}"
|
||||||
|
Loading…
Reference in New Issue
Block a user