From 8892591007819fd413ef58457741f7bc2a2d364f Mon Sep 17 00:00:00 2001 From: Mohamed Dief Date: Mon, 19 Apr 2021 22:21:54 +0200 Subject: [PATCH] Block arguments. --- assets/CommandInjection.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/CommandInjection.py b/assets/CommandInjection.py index 5b2a536..7dce0f4 100644 --- a/assets/CommandInjection.py +++ b/assets/CommandInjection.py @@ -1,5 +1,15 @@ +import re + def commandInjection(argument , RCE): for char in argument: if char in RCE: return False - return True \ No newline at end of file + argumentFinder = re.search(r"(..*\-|^\-)[a-zA-Z]", argument) + if argumentFinder != None: + argument = argument.split(' ')[1].strip() + if not argument.startswith('https://') or not argument.startswith('http://'): + return False + else: + return True + else: + return True