diff options
| author | Ben Fuhrmannek | 2020-06-15 11:51:16 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2020-06-15 11:51:16 +0200 |
| commit | 7ac1e3866ef4f146c6c93a5ca13b9aebb14e936a (patch) | |
| tree | ce57745314d905ff06119788acb56c11dcb3aede /config | |
| parent | f742d9f88bf788e38bbe832f1b75e39784f024bc (diff) | |
| parent | 7f9602ebc23582195d63eb35f1de1961297f2e00 (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'config')
| -rw-r--r-- | config/default.rules | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/config/default.rules b/config/default.rules index 82f8b5d..05dd91d 100644 --- a/config/default.rules +++ b/config/default.rules | |||
| @@ -42,6 +42,13 @@ sp.disable_function.function("mail").param("additional_parameters").value_r("\\- | |||
| 42 | # Since it's now burned, me might as well mitigate it publicly | 42 | # Since it's now burned, me might as well mitigate it publicly |
| 43 | sp.disable_function.function("putenv").param("setting").value_r("LD_").drop() | 43 | sp.disable_function.function("putenv").param("setting").value_r("LD_").drop() |
| 44 | 44 | ||
| 45 | # This one was burned in Nov 2019 - https://gist.github.com/LoadLow/90b60bd5535d6c3927bb24d5f9955b80 | ||
| 46 | sp.disable_function.function("putenv").param("setting").value_r("GCONV_").drop() | ||
| 47 | |||
| 48 | # Since people are stupid enough to use `extract` on things like $_GET or $_POST, we might as well mitigate this vector | ||
| 49 | sp.disable_function.function("extract").param("var_array").value_r("^_").drop() | ||
| 50 | sp.disable_function.function("extract").param("extract_type").value("0").drop() | ||
| 51 | |||
| 45 | # This is also burned: | 52 | # This is also burned: |
| 46 | # ini_set('open_basedir','..');chdir('..');…;chdir('..');ini_set('open_basedir','/');echo(file_get_contents('/etc/passwd')); | 53 | # ini_set('open_basedir','..');chdir('..');…;chdir('..');ini_set('open_basedir','/');echo(file_get_contents('/etc/passwd')); |
| 47 | # Since we have no way of matching on two parameters at the same time, we're | 54 | # Since we have no way of matching on two parameters at the same time, we're |
| @@ -66,16 +73,16 @@ sp.disable_function.function("exec").param("command").value_r("[$|;&`\\n\\(\\)\\ | |||
| 66 | sp.disable_function.function("proc_open").param("command").value_r("[$|;&`\\n\\(\\)\\\\]").drop(); | 73 | sp.disable_function.function("proc_open").param("command").value_r("[$|;&`\\n\\(\\)\\\\]").drop(); |
| 67 | 74 | ||
| 68 | # Prevent runtime modification of interesting things | 75 | # Prevent runtime modification of interesting things |
| 69 | sp.disable_function.function("ini_set").param("var_name").value("assert.active").drop(); | 76 | sp.disable_function.function("ini_set").param("varname").value("assert.active").drop(); |
| 70 | sp.disable_function.function("ini_set").param("var_name").value("zend.assertions").drop(); | 77 | sp.disable_function.function("ini_set").param("varname").value("zend.assertions").drop(); |
| 71 | sp.disable_function.function("ini_set").param("var_name").value("memory_limit").drop(); | 78 | sp.disable_function.function("ini_set").param("varname").value("memory_limit").drop(); |
| 72 | sp.disable_function.function("ini_set").param("var_name").value("include_path").drop(); | 79 | sp.disable_function.function("ini_set").param("varname").value("include_path").drop(); |
| 73 | sp.disable_function.function("ini_set").param("var_name").value("open_basedir").drop(); | 80 | sp.disable_function.function("ini_set").param("varname").value("open_basedir").drop(); |
| 74 | 81 | ||
| 75 | # Detect some backdoors via environnement recon | 82 | # Detect some backdoors via environnement recon |
| 76 | sp.disable_function.function("ini_get").param("var_name").value("allow_url_fopen").drop(); | 83 | sp.disable_function.function("ini_get").param("varname").value("allow_url_fopen").drop(); |
| 77 | sp.disable_function.function("ini_get").param("var_name").value("open_basedir").drop(); | 84 | sp.disable_function.function("ini_get").param("varname").value("open_basedir").drop(); |
| 78 | sp.disable_function.function("ini_get").param("var_name").value_r("suhosin").drop(); | 85 | sp.disable_function.function("ini_get").param("varname").value_r("suhosin").drop(); |
| 79 | sp.disable_function.function("function_exists").param("function_name").value("eval").drop(); | 86 | sp.disable_function.function("function_exists").param("function_name").value("eval").drop(); |
| 80 | sp.disable_function.function("function_exists").param("function_name").value("exec").drop(); | 87 | sp.disable_function.function("function_exists").param("function_name").value("exec").drop(); |
| 81 | sp.disable_function.function("function_exists").param("function_name").value("system").drop(); | 88 | sp.disable_function.function("function_exists").param("function_name").value("system").drop(); |
| @@ -131,3 +138,8 @@ sp.disable_function.function("curl_setopt").param("option").value("81").drop().a | |||
| 131 | #File upload | 138 | #File upload |
| 132 | sp.disable_function.function("move_uploaded_file").param("destination").value_r("\\.ph").drop(); | 139 | sp.disable_function.function("move_uploaded_file").param("destination").value_r("\\.ph").drop(); |
| 133 | sp.disable_function.function("move_uploaded_file").param("destination").value_r("\\.ht").drop(); | 140 | sp.disable_function.function("move_uploaded_file").param("destination").value_r("\\.ht").drop(); |
| 141 | |||
| 142 | # Logging lockdown | ||
| 143 | sp.disable_function.function("ini_set").param("varname").value_r("error_log").drop() | ||
| 144 | sp.disable_function.function("ini_set").param("varname").value_r("error_reporting").drop() | ||
| 145 | sp.disable_function.function("ini_set").param("varname").value_r("display_errors").drop() | ||
