diff --git a/language.py b/language.py index 227ba14..c3d0bd2 100644 --- a/language.py +++ b/language.py @@ -8,6 +8,23 @@ class HTMLTag: self.attributes = [] 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"" + return tag + class HTMLTagAttributeType: TypeText = 0 diff --git a/xzzuf.py b/xzzuf.py index 7b3773a..d0463ad 100644 --- a/xzzuf.py +++ b/xzzuf.py @@ -10,6 +10,14 @@ from tags import Attributes # 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(): code = "window.alert_trigger = false;window.alert = function() {window.alert_trigger = true;}"