Changeset 2337484
- Timestamp:
- 07/08/2020 03:05:56 PM (5 years ago)
- Location:
- wordfence
- Files:
-
- 116 added
- 112 deleted
- 48 edited
- 1 copied
-
tags/7.4.9 (copied) (copied from wordfence/trunk)
-
tags/7.4.9/css/activity-report-widget.1592338782.css (deleted)
-
tags/7.4.9/css/activity-report-widget.1594219913.css (added)
-
tags/7.4.9/css/diff.1592338782.css (deleted)
-
tags/7.4.9/css/diff.1594219913.css (added)
-
tags/7.4.9/css/dt_table.1592338782.css (deleted)
-
tags/7.4.9/css/dt_table.1594219913.css (added)
-
tags/7.4.9/css/fullLog.1592338782.css (deleted)
-
tags/7.4.9/css/fullLog.1594219913.css (added)
-
tags/7.4.9/css/iptraf.1592338782.css (deleted)
-
tags/7.4.9/css/iptraf.1594219913.css (added)
-
tags/7.4.9/css/jquery-ui-timepicker-addon.1592338782.css (deleted)
-
tags/7.4.9/css/jquery-ui-timepicker-addon.1594219913.css (added)
-
tags/7.4.9/css/jquery-ui.min.1592338782.css (deleted)
-
tags/7.4.9/css/jquery-ui.min.1594219913.css (added)
-
tags/7.4.9/css/jquery-ui.structure.min.1592338782.css (deleted)
-
tags/7.4.9/css/jquery-ui.structure.min.1594219913.css (added)
-
tags/7.4.9/css/jquery-ui.theme.min.1592338782.css (deleted)
-
tags/7.4.9/css/jquery-ui.theme.min.1594219913.css (added)
-
tags/7.4.9/css/main.1592338782.css (deleted)
-
tags/7.4.9/css/main.1594219913.css (added)
-
tags/7.4.9/css/phpinfo.1592338782.css (deleted)
-
tags/7.4.9/css/phpinfo.1594219913.css (added)
-
tags/7.4.9/css/wf-adminbar.1592338782.css (deleted)
-
tags/7.4.9/css/wf-adminbar.1594219913.css (added)
-
tags/7.4.9/css/wf-colorbox.1592338782.css (deleted)
-
tags/7.4.9/css/wf-colorbox.1594219913.css (added)
-
tags/7.4.9/css/wf-font-awesome.1592338782.css (deleted)
-
tags/7.4.9/css/wf-font-awesome.1594219913.css (added)
-
tags/7.4.9/css/wf-global.1592338782.css (deleted)
-
tags/7.4.9/css/wf-global.1594219913.css (added)
-
tags/7.4.9/css/wf-ionicons.1592338782.css (deleted)
-
tags/7.4.9/css/wf-ionicons.1594219913.css (added)
-
tags/7.4.9/css/wf-onboarding.1592338782.css (deleted)
-
tags/7.4.9/css/wf-onboarding.1594219913.css (added)
-
tags/7.4.9/css/wf-roboto-font.1592338782.css (deleted)
-
tags/7.4.9/css/wf-roboto-font.1594219913.css (added)
-
tags/7.4.9/css/wfselect2.min.1592338782.css (deleted)
-
tags/7.4.9/css/wfselect2.min.1594219913.css (added)
-
tags/7.4.9/css/wordfenceBox.1592338782.css (deleted)
-
tags/7.4.9/css/wordfenceBox.1594219913.css (added)
-
tags/7.4.9/js/Chart.bundle.min.1592338782.js (deleted)
-
tags/7.4.9/js/Chart.bundle.min.1594219913.js (added)
-
tags/7.4.9/js/admin.1592338782.js (deleted)
-
tags/7.4.9/js/admin.1594219913.js (added)
-
tags/7.4.9/js/admin.ajaxWatcher.1592338782.js (deleted)
-
tags/7.4.9/js/admin.ajaxWatcher.1594219913.js (added)
-
tags/7.4.9/js/admin.liveTraffic.1592338782.js (deleted)
-
tags/7.4.9/js/admin.liveTraffic.1594219913.js (added)
-
tags/7.4.9/js/date.1592338782.js (deleted)
-
tags/7.4.9/js/date.1594219913.js (added)
-
tags/7.4.9/js/jquery-ui-timepicker-addon.1592338782.js (deleted)
-
tags/7.4.9/js/jquery-ui-timepicker-addon.1594219913.js (added)
-
tags/7.4.9/js/jquery.colorbox-min.1592338782.js (deleted)
-
tags/7.4.9/js/jquery.colorbox-min.1594219913.js (added)
-
tags/7.4.9/js/jquery.colorbox.1592338782.js (deleted)
-
tags/7.4.9/js/jquery.colorbox.1594219913.js (added)
-
tags/7.4.9/js/jquery.dataTables.min.1592338782.js (deleted)
-
tags/7.4.9/js/jquery.dataTables.min.1594219913.js (added)
-
tags/7.4.9/js/jquery.qrcode.min.1592338782.js (deleted)
-
tags/7.4.9/js/jquery.qrcode.min.1594219913.js (added)
-
tags/7.4.9/js/jquery.tmpl.min.1592338782.js (deleted)
-
tags/7.4.9/js/jquery.tmpl.min.1594219913.js (added)
-
tags/7.4.9/js/jquery.tools.min.1592338782.js (deleted)
-
tags/7.4.9/js/jquery.tools.min.1594219913.js (added)
-
tags/7.4.9/js/knockout-3.3.0.1592338782.js (deleted)
-
tags/7.4.9/js/knockout-3.3.0.1594219913.js (added)
-
tags/7.4.9/js/wfdashboard.1592338782.js (deleted)
-
tags/7.4.9/js/wfdashboard.1594219913.js (added)
-
tags/7.4.9/js/wfdropdown.1592338782.js (deleted)
-
tags/7.4.9/js/wfdropdown.1594219913.js (added)
-
tags/7.4.9/js/wfglobal.1592338782.js (deleted)
-
tags/7.4.9/js/wfglobal.1594219913.js (added)
-
tags/7.4.9/js/wfpopover.1592338782.js (deleted)
-
tags/7.4.9/js/wfpopover.1594219913.js (added)
-
tags/7.4.9/js/wfselect2.min.1592338782.js (deleted)
-
tags/7.4.9/js/wfselect2.min.1594219913.js (added)
-
tags/7.4.9/lib/menu_options.php (modified) (1 diff)
-
tags/7.4.9/lib/menu_scanner.php (modified) (1 diff)
-
tags/7.4.9/lib/menu_tools_diagnostic.php (modified) (1 diff)
-
tags/7.4.9/lib/wfCentralAPI.php (modified) (2 diffs)
-
tags/7.4.9/lib/wfConfig.php (modified) (2 diffs)
-
tags/7.4.9/lib/wfDashboard.php (modified) (1 diff)
-
tags/7.4.9/lib/wfHelperString.php (modified) (1 diff)
-
tags/7.4.9/lib/wfLog.php (modified) (4 diffs)
-
tags/7.4.9/lib/wfScan.php (modified) (1 diff)
-
tags/7.4.9/lib/wfScanEngine.php (modified) (2 diffs)
-
tags/7.4.9/lib/wfSupportController.php (modified) (2 diffs)
-
tags/7.4.9/lib/wfUpdateCheck.php (modified) (1 diff)
-
tags/7.4.9/lib/wfVersionCheckController.php (modified) (5 diffs)
-
tags/7.4.9/lib/wordfenceClass.php (modified) (11 diffs)
-
tags/7.4.9/modules/login-security/css/admin-global.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/admin-global.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/admin.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/admin.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/colorbox.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/colorbox.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/font-awesome.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/font-awesome.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/ionicons.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/ionicons.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/jquery-ui-timepicker-addon.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/jquery-ui-timepicker-addon.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/jquery-ui.min.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/jquery-ui.min.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/jquery-ui.structure.min.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/jquery-ui.structure.min.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/jquery-ui.theme.min.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/jquery-ui.theme.min.1594219913.css (added)
-
tags/7.4.9/modules/login-security/css/login.1592338782.css (deleted)
-
tags/7.4.9/modules/login-security/css/login.1594219913.css (added)
-
tags/7.4.9/modules/login-security/js/admin-global.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/admin-global.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/admin.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/admin.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/jquery-ui-timepicker-addon.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/jquery-ui-timepicker-addon.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/jquery.colorbox.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/jquery.colorbox.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/jquery.colorbox.min.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/jquery.colorbox.min.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/jquery.qrcode.min.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/jquery.qrcode.min.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/jquery.tmpl.min.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/jquery.tmpl.min.1594219913.js (added)
-
tags/7.4.9/modules/login-security/js/login.1592338782.js (deleted)
-
tags/7.4.9/modules/login-security/js/login.1594219913.js (added)
-
tags/7.4.9/modules/login-security/wordfence-login-security.php (modified) (1 diff)
-
tags/7.4.9/readme.txt (modified) (3 diffs)
-
tags/7.4.9/vendor/wordfence/wf-waf/src/init.php (modified) (1 diff)
-
tags/7.4.9/vendor/wordfence/wf-waf/src/lib/rules.php (modified) (2 diffs)
-
tags/7.4.9/views/diagnostics (added)
-
tags/7.4.9/views/diagnostics/text.php (added)
-
tags/7.4.9/views/scanner/issue-control-repair.php (modified) (1 diff)
-
tags/7.4.9/views/scanner/options-group-general.php (modified) (1 diff)
-
tags/7.4.9/views/waf/waf-install.php (modified) (1 diff)
-
tags/7.4.9/views/waf/waf-uninstall.php (modified) (1 diff)
-
tags/7.4.9/waf/bootstrap.php (modified) (3 diffs)
-
tags/7.4.9/wordfence.php (modified) (3 diffs)
-
trunk/css/activity-report-widget.1592338782.css (deleted)
-
trunk/css/activity-report-widget.1594219913.css (added)
-
trunk/css/diff.1592338782.css (deleted)
-
trunk/css/diff.1594219913.css (added)
-
trunk/css/dt_table.1592338782.css (deleted)
-
trunk/css/dt_table.1594219913.css (added)
-
trunk/css/fullLog.1592338782.css (deleted)
-
trunk/css/fullLog.1594219913.css (added)
-
trunk/css/iptraf.1592338782.css (deleted)
-
trunk/css/iptraf.1594219913.css (added)
-
trunk/css/jquery-ui-timepicker-addon.1592338782.css (deleted)
-
trunk/css/jquery-ui-timepicker-addon.1594219913.css (added)
-
trunk/css/jquery-ui.min.1592338782.css (deleted)
-
trunk/css/jquery-ui.min.1594219913.css (added)
-
trunk/css/jquery-ui.structure.min.1592338782.css (deleted)
-
trunk/css/jquery-ui.structure.min.1594219913.css (added)
-
trunk/css/jquery-ui.theme.min.1592338782.css (deleted)
-
trunk/css/jquery-ui.theme.min.1594219913.css (added)
-
trunk/css/main.1592338782.css (deleted)
-
trunk/css/main.1594219913.css (added)
-
trunk/css/phpinfo.1592338782.css (deleted)
-
trunk/css/phpinfo.1594219913.css (added)
-
trunk/css/wf-adminbar.1592338782.css (deleted)
-
trunk/css/wf-adminbar.1594219913.css (added)
-
trunk/css/wf-colorbox.1592338782.css (deleted)
-
trunk/css/wf-colorbox.1594219913.css (added)
-
trunk/css/wf-font-awesome.1592338782.css (deleted)
-
trunk/css/wf-font-awesome.1594219913.css (added)
-
trunk/css/wf-global.1592338782.css (deleted)
-
trunk/css/wf-global.1594219913.css (added)
-
trunk/css/wf-ionicons.1592338782.css (deleted)
-
trunk/css/wf-ionicons.1594219913.css (added)
-
trunk/css/wf-onboarding.1592338782.css (deleted)
-
trunk/css/wf-onboarding.1594219913.css (added)
-
trunk/css/wf-roboto-font.1592338782.css (deleted)
-
trunk/css/wf-roboto-font.1594219913.css (added)
-
trunk/css/wfselect2.min.1592338782.css (deleted)
-
trunk/css/wfselect2.min.1594219913.css (added)
-
trunk/css/wordfenceBox.1592338782.css (deleted)
-
trunk/css/wordfenceBox.1594219913.css (added)
-
trunk/js/Chart.bundle.min.1592338782.js (deleted)
-
trunk/js/Chart.bundle.min.1594219913.js (added)
-
trunk/js/admin.1592338782.js (deleted)
-
trunk/js/admin.1594219913.js (added)
-
trunk/js/admin.ajaxWatcher.1592338782.js (deleted)
-
trunk/js/admin.ajaxWatcher.1594219913.js (added)
-
trunk/js/admin.liveTraffic.1592338782.js (deleted)
-
trunk/js/admin.liveTraffic.1594219913.js (added)
-
trunk/js/date.1592338782.js (deleted)
-
trunk/js/date.1594219913.js (added)
-
trunk/js/jquery-ui-timepicker-addon.1592338782.js (deleted)
-
trunk/js/jquery-ui-timepicker-addon.1594219913.js (added)
-
trunk/js/jquery.colorbox-min.1592338782.js (deleted)
-
trunk/js/jquery.colorbox-min.1594219913.js (added)
-
trunk/js/jquery.colorbox.1592338782.js (deleted)
-
trunk/js/jquery.colorbox.1594219913.js (added)
-
trunk/js/jquery.dataTables.min.1592338782.js (deleted)
-
trunk/js/jquery.dataTables.min.1594219913.js (added)
-
trunk/js/jquery.qrcode.min.1592338782.js (deleted)
-
trunk/js/jquery.qrcode.min.1594219913.js (added)
-
trunk/js/jquery.tmpl.min.1592338782.js (deleted)
-
trunk/js/jquery.tmpl.min.1594219913.js (added)
-
trunk/js/jquery.tools.min.1592338782.js (deleted)
-
trunk/js/jquery.tools.min.1594219913.js (added)
-
trunk/js/knockout-3.3.0.1592338782.js (deleted)
-
trunk/js/knockout-3.3.0.1594219913.js (added)
-
trunk/js/wfdashboard.1592338782.js (deleted)
-
trunk/js/wfdashboard.1594219913.js (added)
-
trunk/js/wfdropdown.1592338782.js (deleted)
-
trunk/js/wfdropdown.1594219913.js (added)
-
trunk/js/wfglobal.1592338782.js (deleted)
-
trunk/js/wfglobal.1594219913.js (added)
-
trunk/js/wfpopover.1592338782.js (deleted)
-
trunk/js/wfpopover.1594219913.js (added)
-
trunk/js/wfselect2.min.1592338782.js (deleted)
-
trunk/js/wfselect2.min.1594219913.js (added)
-
trunk/lib/menu_options.php (modified) (1 diff)
-
trunk/lib/menu_scanner.php (modified) (1 diff)
-
trunk/lib/menu_tools_diagnostic.php (modified) (1 diff)
-
trunk/lib/wfCentralAPI.php (modified) (2 diffs)
-
trunk/lib/wfConfig.php (modified) (2 diffs)
-
trunk/lib/wfDashboard.php (modified) (1 diff)
-
trunk/lib/wfHelperString.php (modified) (1 diff)
-
trunk/lib/wfLog.php (modified) (4 diffs)
-
trunk/lib/wfScan.php (modified) (1 diff)
-
trunk/lib/wfScanEngine.php (modified) (2 diffs)
-
trunk/lib/wfSupportController.php (modified) (2 diffs)
-
trunk/lib/wfUpdateCheck.php (modified) (1 diff)
-
trunk/lib/wfVersionCheckController.php (modified) (5 diffs)
-
trunk/lib/wordfenceClass.php (modified) (11 diffs)
-
trunk/modules/login-security/css/admin-global.1592338782.css (deleted)
-
trunk/modules/login-security/css/admin-global.1594219913.css (added)
-
trunk/modules/login-security/css/admin.1592338782.css (deleted)
-
trunk/modules/login-security/css/admin.1594219913.css (added)
-
trunk/modules/login-security/css/colorbox.1592338782.css (deleted)
-
trunk/modules/login-security/css/colorbox.1594219913.css (added)
-
trunk/modules/login-security/css/font-awesome.1592338782.css (deleted)
-
trunk/modules/login-security/css/font-awesome.1594219913.css (added)
-
trunk/modules/login-security/css/ionicons.1592338782.css (deleted)
-
trunk/modules/login-security/css/ionicons.1594219913.css (added)
-
trunk/modules/login-security/css/jquery-ui-timepicker-addon.1592338782.css (deleted)
-
trunk/modules/login-security/css/jquery-ui-timepicker-addon.1594219913.css (added)
-
trunk/modules/login-security/css/jquery-ui.min.1592338782.css (deleted)
-
trunk/modules/login-security/css/jquery-ui.min.1594219913.css (added)
-
trunk/modules/login-security/css/jquery-ui.structure.min.1592338782.css (deleted)
-
trunk/modules/login-security/css/jquery-ui.structure.min.1594219913.css (added)
-
trunk/modules/login-security/css/jquery-ui.theme.min.1592338782.css (deleted)
-
trunk/modules/login-security/css/jquery-ui.theme.min.1594219913.css (added)
-
trunk/modules/login-security/css/login.1592338782.css (deleted)
-
trunk/modules/login-security/css/login.1594219913.css (added)
-
trunk/modules/login-security/js/admin-global.1592338782.js (deleted)
-
trunk/modules/login-security/js/admin-global.1594219913.js (added)
-
trunk/modules/login-security/js/admin.1592338782.js (deleted)
-
trunk/modules/login-security/js/admin.1594219913.js (added)
-
trunk/modules/login-security/js/jquery-ui-timepicker-addon.1592338782.js (deleted)
-
trunk/modules/login-security/js/jquery-ui-timepicker-addon.1594219913.js (added)
-
trunk/modules/login-security/js/jquery.colorbox.1592338782.js (deleted)
-
trunk/modules/login-security/js/jquery.colorbox.1594219913.js (added)
-
trunk/modules/login-security/js/jquery.colorbox.min.1592338782.js (deleted)
-
trunk/modules/login-security/js/jquery.colorbox.min.1594219913.js (added)
-
trunk/modules/login-security/js/jquery.qrcode.min.1592338782.js (deleted)
-
trunk/modules/login-security/js/jquery.qrcode.min.1594219913.js (added)
-
trunk/modules/login-security/js/jquery.tmpl.min.1592338782.js (deleted)
-
trunk/modules/login-security/js/jquery.tmpl.min.1594219913.js (added)
-
trunk/modules/login-security/js/login.1592338782.js (deleted)
-
trunk/modules/login-security/js/login.1594219913.js (added)
-
trunk/modules/login-security/wordfence-login-security.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/wordfence/wf-waf/src/init.php (modified) (1 diff)
-
trunk/vendor/wordfence/wf-waf/src/lib/rules.php (modified) (2 diffs)
-
trunk/views/diagnostics (added)
-
trunk/views/diagnostics/text.php (added)
-
trunk/views/scanner/issue-control-repair.php (modified) (1 diff)
-
trunk/views/scanner/options-group-general.php (modified) (1 diff)
-
trunk/views/waf/waf-install.php (modified) (1 diff)
-
trunk/views/waf/waf-uninstall.php (modified) (1 diff)
-
trunk/waf/bootstrap.php (modified) (3 diffs)
-
trunk/wordfence.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordfence/tags/7.4.9/lib/menu_options.php
r2290265 r2337484 163 163 'wf-option-scansEnabled-suspiciousOptions' => __('Scan WordPress core, plugin, and theme options for known dangerous URLs and suspicious content', 'wordfence'), 164 164 'wf-option-scansEnabled-oldVersions' => __('Scan for out of date, abandoned, and vulnerable plugins, themes, and WordPress versions', 'wordfence'), 165 'wf-option-scansEnabled-suspiciousAdminUsers' => __('Scan for admin users created outside of WordPress', 'wordfence'),165 'wf-option-scansEnabled-suspiciousAdminUsers' => __('Scan for suspicious admin users created outside of WordPress', 'wordfence'), 166 166 'wf-option-scansEnabled-passwds' => __('Check the strength of passwords', 'wordfence'), 167 167 'wf-option-scansEnabled-diskSpace' => __('Monitor disk space', 'wordfence'), -
wordfence/tags/7.4.9/lib/menu_scanner.php
r2226721 r2337484 21 21 } 22 22 ?> 23 <div id="wordfenceMode_scan"></div> 23 24 <div class="wrap wordfence"> 24 25 <div class="wf-container-fluid"> -
wordfence/tags/7.4.9/lib/menu_tools_diagnostic.php
r2131558 r2337484 40 40 <div id="sendByEmailDiv" class="wf-add-bottom"> 41 41 <span class="wf-nowrap"> 42 <input class="wf-btn wf-btn-primary" type="submit" id="sendByEmail" value="Send Report by Email"/> 43 <input class="wf-btn wf-btn-default" type="button" id="expandAllDiagnostics" value="Expand All Diagnostics"/> 42 <input class="wf-btn wf-btn-primary wf-btn-sm" type="submit" id="exportDiagnostics" value="Export"/> 43 <input class="wf-btn wf-btn-primary wf-btn-sm" type="submit" id="sendByEmail" value="Send Report by Email"/> 44 <input class="wf-btn wf-btn-default wf-btn-sm" type="button" id="expandAllDiagnostics" value="Expand All Diagnostics"/> 44 45 </span> 45 46 </div> -
wordfence/tags/7.4.9/lib/wfCentralAPI.php
r2131558 r2337484 320 320 */ 321 321 public static function isConnected() { 322 return self::isSupported() && ((bool) wfConfig::get('wordfenceCentralConnected', false));322 return self::isSupported() && ((bool) self::_isConnected()); 323 323 } 324 324 … … 327 327 */ 328 328 public static function isPartialConnection() { 329 return !wfConfig::get('wordfenceCentralConnected') && wfConfig::get('wordfenceCentralSiteID'); 329 return !self::_isConnected() && wfConfig::get('wordfenceCentralSiteID'); 330 } 331 332 public static function _isConnected($forceUpdate = false) { 333 static $isConnected; 334 if (!isset($isConnected) || $forceUpdate) { 335 $isConnected = wfConfig::get('wordfenceCentralConnected', false); 336 } 337 return $isConnected; 330 338 } 331 339 -
wordfence/tags/7.4.9/lib/wfConfig.php
r2290265 r2337484 225 225 ), 226 226 ); 227 public static $serializedOptions = array('lastAdminLogin', 'scanSched', 'emailedIssuesList', 'wf_summaryItems', 'adminUserList', 'twoFactorUsers', 'alertFreqTrack', 'wfStatusStartMsgs', 'vulnerabilities_plugin', 'vulnerabilities_theme', 'dashboardData', 'malwarePrefixes', 'coreHashes', 'noc1ScanSchedule', 'allScansScheduled', 'disclosureStates', 'scanStageStatuses', 'adminNoticeQueue' );227 public static $serializedOptions = array('lastAdminLogin', 'scanSched', 'emailedIssuesList', 'wf_summaryItems', 'adminUserList', 'twoFactorUsers', 'alertFreqTrack', 'wfStatusStartMsgs', 'vulnerabilities_plugin', 'vulnerabilities_theme', 'dashboardData', 'malwarePrefixes', 'coreHashes', 'noc1ScanSchedule', 'allScansScheduled', 'disclosureStates', 'scanStageStatuses', 'adminNoticeQueue', 'suspiciousAdminUsernames', 'wordpressPluginVersions', 'wordpressThemeVersions'); 228 228 // Configuration keypairs that can be set from Central. 229 229 private static $wfCentralInternalConfig = array( … … 932 932 } 933 933 public static function autoUpdate(){ 934 // Prevent auto-update for PHP 5.2. Consider tying this into `wfVersionCheckController::PHP_DEPRECATING`. 935 if (version_compare(PHP_VERSION, '5.3', '<')) { 936 return; 937 } 938 934 939 if (!wfConfig::get('other_bypassLitespeedNoabort', false) && getenv('noabort') != '1' && stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false) { 935 940 $lastEmail = self::get('lastLiteSpdEmail', false); -
wordfence/tags/7.4.9/lib/wfDashboard.php
r2025430 r2337484 225 225 226 226 // Wordfence Central 227 $this->wordfenceCentralConnected = wfC onfig::get('wordfenceCentralConnected');227 $this->wordfenceCentralConnected = wfCentral::_isConnected(); // This value is cached. 228 228 $this->wordfenceCentralConnectTime = wfConfig::get('wordfenceCentralConnectTime'); 229 229 $this->wordfenceCentralConnectEmail = wfConfig::get('wordfenceCentralConnectEmail'); -
wordfence/tags/7.4.9/lib/wfHelperString.php
r1128972 r2337484 20 20 return $return_val; 21 21 } 22 23 public static function plainTextTable($table) { 24 if (count($table) === 0) { 25 return ''; 26 } 27 $colLengths = array(); 28 for ($row = 0; $row < count($table); $row++) { 29 for ($col = 0; $col < count($table[$row]); $col++) { 30 foreach (explode("\n", $table[$row][$col]) as $colText) { 31 if (!isset($colLengths[$col])) { 32 $colLengths[$col] = strlen($colText); 33 continue; 34 } 35 $len = strlen($colText); 36 if ($len > $colLengths[$col]) { 37 $colLengths[$col] = $len; 38 } 39 } 40 } 41 } 42 $hr = str_repeat('-', array_sum($colLengths) + (count($colLengths) * 3) + 1); 43 $output = $hr . "\n"; 44 for ($row = 0; $row < count($table); $row++) { 45 $colHeight = 0; 46 for ($col = 0; $col < count($table[$row]); $col++) { 47 $height = substr_count($table[$row][$col], "\n"); 48 if ($height > $colHeight) { 49 $colHeight = $height; 50 } 51 } 52 for ($colRow = 0; $colRow <= $colHeight; $colRow++) { 53 for ($col = 0; $col < count($table[$row]); $col++) { 54 $colRows = explode("\n", $table[$row][$col]); 55 $output .= '| ' . str_pad(isset($colRows[$colRow]) ? $colRows[$colRow] : '', $colLengths[$col], ' ', STR_PAD_RIGHT) . ' '; 56 } 57 $output .= "|\n"; 58 } 59 if ($row === 0) { 60 $output .= $hr . "\n"; 61 } 62 } 63 return trim($output . (count($table) > 1 ? $hr : '')); 64 } 22 65 } -
wordfence/tags/7.4.9/lib/wfLog.php
r2226721 r2337484 1057 1057 class wfAdminUserMonitor { 1058 1058 1059 protected $currentAdminList = array(); 1060 1059 1061 public function isEnabled() { 1060 1062 $options = wfScanner::shared()->scanOptions(); … … 1074 1076 public function createInitialList() { 1075 1077 $admins = $this->getCurrentAdmins(); 1076 wfConfig::set_ser('adminUserList', $admins); 1078 $adminUserList = array(); 1079 foreach ($admins as $id => $user) { 1080 $adminUserList[$id] = 1; 1081 } 1082 wfConfig::set_ser('adminUserList', $adminUserList); 1077 1083 } 1078 1084 … … 1136 1142 1137 1143 /** 1144 * @param bool $forceReload 1138 1145 * @return array 1139 1146 */ 1140 public function getCurrentAdmins() { 1141 require_once(ABSPATH . WPINC . '/user.php'); 1142 if (is_multisite()) { 1143 if (function_exists("get_sites")) { 1144 $sites = get_sites(array( 1145 'network_id' => null, 1147 public function getCurrentAdmins($forceReload = false) { 1148 if (empty($this->currentAdminList) || $forceReload) { 1149 require_once(ABSPATH . WPINC . '/user.php'); 1150 if (is_multisite()) { 1151 if (function_exists("get_sites")) { 1152 $sites = get_sites(array( 1153 'network_id' => null, 1154 )); 1155 } 1156 else { 1157 $sites = wp_get_sites(array( 1158 'network_id' => null, 1159 )); 1160 } 1161 } else { 1162 $sites = array(array( 1163 'blog_id' => get_current_blog_id(), 1146 1164 )); 1147 1165 } 1148 else { 1149 $sites = wp_get_sites(array( 1150 'network_id' => null, 1166 1167 // not very efficient, but the WordPress API doesn't provide a good way to do this. 1168 $this->currentAdminList = array(); 1169 foreach ($sites as $siteRow) { 1170 $siteRowArray = (array) $siteRow; 1171 $user_query = new WP_User_Query(array( 1172 'blog_id' => $siteRowArray['blog_id'], 1173 'role' => 'administrator', 1151 1174 )); 1152 } 1153 } else { 1154 $sites = array(array( 1155 'blog_id' => get_current_blog_id(), 1156 )); 1157 } 1158 1159 // not very efficient, but the WordPress API doesn't provide a good way to do this. 1160 $admins = array(); 1161 foreach ($sites as $siteRow) { 1162 $siteRowArray = (array) $siteRow; 1163 $user_query = new WP_User_Query(array( 1164 'blog_id' => $siteRowArray['blog_id'], 1165 'role' => 'administrator', 1166 )); 1167 $users = $user_query->get_results(); 1168 if (is_array($users)) { 1169 /** @var WP_User $user */ 1170 foreach ($users as $user) { 1171 $admins[$user->ID] = 1; 1172 } 1173 } 1174 } 1175 1176 // Add any super admins that aren't also admins on a network 1177 $superAdmins = get_super_admins(); 1178 foreach ($superAdmins as $userLogin) { 1179 $user = get_user_by('login', $userLogin); 1180 if ($user) { 1181 $admins[$user->ID] = 1; 1182 } 1183 } 1184 return $admins; 1175 $users = $user_query->get_results(); 1176 if (is_array($users)) { 1177 /** @var WP_User $user */ 1178 foreach ($users as $user) { 1179 $this->currentAdminList[$user->ID] = $user; 1180 } 1181 } 1182 } 1183 1184 // Add any super admins that aren't also admins on a network 1185 $superAdmins = get_super_admins(); 1186 foreach ($superAdmins as $userLogin) { 1187 $user = get_user_by('login', $userLogin); 1188 if ($user) { 1189 $this->currentAdminList[$user->ID] = $user; 1190 } 1191 } 1192 } 1193 1194 return $this->currentAdminList; 1185 1195 } 1186 1196 … … 1995 2005 if (is_file($path)) { 1996 2006 $file = basename($path); 1997 if (preg_match('#(?: error_log(\-\d+)?$|\.log$)#i', $file)) {2007 if (preg_match('#(?:^php_errorlog$|error_log(\-\d+)?$|\.log$)#i', $file)) { 1998 2008 return array($path => is_readable($path)); 1999 2009 } -
wordfence/tags/7.4.9/lib/wfScan.php
r2205414 r2337484 257 257 self::status(2, 'info', "Wordfence used " . wfUtils::formatBytes($peakMemory - self::$peakMemAtStart) . " of memory for scan. Server peak memory usage was: " . wfUtils::formatBytes($peakMemory)); 258 258 self::status(2, 'error', "Scan terminated with error: " . $e->getMessage()); 259 260 if (preg_match('/The Wordfence API key you\'re using is already being used by: (\S*?) /', $e->getMessage(), $matches)) { 261 wordfence::alert(__('Wordfence scan failed because of license site URL conflict', 'wordfence'), sprintf(__(<<<MSG 262 The Wordfence scan has failed because the Wordfence API key you're using is already being used by: %s 263 264 If you have changed your blog URL, please sign-in to Wordfence, purchase a new key or reset an existing key, and then enter that key on this site's Wordfence Options page. 265 MSG 266 , 'wordfence'), $matches[1]), false); 267 } 268 259 269 exit(); 260 270 } -
wordfence/tags/7.4.9/lib/wfScanEngine.php
r2290265 r2337484 815 815 $fullFile = rtrim(ABSPATH, '/') . '/' . $file; 816 816 if (!wfUtils::fileTooBig($fullFile)) { //Silently ignore files that are too large for the purposes of inclusion in the scan issue 817 if (in_array($file, $base_abspath_relative) || (@is_file($fullFile) && @is_readable($fullFile))) {817 if (in_array($file, $base_abspath_relative) || in_array($fullFile, $base_absolute) || (@is_file($fullFile) && @is_readable($fullFile))) { 818 818 $scanned[] = realpath($fullFile); 819 819 } … … 1802 1802 1803 1803 $adminUsers = new wfAdminUserMonitor(); 1804 if ($adminUsers->isEnabled() && $suspiciousAdmins = $adminUsers->checkNewAdmins()) { 1805 foreach ($suspiciousAdmins as $userID) { 1806 $this->scanController->incrementSummaryItem(wfScanner::SUMMARY_SCANNED_USERS); 1807 $user = new WP_User($userID); 1804 if ($adminUsers->isEnabled()) { 1805 try { 1806 $response = $this->api->call('suspicious_admin_usernames'); 1807 if (is_array($response) && isset($response['ok']) && wfUtils::truthyToBoolean($response['ok']) && !empty($response['patterns'])) { 1808 wfConfig::set_ser('suspiciousAdminUsernames', $response['patterns']); 1809 } 1810 } catch (Exception $e) { 1811 // Let the rest of the scan continue 1812 } 1813 1814 $suspiciousAdmins = $adminUsers->checkNewAdmins(); 1815 if (is_array($suspiciousAdmins)) { 1816 foreach ($suspiciousAdmins as $userID) { 1817 $this->scanController->incrementSummaryItem(wfScanner::SUMMARY_SCANNED_USERS); 1818 $user = new WP_User($userID); 1819 $key = 'suspiciousAdminUsers' . $userID; 1820 $added = $this->addIssue('suspiciousAdminUsers', wfIssues::SEVERITY_HIGH, $key, $key, 1821 sprintf(__("An admin user with the username %s was created outside of WordPress.", 'wordfence'), esc_html($user->user_login)), 1822 sprintf(__("An admin user with the username %s was created outside of WordPress. It's possible a plugin could have created the account, but if you do not recognize the user, we suggest you remove it.", 'wordfence'), esc_html($user->user_login)), 1823 array( 1824 'userID' => $userID, 1825 )); 1826 if ($added == wfIssues::ISSUE_ADDED || $added == wfIssues::ISSUE_UPDATED) { $haveIssues = wfIssues::STATUS_PROBLEM; } 1827 else if ($haveIssues != wfIssues::STATUS_PROBLEM && ($added == wfIssues::ISSUE_IGNOREP || $added == wfIssues::ISSUE_IGNOREC)) { $haveIssues = wfIssues::STATUS_IGNORED; } 1828 } 1829 } 1830 1831 $admins = $adminUsers->getCurrentAdmins(); 1832 /** 1833 * @var WP_User $adminUser 1834 */ 1835 foreach ($admins as $userID => $adminUser) { 1836 $added = false; 1808 1837 $key = 'suspiciousAdminUsers' . $userID; 1809 $added = $this->addIssue('suspiciousAdminUsers', wfIssues::SEVERITY_HIGH, $key, $key, 1810 "An admin user with the username " . esc_html($user->user_login) . " was created outside of WordPress.", 1811 "An admin user with the username " . esc_html($user->user_login) . " was created outside of WordPress. It's 1812 possible a plugin could have created the account, but if you do not recognize the user, we suggest you remove 1813 it.", 1814 array( 1815 'userID' => $userID, 1816 )); 1838 1839 // Check against user name list here. 1840 $suspiciousAdminUsernames = wfConfig::get_ser('suspiciousAdminUsernames'); 1841 if (is_array($suspiciousAdminUsernames)) { 1842 foreach ($suspiciousAdminUsernames as $usernamePattern) { 1843 if (preg_match($usernamePattern, $adminUser->user_login)) { 1844 $added = $this->addIssue('suspiciousAdminUsers', wfIssues::SEVERITY_HIGH, $key, $key, 1845 sprintf(__("An admin user with a suspicious username %s was found.", 'wordfence'), esc_html($adminUser->user_login)), 1846 sprintf(__("An admin user with a suspicious username %s was found. Administrators accounts with usernames similar to this are commonly seen created by hackers. It's possible a plugin could have created the account, but if you do not recognize the user, we suggest you remove it.", 'wordfence'), esc_html($adminUser->user_login)), 1847 array( 1848 'userID' => $userID, 1849 )); 1850 } 1851 } 1852 } 1853 1817 1854 if ($added == wfIssues::ISSUE_ADDED || $added == wfIssues::ISSUE_UPDATED) { $haveIssues = wfIssues::STATUS_PROBLEM; } 1818 1855 else if ($haveIssues != wfIssues::STATUS_PROBLEM && ($added == wfIssues::ISSUE_IGNOREP || $added == wfIssues::ISSUE_IGNOREC)) { $haveIssues = wfIssues::STATUS_IGNORED; } -
wordfence/tags/7.4.9/lib/wfSupportController.php
r2226721 r2337484 148 148 const ITEM_SCAN_RESULT_UNKNOWN_FILE_CORE = 'scan-result-unknown-file-in-wordpress-core'; 149 149 const ITEM_SCAN_RESULT_SKIPPED_PATHS = 'scan-result-skipped-paths'; 150 150 const ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES = 'scan-result-repair-modified-files'; 151 151 152 const ITEM_TOOLS_TWO_FACTOR = 'tools-two-factor'; 152 153 const ITEM_TOOLS_LIVE_TRAFFIC = 'tools-live-traffic'; … … 325 326 case self::ITEM_SCAN_RESULT_UNKNOWN_FILE_CORE: 326 327 case self::ITEM_SCAN_RESULT_SKIPPED_PATHS: 327 328 case self::ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES: 329 328 330 case self::ITEM_TOOLS_TWO_FACTOR: 329 331 case self::ITEM_TOOLS_LIVE_TRAFFIC: -
wordfence/tags/7.4.9/lib/wfUpdateCheck.php
r2131558 r2337484 10 10 private $theme_updates = array(); 11 11 private $api = null; 12 13 public static function syncAllVersionInfo() { 14 // Load the core/plugin/theme versions into the WAF configuration. 15 wfConfig::set('wordpressVersion', wfUtils::getWPVersion()); 16 wfWAFConfig::set('wordpressVersion', wfUtils::getWPVersion(), wfWAF::getInstance(), 'synced'); 17 18 if (!function_exists('get_plugins')) { 19 require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 20 } 21 22 $pluginVersions = array(); 23 foreach (get_plugins() as $pluginFile => $pluginData) { 24 $slug = plugin_basename($pluginFile); 25 if (preg_match('/^([^\/]+)\//', $pluginFile, $matches)) { 26 $slug = $matches[1]; 27 } else if (preg_match('/^([^\/.]+)\.php$/', $pluginFile, $matches)) { 28 $slug = $matches[1]; 29 } 30 $pluginVersions[$slug] = isset($pluginData['Version']) ? $pluginData['Version'] : null; 31 } 32 33 wfConfig::set_ser('wordpressPluginVersions', $pluginVersions); 34 wfWAFConfig::set('wordpressPluginVersions', $pluginVersions, wfWAF::getInstance(), 'synced'); 35 36 if (!function_exists('wp_get_themes')) { 37 require_once(ABSPATH . '/wp-includes/theme.php'); 38 } 39 40 $themeVersions = array(); 41 foreach (wp_get_themes() as $slug => $theme) { 42 $themeVersions[$slug] = isset($theme['Version']) ? $theme['Version'] : null; 43 } 44 45 wfConfig::set_ser('wordpressThemeVersions', $themeVersions); 46 wfWAFConfig::set('wordpressThemeVersions', $themeVersions, wfWAF::getInstance(), 'synced'); 47 } 12 48 13 49 public function __construct() { -
wordfence/tags/7.4.9/lib/wfVersionCheckController.php
r1879365 r2337484 6 6 const VERSION_UNSUPPORTED = 'unsupported'; 7 7 8 const PHP_DEPRECATING = '5. 3.0'; //When greater than PHP_MINIMUM, will issue a discontinuing warning the first time we check it and find a version less than this (also applies to the other similar constant pairs)9 const PHP_MINIMUM = '5. 2.0'; //The currently supported minimum8 const PHP_DEPRECATING = '5.5.0'; //When greater than PHP_MINIMUM, will issue a discontinuing warning the first time we check it and find a version less than this (also applies to the other similar constant pairs) 9 const PHP_MINIMUM = '5.3.0'; //The currently supported minimum 10 10 11 11 const OPENSSL_DEPRECATING = '1.0.1'; … … 48 48 'phpVersionCheckDeprecationEmail_' . self::PHP_DEPRECATING, 49 49 __('PHP version too old', 'wordfence'), 50 sprintf(__('Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP))50 sprintf(__('Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP)) 51 51 ); 52 52 … … 54 54 'phpVersionCheckDeprecationNotice_' . self::PHP_DEPRECATING, 55 55 'phpVersionCheck', 56 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>'56 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>' 57 57 ); 58 58 } … … 61 61 'phpVersionCheckUnsupportedEmail_' . self::PHP_MINIMUM, 62 62 __('PHP version too old', 'wordfence'), 63 sprintf(__('Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP))63 sprintf(__('Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP)) 64 64 ); 65 65 … … 67 67 'phpVersionCheckUnsupportedNotice_' . self::PHP_MINIMUM, 68 68 'phpVersionCheck', 69 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>'69 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>' 70 70 ); 71 71 } -
wordfence/tags/7.4.9/lib/wordfenceClass.php
r2325400 r2337484 317 317 wfScanEngine::startScan(false, wfScanner::SCAN_TYPE_QUICK); 318 318 } 319 319 320 wfUpdateCheck::syncAllVersionInfo(); 321 320 322 wfConfig::remove('lastPermissionsTemplateCheck'); 321 323 } … … 1279 1281 1280 1282 add_action('upgrader_process_complete', 'wordfence::_refreshVulnerabilityCache'); 1283 add_action('upgrader_process_complete', 'wfUpdateCheck::syncAllVersionInfo'); 1281 1284 add_action('upgrader_process_complete', 'wordfence::_scheduleRefreshUpdateNotification', 99, 2); 1282 1285 add_action('wordfence_refreshUpdateNotification', 'wordfence::_refreshUpdateNotification', 99, 0); … … 2223 2226 'betaThreatDefenseFeed' => !!wfConfig::get('betaThreatDefenseFeed'), 2224 2227 'disableWAFIPBlocking' => wfConfig::get('disableWAFIPBlocking'), 2228 'wordpressVersion' => wfConfig::get('wordpressVersion'), 2229 'wordpressPluginVersions' => wfConfig::get_ser('wordpressPluginVersions'), 2230 'wordpressThemeVersions' => wfConfig::get_ser('wordpressThemeVersions'), 2225 2231 ); 2226 2232 if (wfUtils::isAdmin()) { … … 2529 2535 public static function jsonAPIAuthorFilter($response, $handler, $request) { 2530 2536 $route = $request->get_route(); 2531 if (!current_user_can(' list_users')) {2537 if (!current_user_can('edit_others_posts')) { 2532 2538 $urlBase = wfWP_REST_Users_Controller::wfGetURLBase(); 2533 2539 if (preg_match('~' . preg_quote($urlBase, '~') . '/*$~i', $route)) { … … 3491 3497 return compact('result'); 3492 3498 } 3499 public static function ajax_exportDiagnostics_callback(){ 3500 add_filter('gettext', 'wordfence::_diagnosticsTranslationDisabler', 0, 3); 3501 3502 $url = site_url(); 3503 $url = preg_replace('/^https?:\/\//i', '', $url); 3504 $url = preg_replace('/[^a-zA-Z0-9\.]+/', '_', $url); 3505 $url = preg_replace('/^_+/', '', $url); 3506 $url = preg_replace('/_+$/', '', $url); 3507 3508 header('Content-Type: application/octet-stream'); 3509 header('Content-Disposition: attachment; filename="diagnostics_for_' . $url . '.txt"'); 3510 3511 echo wfView::create('diagnostics/text', array( 3512 'diagnostic' => new wfDiagnostic, 3513 'plugins' => get_plugins(), 3514 )); 3515 exit; 3516 } 3493 3517 public static function _diagnosticsTranslationDisabler($translation, $text, $domain) { 3494 3518 return $text; … … 5804 5828 'switchTo2FANew', 'switchTo2FAOld', 5805 5829 'wfcentral_step1', 'wfcentral_step2', 'wfcentral_step3', 'wfcentral_step4', 'wfcentral_step5', 'wfcentral_step6', 'wfcentral_disconnect', 5830 'exportDiagnostics', 5806 5831 ) as $func){ 5807 5832 add_action('wp_ajax_wordfence_' . $func, 'wordfence::ajaxReceiver'); … … 5904 5929 'modalHTMLTemplate' => wfView::create('common/modal-prompt', array('title' => '${title}', 'message' => '{{html message}}', 'primaryButton' => array('id' => 'wf-generic-modal-close', 'label' => __('Close', 'wordfence'), 'link' => '#')))->render(), 5905 5930 'alertEmailBlacklist' => wfConfig::alertEmailBlacklist(), 5931 'supportURLs' => array( 5932 'scan-result-repair-modified-files' => esc_url_raw(wfSupportController::supportURL(wfSupportController::ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES)), 5933 ), 5906 5934 )); 5907 5935 } … … 7526 7554 $currentAutoPrependFile = ini_get('auto_prepend_file'); 7527 7555 $currentAutoPrepend = null; 7528 if (isset($_POST['currentAutoPrepend']) && !WF_IS_WP_ENGINE ) {7556 if (isset($_POST['currentAutoPrepend']) && !WF_IS_WP_ENGINE && !WF_IS_PRESSABLE) { 7529 7557 $currentAutoPrepend = $_POST['currentAutoPrepend']; 7530 7558 } … … 7688 7716 7689 7717 try { 7690 if ((!isset($_POST['iniModified']) || (isset($_POST['iniModified']) && !$_POST['iniModified'])) ) { //Uses .user.ini but not yet modified7718 if ((!isset($_POST['iniModified']) || (isset($_POST['iniModified']) && !$_POST['iniModified'])) && !WF_IS_PRESSABLE) { //Uses .user.ini but not yet modified 7691 7719 $hasPreviousAutoPrepend = $helper->performIniRemoval($wp_filesystem); 7692 7720 … … 7729 7757 } 7730 7758 else { //.user.ini and .htaccess modified if applicable and waiting period elapsed or otherwise ready to advance to next step 7731 if (WFWAF_AUTO_PREPEND && !WFWAF_SUBDIRECTORY_INSTALL && !WF_IS_WP_ENGINE ) { //.user.ini modified, but the WAF is still enabled7759 if (WFWAF_AUTO_PREPEND && !WFWAF_SUBDIRECTORY_INSTALL && !WF_IS_WP_ENGINE && !WF_IS_PRESSABLE) { //.user.ini modified, but the WAF is still enabled 7732 7760 $retryAttempted = (isset($_POST['retryAttempted']) && $_POST['retryAttempted']); 7733 7761 $userIniError = '<p class="wf-error">'; … … 8489 8517 8490 8518 public static function getWAFBootstrapPath() { 8519 if (WF_IS_PRESSABLE) { 8520 return WP_CONTENT_DIR . '/wordfence-waf.php'; 8521 } 8491 8522 return ABSPATH . 'wordfence-waf.php'; 8492 8523 } -
wordfence/tags/7.4.9/modules/login-security/wordfence-login-security.php
r2325400 r2337484 28 28 29 29 define('WORDFENCE_LS_VERSION', '1.0.5'); 30 define('WORDFENCE_LS_BUILD_NUMBER', '159 2338782');30 define('WORDFENCE_LS_BUILD_NUMBER', '1594219913'); 31 31 32 32 if (!defined('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES')) { define('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES', 15); } -
wordfence/tags/7.4.9/readme.txt
r2325413 r2337484 5 5 Requires PHP: 5.3 6 6 Tested up to: 5.4 7 Stable tag: 7.4. 87 Stable tag: 7.4.9 8 8 9 9 Secure your website with the most comprehensive WordPress security plugin. Firewall, malware scan, blocking, live traffic, login security & more. … … 184 184 == Changelog == 185 185 186 = 7.4.9 - July 8, 2020 = 187 188 * Improvement: Added list of known malicious usernames to suspicious administrator scan. 189 * Improvement: Added ability for the WAF to determine if a given plugin/theme/core version is installed. 190 * Improvement: Added a feature to export a diagnostics report. 191 * Improvement: Add php_errorlog to the list of downloadable logs in diagnostics. 192 * Improvement: Added a prompt to allow user to download a backup prior to repairing files. 193 * Improvement: Prevent scan from failing when the home URL has changed and the key is no longer valid. 194 * Improvement: Deprecated PHP 5.3, and ended PHP 5.2 support by prevent auto-update from running on older versions. 195 * Fix: Fixed issue where WAF mysqli storage engine cannot find credentials if wflogs/ does not exist. 196 * Fix: Changed capability checked to read WP REST API users endpoint when "Prevent discovery of usernames through ..." is enabled. 197 * Fix: Prevented duplicate queries for wordfenceCentralConnected wfconfig value. 198 * Fix: Prevented custom wp-content or other directories from appearing in "skipped paths" scan result, even when scanned. 199 * Fix: Login Attempts dashboard widget "Show more" link is not visible when long usernames and IPs cause wrapping. 200 * Fix: Fix typo in the readme. 201 186 202 = 7.4.8 - June 16, 2020 = 187 203 * Fix: Fixed issue with fatal errors encountered during activation under certain conditions. … … 194 210 * Improvement: Added the state/province name when applicable to geolocation displays in Live Traffic. 195 211 * Improvement: New blocking page design to better inform blocked visitors on how to resolve the block. 196 * Improvement: Custom WP_CONTENT_DIR, WP_PLUGIN_D UR, and UPLOADS path constants will now get scanned correctly.212 * Improvement: Custom WP_CONTENT_DIR, WP_PLUGIN_DIR, and UPLOADS path constants will now get scanned correctly. 197 213 * Improvement: Added TLS connection failure detection to brute force reporting and checking and a corresponding backoff period. 198 214 * Fix: Fixed an issue where a bad cron record could interfere with automatic WAF rule updates. -
wordfence/tags/7.4.9/vendor/wordfence/wf-waf/src/init.php
r2143823 r2337484 6 6 define('WFWAF_LIB_PATH', WFWAF_PATH . 'lib/'); 7 7 define('WFWAF_VIEW_PATH', WFWAF_PATH . 'views/'); 8 define('WFWAF_API_URL_SEC', 'https://noc4.wordfence.com/v1. 8/');8 define('WFWAF_API_URL_SEC', 'https://noc4.wordfence.com/v1.9/'); 9 9 if (!defined('WFWAF_DEBUG')) { 10 10 define('WFWAF_DEBUG', false); -
wordfence/tags/7.4.9/vendor/wordfence/wf-waf/src/lib/rules.php
r2226721 r2337484 497 497 'urlschemematches', 498 498 'urlschemenotmatches', 499 'versionequals', 500 'versionnotequals', 501 'versiongreaterthan', 502 'versiongreaterthanequalto', 503 'versionlessthan', 504 'versionlessthanequalto', 499 505 ); 500 506 … … 1132 1138 } 1133 1139 1140 public function versionEquals($subject) { 1141 if ($subject === null) { 1142 return false; 1143 } 1144 return version_compare($subject, $this->getExpected(), '=='); 1145 } 1146 1147 public function versionNotEquals($subject) { 1148 if ($subject === null) { 1149 return false; 1150 } 1151 return version_compare($subject, $this->getExpected(), '!='); 1152 } 1153 1154 public function versionGreaterThan($subject) { 1155 if ($subject === null) { 1156 return false; 1157 } 1158 return version_compare($subject, $this->getExpected(), '>'); 1159 } 1160 1161 public function versionGreaterThanEqualTo($subject) { 1162 if ($subject === null) { 1163 return false; 1164 } 1165 return version_compare($subject, $this->getExpected(), '>='); 1166 } 1167 1168 public function versionLessThan($subject) { 1169 if ($subject === null) { 1170 return false; 1171 } 1172 return version_compare($subject, $this->getExpected(), '<'); 1173 } 1174 1175 public function versionLessThanEqualTo($subject) { 1176 if ($subject === null) { 1177 return false; 1178 } 1179 return version_compare($subject, $this->getExpected(), '<='); 1180 } 1181 1134 1182 /** 1135 1183 * @return mixed -
wordfence/tags/7.4.9/views/scanner/issue-control-repair.php
r1808795 r2337484 2 2 if (!defined('WORDFENCE_VERSION')) { exit; } 3 3 ?> 4 {{if data.canFix}}<a href="#" class="wf-issue-control wf-issue-control-repair" ><svg class="wf-issue-control-icon" viewBox="0 0 106.7 106.7"><path d="M104.94,18.77a4,4,0,0,0-1.17-2.93L90.86,2.93a4.25,4.25,0,0,0-5.87,0L1.17,86.75a4.25,4.25,0,0,0,0,5.86l12.91,12.91A4,4,0,0,0,17,106.7a4,4,0,0,0,2.93-1.17L103.77,21.7a4,4,0,0,0,1.17-2.93ZM75.8,37.87l-7-7,19.1-19.1,7,7Zm0,0"/><path d="M14.93,16.68l2-6.39,6.39-2-6.39-2L14.93,0,13,6.39l-6.39,2,6.39,2Zm0,0"/><path d="M31.87,24.77l3.91,12.77L39.7,24.77l12.77-3.91L39.7,16.95,35.78,4.17,31.87,16.95,19.1,20.86Zm0,0"/><path d="M100.31,48.1l-2-6.39-2,6.39-6.39,2,6.39,2,2,6.39,2-6.39,6.39-2Zm0,0"/><path d="M56.64,16.68l2-6.39,6.39-2-6.39-2L56.64,0l-2,6.39-6.39,2,6.39,2Zm0,0"/></svg><span class="wf-issue-control-label"><?php _e('Repair', 'wordfence'); ?></span></a>{{/if}}4 {{if data.canFix}}<a href="#" class="wf-issue-control wf-issue-control-repair" data-file="${data.file}"><svg class="wf-issue-control-icon" viewBox="0 0 106.7 106.7"><path d="M104.94,18.77a4,4,0,0,0-1.17-2.93L90.86,2.93a4.25,4.25,0,0,0-5.87,0L1.17,86.75a4.25,4.25,0,0,0,0,5.86l12.91,12.91A4,4,0,0,0,17,106.7a4,4,0,0,0,2.93-1.17L103.77,21.7a4,4,0,0,0,1.17-2.93ZM75.8,37.87l-7-7,19.1-19.1,7,7Zm0,0"/><path d="M14.93,16.68l2-6.39,6.39-2-6.39-2L14.93,0,13,6.39l-6.39,2,6.39,2Zm0,0"/><path d="M31.87,24.77l3.91,12.77L39.7,24.77l12.77-3.91L39.7,16.95,35.78,4.17,31.87,16.95,19.1,20.86Zm0,0"/><path d="M100.31,48.1l-2-6.39-2,6.39-6.39,2,6.39,2,2,6.39,2-6.39,6.39-2Zm0,0"/><path d="M56.64,16.68l2-6.39,6.39-2-6.39-2L56.64,0l-2,6.39-6.39,2,6.39,2Zm0,0"/></svg><span class="wf-issue-control-label"><?php _e('Repair', 'wordfence'); ?></span></a>{{/if}} -
wordfence/tags/7.4.9/views/scanner/options-group-general.php
r2187129 r2337484 47 47 array('key' => 'scansEnabled_suspiciousOptions', 'label' => __('Scan WordPress core, plugin, and theme options for known dangerous URLs and suspicious content', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MALWARE_OPTIONS)), 48 48 array('key' => 'scansEnabled_oldVersions', 'label' => __('Scan for out of date, abandoned, and vulnerable plugins, themes, and WordPress versions', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UPDATES)), 49 array('key' => 'scansEnabled_suspiciousAdminUsers', 'label' => __('Scan for admin users created outside of WordPress', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UNKNOWN_ADMINS)),49 array('key' => 'scansEnabled_suspiciousAdminUsers', 'label' => __('Scan for suspicious admin users created outside of WordPress', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UNKNOWN_ADMINS)), 50 50 array('key' => 'scansEnabled_passwds', 'label' => __('Check the strength of passwords', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_PASSWORD_STRENGTH)), 51 51 array('key' => 'scansEnabled_diskSpace', 'label' => __('Monitor disk space', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_DISK_SPACE)), -
wordfence/tags/7.4.9/views/waf/waf-install.php
r2143823 r2337484 18 18 <?php 19 19 $currentAutoPrependFile = ini_get('auto_prepend_file'); 20 if (empty($currentAutoPrependFile) || WF_IS_WP_ENGINE ):20 if (empty($currentAutoPrependFile) || WF_IS_WP_ENGINE || WF_IS_PRESSABLE): 21 21 ?> 22 22 <p><?php _e('To make your site as secure as possible, the Wordfence Web Application Firewall is designed to run via a PHP setting called <code>auto_prepend_file</code>, which ensures it runs before any potentially vulnerable code runs.', 'wordfence'); ?></p> -
wordfence/tags/7.4.9/views/waf/waf-uninstall.php
r2143823 r2337484 17 17 <div class="wf-modal-content"> 18 18 <?php 19 if (WF_IS_WP_ENGINE ) {19 if (WF_IS_WP_ENGINE || WF_IS_PRESSABLE) { 20 20 $currentAutoPrependFile = wordfence::getWAFBootstrapPath(); 21 21 } else { -
wordfence/tags/7.4.9/waf/bootstrap.php
r2290265 r2337484 12 12 if (!defined('WF_IS_WP_ENGINE')) { 13 13 define('WF_IS_WP_ENGINE', isset($_SERVER['IS_WPE'])); 14 } 15 if (!defined('WF_IS_PRESSABLE')) { 16 define('WF_IS_PRESSABLE', (defined('IS_ATOMIC') && IS_ATOMIC) || (defined('IS_PRESSABLE') && IS_PRESSABLE)); 14 17 } 15 18 … … 693 696 @chmod(rtrim(WFWAF_LOG_PATH, '/') . '/.htaccess', (wfWAFWordPress::permissions() | 0444)); 694 697 } 698 699 public function getGlobal($global) { 700 if (wfWAFUtils::strpos($global, '.') === false) { 701 return null; 702 } 703 list($prefix, $_global) = explode('.', $global); 704 switch ($prefix) { 705 case 'wordpress': 706 if ($_global === 'core') { 707 return $this->getStorageEngine()->getConfig('wordpressVersion', null, 'synced'); 708 } else if ($_global === 'plugins') { 709 return $this->getStorageEngine()->getConfig('wordpressPluginVersions', null, 'synced'); 710 } else if ($_global === 'themes') { 711 return $this->getStorageEngine()->getConfig('wordpressThemeVersions', null, 'synced'); 712 } 713 break; 714 } 715 return parent::getGlobal($global); 716 } 717 } 718 719 class wfWAFWordPressStorageMySQL extends wfWAFStorageMySQL { 720 721 public function getSerializedParams() { 722 $params = parent::getSerializedParams(); 723 $params[] = 'wordpressPluginVersions'; 724 $params[] = 'wordpressThemeVersions'; 725 return $params; 726 } 727 728 public function getAutoloadParams() { 729 $params = parent::getAutoloadParams(); 730 $params['synced'][] = 'wordpressVersion'; 731 $params['synced'][] = 'wordpressPluginVersions'; 732 $params['synced'][] = 'wordpressThemeVersions'; 733 return $params; 734 } 695 735 } 696 736 … … 718 758 case 'mysqli': 719 759 // Find the wp-config.php 720 if (file_exists(dirname(WFWAF_LOG_PATH) . '/../wp-config.php')) { 721 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(WFWAF_LOG_PATH . '/../../wp-config.php'); 722 } else if (file_exists(dirname(WFWAF_LOG_PATH) . '/../../wp-config.php')) { 723 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(WFWAF_LOG_PATH . '/../../../wp-config.php'); 760 if (is_dir(dirname(WFWAF_LOG_PATH))) { 761 if (file_exists(dirname(WFWAF_LOG_PATH) . '/../wp-config.php')) { 762 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(dirname(WFWAF_LOG_PATH) . '/../wp-config.php'); 763 } else if (file_exists(dirname(WFWAF_LOG_PATH) . '/../../wp-config.php')) { 764 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(dirname(WFWAF_LOG_PATH) . '/../../wp-config.php'); 765 } 766 } else if (!empty($_SERVER['DOCUMENT_ROOT'])) { 767 if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/wp-config.php')) { 768 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig($_SERVER['DOCUMENT_ROOT'] . '/wp-config.php'); 769 } else if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/../wp-config.php')) { 770 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig($_SERVER['DOCUMENT_ROOT'] . '/../wp-config.php'); 771 } 724 772 } 725 773 726 774 if (!empty($wfWAFDBCredentials)) { 727 $wfWAFStorageEngine = new wfWAF StorageMySQL(new wfWAFStorageEngineMySQLi(), $wfWAFDBCredentials['tablePrefix']);775 $wfWAFStorageEngine = new wfWAFWordPressStorageMySQL(new wfWAFStorageEngineMySQLi(), $wfWAFDBCredentials['tablePrefix']); 728 776 $wfWAFStorageEngine->getDb()->connect( 729 777 $wfWAFDBCredentials['user'], -
wordfence/tags/7.4.9/wordfence.php
r2325400 r2337484 5 5 Description: Wordfence Security - Anti-virus, Firewall and Malware Scan 6 6 Author: Wordfence 7 Version: 7.4. 87 Version: 7.4.9 8 8 Author URI: http://www.wordfence.com/ 9 9 Network: true … … 16 16 exit; 17 17 } 18 define('WORDFENCE_VERSION', '7.4. 8');19 define('WORDFENCE_BUILD_NUMBER', '159 2338782');18 define('WORDFENCE_VERSION', '7.4.9'); 19 define('WORDFENCE_BUILD_NUMBER', '1594219913'); 20 20 define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) : 21 21 basename(dirname(__FILE__)) . '/' . basename(__FILE__)); … … 37 37 if (!defined('WF_IS_WP_ENGINE')) { 38 38 define('WF_IS_WP_ENGINE', isset($_SERVER['IS_WPE'])); 39 } 40 if (!defined('WF_IS_PRESSABLE')) { 41 define('WF_IS_PRESSABLE', (defined('IS_ATOMIC') && IS_ATOMIC) || (defined('IS_PRESSABLE') && IS_PRESSABLE)); 39 42 } 40 43 -
wordfence/trunk/lib/menu_options.php
r2290265 r2337484 163 163 'wf-option-scansEnabled-suspiciousOptions' => __('Scan WordPress core, plugin, and theme options for known dangerous URLs and suspicious content', 'wordfence'), 164 164 'wf-option-scansEnabled-oldVersions' => __('Scan for out of date, abandoned, and vulnerable plugins, themes, and WordPress versions', 'wordfence'), 165 'wf-option-scansEnabled-suspiciousAdminUsers' => __('Scan for admin users created outside of WordPress', 'wordfence'),165 'wf-option-scansEnabled-suspiciousAdminUsers' => __('Scan for suspicious admin users created outside of WordPress', 'wordfence'), 166 166 'wf-option-scansEnabled-passwds' => __('Check the strength of passwords', 'wordfence'), 167 167 'wf-option-scansEnabled-diskSpace' => __('Monitor disk space', 'wordfence'), -
wordfence/trunk/lib/menu_scanner.php
r2226721 r2337484 21 21 } 22 22 ?> 23 <div id="wordfenceMode_scan"></div> 23 24 <div class="wrap wordfence"> 24 25 <div class="wf-container-fluid"> -
wordfence/trunk/lib/menu_tools_diagnostic.php
r2131558 r2337484 40 40 <div id="sendByEmailDiv" class="wf-add-bottom"> 41 41 <span class="wf-nowrap"> 42 <input class="wf-btn wf-btn-primary" type="submit" id="sendByEmail" value="Send Report by Email"/> 43 <input class="wf-btn wf-btn-default" type="button" id="expandAllDiagnostics" value="Expand All Diagnostics"/> 42 <input class="wf-btn wf-btn-primary wf-btn-sm" type="submit" id="exportDiagnostics" value="Export"/> 43 <input class="wf-btn wf-btn-primary wf-btn-sm" type="submit" id="sendByEmail" value="Send Report by Email"/> 44 <input class="wf-btn wf-btn-default wf-btn-sm" type="button" id="expandAllDiagnostics" value="Expand All Diagnostics"/> 44 45 </span> 45 46 </div> -
wordfence/trunk/lib/wfCentralAPI.php
r2131558 r2337484 320 320 */ 321 321 public static function isConnected() { 322 return self::isSupported() && ((bool) wfConfig::get('wordfenceCentralConnected', false));322 return self::isSupported() && ((bool) self::_isConnected()); 323 323 } 324 324 … … 327 327 */ 328 328 public static function isPartialConnection() { 329 return !wfConfig::get('wordfenceCentralConnected') && wfConfig::get('wordfenceCentralSiteID'); 329 return !self::_isConnected() && wfConfig::get('wordfenceCentralSiteID'); 330 } 331 332 public static function _isConnected($forceUpdate = false) { 333 static $isConnected; 334 if (!isset($isConnected) || $forceUpdate) { 335 $isConnected = wfConfig::get('wordfenceCentralConnected', false); 336 } 337 return $isConnected; 330 338 } 331 339 -
wordfence/trunk/lib/wfConfig.php
r2290265 r2337484 225 225 ), 226 226 ); 227 public static $serializedOptions = array('lastAdminLogin', 'scanSched', 'emailedIssuesList', 'wf_summaryItems', 'adminUserList', 'twoFactorUsers', 'alertFreqTrack', 'wfStatusStartMsgs', 'vulnerabilities_plugin', 'vulnerabilities_theme', 'dashboardData', 'malwarePrefixes', 'coreHashes', 'noc1ScanSchedule', 'allScansScheduled', 'disclosureStates', 'scanStageStatuses', 'adminNoticeQueue' );227 public static $serializedOptions = array('lastAdminLogin', 'scanSched', 'emailedIssuesList', 'wf_summaryItems', 'adminUserList', 'twoFactorUsers', 'alertFreqTrack', 'wfStatusStartMsgs', 'vulnerabilities_plugin', 'vulnerabilities_theme', 'dashboardData', 'malwarePrefixes', 'coreHashes', 'noc1ScanSchedule', 'allScansScheduled', 'disclosureStates', 'scanStageStatuses', 'adminNoticeQueue', 'suspiciousAdminUsernames', 'wordpressPluginVersions', 'wordpressThemeVersions'); 228 228 // Configuration keypairs that can be set from Central. 229 229 private static $wfCentralInternalConfig = array( … … 932 932 } 933 933 public static function autoUpdate(){ 934 // Prevent auto-update for PHP 5.2. Consider tying this into `wfVersionCheckController::PHP_DEPRECATING`. 935 if (version_compare(PHP_VERSION, '5.3', '<')) { 936 return; 937 } 938 934 939 if (!wfConfig::get('other_bypassLitespeedNoabort', false) && getenv('noabort') != '1' && stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false) { 935 940 $lastEmail = self::get('lastLiteSpdEmail', false); -
wordfence/trunk/lib/wfDashboard.php
r2025430 r2337484 225 225 226 226 // Wordfence Central 227 $this->wordfenceCentralConnected = wfC onfig::get('wordfenceCentralConnected');227 $this->wordfenceCentralConnected = wfCentral::_isConnected(); // This value is cached. 228 228 $this->wordfenceCentralConnectTime = wfConfig::get('wordfenceCentralConnectTime'); 229 229 $this->wordfenceCentralConnectEmail = wfConfig::get('wordfenceCentralConnectEmail'); -
wordfence/trunk/lib/wfHelperString.php
r1128972 r2337484 20 20 return $return_val; 21 21 } 22 23 public static function plainTextTable($table) { 24 if (count($table) === 0) { 25 return ''; 26 } 27 $colLengths = array(); 28 for ($row = 0; $row < count($table); $row++) { 29 for ($col = 0; $col < count($table[$row]); $col++) { 30 foreach (explode("\n", $table[$row][$col]) as $colText) { 31 if (!isset($colLengths[$col])) { 32 $colLengths[$col] = strlen($colText); 33 continue; 34 } 35 $len = strlen($colText); 36 if ($len > $colLengths[$col]) { 37 $colLengths[$col] = $len; 38 } 39 } 40 } 41 } 42 $hr = str_repeat('-', array_sum($colLengths) + (count($colLengths) * 3) + 1); 43 $output = $hr . "\n"; 44 for ($row = 0; $row < count($table); $row++) { 45 $colHeight = 0; 46 for ($col = 0; $col < count($table[$row]); $col++) { 47 $height = substr_count($table[$row][$col], "\n"); 48 if ($height > $colHeight) { 49 $colHeight = $height; 50 } 51 } 52 for ($colRow = 0; $colRow <= $colHeight; $colRow++) { 53 for ($col = 0; $col < count($table[$row]); $col++) { 54 $colRows = explode("\n", $table[$row][$col]); 55 $output .= '| ' . str_pad(isset($colRows[$colRow]) ? $colRows[$colRow] : '', $colLengths[$col], ' ', STR_PAD_RIGHT) . ' '; 56 } 57 $output .= "|\n"; 58 } 59 if ($row === 0) { 60 $output .= $hr . "\n"; 61 } 62 } 63 return trim($output . (count($table) > 1 ? $hr : '')); 64 } 22 65 } -
wordfence/trunk/lib/wfLog.php
r2226721 r2337484 1057 1057 class wfAdminUserMonitor { 1058 1058 1059 protected $currentAdminList = array(); 1060 1059 1061 public function isEnabled() { 1060 1062 $options = wfScanner::shared()->scanOptions(); … … 1074 1076 public function createInitialList() { 1075 1077 $admins = $this->getCurrentAdmins(); 1076 wfConfig::set_ser('adminUserList', $admins); 1078 $adminUserList = array(); 1079 foreach ($admins as $id => $user) { 1080 $adminUserList[$id] = 1; 1081 } 1082 wfConfig::set_ser('adminUserList', $adminUserList); 1077 1083 } 1078 1084 … … 1136 1142 1137 1143 /** 1144 * @param bool $forceReload 1138 1145 * @return array 1139 1146 */ 1140 public function getCurrentAdmins() { 1141 require_once(ABSPATH . WPINC . '/user.php'); 1142 if (is_multisite()) { 1143 if (function_exists("get_sites")) { 1144 $sites = get_sites(array( 1145 'network_id' => null, 1147 public function getCurrentAdmins($forceReload = false) { 1148 if (empty($this->currentAdminList) || $forceReload) { 1149 require_once(ABSPATH . WPINC . '/user.php'); 1150 if (is_multisite()) { 1151 if (function_exists("get_sites")) { 1152 $sites = get_sites(array( 1153 'network_id' => null, 1154 )); 1155 } 1156 else { 1157 $sites = wp_get_sites(array( 1158 'network_id' => null, 1159 )); 1160 } 1161 } else { 1162 $sites = array(array( 1163 'blog_id' => get_current_blog_id(), 1146 1164 )); 1147 1165 } 1148 else { 1149 $sites = wp_get_sites(array( 1150 'network_id' => null, 1166 1167 // not very efficient, but the WordPress API doesn't provide a good way to do this. 1168 $this->currentAdminList = array(); 1169 foreach ($sites as $siteRow) { 1170 $siteRowArray = (array) $siteRow; 1171 $user_query = new WP_User_Query(array( 1172 'blog_id' => $siteRowArray['blog_id'], 1173 'role' => 'administrator', 1151 1174 )); 1152 } 1153 } else { 1154 $sites = array(array( 1155 'blog_id' => get_current_blog_id(), 1156 )); 1157 } 1158 1159 // not very efficient, but the WordPress API doesn't provide a good way to do this. 1160 $admins = array(); 1161 foreach ($sites as $siteRow) { 1162 $siteRowArray = (array) $siteRow; 1163 $user_query = new WP_User_Query(array( 1164 'blog_id' => $siteRowArray['blog_id'], 1165 'role' => 'administrator', 1166 )); 1167 $users = $user_query->get_results(); 1168 if (is_array($users)) { 1169 /** @var WP_User $user */ 1170 foreach ($users as $user) { 1171 $admins[$user->ID] = 1; 1172 } 1173 } 1174 } 1175 1176 // Add any super admins that aren't also admins on a network 1177 $superAdmins = get_super_admins(); 1178 foreach ($superAdmins as $userLogin) { 1179 $user = get_user_by('login', $userLogin); 1180 if ($user) { 1181 $admins[$user->ID] = 1; 1182 } 1183 } 1184 return $admins; 1175 $users = $user_query->get_results(); 1176 if (is_array($users)) { 1177 /** @var WP_User $user */ 1178 foreach ($users as $user) { 1179 $this->currentAdminList[$user->ID] = $user; 1180 } 1181 } 1182 } 1183 1184 // Add any super admins that aren't also admins on a network 1185 $superAdmins = get_super_admins(); 1186 foreach ($superAdmins as $userLogin) { 1187 $user = get_user_by('login', $userLogin); 1188 if ($user) { 1189 $this->currentAdminList[$user->ID] = $user; 1190 } 1191 } 1192 } 1193 1194 return $this->currentAdminList; 1185 1195 } 1186 1196 … … 1995 2005 if (is_file($path)) { 1996 2006 $file = basename($path); 1997 if (preg_match('#(?: error_log(\-\d+)?$|\.log$)#i', $file)) {2007 if (preg_match('#(?:^php_errorlog$|error_log(\-\d+)?$|\.log$)#i', $file)) { 1998 2008 return array($path => is_readable($path)); 1999 2009 } -
wordfence/trunk/lib/wfScan.php
r2205414 r2337484 257 257 self::status(2, 'info', "Wordfence used " . wfUtils::formatBytes($peakMemory - self::$peakMemAtStart) . " of memory for scan. Server peak memory usage was: " . wfUtils::formatBytes($peakMemory)); 258 258 self::status(2, 'error', "Scan terminated with error: " . $e->getMessage()); 259 260 if (preg_match('/The Wordfence API key you\'re using is already being used by: (\S*?) /', $e->getMessage(), $matches)) { 261 wordfence::alert(__('Wordfence scan failed because of license site URL conflict', 'wordfence'), sprintf(__(<<<MSG 262 The Wordfence scan has failed because the Wordfence API key you're using is already being used by: %s 263 264 If you have changed your blog URL, please sign-in to Wordfence, purchase a new key or reset an existing key, and then enter that key on this site's Wordfence Options page. 265 MSG 266 , 'wordfence'), $matches[1]), false); 267 } 268 259 269 exit(); 260 270 } -
wordfence/trunk/lib/wfScanEngine.php
r2290265 r2337484 815 815 $fullFile = rtrim(ABSPATH, '/') . '/' . $file; 816 816 if (!wfUtils::fileTooBig($fullFile)) { //Silently ignore files that are too large for the purposes of inclusion in the scan issue 817 if (in_array($file, $base_abspath_relative) || (@is_file($fullFile) && @is_readable($fullFile))) {817 if (in_array($file, $base_abspath_relative) || in_array($fullFile, $base_absolute) || (@is_file($fullFile) && @is_readable($fullFile))) { 818 818 $scanned[] = realpath($fullFile); 819 819 } … … 1802 1802 1803 1803 $adminUsers = new wfAdminUserMonitor(); 1804 if ($adminUsers->isEnabled() && $suspiciousAdmins = $adminUsers->checkNewAdmins()) { 1805 foreach ($suspiciousAdmins as $userID) { 1806 $this->scanController->incrementSummaryItem(wfScanner::SUMMARY_SCANNED_USERS); 1807 $user = new WP_User($userID); 1804 if ($adminUsers->isEnabled()) { 1805 try { 1806 $response = $this->api->call('suspicious_admin_usernames'); 1807 if (is_array($response) && isset($response['ok']) && wfUtils::truthyToBoolean($response['ok']) && !empty($response['patterns'])) { 1808 wfConfig::set_ser('suspiciousAdminUsernames', $response['patterns']); 1809 } 1810 } catch (Exception $e) { 1811 // Let the rest of the scan continue 1812 } 1813 1814 $suspiciousAdmins = $adminUsers->checkNewAdmins(); 1815 if (is_array($suspiciousAdmins)) { 1816 foreach ($suspiciousAdmins as $userID) { 1817 $this->scanController->incrementSummaryItem(wfScanner::SUMMARY_SCANNED_USERS); 1818 $user = new WP_User($userID); 1819 $key = 'suspiciousAdminUsers' . $userID; 1820 $added = $this->addIssue('suspiciousAdminUsers', wfIssues::SEVERITY_HIGH, $key, $key, 1821 sprintf(__("An admin user with the username %s was created outside of WordPress.", 'wordfence'), esc_html($user->user_login)), 1822 sprintf(__("An admin user with the username %s was created outside of WordPress. It's possible a plugin could have created the account, but if you do not recognize the user, we suggest you remove it.", 'wordfence'), esc_html($user->user_login)), 1823 array( 1824 'userID' => $userID, 1825 )); 1826 if ($added == wfIssues::ISSUE_ADDED || $added == wfIssues::ISSUE_UPDATED) { $haveIssues = wfIssues::STATUS_PROBLEM; } 1827 else if ($haveIssues != wfIssues::STATUS_PROBLEM && ($added == wfIssues::ISSUE_IGNOREP || $added == wfIssues::ISSUE_IGNOREC)) { $haveIssues = wfIssues::STATUS_IGNORED; } 1828 } 1829 } 1830 1831 $admins = $adminUsers->getCurrentAdmins(); 1832 /** 1833 * @var WP_User $adminUser 1834 */ 1835 foreach ($admins as $userID => $adminUser) { 1836 $added = false; 1808 1837 $key = 'suspiciousAdminUsers' . $userID; 1809 $added = $this->addIssue('suspiciousAdminUsers', wfIssues::SEVERITY_HIGH, $key, $key, 1810 "An admin user with the username " . esc_html($user->user_login) . " was created outside of WordPress.", 1811 "An admin user with the username " . esc_html($user->user_login) . " was created outside of WordPress. It's 1812 possible a plugin could have created the account, but if you do not recognize the user, we suggest you remove 1813 it.", 1814 array( 1815 'userID' => $userID, 1816 )); 1838 1839 // Check against user name list here. 1840 $suspiciousAdminUsernames = wfConfig::get_ser('suspiciousAdminUsernames'); 1841 if (is_array($suspiciousAdminUsernames)) { 1842 foreach ($suspiciousAdminUsernames as $usernamePattern) { 1843 if (preg_match($usernamePattern, $adminUser->user_login)) { 1844 $added = $this->addIssue('suspiciousAdminUsers', wfIssues::SEVERITY_HIGH, $key, $key, 1845 sprintf(__("An admin user with a suspicious username %s was found.", 'wordfence'), esc_html($adminUser->user_login)), 1846 sprintf(__("An admin user with a suspicious username %s was found. Administrators accounts with usernames similar to this are commonly seen created by hackers. It's possible a plugin could have created the account, but if you do not recognize the user, we suggest you remove it.", 'wordfence'), esc_html($adminUser->user_login)), 1847 array( 1848 'userID' => $userID, 1849 )); 1850 } 1851 } 1852 } 1853 1817 1854 if ($added == wfIssues::ISSUE_ADDED || $added == wfIssues::ISSUE_UPDATED) { $haveIssues = wfIssues::STATUS_PROBLEM; } 1818 1855 else if ($haveIssues != wfIssues::STATUS_PROBLEM && ($added == wfIssues::ISSUE_IGNOREP || $added == wfIssues::ISSUE_IGNOREC)) { $haveIssues = wfIssues::STATUS_IGNORED; } -
wordfence/trunk/lib/wfSupportController.php
r2226721 r2337484 148 148 const ITEM_SCAN_RESULT_UNKNOWN_FILE_CORE = 'scan-result-unknown-file-in-wordpress-core'; 149 149 const ITEM_SCAN_RESULT_SKIPPED_PATHS = 'scan-result-skipped-paths'; 150 150 const ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES = 'scan-result-repair-modified-files'; 151 151 152 const ITEM_TOOLS_TWO_FACTOR = 'tools-two-factor'; 152 153 const ITEM_TOOLS_LIVE_TRAFFIC = 'tools-live-traffic'; … … 325 326 case self::ITEM_SCAN_RESULT_UNKNOWN_FILE_CORE: 326 327 case self::ITEM_SCAN_RESULT_SKIPPED_PATHS: 327 328 case self::ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES: 329 328 330 case self::ITEM_TOOLS_TWO_FACTOR: 329 331 case self::ITEM_TOOLS_LIVE_TRAFFIC: -
wordfence/trunk/lib/wfUpdateCheck.php
r2131558 r2337484 10 10 private $theme_updates = array(); 11 11 private $api = null; 12 13 public static function syncAllVersionInfo() { 14 // Load the core/plugin/theme versions into the WAF configuration. 15 wfConfig::set('wordpressVersion', wfUtils::getWPVersion()); 16 wfWAFConfig::set('wordpressVersion', wfUtils::getWPVersion(), wfWAF::getInstance(), 'synced'); 17 18 if (!function_exists('get_plugins')) { 19 require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 20 } 21 22 $pluginVersions = array(); 23 foreach (get_plugins() as $pluginFile => $pluginData) { 24 $slug = plugin_basename($pluginFile); 25 if (preg_match('/^([^\/]+)\//', $pluginFile, $matches)) { 26 $slug = $matches[1]; 27 } else if (preg_match('/^([^\/.]+)\.php$/', $pluginFile, $matches)) { 28 $slug = $matches[1]; 29 } 30 $pluginVersions[$slug] = isset($pluginData['Version']) ? $pluginData['Version'] : null; 31 } 32 33 wfConfig::set_ser('wordpressPluginVersions', $pluginVersions); 34 wfWAFConfig::set('wordpressPluginVersions', $pluginVersions, wfWAF::getInstance(), 'synced'); 35 36 if (!function_exists('wp_get_themes')) { 37 require_once(ABSPATH . '/wp-includes/theme.php'); 38 } 39 40 $themeVersions = array(); 41 foreach (wp_get_themes() as $slug => $theme) { 42 $themeVersions[$slug] = isset($theme['Version']) ? $theme['Version'] : null; 43 } 44 45 wfConfig::set_ser('wordpressThemeVersions', $themeVersions); 46 wfWAFConfig::set('wordpressThemeVersions', $themeVersions, wfWAF::getInstance(), 'synced'); 47 } 12 48 13 49 public function __construct() { -
wordfence/trunk/lib/wfVersionCheckController.php
r1879365 r2337484 6 6 const VERSION_UNSUPPORTED = 'unsupported'; 7 7 8 const PHP_DEPRECATING = '5. 3.0'; //When greater than PHP_MINIMUM, will issue a discontinuing warning the first time we check it and find a version less than this (also applies to the other similar constant pairs)9 const PHP_MINIMUM = '5. 2.0'; //The currently supported minimum8 const PHP_DEPRECATING = '5.5.0'; //When greater than PHP_MINIMUM, will issue a discontinuing warning the first time we check it and find a version less than this (also applies to the other similar constant pairs) 9 const PHP_MINIMUM = '5.3.0'; //The currently supported minimum 10 10 11 11 const OPENSSL_DEPRECATING = '1.0.1'; … … 48 48 'phpVersionCheckDeprecationEmail_' . self::PHP_DEPRECATING, 49 49 __('PHP version too old', 'wordfence'), 50 sprintf(__('Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP))50 sprintf(__('Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP)) 51 51 ); 52 52 … … 54 54 'phpVersionCheckDeprecationNotice_' . self::PHP_DEPRECATING, 55 55 'phpVersionCheck', 56 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>'56 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>' 57 57 ); 58 58 } … … 61 61 'phpVersionCheckUnsupportedEmail_' . self::PHP_MINIMUM, 62 62 __('PHP version too old', 'wordfence'), 63 sprintf(__('Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP))63 sprintf(__('Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP)) 64 64 ); 65 65 … … 67 67 'phpVersionCheckUnsupportedNotice_' . self::PHP_MINIMUM, 68 68 'phpVersionCheck', 69 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>'69 sprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP available but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '" target="_blank" rel="noopener noreferrer">' . __('Learn More', 'wordfence') . '</a>' 70 70 ); 71 71 } -
wordfence/trunk/lib/wordfenceClass.php
r2325400 r2337484 317 317 wfScanEngine::startScan(false, wfScanner::SCAN_TYPE_QUICK); 318 318 } 319 319 320 wfUpdateCheck::syncAllVersionInfo(); 321 320 322 wfConfig::remove('lastPermissionsTemplateCheck'); 321 323 } … … 1279 1281 1280 1282 add_action('upgrader_process_complete', 'wordfence::_refreshVulnerabilityCache'); 1283 add_action('upgrader_process_complete', 'wfUpdateCheck::syncAllVersionInfo'); 1281 1284 add_action('upgrader_process_complete', 'wordfence::_scheduleRefreshUpdateNotification', 99, 2); 1282 1285 add_action('wordfence_refreshUpdateNotification', 'wordfence::_refreshUpdateNotification', 99, 0); … … 2223 2226 'betaThreatDefenseFeed' => !!wfConfig::get('betaThreatDefenseFeed'), 2224 2227 'disableWAFIPBlocking' => wfConfig::get('disableWAFIPBlocking'), 2228 'wordpressVersion' => wfConfig::get('wordpressVersion'), 2229 'wordpressPluginVersions' => wfConfig::get_ser('wordpressPluginVersions'), 2230 'wordpressThemeVersions' => wfConfig::get_ser('wordpressThemeVersions'), 2225 2231 ); 2226 2232 if (wfUtils::isAdmin()) { … … 2529 2535 public static function jsonAPIAuthorFilter($response, $handler, $request) { 2530 2536 $route = $request->get_route(); 2531 if (!current_user_can(' list_users')) {2537 if (!current_user_can('edit_others_posts')) { 2532 2538 $urlBase = wfWP_REST_Users_Controller::wfGetURLBase(); 2533 2539 if (preg_match('~' . preg_quote($urlBase, '~') . '/*$~i', $route)) { … … 3491 3497 return compact('result'); 3492 3498 } 3499 public static function ajax_exportDiagnostics_callback(){ 3500 add_filter('gettext', 'wordfence::_diagnosticsTranslationDisabler', 0, 3); 3501 3502 $url = site_url(); 3503 $url = preg_replace('/^https?:\/\//i', '', $url); 3504 $url = preg_replace('/[^a-zA-Z0-9\.]+/', '_', $url); 3505 $url = preg_replace('/^_+/', '', $url); 3506 $url = preg_replace('/_+$/', '', $url); 3507 3508 header('Content-Type: application/octet-stream'); 3509 header('Content-Disposition: attachment; filename="diagnostics_for_' . $url . '.txt"'); 3510 3511 echo wfView::create('diagnostics/text', array( 3512 'diagnostic' => new wfDiagnostic, 3513 'plugins' => get_plugins(), 3514 )); 3515 exit; 3516 } 3493 3517 public static function _diagnosticsTranslationDisabler($translation, $text, $domain) { 3494 3518 return $text; … … 5804 5828 'switchTo2FANew', 'switchTo2FAOld', 5805 5829 'wfcentral_step1', 'wfcentral_step2', 'wfcentral_step3', 'wfcentral_step4', 'wfcentral_step5', 'wfcentral_step6', 'wfcentral_disconnect', 5830 'exportDiagnostics', 5806 5831 ) as $func){ 5807 5832 add_action('wp_ajax_wordfence_' . $func, 'wordfence::ajaxReceiver'); … … 5904 5929 'modalHTMLTemplate' => wfView::create('common/modal-prompt', array('title' => '${title}', 'message' => '{{html message}}', 'primaryButton' => array('id' => 'wf-generic-modal-close', 'label' => __('Close', 'wordfence'), 'link' => '#')))->render(), 5905 5930 'alertEmailBlacklist' => wfConfig::alertEmailBlacklist(), 5931 'supportURLs' => array( 5932 'scan-result-repair-modified-files' => esc_url_raw(wfSupportController::supportURL(wfSupportController::ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES)), 5933 ), 5906 5934 )); 5907 5935 } … … 7526 7554 $currentAutoPrependFile = ini_get('auto_prepend_file'); 7527 7555 $currentAutoPrepend = null; 7528 if (isset($_POST['currentAutoPrepend']) && !WF_IS_WP_ENGINE ) {7556 if (isset($_POST['currentAutoPrepend']) && !WF_IS_WP_ENGINE && !WF_IS_PRESSABLE) { 7529 7557 $currentAutoPrepend = $_POST['currentAutoPrepend']; 7530 7558 } … … 7688 7716 7689 7717 try { 7690 if ((!isset($_POST['iniModified']) || (isset($_POST['iniModified']) && !$_POST['iniModified'])) ) { //Uses .user.ini but not yet modified7718 if ((!isset($_POST['iniModified']) || (isset($_POST['iniModified']) && !$_POST['iniModified'])) && !WF_IS_PRESSABLE) { //Uses .user.ini but not yet modified 7691 7719 $hasPreviousAutoPrepend = $helper->performIniRemoval($wp_filesystem); 7692 7720 … … 7729 7757 } 7730 7758 else { //.user.ini and .htaccess modified if applicable and waiting period elapsed or otherwise ready to advance to next step 7731 if (WFWAF_AUTO_PREPEND && !WFWAF_SUBDIRECTORY_INSTALL && !WF_IS_WP_ENGINE ) { //.user.ini modified, but the WAF is still enabled7759 if (WFWAF_AUTO_PREPEND && !WFWAF_SUBDIRECTORY_INSTALL && !WF_IS_WP_ENGINE && !WF_IS_PRESSABLE) { //.user.ini modified, but the WAF is still enabled 7732 7760 $retryAttempted = (isset($_POST['retryAttempted']) && $_POST['retryAttempted']); 7733 7761 $userIniError = '<p class="wf-error">'; … … 8489 8517 8490 8518 public static function getWAFBootstrapPath() { 8519 if (WF_IS_PRESSABLE) { 8520 return WP_CONTENT_DIR . '/wordfence-waf.php'; 8521 } 8491 8522 return ABSPATH . 'wordfence-waf.php'; 8492 8523 } -
wordfence/trunk/modules/login-security/wordfence-login-security.php
r2325400 r2337484 28 28 29 29 define('WORDFENCE_LS_VERSION', '1.0.5'); 30 define('WORDFENCE_LS_BUILD_NUMBER', '159 2338782');30 define('WORDFENCE_LS_BUILD_NUMBER', '1594219913'); 31 31 32 32 if (!defined('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES')) { define('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES', 15); } -
wordfence/trunk/readme.txt
r2325413 r2337484 184 184 == Changelog == 185 185 186 = 7.4.9 - July 8, 2020 = 187 188 * Improvement: Added list of known malicious usernames to suspicious administrator scan. 189 * Improvement: Added ability for the WAF to determine if a given plugin/theme/core version is installed. 190 * Improvement: Added a feature to export a diagnostics report. 191 * Improvement: Add php_errorlog to the list of downloadable logs in diagnostics. 192 * Improvement: Added a prompt to allow user to download a backup prior to repairing files. 193 * Improvement: Prevent scan from failing when the home URL has changed and the key is no longer valid. 194 * Improvement: Deprecated PHP 5.3, and ended PHP 5.2 support by prevent auto-update from running on older versions. 195 * Fix: Fixed issue where WAF mysqli storage engine cannot find credentials if wflogs/ does not exist. 196 * Fix: Changed capability checked to read WP REST API users endpoint when "Prevent discovery of usernames through ..." is enabled. 197 * Fix: Prevented duplicate queries for wordfenceCentralConnected wfconfig value. 198 * Fix: Prevented custom wp-content or other directories from appearing in "skipped paths" scan result, even when scanned. 199 * Fix: Login Attempts dashboard widget "Show more" link is not visible when long usernames and IPs cause wrapping. 200 * Fix: Fix typo in the readme. 201 186 202 = 7.4.8 - June 16, 2020 = 187 203 * Fix: Fixed issue with fatal errors encountered during activation under certain conditions. … … 194 210 * Improvement: Added the state/province name when applicable to geolocation displays in Live Traffic. 195 211 * Improvement: New blocking page design to better inform blocked visitors on how to resolve the block. 196 * Improvement: Custom WP_CONTENT_DIR, WP_PLUGIN_D UR, and UPLOADS path constants will now get scanned correctly.212 * Improvement: Custom WP_CONTENT_DIR, WP_PLUGIN_DIR, and UPLOADS path constants will now get scanned correctly. 197 213 * Improvement: Added TLS connection failure detection to brute force reporting and checking and a corresponding backoff period. 198 214 * Fix: Fixed an issue where a bad cron record could interfere with automatic WAF rule updates. -
wordfence/trunk/vendor/wordfence/wf-waf/src/init.php
r2143823 r2337484 6 6 define('WFWAF_LIB_PATH', WFWAF_PATH . 'lib/'); 7 7 define('WFWAF_VIEW_PATH', WFWAF_PATH . 'views/'); 8 define('WFWAF_API_URL_SEC', 'https://noc4.wordfence.com/v1. 8/');8 define('WFWAF_API_URL_SEC', 'https://noc4.wordfence.com/v1.9/'); 9 9 if (!defined('WFWAF_DEBUG')) { 10 10 define('WFWAF_DEBUG', false); -
wordfence/trunk/vendor/wordfence/wf-waf/src/lib/rules.php
r2226721 r2337484 497 497 'urlschemematches', 498 498 'urlschemenotmatches', 499 'versionequals', 500 'versionnotequals', 501 'versiongreaterthan', 502 'versiongreaterthanequalto', 503 'versionlessthan', 504 'versionlessthanequalto', 499 505 ); 500 506 … … 1132 1138 } 1133 1139 1140 public function versionEquals($subject) { 1141 if ($subject === null) { 1142 return false; 1143 } 1144 return version_compare($subject, $this->getExpected(), '=='); 1145 } 1146 1147 public function versionNotEquals($subject) { 1148 if ($subject === null) { 1149 return false; 1150 } 1151 return version_compare($subject, $this->getExpected(), '!='); 1152 } 1153 1154 public function versionGreaterThan($subject) { 1155 if ($subject === null) { 1156 return false; 1157 } 1158 return version_compare($subject, $this->getExpected(), '>'); 1159 } 1160 1161 public function versionGreaterThanEqualTo($subject) { 1162 if ($subject === null) { 1163 return false; 1164 } 1165 return version_compare($subject, $this->getExpected(), '>='); 1166 } 1167 1168 public function versionLessThan($subject) { 1169 if ($subject === null) { 1170 return false; 1171 } 1172 return version_compare($subject, $this->getExpected(), '<'); 1173 } 1174 1175 public function versionLessThanEqualTo($subject) { 1176 if ($subject === null) { 1177 return false; 1178 } 1179 return version_compare($subject, $this->getExpected(), '<='); 1180 } 1181 1134 1182 /** 1135 1183 * @return mixed -
wordfence/trunk/views/scanner/issue-control-repair.php
r1808795 r2337484 2 2 if (!defined('WORDFENCE_VERSION')) { exit; } 3 3 ?> 4 {{if data.canFix}}<a href="#" class="wf-issue-control wf-issue-control-repair" ><svg class="wf-issue-control-icon" viewBox="0 0 106.7 106.7"><path d="M104.94,18.77a4,4,0,0,0-1.17-2.93L90.86,2.93a4.25,4.25,0,0,0-5.87,0L1.17,86.75a4.25,4.25,0,0,0,0,5.86l12.91,12.91A4,4,0,0,0,17,106.7a4,4,0,0,0,2.93-1.17L103.77,21.7a4,4,0,0,0,1.17-2.93ZM75.8,37.87l-7-7,19.1-19.1,7,7Zm0,0"/><path d="M14.93,16.68l2-6.39,6.39-2-6.39-2L14.93,0,13,6.39l-6.39,2,6.39,2Zm0,0"/><path d="M31.87,24.77l3.91,12.77L39.7,24.77l12.77-3.91L39.7,16.95,35.78,4.17,31.87,16.95,19.1,20.86Zm0,0"/><path d="M100.31,48.1l-2-6.39-2,6.39-6.39,2,6.39,2,2,6.39,2-6.39,6.39-2Zm0,0"/><path d="M56.64,16.68l2-6.39,6.39-2-6.39-2L56.64,0l-2,6.39-6.39,2,6.39,2Zm0,0"/></svg><span class="wf-issue-control-label"><?php _e('Repair', 'wordfence'); ?></span></a>{{/if}}4 {{if data.canFix}}<a href="#" class="wf-issue-control wf-issue-control-repair" data-file="${data.file}"><svg class="wf-issue-control-icon" viewBox="0 0 106.7 106.7"><path d="M104.94,18.77a4,4,0,0,0-1.17-2.93L90.86,2.93a4.25,4.25,0,0,0-5.87,0L1.17,86.75a4.25,4.25,0,0,0,0,5.86l12.91,12.91A4,4,0,0,0,17,106.7a4,4,0,0,0,2.93-1.17L103.77,21.7a4,4,0,0,0,1.17-2.93ZM75.8,37.87l-7-7,19.1-19.1,7,7Zm0,0"/><path d="M14.93,16.68l2-6.39,6.39-2-6.39-2L14.93,0,13,6.39l-6.39,2,6.39,2Zm0,0"/><path d="M31.87,24.77l3.91,12.77L39.7,24.77l12.77-3.91L39.7,16.95,35.78,4.17,31.87,16.95,19.1,20.86Zm0,0"/><path d="M100.31,48.1l-2-6.39-2,6.39-6.39,2,6.39,2,2,6.39,2-6.39,6.39-2Zm0,0"/><path d="M56.64,16.68l2-6.39,6.39-2-6.39-2L56.64,0l-2,6.39-6.39,2,6.39,2Zm0,0"/></svg><span class="wf-issue-control-label"><?php _e('Repair', 'wordfence'); ?></span></a>{{/if}} -
wordfence/trunk/views/scanner/options-group-general.php
r2187129 r2337484 47 47 array('key' => 'scansEnabled_suspiciousOptions', 'label' => __('Scan WordPress core, plugin, and theme options for known dangerous URLs and suspicious content', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MALWARE_OPTIONS)), 48 48 array('key' => 'scansEnabled_oldVersions', 'label' => __('Scan for out of date, abandoned, and vulnerable plugins, themes, and WordPress versions', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UPDATES)), 49 array('key' => 'scansEnabled_suspiciousAdminUsers', 'label' => __('Scan for admin users created outside of WordPress', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UNKNOWN_ADMINS)),49 array('key' => 'scansEnabled_suspiciousAdminUsers', 'label' => __('Scan for suspicious admin users created outside of WordPress', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UNKNOWN_ADMINS)), 50 50 array('key' => 'scansEnabled_passwds', 'label' => __('Check the strength of passwords', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_PASSWORD_STRENGTH)), 51 51 array('key' => 'scansEnabled_diskSpace', 'label' => __('Monitor disk space', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_DISK_SPACE)), -
wordfence/trunk/views/waf/waf-install.php
r2143823 r2337484 18 18 <?php 19 19 $currentAutoPrependFile = ini_get('auto_prepend_file'); 20 if (empty($currentAutoPrependFile) || WF_IS_WP_ENGINE ):20 if (empty($currentAutoPrependFile) || WF_IS_WP_ENGINE || WF_IS_PRESSABLE): 21 21 ?> 22 22 <p><?php _e('To make your site as secure as possible, the Wordfence Web Application Firewall is designed to run via a PHP setting called <code>auto_prepend_file</code>, which ensures it runs before any potentially vulnerable code runs.', 'wordfence'); ?></p> -
wordfence/trunk/views/waf/waf-uninstall.php
r2143823 r2337484 17 17 <div class="wf-modal-content"> 18 18 <?php 19 if (WF_IS_WP_ENGINE ) {19 if (WF_IS_WP_ENGINE || WF_IS_PRESSABLE) { 20 20 $currentAutoPrependFile = wordfence::getWAFBootstrapPath(); 21 21 } else { -
wordfence/trunk/waf/bootstrap.php
r2290265 r2337484 12 12 if (!defined('WF_IS_WP_ENGINE')) { 13 13 define('WF_IS_WP_ENGINE', isset($_SERVER['IS_WPE'])); 14 } 15 if (!defined('WF_IS_PRESSABLE')) { 16 define('WF_IS_PRESSABLE', (defined('IS_ATOMIC') && IS_ATOMIC) || (defined('IS_PRESSABLE') && IS_PRESSABLE)); 14 17 } 15 18 … … 693 696 @chmod(rtrim(WFWAF_LOG_PATH, '/') . '/.htaccess', (wfWAFWordPress::permissions() | 0444)); 694 697 } 698 699 public function getGlobal($global) { 700 if (wfWAFUtils::strpos($global, '.') === false) { 701 return null; 702 } 703 list($prefix, $_global) = explode('.', $global); 704 switch ($prefix) { 705 case 'wordpress': 706 if ($_global === 'core') { 707 return $this->getStorageEngine()->getConfig('wordpressVersion', null, 'synced'); 708 } else if ($_global === 'plugins') { 709 return $this->getStorageEngine()->getConfig('wordpressPluginVersions', null, 'synced'); 710 } else if ($_global === 'themes') { 711 return $this->getStorageEngine()->getConfig('wordpressThemeVersions', null, 'synced'); 712 } 713 break; 714 } 715 return parent::getGlobal($global); 716 } 717 } 718 719 class wfWAFWordPressStorageMySQL extends wfWAFStorageMySQL { 720 721 public function getSerializedParams() { 722 $params = parent::getSerializedParams(); 723 $params[] = 'wordpressPluginVersions'; 724 $params[] = 'wordpressThemeVersions'; 725 return $params; 726 } 727 728 public function getAutoloadParams() { 729 $params = parent::getAutoloadParams(); 730 $params['synced'][] = 'wordpressVersion'; 731 $params['synced'][] = 'wordpressPluginVersions'; 732 $params['synced'][] = 'wordpressThemeVersions'; 733 return $params; 734 } 695 735 } 696 736 … … 718 758 case 'mysqli': 719 759 // Find the wp-config.php 720 if (file_exists(dirname(WFWAF_LOG_PATH) . '/../wp-config.php')) { 721 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(WFWAF_LOG_PATH . '/../../wp-config.php'); 722 } else if (file_exists(dirname(WFWAF_LOG_PATH) . '/../../wp-config.php')) { 723 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(WFWAF_LOG_PATH . '/../../../wp-config.php'); 760 if (is_dir(dirname(WFWAF_LOG_PATH))) { 761 if (file_exists(dirname(WFWAF_LOG_PATH) . '/../wp-config.php')) { 762 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(dirname(WFWAF_LOG_PATH) . '/../wp-config.php'); 763 } else if (file_exists(dirname(WFWAF_LOG_PATH) . '/../../wp-config.php')) { 764 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig(dirname(WFWAF_LOG_PATH) . '/../../wp-config.php'); 765 } 766 } else if (!empty($_SERVER['DOCUMENT_ROOT'])) { 767 if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/wp-config.php')) { 768 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig($_SERVER['DOCUMENT_ROOT'] . '/wp-config.php'); 769 } else if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/../wp-config.php')) { 770 $wfWAFDBCredentials = wfWAFUtils::extractCredentialsWPConfig($_SERVER['DOCUMENT_ROOT'] . '/../wp-config.php'); 771 } 724 772 } 725 773 726 774 if (!empty($wfWAFDBCredentials)) { 727 $wfWAFStorageEngine = new wfWAF StorageMySQL(new wfWAFStorageEngineMySQLi(), $wfWAFDBCredentials['tablePrefix']);775 $wfWAFStorageEngine = new wfWAFWordPressStorageMySQL(new wfWAFStorageEngineMySQLi(), $wfWAFDBCredentials['tablePrefix']); 728 776 $wfWAFStorageEngine->getDb()->connect( 729 777 $wfWAFDBCredentials['user'], -
wordfence/trunk/wordfence.php
r2325400 r2337484 5 5 Description: Wordfence Security - Anti-virus, Firewall and Malware Scan 6 6 Author: Wordfence 7 Version: 7.4. 87 Version: 7.4.9 8 8 Author URI: http://www.wordfence.com/ 9 9 Network: true … … 16 16 exit; 17 17 } 18 define('WORDFENCE_VERSION', '7.4. 8');19 define('WORDFENCE_BUILD_NUMBER', '159 2338782');18 define('WORDFENCE_VERSION', '7.4.9'); 19 define('WORDFENCE_BUILD_NUMBER', '1594219913'); 20 20 define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) : 21 21 basename(dirname(__FILE__)) . '/' . basename(__FILE__)); … … 37 37 if (!defined('WF_IS_WP_ENGINE')) { 38 38 define('WF_IS_WP_ENGINE', isset($_SERVER['IS_WPE'])); 39 } 40 if (!defined('WF_IS_PRESSABLE')) { 41 define('WF_IS_PRESSABLE', (defined('IS_ATOMIC') && IS_ATOMIC) || (defined('IS_PRESSABLE') && IS_PRESSABLE)); 39 42 } 40 43
Note: See TracChangeset
for help on using the changeset viewer.