diff options
| author | Connor Carr | 2017-10-08 17:06:55 +0100 |
|---|---|---|
| committer | jvoisin | 2017-10-08 18:06:55 +0200 |
| commit | 21e6837c1c8442eb01e069b87a01e5996d41f2e9 (patch) | |
| tree | f97931aef6ea060a9d761c4acb62d6d3e9a6eaa2 | |
| parent | 99f18f7818f8f3ee354c78276d7cd981312c7d43 (diff) | |
Grammar/Punctuation changes (#29)
| -rw-r--r-- | doc/source/config.rst | 74 | ||||
| -rw-r--r-- | doc/source/faq.rst | 34 | ||||
| -rw-r--r-- | doc/source/features.rst | 73 | ||||
| -rw-r--r-- | doc/source/index.rst | 9 | ||||
| -rw-r--r-- | doc/source/installation.rst | 6 |
5 files changed, 97 insertions, 99 deletions
diff --git a/doc/source/config.rst b/doc/source/config.rst index 7170385..1b2ed09 100644 --- a/doc/source/config.rst +++ b/doc/source/config.rst | |||
| @@ -2,33 +2,33 @@ Configuration | |||
| 2 | ============= | 2 | ============= |
| 3 | 3 | ||
| 4 | Since PHP *ini-like* configuration model isn't flexible enough, | 4 | Since PHP *ini-like* configuration model isn't flexible enough, |
| 5 | Snuffleupagus is using its own format, in the file specified by | 5 | Snuffleupagus is using its own format in the file specified by |
| 6 | the directive ``sp.configuration_file`` (in your ``php.ini`` file), | 6 | the directive ``sp.configuration_file`` (in your ``php.ini`` file), |
| 7 | like ``sp.configuration_file=/etc/php/conf.d/snuffleupagus.ini``. | 7 | like ``sp.configuration_file=/etc/php/conf.d/snuffleupagus.ini``. |
| 8 | 8 | ||
| 9 | Options are chainable by using dots (``.``), and string parameters | 9 | Options are chainable by using dots (``.``) and string parameters |
| 10 | **must** be quoted, while booleans and integers aren't. | 10 | **must** be quoted, while booleans and integers aren't. |
| 11 | 11 | ||
| 12 | Comments are prefixed either with ``#``, or ``;``. | 12 | Comments are prefixed either with ``#``, or ``;``. |
| 13 | 13 | ||
| 14 | Some rules applies in a specific ``function`` (context), on a specific ``variable`` | 14 | Some rules apply in a specific ``function`` (context) on a specific ``variable`` |
| 15 | (data), like ``disable_functions``, others can only be enabled/disabled, like | 15 | (data), like ``disable_functions``. Others can only be enabled/disabled, like |
| 16 | ``harden_random``. | 16 | ``harden_random``. |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | .. warning:: | 19 | .. warning:: |
| 20 | 20 | ||
| 21 | Careful, a wrongly configured Snuffleupagus might break your website. | 21 | If you configure Snuffleupagus incorrectly, you could break your website. |
| 22 | It's up to you to understand its :doc:`features <features>`, | 22 | It's up to you to understand the :doc:`features <features>`, |
| 23 | read the present documentation about how to configure them, | 23 | read the present documentation about how to configure them, |
| 24 | evaluate your threat model, and write your configuration file accordingly. | 24 | evaluate your threat model and write your configuration file accordingly. |
| 25 | 25 | ||
| 26 | Most of the features can be used in ``simulation`` mode by appending the | 26 | Most of the features can be used in ``simulation`` mode by appending the |
| 27 | ``.simulation()`` option to them (eg. ``sp.readonly_exec.simulation()enable();``) to see | 27 | ``.simulation()`` option to them (eg. ``sp.readonly_exec.simulation()enable();``) to see |
| 28 | if they might break your website. The simulation mode won't block the request, | 28 | whether or not they could break your website. The simulation mode won't block the request, |
| 29 | but will write a warning in the log. | 29 | but will write a warning in the log. |
| 30 | 30 | ||
| 31 | The rules are evaluated in the order that they are written, and the **first** one | 31 | The rules are evaluated in the order that they are written, the **first** one |
| 32 | to match will terminate the evaluation (except for rules in simulation mode). | 32 | to match will terminate the evaluation (except for rules in simulation mode). |
| 33 | 33 | ||
| 34 | Bugclass-killer features | 34 | Bugclass-killer features |
| @@ -70,12 +70,12 @@ It can either be ``enabled`` or ``disabled``. | |||
| 70 | global | 70 | global |
| 71 | ^^^^^^ | 71 | ^^^^^^ |
| 72 | 72 | ||
| 73 | This configuration variable contain parameters that are used by other ones: | 73 | This configuration variable contains parameters that are used by multiple functions: |
| 74 | 74 | ||
| 75 | - ``secret_key``: A secret key used by various cryptographic features, | 75 | - ``secret_key``: A secret key used by various cryptographic features, |
| 76 | like `cookies protection <features.html#session-cookie-stealing-via-xss>`__ or `unserialize protection <features.html#unserialize-related-magic>`__, | 76 | like `cookies protection <features.html#session-cookie-stealing-via-xss>`__ or `unserialize protection <features.html#unserialize-related-magic>`__, |
| 77 | so do make sure that it's random and long enough. | 77 | please ensure the length and complexity is sufficient. |
| 78 | You can generate it with something like this: ``head -c 256 /dev/urandom | tr -dc 'a-zA-Z0-9'``. | 78 | You can generate it with functions such as: ``head -c 256 /dev/urandom | tr -dc 'a-zA-Z0-9'``. |
| 79 | 79 | ||
| 80 | :: | 80 | :: |
| 81 | 81 | ||
| @@ -86,10 +86,10 @@ unserialize_hmac | |||
| 86 | * `default: disabled` | 86 | * `default: disabled` |
| 87 | * `more <features.html#unserialize-related-magic>`__ | 87 | * `more <features.html#unserialize-related-magic>`__ |
| 88 | 88 | ||
| 89 | ``unserialize_hmac`` will add integrity check to ``unserialize`` calls, preventing | 89 | ``unserialize_hmac`` will add an integrity check to ``unserialize`` calls, preventing |
| 90 | abritrary code execution in their context. | 90 | abritrary code execution in their context. |
| 91 | 91 | ||
| 92 | It can either be ``enabled`` or ``disabled``, and used in ``simulation`` mode. | 92 | It can either be ``enabled`` or ``disabled`` and can be used in ``simulation`` mode. |
| 93 | 93 | ||
| 94 | :: | 94 | :: |
| 95 | 95 | ||
| @@ -120,15 +120,15 @@ cookie_encryption | |||
| 120 | 120 | ||
| 121 | .. warning:: | 121 | .. warning:: |
| 122 | 122 | ||
| 123 | To use this feature, you **must** set the :ref:`global.secret_key <config_global>` and | 123 | To use this feature, you **must** set the :ref:`global.secret_key <config_global>` |
| 124 | and the :ref:`global.cookie_env_var <config_global>` variables. | 124 | and the :ref:`global.cookie_env_var <config_global>` variables. |
| 125 | This design decision prevents attacker from | 125 | This design decision prevents an attacker from |
| 126 | `trivially bruteforcing <https://www.idontplaydarts.com/2011/11/decrypting-suhosin-sessions-and-cookies/>`_ | 126 | `trivially bruteforcing <https://www.idontplaydarts.com/2011/11/decrypting-suhosin-sessions-and-cookies/>`_ |
| 127 | or re-using session cookies. | 127 | or re-using session cookies. |
| 128 | 128 | ||
| 129 | ``cookie_secure`` will activate transparent encryption of specific cookies. | 129 | ``cookie_secure`` will activate transparent encryption of specific cookies. |
| 130 | 130 | ||
| 131 | It can either be ``enabled`` or ``disabled``, and used in ``simulation`` mode. | 131 | It can either be ``enabled`` or ``disabled`` and can be used in ``simulation`` mode. |
| 132 | 132 | ||
| 133 | :: | 133 | :: |
| 134 | 134 | ||
| @@ -138,22 +138,22 @@ It can either be ``enabled`` or ``disabled``, and used in ``simulation`` mode. | |||
| 138 | Choosing the proper environment variable | 138 | Choosing the proper environment variable |
| 139 | """""""""""""""""""""""""""""""""""""""" | 139 | """""""""""""""""""""""""""""""""""""""" |
| 140 | 140 | ||
| 141 | It's up to you to chose a meaningul environment variable to derive the key from. | 141 | It's up to you to choose a meaningful environment variable to derive the key from. |
| 142 | Suhosin `is using <https://www.suhosin.org/stories/configuration.html#suhosin-session-cryptraddr>`_ | 142 | Suhosin `is using <https://www.suhosin.org/stories/configuration.html#suhosin-session-cryptraddr>`_ |
| 143 | the ``REMOTE_ADDR`` one, tying the validity of the cookie to the IP address of the user; | 143 | the ``REMOTE_ADDR`` one, tying the validity of the cookie to the IP address of the user; |
| 144 | unfortunately, nowadays, people are `roaming <https://en.wikipedia.org/wiki/Roaming>`_ a lot on their smartphone, | 144 | unfortunately, nowadays, people are `roaming <https://en.wikipedia.org/wiki/Roaming>`_ a lot on their smartphone, |
| 145 | hopping from WiFi to 4G, … | 145 | hopping from WiFi to 4G. |
| 146 | 146 | ||
| 147 | This is why we recommend, if possible, to use the *extended master secret* | 147 | This is why we recommend, if possible, to use the *extended master secret* |
| 148 | from TLS connections (`RFC7627 <https://tools.ietf.org/html/rfc7627>`_) | 148 | from TLS connections (`RFC7627 <https://tools.ietf.org/html/rfc7627>`_) |
| 149 | instead, to make the valitity of the cookie TLS-dependent, by using the ``SSL_SESSION_ID`` variable. | 149 | instead. The will make the validity of the cookie TLS-dependent, by using the ``SSL_SESSION_ID`` variable. |
| 150 | 150 | ||
| 151 | - In `Apache <https://httpd.apache.org/docs/current/mod/mod_ssl.html>`_, | 151 | - In `Apache <https://httpd.apache.org/docs/current/mod/mod_ssl.html>`_, |
| 152 | it possible to enable by adding ``SSLOptions StdEnvVars`` in your Apache2 configuration. | 152 | it is possible to enable by adding ``SSLOptions StdEnvVars`` in your Apache2 configuration. |
| 153 | - In `nginx <https://nginx.org/en/docs/http/ngx_http_ssl_module.html#variables>`_, | 153 | - In `nginx <https://nginx.org/en/docs/http/ngx_http_ssl_module.html#variables>`_, |
| 154 | you have to use ``fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty;``. | 154 | you have to use ``fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty;``. |
| 155 | 155 | ||
| 156 | If you're not using TLS (you should.), you can always use the ``REMOTE_ADDR`` one, | 156 | If you aren't using TLS (you should be), you can always use the ``REMOTE_ADDR`` one, |
| 157 | or ``X-Real-IP`` if you're behind a reverse proxy. | 157 | or ``X-Real-IP`` if you're behind a reverse proxy. |
| 158 | 158 | ||
| 159 | readonly_exec | 159 | readonly_exec |
| @@ -162,7 +162,7 @@ readonly_exec | |||
| 162 | 162 | ||
| 163 | ``readonly_exec`` will prevent the execution of writable PHP files. | 163 | ``readonly_exec`` will prevent the execution of writable PHP files. |
| 164 | 164 | ||
| 165 | It can either be ``enabled`` or ``disabled``, and used in ``simulation`` mode. | 165 | It can either be ``enabled`` or ``disabled`` and can be used in ``simulation`` mode. |
| 166 | 166 | ||
| 167 | :: | 167 | :: |
| 168 | 168 | ||
| @@ -174,7 +174,7 @@ upload_validation | |||
| 174 | * `more <features.html#remote-code-execution-via-file-upload>`__ | 174 | * `more <features.html#remote-code-execution-via-file-upload>`__ |
| 175 | 175 | ||
| 176 | ``upload_validation`` will call a given script upon a file upload, with the path | 176 | ``upload_validation`` will call a given script upon a file upload, with the path |
| 177 | to the file being uploaded as argument, and various information about it in the environment: | 177 | to the file being uploaded as argument and various information about it in the environment: |
| 178 | 178 | ||
| 179 | * ``SP_FILENAME``: the name of the uploaded file | 179 | * ``SP_FILENAME``: the name of the uploaded file |
| 180 | * ``SP_FILESIZE``: the size of the file being uploaded | 180 | * ``SP_FILESIZE``: the size of the file being uploaded |
| @@ -185,10 +185,10 @@ This feature can be used, for example, to check if an uploaded file contains php | |||
| 185 | code, with something like `vld <https://derickrethans.nl/projects.html#vld>`_ | 185 | code, with something like `vld <https://derickrethans.nl/projects.html#vld>`_ |
| 186 | (``php -d vld.execute=0 -d vld.active=1 -d extension=vld.so yourfile.php``). | 186 | (``php -d vld.execute=0 -d vld.active=1 -d extension=vld.so yourfile.php``). |
| 187 | 187 | ||
| 188 | The upload will be **allowed** if the script return the value ``0``. Every other | 188 | The upload will be **allowed** if the script returns the value ``0``. Every other |
| 189 | value will prevent the file from being uploaded. | 189 | value will prevent the file from being uploaded. |
| 190 | 190 | ||
| 191 | It can either be ``enabled`` or ``disabled``, and used in ``simulation`` mode. | 191 | It can either be ``enabled`` or ``disabled`` and can be used in ``simulation`` mode. |
| 192 | 192 | ||
| 193 | :: | 193 | :: |
| 194 | 194 | ||
| @@ -210,8 +210,8 @@ disable_xxe | |||
| 210 | Virtual-patching | 210 | Virtual-patching |
| 211 | ---------------- | 211 | ---------------- |
| 212 | 212 | ||
| 213 | Snuffleupagus provides virtual-patching, via the ``disable_functions`` directive, allowing you to stop or control dangerous behaviours. | 213 | Snuffleupagus provides virtual-patching via the ``disable_functions`` directive, allowing you to stop or control dangerous behaviours. |
| 214 | Admitting you have a call to ``system()`` that lacks proper user-input validation, thus leading to an **RCE**, this might be the right tool. | 214 | In the situation where you have a call to ``system()`` that lacks proper user-input validation, this could cause issues as it would lead to an **RCE**. The virtual-patching would allow this to be prevented. |
| 215 | 215 | ||
| 216 | :: | 216 | :: |
| 217 | 217 | ||
| @@ -219,7 +219,7 @@ Admitting you have a call to ``system()`` that lacks proper user-input validatio | |||
| 219 | sp.disable_functions.function("system").filename("id.php").param("cmd").value("id").allow(); | 219 | sp.disable_functions.function("system").filename("id.php").param("cmd").value("id").allow(); |
| 220 | sp.disable_functions.function("system").filename("id.php").drop() | 220 | sp.disable_functions.function("system").filename("id.php").drop() |
| 221 | 221 | ||
| 222 | Of course, this is a trivial example, and a lot can be achieved with this feature, as you will see below. | 222 | Of course, this is a trivial example, a lot can be achieved with this feature, as you will see below. |
| 223 | 223 | ||
| 224 | 224 | ||
| 225 | Filters | 225 | Filters |
| @@ -238,7 +238,7 @@ Filters | |||
| 238 | - ``ret(value)``: match on the function's return ``value`` | 238 | - ``ret(value)``: match on the function's return ``value`` |
| 239 | - ``ret_r(regexp)``: match with a ``regexp`` on the function's return | 239 | - ``ret_r(regexp)``: match with a ``regexp`` on the function's return |
| 240 | - ``ret_type(type_name)``: match on the ``type_name`` of the function's return value | 240 | - ``ret_type(type_name)``: match on the ``type_name`` of the function's return value |
| 241 | - ``value(value)``: match on a litteral ``value`` | 241 | - ``value(value)``: match on a literal ``value`` |
| 242 | - ``value_r(regexp)``: match on a value matching the ``regexp`` | 242 | - ``value_r(regexp)``: match on a value matching the ``regexp`` |
| 243 | - ``var(name)``: match on a **local variable** ``name`` | 243 | - ``var(name)``: match on a **local variable** ``name`` |
| 244 | 244 | ||
| @@ -267,22 +267,22 @@ Details | |||
| 267 | 267 | ||
| 268 | The ``function`` filter is able to do various dereferencing: | 268 | The ``function`` filter is able to do various dereferencing: |
| 269 | 269 | ||
| 270 | - ``function("AwesomeClass::my_method")`` will match in the method ``my_method`` in the class ``AwesomeClass`` | 270 | - ``function("AwesomeClass::my_method")`` will match the method ``my_method`` in the class ``AwesomeClass`` |
| 271 | - ``function("AwesomeNamespace\\my_function")`` will match in the function ``my_function`` in the namespace ``AwesomeNamespace`` | 271 | - ``function("AwesomeNamespace\\my_function")`` will match the function ``my_function`` in the namespace ``AwesomeNamespace`` |
| 272 | 272 | ||
| 273 | The ``param`` filter is also able to do some dereferencing: | 273 | The ``param`` filter is also able to do some dereferencing: |
| 274 | 274 | ||
| 275 | - ``param(foo[bar])`` will get match on the value corresponding to the ``bar`` key in the hashtable ``foo``. | 275 | - ``param(foo[bar])`` will get a match on the value corresponding to the ``bar`` key in the hashtable ``foo``. |
| 276 | Remember that in PHP, almost every data structure is a hashtable. You can of course nest this like | 276 | Remember that in PHP, almost every data structure is a hashtable. You can of course nest this like |
| 277 | ``param(foo[bar][baz][batman])``. | 277 | ``param(foo[bar][baz][batman])``. |
| 278 | - The ``var`` filter will walk the calltrace until it finds the variable's name, or the end of it, | 278 | - The ``var`` filter will walk the calltrace until it finds the variable name, or the end of the calltrace, |
| 279 | allowing to match on global variables: ``.var("_GET[param]")`` will match on the GET parameter ``param``. | 279 | allowing the filter to match global variables: ``.var("_GET[param]")`` will match on the GET parameter ``param``. |
| 280 | 280 | ||
| 281 | For clarity's sake, the presence of the ``allow`` or ``drop`` action is **mandatory**. | 281 | For clarity, the presence of the ``allow`` or ``drop`` action is **mandatory**. |
| 282 | 282 | ||
| 283 | .. warning:: | 283 | .. warning:: |
| 284 | 284 | ||
| 285 | When you're writing rules, please do keep in mind that the **order matters**. | 285 | When you're writing rules, please do keep in mind that **the order matters**. |
| 286 | For example, if you're denying a call to ``system()`` and then allowing it in a | 286 | For example, if you're denying a call to ``system()`` and then allowing it in a |
| 287 | more narrowed way later, the call will be denied, | 287 | more narrowed way later, the call will be denied, |
| 288 | because it'll match the deny first. | 288 | because it'll match the deny first. |
diff --git a/doc/source/faq.rst b/doc/source/faq.rst index 53d65ce..71326b6 100644 --- a/doc/source/faq.rst +++ b/doc/source/faq.rst | |||
| @@ -8,19 +8,19 @@ What is Snuffleupagus? | |||
| 8 | """""""""""""""""""""" | 8 | """""""""""""""""""""" |
| 9 | 9 | ||
| 10 | Snuffleupagus is a `PHP7+ <http://php.net/manual/en/migration70.php>`_ | 10 | Snuffleupagus is a `PHP7+ <http://php.net/manual/en/migration70.php>`_ |
| 11 | module designed to drastically raising the cost of attacks against website, | 11 | module designed to drastically raise the cost of attacks against websites. This is achieved |
| 12 | by killing entire bug classes, and also providing a powerful virtual-patching system, | 12 | by killing entire bug classes and providing a powerful virtual-patching system, |
| 13 | allowing administrator to fix specific vulnerabilities without having to touch the PHP code. | 13 | allowing the administrator to fix specific vulnerabilities without having to touch the PHP code. |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | Where does the name *Snuffeupagus* comes from? | 16 | Where does the name *Snuffeupagus* come from? |
| 17 | """""""""""""""""""""""""""""""""""""""""""""" | 17 | """""""""""""""""""""""""""""""""""""""""""""" |
| 18 | 18 | ||
| 19 | Aloysius Snuffleupagus, more commonly known as Mr. Snuffleupagus, Snuffleupagus | 19 | Aloysius Snuffleupagus, more commonly known as Mr. Snuffleupagus, |
| 20 | or Snuffy for short, is one of the characters on Sesame Street, | 20 | or Snuffy for short, is one of the characters on Sesame Street, |
| 21 | the educational television program for young children. | 21 | the educational television program for young children. |
| 22 | 22 | ||
| 23 | He was created as a woolly mammoth, without tusks or (visible) ears, | 23 | He was created as a woolly mammoth without tusks or (visible) ears, |
| 24 | and has a long thick pointed tail, similar in shape to that of a dinosaur | 24 | and has a long thick pointed tail, similar in shape to that of a dinosaur |
| 25 | or other reptile. He has long thick brown hair and a trunk, or "snuffle", | 25 | or other reptile. He has long thick brown hair and a trunk, or "snuffle", |
| 26 | that drags along the ground. He is Big Bird's best friend and | 26 | that drags along the ground. He is Big Bird's best friend and |
| @@ -43,9 +43,9 @@ We're working for `NBS System <https://nbs-system.com/en/>`__, | |||
| 43 | a web hosting company (meaning that we're dealing with PHP code all day long), | 43 | a web hosting company (meaning that we're dealing with PHP code all day long), |
| 44 | with a strong focus on security. We do have hardening | 44 | with a strong focus on security. We do have hardening |
| 45 | (`kernel <https://grsecurity.net/>`_, `WAF <https://naxsi.org>`_, | 45 | (`kernel <https://grsecurity.net/>`_, `WAF <https://naxsi.org>`_, |
| 46 | `IDS <https://en.wikipedia.org/wiki/Intrusion_detection_system>`_, …) | 46 | `IDS <https://en.wikipedia.org/wiki/Intrusion_detection_system>`_, etc) |
| 47 | below the web stack, but most of the time, when a website is compromised, | 47 | below the web stack, but most of the time, when a website is compromised, |
| 48 | it's either to send ads, spam, deface it, steal data, … | 48 | it's can be to send ads, spam, deface it, steal data etc. |
| 49 | This is why we need to harden the website itself too, but we can't touch its | 49 | This is why we need to harden the website itself too, but we can't touch its |
| 50 | source code. | 50 | source code. |
| 51 | 51 | ||
| @@ -62,7 +62,7 @@ We're huge fans of `Suhosin <https://suhosin.org>`_, unfortunately: | |||
| 62 | We're using the `disable_function <https://secure.php.net/manual/en/ini.core.php#ini.disable-functions>`_ | 62 | We're using the `disable_function <https://secure.php.net/manual/en/ini.core.php#ini.disable-functions>`_ |
| 63 | directive, but unfortunately, it doesn't provide enough usable granularity (guess how many CMS are using | 63 | directive, but unfortunately, it doesn't provide enough usable granularity (guess how many CMS are using |
| 64 | the `system <https://secure.php.net/manual/en/function.system.php#refsect1-function.system-notes>`_ | 64 | the `system <https://secure.php.net/manual/en/function.system.php#refsect1-function.system-notes>`_ |
| 65 | function to perform various mandatory maintenance tasks…). | 65 | function to perform various mandatory maintenance tasks). |
| 66 | 66 | ||
| 67 | This is why we decided to write our own hardening module, in the spirit of Suhosin, | 67 | This is why we decided to write our own hardening module, in the spirit of Suhosin, |
| 68 | via virtual-patching support, and other cool new features. | 68 | via virtual-patching support, and other cool new features. |
| @@ -70,7 +70,7 @@ via virtual-patching support, and other cool new features. | |||
| 70 | What license is Snuffleupagus under and why? | 70 | What license is Snuffleupagus under and why? |
| 71 | """""""""""""""""""""""""""""""""""""""""""" | 71 | """""""""""""""""""""""""""""""""""""""""""" |
| 72 | 72 | ||
| 73 | Snuffleupagus is licensed under the `LGPL <https://www.gnu.org/copyleft/lesser.html>`_, | 73 | Snuffleupagus is licensed under the `LGPL <https://www.gnu.org/copyleft/lesser.html>`_ |
| 74 | and is developed by the fine people from `NBS System <https://nbs-system.com/>`__. | 74 | and is developed by the fine people from `NBS System <https://nbs-system.com/>`__. |
| 75 | 75 | ||
| 76 | We chose the LGPL because we don't care that much how you're using Snuffleupagus, | 76 | We chose the LGPL because we don't care that much how you're using Snuffleupagus, |
| @@ -92,22 +92,22 @@ it becomes compromised. | |||
| 92 | How mature is this project? | 92 | How mature is this project? |
| 93 | """"""""""""""""""""""""""" | 93 | """"""""""""""""""""""""""" |
| 94 | 94 | ||
| 95 | This project was floating around since early 2016, and we did the first commit | 95 | This project was floating around since early 2016 and we did the first commit |
| 96 | the 28ᵗʰ of December of the same year. We're currently in an alpha phase, | 96 | the 28ᵗʰ of December of the same year. We're currently in an alpha phase, |
| 97 | finding and fixing as much bugs as possible before the beta. | 97 | finding and fixing as many bugs as possible before the beta. |
| 98 | 98 | ||
| 99 | Are you saying that PHP isn't secure? | 99 | Are you saying that PHP isn't secure? |
| 100 | """"""""""""""""""""""""""""""""""""" | 100 | """"""""""""""""""""""""""""""""""""" |
| 101 | 101 | ||
| 102 | We don't like PHP's approach of security; namely (sometimes) adding warnings | 102 | We don't like PHP's approach of security; namely (sometimes) adding warnings |
| 103 | in the documentation and trusting the developer to not do any mistake, | 103 | in the documentation and trusting the developer to not do any mistake, |
| 104 | instead of focusing on the root cause, and killing the | 104 | instead of focusing on the root cause and killing the |
| 105 | bug class one for all. | 105 | bug class once and for all. |
| 106 | 106 | ||
| 107 | Moreover, it seems that the current attitude toward security in the PHP world | 107 | Moreover, it seems that the current attitude toward security in the PHP world |
| 108 | is to `blame the user <https://externals.io/message/100147>`_ instead of acknowledging | 108 | is to `blame the user <https://externals.io/message/100147>`_ instead of acknowledging |
| 109 | issues, as stated in their `documentation <https://wiki.php.net/security#not_a_security_issue>`_. | 109 | issues, as stated in their `documentation <https://wiki.php.net/security#not_a_security_issue>`_. |
| 110 | We do think that an security issue that "requires the use of code or settings known to be insecure" | 110 | We do think that a security issue that "requires the use of code or settings known to be insecure" |
| 111 | is still a security issue, and should be treated as such. | 111 | is still a security issue, and should be treated as such. |
| 112 | 112 | ||
| 113 | We don't have the pretention to state that Snuffleupagus will magically solve | 113 | We don't have the pretention to state that Snuffleupagus will magically solve |
| @@ -133,12 +133,12 @@ Yes. | |||
| 133 | 133 | ||
| 134 | Some options won't break anything, like :ref:`harden-rand <harden-rand-feature>`, | 134 | Some options won't break anything, like :ref:`harden-rand <harden-rand-feature>`, |
| 135 | but some like :ref:`global_strict <global-strict-feature>` | 135 | but some like :ref:`global_strict <global-strict-feature>` |
| 136 | or overly-restrictives :ref:`virtual-patching<virtual-patching-feature>` | 136 | or overly-restrictive :ref:`virtual-patching<virtual-patching-feature>` |
| 137 | rules might pretty well break your website. | 137 | rules might pretty well break your website. |
| 138 | It's up to you to configure Snuffleupaggus accordingly to your needs. | 138 | It's up to you to configure Snuffleupaggus accordingly to your needs. |
| 139 | 139 | ||
| 140 | You can also enable the ``simulation`` mode on features that you're not sure about, | 140 | You can also enable the ``simulation`` mode on features that you're not sure about, |
| 141 | to see what would snuffleupagus do to your application, before activating them for good. | 141 | to see what snuffleupagus would do to your application, before activating them for good. |
| 142 | 142 | ||
| 143 | How can I find out the problem when my application breaks? | 143 | How can I find out the problem when my application breaks? |
| 144 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""" | 144 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
diff --git a/doc/source/features.rst b/doc/source/features.rst index c0fade3..3aab1a0 100644 --- a/doc/source/features.rst +++ b/doc/source/features.rst | |||
| @@ -3,8 +3,8 @@ Features | |||
| 3 | 3 | ||
| 4 | Snuffleupagus has a lot of features that can be divided in two main categories: bug-classes | 4 | Snuffleupagus has a lot of features that can be divided in two main categories: bug-classes |
| 5 | killers and virtual-patching. The first category provides primitives to kill various | 5 | killers and virtual-patching. The first category provides primitives to kill various |
| 6 | bug families (like arbitrary code execution via ``unserialize`` for example) or rise the | 6 | bug families (like arbitrary code execution via ``unserialize`` for example) or raise the |
| 7 | cost of exploitation, the second one is a highly configurable system to patch functions in php itself. | 7 | cost of exploitation. The second category is a highly configurable system to patch functions in php itself. |
| 8 | 8 | ||
| 9 | Bug classes killed or mitigated | 9 | Bug classes killed or mitigated |
| 10 | ------------------------------- | 10 | ------------------------------- |
| @@ -12,9 +12,9 @@ Bug classes killed or mitigated | |||
| 12 | ``system`` injections | 12 | ``system`` injections |
| 13 | ^^^^^^^^^^^^^^^^^^^^^ | 13 | ^^^^^^^^^^^^^^^^^^^^^ |
| 14 | 14 | ||
| 15 | The ``system`` function execute an external program and displays the output. | 15 | The ``system`` function executes an external program and displays the output. |
| 16 | It's used to interract with various external tools, like file-format converters for example. | 16 | It is used to interact with various external tools, like file-format converters. |
| 17 | Unfortunately, passing user-controlled parameters to it often leads to an arbitrary command execution. | 17 | Unfortunately, passing user-controlled parameters to it often leads to arbitrary command execution. |
| 18 | 18 | ||
| 19 | When allowing user-supplied data to be passed to this function, | 19 | When allowing user-supplied data to be passed to this function, |
| 20 | use `escapeshellarg()` or `escapeshellcmd()` to ensure that users cannot trick | 20 | use `escapeshellarg()` or `escapeshellcmd()` to ensure that users cannot trick |
| @@ -25,7 +25,7 @@ Unfortunately, passing user-controlled parameters to it often leads to an arbitr | |||
| 25 | We're mitigating it by filtering the ``$``, ``|``, ``;``, `````, ``\n`` and ``&`` chars in our | 25 | We're mitigating it by filtering the ``$``, ``|``, ``;``, `````, ``\n`` and ``&`` chars in our |
| 26 | default configuration, making it a lot harder for an attacker to inject arbitrary commands. | 26 | default configuration, making it a lot harder for an attacker to inject arbitrary commands. |
| 27 | 27 | ||
| 28 | This family of vulnerabilities lead to various CVE, like: | 28 | This family of vulnerabilities lead to various CVE entries, like: |
| 29 | 29 | ||
| 30 | - `CVE-2017-7981 <https://tuleap.net/plugins/tracker/?aid=10159>`_: Authenticated remote code execution on Tuleap | 30 | - `CVE-2017-7981 <https://tuleap.net/plugins/tracker/?aid=10159>`_: Authenticated remote code execution on Tuleap |
| 31 | - `CVE-2014-4688 <https://www.pfsense.org/security/advisories/pfSense-SA-14_10.webgui.asc>`_: Authenticated remote code execution on pfSense | 31 | - `CVE-2014-4688 <https://www.pfsense.org/security/advisories/pfSense-SA-14_10.webgui.asc>`_: Authenticated remote code execution on pfSense |
| @@ -37,10 +37,10 @@ This family of vulnerabilities lead to various CVE, like: | |||
| 37 | ``mail``-related injections | 37 | ``mail``-related injections |
| 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 39 | 39 | ||
| 40 | This vulnerability is known `since 2011 <http://esec-pentest.sogeti.com/posts/2011/11/03/using-mail-for-remote-code-execution.html>`_, | 40 | This vulnerability has been known `since 2011 <http://esec-pentest.sogeti.com/posts/2011/11/03/using-mail-for-remote-code-execution.html>`_ |
| 41 | and was popularized by `RIPS <https://www.ripstech.com/blog/2016/roundcube-command-execution-via-email/>`_ in 2016. | 41 | and was popularized by `RIPS <https://www.ripstech.com/blog/2016/roundcube-command-execution-via-email/>`_ in 2016. |
| 42 | The last flag of the `mail` function can be used to pass various parameters to | 42 | The last flag of the `mail` function can be used to pass various parameters to |
| 43 | the underlying binary used to send emails: this can lead to an arbitrary file write, | 43 | the underlying binary used to send emails; this can lead to an arbitrary file write, |
| 44 | often meaning an arbitrary code execution. | 44 | often meaning an arbitrary code execution. |
| 45 | 45 | ||
| 46 | The ``additional_parameters`` parameter can be used to pass additional flags | 46 | The ``additional_parameters`` parameter can be used to pass additional flags |
| @@ -63,7 +63,7 @@ Session-cookie stealing via XSS | |||
| 63 | The goto payload for XSS is often to steal cookies. | 63 | The goto payload for XSS is often to steal cookies. |
| 64 | Like *Suhosin*, we are encrypting the cookies with a secret key, | 64 | Like *Suhosin*, we are encrypting the cookies with a secret key, |
| 65 | an environment variable (usually the IP of the user) | 65 | an environment variable (usually the IP of the user) |
| 66 | and its user-agent. This means that an attacker with an XSS won't be able to use | 66 | and the user's user-agent. This means that an attacker with an XSS won't be able to use |
| 67 | the stolen cookie, since he can't spoof the content of the value of the environment | 67 | the stolen cookie, since he can't spoof the content of the value of the environment |
| 68 | variable for the user. Please do read the :ref:`documentation about this feature <cookie-encryption_config>` | 68 | variable for the user. Please do read the :ref:`documentation about this feature <cookie-encryption_config>` |
| 69 | if you're planning to use it. | 69 | if you're planning to use it. |
| @@ -81,10 +81,9 @@ library because of its portability, simplicity and reduced size (a single `.h` a | |||
| 81 | Remote code execution via file-upload | 81 | Remote code execution via file-upload |
| 82 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 82 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 83 | 83 | ||
| 84 | Some PHP applications allows users to upload contents, like avatars for a forum. | 84 | Some PHP applications allows users to upload content like avatars to a forum. |
| 85 | Unfortunately, sometimes, content validation isn't implemented properly (if at all), | 85 | Unfortunately, content validation often isn't implemented properly (if at all), |
| 86 | meaning arbitrary file upload, often leading, contrary to what the documentation is saying, | 86 | meaning arbitrary file upload often leads to an arbitrary code execution, contrary to the documentation. |
| 87 | to an arbitrary code execution. | ||
| 88 | 87 | ||
| 89 | Not validating which file you operate on may mean that users can *access sensitive information* in other directories. | 88 | Not validating which file you operate on may mean that users can *access sensitive information* in other directories. |
| 90 | 89 | ||
| @@ -105,11 +104,11 @@ Unserialize-related magic | |||
| 105 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | 104 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 106 | 105 | ||
| 107 | PHP is able to *serialize* arbitrary objects, to easily store them. | 106 | PHP is able to *serialize* arbitrary objects, to easily store them. |
| 108 | Unfortunately, it's often possible to gain arbitrary code execution upon deserialization | 107 | Unfortunately, it is often possible to gain arbitrary code execution upon deserialization |
| 109 | of user-supplied serialized objects. | 108 | of user-supplied serialized objects. |
| 110 | 109 | ||
| 111 | Do not pass untrusted user input to ``unserialize()`` regardless of the options value of allowed_classes. | 110 | Do not pass untrusted user input to ``unserialize()`` regardless of the options value of allowed_classes. |
| 112 | Unserialization can result in code being loaded and executed due to object instantiation and autoloading, | 111 | Unserialization can result in code being loaded and executed due to object instantiation and autoloading |
| 113 | and a malicious user may be able to exploit this. | 112 | and a malicious user may be able to exploit this. |
| 114 | 113 | ||
| 115 | --- `The PHP documentation about serialize <https://secure.php.net/manual/en/function.serialize.php>`_ | 114 | --- `The PHP documentation about serialize <https://secure.php.net/manual/en/function.serialize.php>`_ |
| @@ -117,25 +116,25 @@ of user-supplied serialized objects. | |||
| 117 | We're killing it by exploiting the fact that PHP will discard any garbage found at the end of a serialized object, | 116 | We're killing it by exploiting the fact that PHP will discard any garbage found at the end of a serialized object, |
| 118 | allowing us to simply append a `HMAC <https://en.wikipedia.org/wiki/Hash-based_message_authentication_code>`_ | 117 | allowing us to simply append a `HMAC <https://en.wikipedia.org/wiki/Hash-based_message_authentication_code>`_ |
| 119 | at the end of strings generated by the ``serialize``, | 118 | at the end of strings generated by the ``serialize``, |
| 120 | hence guaranteeing that any object deserialized came from the application, | 119 | hence guaranteeing that any object deserialized came from the application |
| 121 | and wasn't tampered with, | 120 | and wasn't tampered with. |
| 122 | 121 | ||
| 123 | We're not encrypting it, like we do with the cookies, | 122 | We aren't encrypting it, like we do with the cookies, |
| 124 | allowing this feature to be disabled (or switch into leaning mode) | 123 | allowing this feature to be disabled (or switch into leaning mode) |
| 125 | without the need to invalidate any data. | 124 | without the need to invalidate any data. |
| 126 | 125 | ||
| 127 | .. warning:: | 126 | .. warning:: |
| 128 | 127 | ||
| 129 | This feature can't be deployed on websites that already stored serialized | 128 | This feature can't be deployed on websites that already stored serialized |
| 130 | objects (ie. in database), since they are missing the HMAC, and thus will be detected as | 129 | objects (ie. in database), since they are missing the HMAC and thus will be detected as |
| 131 | an attack. If you're in this situation, you should use this feature with the | 130 | an attack. If you're in this situation, you should use this feature with the |
| 132 | ``simulation`` mode, and switch it off once you don't have any messages in your | 131 | ``simulation`` mode, and switch it off once you don't have any messages in your |
| 133 | logs. | 132 | logs. |
| 134 | 133 | ||
| 135 | A nice side-effect of this feature is that it'll defeat various memory corruption | 134 | A nice side-effect of this feature is that it will defeat various memory corruption |
| 136 | issues related to the complexity of ``unserialize``'s implementation, | 135 | issues related to the complexity of ``unserialize``'s implementation, |
| 137 | and the amount of control if provides to an attacker, like `CVE-2016-9137, CVE-2016-9138 <https://bugs.php.net/bug.php?id=73147>`_, | 136 | and the amount of control if provides to an attacker, like `CVE-2016-9137, CVE-2016-9138 <https://bugs.php.net/bug.php?id=73147>`_, |
| 138 | `2016-7124 <https://bugs.php.net/bug.php?id=72663>`_, `CVE-2016-5771 and CVE-2016-5773 <https://www.evonide.com/how-we-broke-php-hacked-pornhub-and-earned-20000-dollar/>`_, … | 137 | `2016-7124 <https://bugs.php.net/bug.php?id=72663>`_, `CVE-2016-5771 and CVE-2016-5773 <https://www.evonide.com/how-we-broke-php-hacked-pornhub-and-earned-20000-dollar/>`_. |
| 139 | 138 | ||
| 140 | This family of vulnerabilities lead to various CVE, like: | 139 | This family of vulnerabilities lead to various CVE, like: |
| 141 | 140 | ||
| @@ -155,8 +154,8 @@ Weak-PRNG via rand/mt_rand | |||
| 155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | 154 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 156 | 155 | ||
| 157 | The functions ``rand`` and ``mt_rand`` are often used to generate random numbers used | 156 | The functions ``rand`` and ``mt_rand`` are often used to generate random numbers used |
| 158 | in sensitive context, like password generation, token creation, … | 157 | in sensitive context, like password generation, token creation. |
| 159 | Unfortunately, as said in the documentation, the quality of their entropy is low, | 158 | Unfortunately, as stated in the documentation, the quality of their entropy is low, |
| 160 | leading to the generation of guessable values. | 159 | leading to the generation of guessable values. |
| 161 | 160 | ||
| 162 | This function does not generate cryptographically secure values, and should not be used for cryptographic purposes. | 161 | This function does not generate cryptographically secure values, and should not be used for cryptographic purposes. |
| @@ -195,16 +194,16 @@ XXE | |||
| 195 | ^^^ | 194 | ^^^ |
| 196 | 195 | ||
| 197 | Despite the documentation saying nothing about this class of vulnerabilities, | 196 | Despite the documentation saying nothing about this class of vulnerabilities, |
| 198 | `XML eXternal Entitiy <https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing>`_ (XXE) are often leading to arbitrary file reading, SSRF, and sometimes even arbitrary | 197 | `XML eXternal Entity <https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing>`_ (XXE) often leads to arbitrary file reading, `SSRF <https://www.owasp.org/index.php/Server_Side_Request_Forgery>`_ and sometimes even arbitrary |
| 199 | code execution. | 198 | code execution. |
| 200 | 199 | ||
| 201 | XML documents can contain a `Document Type Definition <https://www.w3.org/TR/REC-xml/#sec-prolog-dtd>`_ (DTD), | 200 | XML documents can contain a `Document Type Definition <https://www.w3.org/TR/REC-xml/#sec-prolog-dtd>`_ (DTD), |
| 202 | enabling definition of XML entities. It's possible to define an (external) entity by an | 201 | enabling definition of XML entities. It is possible to define an (external) entity by a |
| 203 | URI, that the parser will access, and embed its content back into the document | 202 | URI, that the parser will access and embed its content back into the document |
| 204 | for further processing. | 203 | for further processing. |
| 205 | 204 | ||
| 206 | For example, providing an url like ``file:///etc/passwd`` will read | 205 | For example, providing an url like ``file:///etc/passwd`` will read |
| 207 | this file's content, and since it's not valid XML, the application | 206 | the file's content. Since the file is not valid XML, the application |
| 208 | will spit it out in an error message, thus leaking its content. | 207 | will spit it out in an error message, thus leaking its content. |
| 209 | 208 | ||
| 210 | We're killing this class of vulnerabilities by calling | 209 | We're killing this class of vulnerabilities by calling |
| @@ -212,7 +211,7 @@ the `libxml_disable_entity_loader <https://secure.php.net/manual/en/function.lib | |||
| 212 | function with its parameter set to ``true`` at startup, | 211 | function with its parameter set to ``true`` at startup, |
| 213 | and then *nop'ing* it, so it won't do anything if ever called again. | 212 | and then *nop'ing* it, so it won't do anything if ever called again. |
| 214 | 213 | ||
| 215 | This family of vulnerabilities lead to various CVE, like: | 214 | This family of vulnerabilities lead to various CVE vulnerabilities, like: |
| 216 | 215 | ||
| 217 | - `CVE-2015-5161 <https://legalhackers.com/advisories/eBay-Magento-XXE-Injection-Vulnerability.html>`_: Unauthenticated arbitrary file disclosure on Magento | 216 | - `CVE-2015-5161 <https://legalhackers.com/advisories/eBay-Magento-XXE-Injection-Vulnerability.html>`_: Unauthenticated arbitrary file disclosure on Magento |
| 218 | - `CVE-2014-8790 <https://github.com/GetSimpleCMS/GetSimpleCMS/issues/944>`_: Unauthenticated remote code execution in GetSimple CMS | 217 | - `CVE-2014-8790 <https://github.com/GetSimpleCMS/GetSimpleCMS/issues/944>`_: Unauthenticated remote code execution in GetSimple CMS |
| @@ -245,14 +244,14 @@ Virtual-patching | |||
| 245 | ^^^^^^^^^^^^^^^^ | 244 | ^^^^^^^^^^^^^^^^ |
| 246 | 245 | ||
| 247 | PHP itself exposes a number of functions that might be considered **dangerous** and that have limited legitimate use cases. | 246 | PHP itself exposes a number of functions that might be considered **dangerous** and that have limited legitimate use cases. |
| 248 | ``system()``, ``exec()``, ``dlopen()`` - for example - fall into this category. By default, PHP only allows to globally disable some functions. | 247 | ``system()``, ``exec()``, ``dlopen()`` - for example - fall into this category. By default, PHP only allows us to globally disable some functions. |
| 249 | 248 | ||
| 250 | 249 | ||
| 251 | However, (ie. ``system()``) they might have legitimate use cases in processes such as self upgrade etc., making it impossible to effectively | 250 | However, (ie. ``system()``) they might have legitimate use cases in processes such as self upgrade etc., making it impossible to effectively |
| 252 | disable them - at the risk of breaking critical features. | 251 | disable them - at the risk of breaking critical features. |
| 253 | 252 | ||
| 254 | SnuffleuPagus allows the user to restrict usage of specific functions per files, or per | 253 | Snuffleupagus allows the user to restrict usage of specific functions per file, or per |
| 255 | files with a matching (sha256) hash, thus allowing the use of such functions **only** in the intended places. | 254 | file with a matching (sha256) hash, thus allowing the use of such functions **only** in the intended places. |
| 256 | 255 | ||
| 257 | Furthermore, running the `following script <FIXME>`_ will generate an hash and line-based whitelist | 256 | Furthermore, running the `following script <FIXME>`_ will generate an hash and line-based whitelist |
| 258 | of dangerous functions, droping them everywhere else: | 257 | of dangerous functions, droping them everywhere else: |
| @@ -283,7 +282,7 @@ since every internal function from php has them. | |||
| 283 | 282 | ||
| 284 | This option provide a switch to globally activate this strict mode, | 283 | This option provide a switch to globally activate this strict mode, |
| 285 | helping to uncover vulnerabilities like the classical | 284 | helping to uncover vulnerabilities like the classical |
| 286 | `strcmp bypass <https://danuxx.blogspot.fr/2013/03/unauthorized-access-bypassing-php-strcmp.html>`_, | 285 | `strcmp bypass <https://danuxx.blogspot.fr/2013/03/unauthorized-access-bypassing-php-strcmp.html>`_ |
| 287 | and various other types mismatch. | 286 | and various other types mismatch. |
| 288 | 287 | ||
| 289 | This feature is largely inspired from the | 288 | This feature is largely inspired from the |
| @@ -297,7 +296,7 @@ If an attacker manages to upload an arbitrary file or to modify an existing one, | |||
| 297 | odds are that (thanks to the default `umask <https://en.wikipedia.org/wiki/Umask>`_) | 296 | odds are that (thanks to the default `umask <https://en.wikipedia.org/wiki/Umask>`_) |
| 298 | this file is writable by the PHP process. | 297 | this file is writable by the PHP process. |
| 299 | 298 | ||
| 300 | Snuffleupagus can prevent the execution of this kind of files. A good practise | 299 | Snuffleupagus can prevent the execution of this kind of file. A good practice |
| 301 | would be to use a different user to run PHP than for administrating the website, | 300 | would be to use a different user to run PHP than for administrating the website, |
| 302 | and using this feature to lock this up. | 301 | and using this feature to lock this up. |
| 303 | 302 | ||
| @@ -321,9 +320,9 @@ various examples and ideas of things that you might want to enable (or not). | |||
| 321 | Available functions recon | 320 | Available functions recon |
| 322 | """"""""""""""""""""""""" | 321 | """"""""""""""""""""""""" |
| 323 | 322 | ||
| 324 | After compromising a website, most of the time, the attacker does some recon | 323 | Usually after compromising a website the attacker does some recon |
| 325 | within its webshell, to check which functions are available to execute arbitrary code, | 324 | within its webshell, to check which functions are available to execute arbitrary code. |
| 326 | since it's not uncommon for some web-hoster to disable things like ``system`` or ``passthru``, | 325 | Since it's not uncommon for some web-hosts to disable things like ``system`` or ``passthru``, |
| 327 | or to check if mitigations are enabled, like ``open_basedir``. | 326 | or to check if mitigations are enabled, like ``open_basedir``. |
| 328 | This behaviour can be detected by preventing the execution of functions like ``ini_get`` | 327 | This behaviour can be detected by preventing the execution of functions like ``ini_get`` |
| 329 | or ``is_callable`` with *suspicious* parameters. | 328 | or ``is_callable`` with *suspicious* parameters. |
| @@ -352,6 +351,6 @@ queries that contains some. The same filtering idea can be used against | |||
| 352 | SQL functions that are frequently used in SQL injections, like ``sleep``, ``benchmark`` | 351 | SQL functions that are frequently used in SQL injections, like ``sleep``, ``benchmark`` |
| 353 | or strings like ``version_info``. | 352 | or strings like ``version_info``. |
| 354 | 353 | ||
| 355 | Still about SQL injections, if a function performing a query returns ``FALSE`` | 354 | On the topic of SQL injections, if a function performing a query returns ``FALSE`` |
| 356 | (indicating an error), it might be useful to dump the request for further analysis. | 355 | (indicating an error), it might be useful to dump the request for further analysis. |
| 357 | 356 | ||
diff --git a/doc/source/index.rst b/doc/source/index.rst index 6de2fa8..9b91e18 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst | |||
| @@ -1,11 +1,10 @@ | |||
| 1 | Snuffleupagus | 1 | Snuffleupagus |
| 2 | ============= | 2 | ============= |
| 3 | 3 | ||
| 4 | Snuffleupagus is a `PHP 7+ <https://secure.php.net/>`_ module designed to | 4 | Snuffleupagus is a `PHP7+ <http://php.net/manual/en/migration70.php>`_ |
| 5 | drastically raise the cost of attacks against website, by killing entire bug | 5 | module designed to drastically raise the cost of attacks against websites. This is achieved |
| 6 | classes, and also providing a powerful virtual-patching system, allowing | 6 | by killing entire bug classes and providing a powerful virtual-patching system, |
| 7 | administrator to fix specific vulnerabilities and audit suspicious behaviours | 7 | allowing the administrator to fix specific vulnerabilities without having to touch the PHP code. |
| 8 | without having to touch the PHP code. | ||
| 9 | 8 | ||
| 10 | Documentation | 9 | Documentation |
| 11 | ------------- | 10 | ------------- |
diff --git a/doc/source/installation.rst b/doc/source/installation.rst index fb68ccd..fb3e398 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst | |||
| @@ -28,9 +28,9 @@ Quickstart | |||
| 28 | make | 28 | make |
| 29 | make install | 29 | make install |
| 30 | 30 | ||
| 31 | This should install ``snuffleupagus.so`` file in your extension directory. | 31 | This should install the ``snuffleupagus.so`` file in your extension directory. |
| 32 | The final step is adding a load directive to ``php.ini``, | 32 | The final step is adding a load directive to ``php.ini`` |
| 33 | and to specify the location of its :doc:`configuration file <config>`: | 33 | and to specify the location of the :doc:`configuration file <config>`: |
| 34 | 34 | ||
| 35 | :: | 35 | :: |
| 36 | 36 | ||
