Coder Social home page Coder Social logo

pcc's People

Contributors

bef avatar jvoisin avatar mattsches avatar tensts avatar wapmorgan avatar zurborg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pcc's Issues

Check for commonly used modules like xdebug

The PHP.ini could be checked against loaded modules like zend_extension=xdebug.so. Xdebug for example is commonly used but should not be available in production environment. Is such a check wished?

Inverse test for log_errors parameter (missing !)

Hi,

The warning message about not logging error is "You are not logging errors." and I aggree it should be activated. So I suppose line 346 should be :
if(!is_on($v)) {

instead of
if(is_on($v)) {

Dubious use of constant STDOUT

The constant STDOUT is only defined if PHP is called in CLI mode.
In line 1367 the constant STDOUT is used unconditionally which leads to warning or even error messages if PHP is not called in CLI mode.
Dubious use is: if (function_exists('posix_isatty') && posix_isatty(STDOUT)) {
Safe use could be: if (function_exists('posix_isatty') && defined('STDOUT') && posix_isatty(STDOUT)) {

Latest version reports "script is rather old"

I'm experimenting with Version 0.1-dev11 and it's reporting:

[*] This script is rather old. Please check for updates:
https://github.com/sektioneins/pcc

Is there a later version that I'm somehow missing? I see there have been minor updates as recently as six months ago - is there further development being done on this script?

We'd like to feature it on linuxsecurity.com.

Values are not shown corectly

I had tried the script but some values are not shown corectly.

from command line

php -i | grep suhosin.request.disallow_nul
suhosin.request.disallow_nul => 1 => 1

and your script recommends

[high ] php.ini / suhosin.request.disallow_nul
nul-protection off.
Unless binary data is handled unencoded - which would be very obscure - this feature wants to remain enabled.

The problem seem to be with all of the following:

php.ini / suhosin.cookie.disallow_nul
php.ini / suhosin.get.disallow_nul
php.ini / suhosin.post.disallow_nul
php.ini / suhosin.request.disallow_nul

php version:
PHP 5.4.30 (cli) (built: Jun 27 2014 11:59:31)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd.
with Suhosin v0.9.36, Copyright (c) 2007-2014, by SektionEins GmbH

Any new updates?

Just wondering, for example under PHP 8.x there's a deprecation warning at line 1098 about return "\033[${color}m$result\033[0m"; (fixable with {$color})

False warning due to values using "Off"

Hi,
First of all, thank you for this initiative.
I just install a default Linux Debian 7.7 with Apache and PHP 5.4 and in the php.ini file it is written :
enable_dl = Off
which seems fine to me but when using your script, it still give me a high risk on enable_dl.

Looking at phpinfo() function I've got
enable_dl Off
witch seems also correct.

Looking at your script, and trying to debug it, it seems that the problem comes from the usage of ini_get_all function.

print_r(ini_get_all()); give me this kind of thing
[enable_dl] => Array ( [global_value] => [local_value] => [access] => 4 )

As you see, there seems to be no value at all.

If I put 0 in the php.ini the ini_get_all function return 0
If I put 1 in the php.ini the ini_get_all function return 1
If I put Off or off in the php.ini the ini_get_all function return nothing
If I put On or on in the php.ini the ini_get_all function return 1

This problem is not only for enable_dl, it's a global problem.

Failure in suhosin check if snuffleupagus is active

If running PHP 7.x and hence using snuffleupagus instead of suhosin the following check in line 1249 causes the whole script to abort if the default snuffleupagus ruleset is active:
test_log_in_document_root('suhosin.log.file.name')
The reason is that test_log_in_document_root calls ini_get('suhosin.log.file.name') and the default snuffleupagus ruleset forbids to call ini_get() for any suhosin parameters.
This could possibly be improved by replacing line 1249 with the following code:
extension_loaded('suhosin') && test_log_in_document_root('suhosin.log.file.name')

Test for intl.error_level is logically wrong

In line 792 the test for intl.error_level is logically wrong.
It is: intval($v) | E_ERROR which always yields true regardless of the value of $v.
It should be: intval($v) & E_ERROR

Composer support

Hi. I know that one point of the basic idea of this library is:

NO complicated/overengineered code, e.g. no classes/interfaces, test-frameworks, libraries, ... -> It is supposed to be obvious on first glance - even for novices - how this tool works and what it does!

But I think it should be great if the library had some basic support for composer, for easy distribution and use. So, for "advanced users", they can install the library with composer and then execute it with some code like:

require 'vendor/autoload.php';

Pcc::check();

And for novices, just execute the php file phpconfigcheck.php that launch the class and print the result.

Typos: memory_limit text

I'm no whiz at Github, so I'll just paste my diff:

diff -u2 original/phpconfigcheck.php updated/phpconfigcheck.php
--- original/phpconfigcheck.php 2015-01-07 21:47:04.000000000 -0500
+++ updated/phpconfigcheck.php  2015-01-07 21:50:56.000000000 -0500
@@ -239,5 +239,5 @@
        'max_input_time' => "It may be useful to limit the time a script is allowed to parse input. This should be decided on a per application basis.",
        'max_input_nesting_level' => "Deep input nesting is only required in rare cases and may trigger unexpected ressource limits.",
-       'memory_limit' => "A high memory limit may easy lead lead to ressource exhaustion and thus make your application vulnerable to denial-of-service attacks. This value should be set approximately 20% above empirically gathered maximum memory requirement.",
+       'memory_limit' => "A high memory limit may easily lead to resource exhaustion and thus make your application vulnerable to denial-of-service attacks. This value should be set approximately 20% above an empirically gathered maximum memory requirement.",
        'post_max_size' => "Setting the maximum allowed POST size to a high value may lead to denial-of-service from memory exhaustion. If your application does not need huge file uploads, consider setting this option to a lower value. Note: File uploads have to be covered by this setting as well.",
        'post_max_size>memory_limit' => "post_max_size must be lower than memory_limit. Otherwise, a simple POST request will let PHP reach the configured memory limit and stop execution. Apart from denial-of-service an attacker may try to split a transaction, e.g. let PHP execute only a part of a program.",

Thanks again for this handy tool!

Check for allowed functions

Do we want to check if specific functions are present, like proc_open or setenv?
Those are dangerous and shouldn't be available in production.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.