diff options
| author | Ben Fuhrmannek | 2021-08-02 10:42:12 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-08-02 10:42:12 +0200 |
| commit | 4cda0120313dfd5d71236f6faf87416e93f5f89c (patch) | |
| tree | 0c2c6d15e8ac5287fb3304f96de719547d9e847a /config/default.rules | |
| parent | 6c132e6a1d8d339a20282afb5a4af52eb6bce9db (diff) | |
| parent | e62f226c3ed885808c832040872fc2d73ca46dac (diff) | |
Merge branch 'master' of https://github.com/jvoisin/snuffleupagus
Diffstat (limited to 'config/default.rules')
| -rw-r--r-- | config/default.rules | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/config/default.rules b/config/default.rules index 05dd91d..ea65e01 100644 --- a/config/default.rules +++ b/config/default.rules | |||
| @@ -33,8 +33,9 @@ sp.disable_xxe.enable(); | |||
| 33 | # https://snuffleupagus.readthedocs.io/features.html#protection-against-cross-site-request-forgery | 33 | # https://snuffleupagus.readthedocs.io/features.html#protection-against-cross-site-request-forgery |
| 34 | sp.cookie.name("PHPSESSID").samesite("lax"); | 34 | sp.cookie.name("PHPSESSID").samesite("lax"); |
| 35 | 35 | ||
| 36 | # Harden the `chmod` function | 36 | # Harden the `chmod` function (0777 (oct = 511, 0666 = 438) |
| 37 | sp.disable_function.function("chmod").param("mode").value_r("^[0-9]{2}[67]$").drop(); | 37 | sp.disable_function.function("chmod").param("mode").value("438").drop(); |
| 38 | sp.disable_function.function("chmod").param("mode").value("511").drop(); | ||
| 38 | 39 | ||
| 39 | # Prevent various `mail`-related vulnerabilities | 40 | # Prevent various `mail`-related vulnerabilities |
| 40 | sp.disable_function.function("mail").param("additional_parameters").value_r("\\-").drop(); | 41 | sp.disable_function.function("mail").param("additional_parameters").value_r("\\-").drop(); |
| @@ -96,34 +97,7 @@ sp.disable_function.function("is_callable").param("var").value("shell_exec").dro | |||
| 96 | sp.disable_function.function("is_callable").param("var").value("proc_open").drop(); | 97 | sp.disable_function.function("is_callable").param("var").value("proc_open").drop(); |
| 97 | sp.disable_function.function("is_callable").param("var").value("passthru").drop(); | 98 | sp.disable_function.function("is_callable").param("var").value("passthru").drop(); |
| 98 | 99 | ||
| 99 | # Commenting sqli related stuff to improve performance. | 100 | # Ghetto error-based sqli detection |
| 100 | # TODO figure out why these functions can't be hooked at startup | ||
| 101 | # Ghetto sqli hardening | ||
| 102 | # sp.disable_function.function("mysql_query").param("query").value_r("/\\*").drop(); | ||
| 103 | # sp.disable_function.function("mysql_query").param("query").value_r("--").drop(); | ||
| 104 | # sp.disable_function.function("mysql_query").param("query").value_r("#").drop(); | ||
| 105 | # sp.disable_function.function("mysql_query").param("query").value_r(";.*;").drop(); | ||
| 106 | # sp.disable_function.function("mysql_query").param("query").value_r("benchmark").drop(); | ||
| 107 | # sp.disable_function.function("mysql_query").param("query").value_r("sleep").drop(); | ||
| 108 | # sp.disable_function.function("mysql_query").param("query").value_r("information_schema").drop(); | ||
| 109 | |||
| 110 | # sp.disable_function.function("mysqli_query").param("query").value_r("/\\*").drop(); | ||
| 111 | # sp.disable_function.function("mysqli_query").param("query").value_r("--").drop(); | ||
| 112 | # sp.disable_function.function("mysqli_query").param("query").value_r("#").drop(); | ||
| 113 | # sp.disable_function.function("mysqli_query").param("query").value_r(";.*;").drop(); | ||
| 114 | # sp.disable_function.function("mysqli_query").param("query").value_r("benchmark").drop(); | ||
| 115 | # sp.disable_function.function("mysqli_query").param("query").value_r("sleep").drop(); | ||
| 116 | # sp.disable_function.function("mysqli_query").param("query").value_r("information_schema").drop(); | ||
| 117 | |||
| 118 | # sp.disable_function.function("PDO::query").param("query").value_r("/\\*").drop(); | ||
| 119 | # sp.disable_function.function("PDO::query").param("query").value_r("--").drop(); | ||
| 120 | # sp.disable_function.function("PDO::query").param("query").value_r("#").drop(); | ||
| 121 | # sp.disable_function.function("PDO::query").param("query").value_r(";.*;").drop(); | ||
| 122 | # sp.disable_function.function("PDO::query").param("query").value_r("benchmark\\s*\\(").drop(); | ||
| 123 | # sp.disable_function.function("PDO::query").param("query").value_r("sleep\\s*\\(").drop(); | ||
| 124 | # sp.disable_function.function("PDO::query").param("query").value_r("information_schema").drop(); | ||
| 125 | |||
| 126 | # Ghetto sqli detection | ||
| 127 | # sp.disable_function.function("mysql_query").ret("FALSE").drop(); | 101 | # sp.disable_function.function("mysql_query").ret("FALSE").drop(); |
| 128 | # sp.disable_function.function("mysqli_query").ret("FALSE").drop(); | 102 | # sp.disable_function.function("mysqli_query").ret("FALSE").drop(); |
| 129 | # sp.disable_function.function("PDO::query").ret("FALSE").drop(); | 103 | # sp.disable_function.function("PDO::query").ret("FALSE").drop(); |
