Errata - 3.1.1 Running Discoveries on Centos (PHP < 5.5)

If you are running Open-AudIT on Centos (or the Opmantek VM which is running Centos), with a version of PHP < v5.5 you will need to patch three files to ensure discoveries run.

You can check your server for the current version of PHP using php -v, for example:


[root@myopenauditserver]# php -v
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies


If the version of PHP is < 5.5 then you must patch the following three files to ensure your discoveries will run. These changes have been incorporated into the next release.


  1. EDIT /usr/local/open-audit/code_igniter/application/helpers/discovery_helper.php
    Change line 1150 from:
if (php_uname('s') == 'Windows NT' and exec('whoami') == 'nt authority\system' and !empty($this->config->item('discovery_linux_script_directory')) and $this->config->item('discovery_linux_script_directory') == 'y') {

to:

if (php_uname('s') == 'Windows NT' and exec('whoami') == 'nt authority\system' and !empty($this->config->config['discovery_linux_script_directory']) and $this->config->config['discovery_linux_script_directory'] == 'y') {


2. EDIT /usr/local/open-audit/code_igniter/application/controllers/include_input_discoveries.php
Change line 1162 from:

if (php_uname('s') == 'Windows NT' and exec('whoami') == 'nt authority\system' and !empty($this->config->item('discovery_linux_script_directory')) and $this->config->item('discovery_linux_script_directory') == 'y') {

to

if (php_uname('s') == 'Windows NT' and exec('whoami') == 'nt authority\system' and !empty($this->config->config['discovery_linux_script_directory']) and $this->config->config['discovery_linux_script_directory'] == 'y') {



3. EDIT /usr/local/open-audit/code_igniter/application/models/m_scripts.php
Change line 219 from:

if (!empty($CI->config->item('default_network_address')) {

to:

if (!empty($CI->config->config['default_network_address'])) {