Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,8 @@ FORBIDDEN_KEYWORDS = [
|
|
| 31 |
"reverse shell", "sqlmap", "chmod", "chown", "exec "
|
| 32 |
]
|
| 33 |
FORBIDDEN_CMDLIKE = ["curl ", "wget ", "sudo ", "bash -i", "nc ", "ncat ", "rm -rf"]
|
| 34 |
-
|
|
|
|
| 35 |
FORBIDDEN_HEX_RE = re.compile(r"0x[0-9a-fA-F]{2,}") # compilar por separado, simple y seguro
|
| 36 |
|
| 37 |
def contains_forbidden(text: str) -> bool:
|
|
|
|
| 31 |
"reverse shell", "sqlmap", "chmod", "chown", "exec "
|
| 32 |
]
|
| 33 |
FORBIDDEN_CMDLIKE = ["curl ", "wget ", "sudo ", "bash -i", "nc ", "ncat ", "rm -rf"]
|
| 34 |
+
# OJO: usar \\x aquí para que el archivo final contenga \x y no sea interpretado como escape por Python
|
| 35 |
+
FORBIDDEN_SUBSTR = ["$(", "${", "\\x", "base64 -d"]
|
| 36 |
FORBIDDEN_HEX_RE = re.compile(r"0x[0-9a-fA-F]{2,}") # compilar por separado, simple y seguro
|
| 37 |
|
| 38 |
def contains_forbidden(text: str) -> bool:
|