From 100a1eeaf2c415a927589b278f200a25f69dfc03 Mon Sep 17 00:00:00 2001 From: Marven11 <110723864+Marven11@users.noreply.github.com> Date: Sat, 28 Oct 2023 02:55:06 +0800 Subject: [PATCH] Add tests --- tests/test_full_payload_gen.py | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/test_full_payload_gen.py b/tests/test_full_payload_gen.py index 873b100..1dc1842 100644 --- a/tests/test_full_payload_gen.py +++ b/tests/test_full_payload_gen.py @@ -168,6 +168,57 @@ def setUp(self) -> None: self.full_payload_gen = get_full_payload_gen(self.blacklist) +class FullPayloadGenTestCaseStringFormat1(FullPayloadGenTestCaseSimple): + def setUp(self) -> None: + super().setUp() + self.blacklist = [ + "_", + "'", + '"', + ".", + "system", + "os", + "eval", + "exec", + "popen", + "subprocess", + "posix", + "builtins", + "namespace", + "open", + "read", + "\\", + "=", + "%" + ] + self.full_payload_gen = get_full_payload_gen(self.blacklist) + +class FullPayloadGenTestCaseStringFormat2(FullPayloadGenTestCaseSimple): + def setUp(self) -> None: + super().setUp() + self.blacklist = [ + "_", + "'", + '"', + ".", + "system", + "os", + "eval", + "exec", + "popen", + "subprocess", + "posix", + "builtins", + "namespace", + "open", + "read", + "\\", + "=", + "%", + "|format" + ] + self.full_payload_gen = get_full_payload_gen(self.blacklist) + class FullPayloadGenTestCaseSubs(FullPayloadGenTestCaseSimple): def setUp(self) -> None: super().setUp()