Changeset 3380286
- Timestamp:
- 10/17/2025 05:48:37 PM (4 months ago)
- Location:
- folder-auditor
- Files:
-
- 73 added
- 4 edited
-
tags/4.4 (added)
-
tags/4.4/assets (added)
-
tags/4.4/assets/admin.js (added)
-
tags/4.4/assets/brand-banner.webp (added)
-
tags/4.4/assets/dark-icon.png (added)
-
tags/4.4/assets/email.jpg (added)
-
tags/4.4/assets/icon.png (added)
-
tags/4.4/assets/style.css (added)
-
tags/4.4/folder-auditor.php (added)
-
tags/4.4/includes (added)
-
tags/4.4/includes/bridge (added)
-
tags/4.4/includes/bridge/class-wpfa-mainwp-bridge.php (added)
-
tags/4.4/includes/bridge/unlock-relock.php (added)
-
tags/4.4/includes/class-wp-folder-auditor.php (added)
-
tags/4.4/includes/handlers (added)
-
tags/4.4/includes/handlers/handler-actions.php (added)
-
tags/4.4/includes/handlers/handler-content.php (added)
-
tags/4.4/includes/handlers/handler-htaccess.php (added)
-
tags/4.4/includes/handlers/handler-plugins.php (added)
-
tags/4.4/includes/handlers/handler-root.php (added)
-
tags/4.4/includes/handlers/handler-scanner.php (added)
-
tags/4.4/includes/handlers/handler-settings.php (added)
-
tags/4.4/includes/handlers/handler-themes.php (added)
-
tags/4.4/includes/handlers/handler-uploads.php (added)
-
tags/4.4/includes/helpers (added)
-
tags/4.4/includes/helpers/admin.php (added)
-
tags/4.4/includes/helpers/health-score (added)
-
tags/4.4/includes/helpers/health-score/health-score-display.php (added)
-
tags/4.4/includes/helpers/health-score/health-score-functions.php (added)
-
tags/4.4/includes/helpers/html-export.php (added)
-
tags/4.4/includes/helpers/lock-system (added)
-
tags/4.4/includes/helpers/lock-system/folder-locker.php (added)
-
tags/4.4/includes/helpers/lock-system/traits (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_Actions.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_Assets.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_Cache.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_FS.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_FSModal.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_NoticesBar.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_Request.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_Status.php (added)
-
tags/4.4/includes/helpers/lock-system/traits/WPFA_Folder_Locker_Trait_Targets.php (added)
-
tags/4.4/includes/helpers/reports (added)
-
tags/4.4/includes/helpers/reports/Guard-Dog-Security-Report.html (added)
-
tags/4.4/includes/helpers/reports/index.html (added)
-
tags/4.4/includes/helpers/safe-paths.php (added)
-
tags/4.4/includes/helpers/scanner (added)
-
tags/4.4/includes/helpers/scanner/scanner.php (added)
-
tags/4.4/includes/helpers/security-headers.php (added)
-
tags/4.4/includes/helpers/user-security.php (added)
-
tags/4.4/includes/summaries (added)
-
tags/4.4/includes/summaries/summary-content.php (added)
-
tags/4.4/includes/summaries/summary-htaccess.php (added)
-
tags/4.4/includes/summaries/summary-plugins.php (added)
-
tags/4.4/includes/summaries/summary-root.php (added)
-
tags/4.4/includes/summaries/summary-themes.php (added)
-
tags/4.4/includes/summaries/summary-totals.php (added)
-
tags/4.4/includes/summaries/summary-uploads.php (added)
-
tags/4.4/includes/views (added)
-
tags/4.4/includes/views/view-audit.php (added)
-
tags/4.4/includes/views/view-content.php (added)
-
tags/4.4/includes/views/view-dashboard.php (added)
-
tags/4.4/includes/views/view-header.php (added)
-
tags/4.4/includes/views/view-htaccess-files.php (added)
-
tags/4.4/includes/views/view-html-export.php (added)
-
tags/4.4/includes/views/view-plugins.php (added)
-
tags/4.4/includes/views/view-root.php (added)
-
tags/4.4/includes/views/view-scanner.php (added)
-
tags/4.4/includes/views/view-security.php (added)
-
tags/4.4/includes/views/view-settings.php (added)
-
tags/4.4/includes/views/view-themes.php (added)
-
tags/4.4/includes/views/view-uploads.php (added)
-
tags/4.4/readme.txt (added)
-
trunk/folder-auditor.php (modified) (1 diff)
-
trunk/includes/helpers/reports/Guard-Dog-Security-Report.html (modified) (5 diffs)
-
trunk/includes/helpers/scanner/scanner.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
folder-auditor/trunk/folder-auditor.php
r3379504 r3380286 3 3 * Plugin Name: Guard Dog Security & Site Lock 4 4 * Description: Helps WordPress administrators take full control of their site. It scans critical areas including the root directory, wp-content, plugins, themes, uploads, and .htaccess files to detect anything suspicious such as orphaned folders, leftover files, or hidden PHP in uploads. From the WordPress dashboard, you can safely review, download, or remove items that don’t belong, with built-in protection to ensure required resources remain untouched. In addition, Guard Dog Security lets you lock all files and folders as read-only, preventing unauthorized changes, additions, or deletions to your WordPress installation. 5 * Version: 4. 35 * Version: 4.4 6 6 * Author: WP Fix It 7 7 * Author URI: https://www.wpfixit.com -
folder-auditor/trunk/includes/helpers/reports/Guard-Dog-Security-Report.html
r3379504 r3380286 1573 1573 <div class="fa-export-header-details"> 1574 1574 <h1>WP Fix It Sandbox - Guard Dog Security Report</h1> 1575 <div class="fa-export-meta">October 1 6, 2025 8:36am</div>1575 <div class="fa-export-meta">October 17, 2025 7:03 am</div> 1576 1576 </div> 1577 1577 </div> … … 1664 1664 </div> 1665 1665 <div class="fa-desc"> 1666 28 installed • 3active</div>1666 28 installed • 4 active</div> 1667 1667 </div> 1668 1668 <div class="fa-badges"> … … 1731 1731 <!-- Icon --> 1732 1732 <div class="fa-sitelock-icon" aria-hidden="true"> 1733 <span class="dashicons dashicons- unlock"></span>1733 <span class="dashicons dashicons-lock"></span> 1734 1734 </div> 1735 1735 <!-- Title + status + desc --> … … 1737 1737 <div class="fa-sitelock-titleline"> 1738 1738 <strong class="fa-sitelock-title">Site Lock Status - </strong> 1739 <span class="fa-chip" style="background:# f54545;color:#fff;">1740 Unlocked </span>1739 <span class="fa-chip" style="background:#1ab06f;color:#fff;"> 1740 Locked </span> 1741 1741 </div> 1742 <p class="fa-sitelock-desc"> Software updates, installs and removals are allowed. Turn on your Site Lock to harden file changes.</p>1742 <p class="fa-sitelock-desc">You have enabled Site Lock and below is the list of items that are locked and read only.</p> 1743 1743 </div> 1744 1744 <!-- CTA --> 1745 1745 <div class="fa-sitelock-cta"> 1746 1746 <a href="https://test.wpfixithosting.com/wp-admin/admin.php?page=guard-dog-security&tab=security#site-lock" class="wpfa-sexy-btn"> 1747 Enable Site Lock→1747 Open Site Lock Settings → 1748 1748 </a> 1749 1749 </div> … … 1751 1751 <div class="fa-locked-section"> 1752 1752 <div class="fa-locked-row"> 1753 <h4 class="fa-locked-title">Folders Locked (12)</h4> 1754 <div class="fa-pill-wrap"> 1755 <span class="fa-pill fa-pill-success"> 1756 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1757 <span class="fa-pill-label">error_log</span> 1758 </span> 1759 <span class="fa-pill fa-pill-success"> 1760 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1761 <span class="fa-pill-label">mu-plugins</span> 1762 </span> 1763 <span class="fa-pill fa-pill-success"> 1764 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1765 <span class="fa-pill-label">New directory</span> 1766 </span> 1767 <span class="fa-pill fa-pill-success"> 1768 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1769 <span class="fa-pill-label">plugins</span> 1770 </span> 1771 <span class="fa-pill fa-pill-success"> 1772 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1773 <span class="fa-pill-label">Some-Folder</span> 1774 </span> 1775 <span class="fa-pill fa-pill-success"> 1776 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1777 <span class="fa-pill-label">themes</span> 1778 </span> 1779 <span class="fa-pill fa-pill-success"> 1780 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1781 <span class="fa-pill-label">upgrade</span> 1782 </span> 1783 <span class="fa-pill fa-pill-success"> 1784 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1785 <span class="fa-pill-label">upgrade-temp-backup</span> 1786 </span> 1787 <span class="fa-pill fa-pill-success"> 1788 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1789 <span class="fa-pill-label">uploads</span> 1790 </span> 1791 <span class="fa-pill fa-pill-success"> 1792 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1793 <span class="fa-pill-label">wp-admin</span> 1794 </span> 1795 <span class="fa-pill fa-pill-success"> 1796 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1797 <span class="fa-pill-label">wp-content</span> 1798 </span> 1799 <span class="fa-pill fa-pill-success"> 1800 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1801 <span class="fa-pill-label">wp-includes</span> 1802 </span> 1803 </div> 1804 </div> 1805 <div class="fa-locked-row"> 1806 <h4 class="fa-locked-title">Files Locked (20)</h4> 1807 <div class="fa-pill-wrap"> 1808 <span class="fa-pill fa-pill-success"> 1809 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1810 <span class="fa-pill-label">file-1.php</span> 1811 </span> 1812 <span class="fa-pill fa-pill-success"> 1813 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1814 <span class="fa-pill-label">file-2.php</span> 1815 </span> 1816 <span class="fa-pill fa-pill-success"> 1817 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1818 <span class="fa-pill-label">file-3.php</span> 1819 </span> 1820 <span class="fa-pill fa-pill-success"> 1821 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1822 <span class="fa-pill-label">index.php</span> 1823 </span> 1824 <span class="fa-pill fa-pill-success"> 1825 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1826 <span class="fa-pill-label">license.txt</span> 1827 </span> 1828 <span class="fa-pill fa-pill-success"> 1829 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1830 <span class="fa-pill-label">readme.html</span> 1831 </span> 1832 <span class="fa-pill fa-pill-success"> 1833 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1834 <span class="fa-pill-label">wp-activate.php</span> 1835 </span> 1836 <span class="fa-pill fa-pill-success"> 1837 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1838 <span class="fa-pill-label">wp-blog-header.php</span> 1839 </span> 1840 <span class="fa-pill fa-pill-success"> 1841 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1842 <span class="fa-pill-label">wp-comments-post.php</span> 1843 </span> 1844 <span class="fa-pill fa-pill-success"> 1845 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1846 <span class="fa-pill-label">wp-config-sample.php</span> 1847 </span> 1848 <span class="fa-pill fa-pill-success"> 1849 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1850 <span class="fa-pill-label">wp-config.php</span> 1851 </span> 1852 <span class="fa-pill fa-pill-success"> 1853 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1854 <span class="fa-pill-label">wp-cron.php</span> 1855 </span> 1856 <span class="fa-pill fa-pill-success"> 1857 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1858 <span class="fa-pill-label">wp-links-opml.php</span> 1859 </span> 1860 <span class="fa-pill fa-pill-success"> 1861 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1862 <span class="fa-pill-label">wp-load.php</span> 1863 </span> 1864 <span class="fa-pill fa-pill-success"> 1865 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1866 <span class="fa-pill-label">wp-login.php</span> 1867 </span> 1868 <span class="fa-pill fa-pill-success"> 1869 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1870 <span class="fa-pill-label">wp-mail.php</span> 1871 </span> 1872 <span class="fa-pill fa-pill-success"> 1873 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1874 <span class="fa-pill-label">wp-settings.php</span> 1875 </span> 1876 <span class="fa-pill fa-pill-success"> 1877 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1878 <span class="fa-pill-label">wp-signup.php</span> 1879 </span> 1880 <span class="fa-pill fa-pill-success"> 1881 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1882 <span class="fa-pill-label">wp-trackback.php</span> 1883 </span> 1884 <span class="fa-pill fa-pill-success"> 1885 <span class="dashicons dashicons-lock" aria-hidden="true"></span> 1886 <span class="fa-pill-label">xmlrpc.php</span> 1887 </span> 1888 </div> 1889 </div> 1890 <div class="fa-locked-row"> 1753 1891 <h4 class="fa-locked-title"> 1754 1892 Folder Lock Exclusions (2) </h4> -
folder-auditor/trunk/includes/helpers/scanner/scanner.php
r3374418 r3380286 41 41 42 42 protected function wpfa_list_files( string $directory, array $opts = [] ) : array { 43 $allowed_ext = '/(?:\.(?:php|html|txt|md|js|css|scss|less|json|xml|svg|htaccess|ini|user\.ini)$)/i'; 43 //$allowed_ext = '/(?:\.(?:php|html|txt|md|js|css|scss|less|json|xml|svg|htaccess|ini|user\.ini)$)/i'; 44 $allowed_ext = '/(?:\.(?:php|html|txt|md|js|css|scss|less|json|xml|svg|htaccess|ini|user\.ini)$|(?:\/[^\/\.]+$))/i'; 44 45 45 46 // Resolve common WP paths (same as in your scanner) … … 107 108 continue; 108 109 } 109 $path = wp_normalize_path( $fileinfo->getPathname() ); 110 111 // Only allowed extensions / names / .well-known subtree 112 if ( ! preg_match( $allowed_ext, $path ) ) { 113 continue; 114 } 115 $files[] = $path; 110 $path = wp_normalize_path( $fileinfo->getPathname() ); 111 112 $bn = basename( $path ); 113 114 // If no extension, peek at first few bytes so we can still catch ELF/MZ/Mach-O 115 if ( strpos( $bn, '.' ) === false ) { 116 $head = @file_get_contents( $path, false, null, 0, 4 ); 117 if ( $head !== false ) { 118 // If header matches known binary magics, force it into the scan list 119 if ( $head === "\x7FELF" || $head === "MZ" || $head === "\xCF\xFA\xED" ) { 120 $files[] = $path; 121 continue; 122 } 123 } 124 } 125 126 // --- HARD GUARDS to keep "Full" scans from choking on giant/no-ext files --- 127 128 // 1) Skip symlinks (can loop or point out of tree) 129 if ( $fileinfo->isLink() ) { 130 continue; 131 } 132 133 // 2) Skip very large files (logs, dumps, backups with no extension) 134 $size = @filesize( $path ); 135 if ( $size !== false && $size > 20 * 1024 * 1024 ) { // 20MB cap; raise/lower if you want 136 continue; 137 } 138 139 // 3) If the filename has NO extension (allowed by your regex), quickly sniff for binary. 140 // Binary / blob files (often huge) will contain NUL bytes and should be skipped. 141 $bn = basename( $path ); 142 if ( ! preg_match( '/\.[A-Za-z0-9]+$/', $bn ) ) { 143 $head = @file_get_contents( $path, false, null, 0, 512 ); 144 if ( $head !== false && strpos( $head, "\0" ) !== false ) { 145 continue; // looks binary 146 } 147 148 // Also skip very common extensionless log names that get huge 149 if ( in_array( $bn, [ 'error_log', 'php_errors', 'php_errors.log', 'slow_query_log' ], true ) ) { 150 continue; 151 } 152 } 153 154 155 // 4) (Optional but recommended) skip known heavy dirs that never contain PHP you care about 156 $path_lc = strtolower( $path ); 157 if ( 158 strpos( $path_lc, '/wp-content/cache/' ) !== false || 159 strpos( $path_lc, '/node_modules/' ) !== false || 160 strpos( $path_lc, '/.git/' ) !== false || 161 strpos( $path_lc, '/.svn/' ) !== false 162 ) { 163 continue; 164 } 165 166 // NEW: skip the scanner file itself so it never enters the queue 167 $scanner_file = wp_normalize_path( __FILE__ ); 168 if ( realpath( $path ) === realpath( $scanner_file ) ) { 169 continue; 170 } 171 172 // Only allowed extensions / names / .well-known subtree 173 if ( ! preg_match( $allowed_ext, $path ) ) { 174 continue; 175 } 176 $files[] = $path; 116 177 } 117 178 } catch ( Throwable $e ) { … … 240 301 } 241 302 242 $path = array_shift( $state['queue'] ); 243 $state['done']++; 244 245 $contents = @file_get_contents( $path ); 303 $path = array_shift( $state['queue'] ); 304 $state['done']++; 305 306 // NEW: skip the scanner file itself 307 $scanner_file = wp_normalize_path( __FILE__ ); 308 if ( realpath( $path ) === realpath( $scanner_file ) ) { 309 $processed_this_step++; 310 continue; 311 } 312 313 $contents = @file_get_contents( $path ); 314 246 315 if ( $contents === false ) { 247 316 $processed_this_step++; … … 350 419 // Build file body 351 420 $lines = []; 352 $lines[] = ' WP Folder Auditor— Scan Report';421 $lines[] = 'Guard Dog Security — Scan Report'; 353 422 $lines[] = 'Generated: ' . gmdate( 'm-d-Y H:i:s' ) . ''; 354 423 $lines[] = 'Site: ' . ( isset( $_SERVER['HTTP_HOST'] ) ? esc_url_raw( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '' ); … … 378 447 379 448 $body = implode( "\r\n", $lines ) . "\r\n"; 380 $filename = ' Folder-Auditor-Scan-Report-' . gmdate( 'm-d-Y' ) . '.txt';449 $filename = 'Guard-Dog-Security-Scan-Report-' . gmdate( 'm-d-Y' ) . '.txt'; 381 450 382 451 // Output download … … 408 477 } 409 478 if ( empty( $scopes ) ) { 410 $scopes = [ ' themes' ]; // safe default479 $scopes = [ 'full' ]; // safe default 411 480 } 412 481 $opts = [ 'scopes' => array_values( array_unique( $scopes ) ) ]; … … 451 520 452 521 // Allowlist (same as wpfa_list_files) 453 $allowed_ext = '/(?:\.(?:php|phtml|php7|pht|phtm|phar|html|css|js|htaccess|env|json|xml|lock|txt|md|po|mo|pot|log|ini|sql|csv)$' 522 //$allowed_ext = '/(?:\.(?:php|phtml|php7|pht|phtm|phar|html|css|js|htaccess|env|json|xml|lock|txt|md|po|mo|pot|log|ini|sql|csv)$' 523 //. '|(?:composer\.json|composer\.lock|package\.json|package-lock\.json|yarn\.lock|\.user\.ini|\.gitignore|\.gitattributes|\.editorconfig)$' 524 //. '|\/\.well-known\/)/i'; 525 $allowed_ext = '/(?:\.(?:php|phtml|php7|pht|phtm|phar|html|css|js|htaccess|env|json|xml|lock|txt|md|po|mo|pot|log|ini|sql|csv)$' 454 526 . '|(?:composer\.json|composer\.lock|package\.json|package-lock\.json|yarn\.lock|\.user\.ini|\.gitignore|\.gitattributes|\.editorconfig)$' 455 527 . '|\/\.well-known\/)/i'; … … 510 582 } 511 583 512 $path = wp_normalize_path( $fileinfo->getPathname() ); 513 514 // Only allowed extensions / names / .well-known subtree 515 if ( ! preg_match( $allowed_ext, $path ) ) { 516 continue; 517 } 518 584 $path = wp_normalize_path( $fileinfo->getPathname() ); 585 586 // NEW: skip the scanner file itself 587 $scanner_file = wp_normalize_path( __FILE__ ); 588 if ( realpath( $path ) === realpath( $scanner_file ) ) { 589 continue; 590 } 591 592 // Only allowed extensions / names / .well-known subtree 593 if ( ! preg_match( $allowed_ext, $path ) ) { 594 continue; 595 } 519 596 // meta counts 520 597 $__files_seen++; … … 589 666 $lc = $contents; 590 667 $filename = basename( $path ); 668 669 // Quick binary header detection 670 $head = @file_get_contents( $path, false, null, 0, 4 ); 671 if ( $head === "\x7FELF" || $head === "MZ" || $head === "\xCF\xFA\xED" ) { 672 return true; // flag immediately 673 } 591 674 592 675 // --- Whitelist common safe libs to cut false positives … … 772 855 return [ $raw, $norm ]; 773 856 } 774 775 protected function wpfa_get_raw_patterns() : array { 776 // comment-aware (used on $raw) — flags even if disabled in comments 777 778 return [ 779 '\beval\s*\(\s*base64_decode\s*\(', 780 '\bpreg_replace\s*\(\s*([\'"])\s*([^\w\s\\])(?:\\.|(?!\2).)*\2(?=[A-Za-z]*e[A-Za-z]*\1)', 781 '\b(?:include|require|include_once|require_once)\s*(?:\(\s*)?[\'"]https?:\/\/', 782 '\b(?:exec|shell_exec|system|passthru|proc_open|popen|pcntl_exec)\s*\([^)]*\$_(?:GET|POST|REQUEST|COOKIE|SERVER)\b', 783 'shell_exec\s*\([^)]*\$_REQUEST', 784 '\b(?:file_put_contents|fopen|fwrite|fputs)\s*\(\s*\$[A-Za-z_]\w*\s*,\s*base64_decode\s*\(', 785 '[\'"]\s*e\s*[\'"]\s*\.\s*[\'"]\s*val\s*[\'"]', 786 '[\'"]\s*base\s*[\'"]\s*\.\s*[\'"]\s*64\s*[\'"]\s*\.\s*[\'"]\s*decode\s*[\'"]', 787 '\$\w+\s*=\s*[\'"][a-z]{1,3}[\'"]\s*;\s*\$\w+\s*=\s*[\'"][a-z]{1,3}[\'"]\s*;\s*\$\w+\s*=\s*\$\w+\s*\.\s*\$\w+\s*\.\s*[\'"](tem|val|sert)[\'"]\s*;', 788 'ob_implicit_flush\s*\(\s*true\s*\)\s*;[\s\S]{0,160}\bob_end_flush\s*\(', 789 '(?s)(?:OPENSSL_RAW_DATA.*substr\s*\(\s*hash\s*\(\s*[\'"]sha256[\'"]|substr\s*\(\s*hash\s*\(\s*[\'"]sha256[\'"].*OPENSSL_RAW_DATA|[\'"]<\s*\/?\s*scr?\s*[\'"]\s*\.\s*[\'"]r?ipt\s*>[\'"])', 790 '(?s)\$[A-Za-z_]\w*\s*=\s*\$_(?:POST|REQUEST)\s*;.*?isset\s*\(\s*\$[A-Za-z_]\w*\s*\[[\'"][a-z0-9_]{3,}[\'"]\]\s*\).*?\$\w+\s*\(\s*\.\.\.\$\w+\s*\)', 791 '(?s)readfile\s*\(\s*base64_decode\s*\(\s*["\'][^"\']{8,}["\']\s*\)\s*\)\s*;.*?eval\s*\(\s*.*?ob_get_clean\s*\(\s*\)\s*\)\s*;', 792 'function\s*uPqmvR\s*\(', 793 'function\s*yh1\s*\(', 794 '\bUpVwwHRQ\s*\(', 795 'array_map\(\s*[\'"]md5[\'"]\s*,\s*\$_COOKIE', 796 '\$gi6\[\d+\]\s*\(\s*\$_(?:COOKIE|POST|REQUEST)', 797 'include\s*\(\s*base64_decode\s*\(\s*\$[A-Za-z_]\w*\s*\)\s*(?:\.\s*)?\)\s*;', 798 'call_user_func\s*\(\s*new\s+LiteSpeedMetaDataStore' 799 ]; 800 801 } 802 803 protected function wpfa_get_patterns() : array { 804 // normalized patterns (used on $norm) 805 return [ 806 '\b(?:fopen|fwrite|fputs|file_put_contents|file_get_contents|fclose|chmod|unlink)\s*\([^)]*base64_decode\s*\(', 807 'basename\s*\(\s*__FILE__\s*,\s*base64_decode\s*\(', 808 '\b(?:exec|shell_exec|system|passthru|proc_open|popen|pcntl_exec)\s*\([^)]*base64_decode\s*\(', 809 '\b(?:exec|shell_exec|system|passthru|proc_open|popen|pcntl_exec)\s*\(\s*\$_(?:GET|POST|REQUEST|COOKIE|SERVER)\b', 810 '>\s*\/dev\/null\s*2>\s*\/dev\/null\s*&', 811 '(?:base64_encode\s*\(\s*){2,}[^)]*\)', 812 '(?:base64_decode\s*\(\s*){2,}[^)]*\)', 813 'openssl_(?:en|de)crypt\s*\([^,]+,\s*[\'"]?\s*aes\s*[-_ ]?(?:128|192|256)\s*[-_ ]?cbc[\'"]?\s*,[^)]*hash\s*\(\s*[\'"]sha256[\'"]\s*,\s*[\'"][^\'"]{8,}[\'"]\s*,\s*true\s*\)[^)]*\)', 814 'substr\s*\(\s*hash\s*\(\s*[\'"]sha256[\'"]\s*,\s*[\'"][^\'"]{8,}[\'"]\s*,\s*true\s*\)\s*,\s*0\s*,\s*16\s*\)', 815 '\b(?:include|require|include_once|require_once)\s*\(\s*base64_decode\s*\(', 816 '\b(?:include|require|include_once|require_once|file_get_contents|fopen)\s*\([^)]*(?:php:\/\/input|php:\/\/filter|data:\/\/)', 817 'md5\s*\(\s*uniqid\s*\([^)]*\)\s*\)\s*\.\s*[\'"]\.(?:php|phtml)\b', 818 'curl_init\s*\([^)]*\)\s*;[^;]*CURLOPT_(?:HTTPHEADER|COOKIE)[^;]*(?:Authorization|Cookie)[^;]*token\s*=\s*', 819 'wp_remote_request\s*\([^)]*\bheaders\b[^)]*(?:Authorization|Cookie)[\'"]\s*=>\s*[\'"][^\'"]*token=', 820 '`[^`]{1,200}`', 821 '[\'"]<\s*sc[\'"]\s*\.\s*[\'"]ript\s*>[\'"]', 822 '[\'"]<\/\s*scr[\'"]\s*\.\s*[\'"]ipt\s*>[\'"]', 823 'array\s*\(\s*(?:\s*[\'"][a-z0-9][\'"]\s*,){3,}\s*[\'"][a-z0-9][\'"]\s*\)', 824 '\$[A-Za-z_]\w*\s*=\s*\$\w+\s*\.\s*\$\w+\s*\.\s*[\'"](tem|xec)[\'"]', 825 '(?s)readfile\s*\(\s*base64_decode\s*\(.*?\)\s*\).*?eval\s*\(\s*.*?ob_get_clean\s*\(\s*\).*?\)', 826 '\$[A-Za-z_]\w*\s*=\s*\$[A-Za-z_]\w*\s*\[[\'"][a-z0-9_]{3,}[\'"]\]\s*;.*\$\w+\s*\(\s*\.\.\.\$\w+\s*\)', 827 'function\s*uPqmvR\s*\(', 828 'function\s*yh1\s*\(', 829 '\bUpVwwHRQ\s*\(', 830 'array_map\(\s*[\'"]md5[\'"]\s*,\s*\$_COOKIE', 831 '\$gi6\[\d+\]\s*\(\s*\$_(?:COOKIE|POST|REQUEST)', 832 'include\s*\(\s*base64_decode\s*\(\s*\$[A-Za-z_]\w*\s*\)\s*(?:\.\s*)?\)\s*;', 833 'call_user_func\s*\(\s*new\s+LiteSpeedMetaDataStore' 834 ]; 835 } 857 protected function wpfa_get_raw_patterns() : array { 858 return [ 859 '^\x7fELF', 860 '^MZ', 861 '^\xCF\xFA\xED', 862 '\b(?:require|require_once|include|include_once)\s*\(?\s*(?:@?\s*)?(?:base64_decode|str_rot13|gzinflate|gzuncompress)\s*\(', 863 'error_reporting\\s*\\(\\s*0\\s*\\)\\s*;\\s*\\$LlCam\\s*=\\s*array\\(\\s*\"\\\\x5f\\\\107\\\\x45\\\\x54\"\\s*\\)\\s*;', 864 '\\$\\{\\s*\\$LlCam\\s*\\[\\s*0\\s*\\]\\s*\\}', 865 '@?require_once\\s*[\'"](?:\\\\x7a\\\\x69\\\\x70)[^\'"]*[\'"]', 866 '\\\\x65\\\\x64\\\\x31\\\\x31\\\\x30\\\\x62\\\\x65\\\\x62\\\\x63\\\\x65\\\\x39\\\\x2e\\\\x74\\\\x6d\\\\x70', 867 'ycycsUnT3uBLqyUrzfdIDg23r', 868 '\beval\s*\(\s*base64_decode\s*\(', 869 '\bpreg_replace\s*\(\s*([\'"])\s*([^\w\s\\])(?:\\.|(?!\2).)*\2(?=[A-Za-z]*e[A-Za-z]*\1)', 870 '\b(?:include|require|include_once|require_once)\s*(?:\(\s*)?[\'"]https?:\/\/', 871 '\b(?:exec|shell_exec|system|passthru|proc_open|popen|pcntl_exec)\s*\([^)]*\$_(?:GET|POST|REQUEST|COOKIE|SERVER)\b', 872 'shell_exec\s*\([^)]*\$_REQUEST', 873 '\b(?:file_put_contents|fopen|fwrite|fputs)\s*\(\s*\$[A-Za-z_]\w*\s*,\s*base64_decode\s*\(', 874 '[\'"]\s*e\s*[\'"]\s*\.\s*[\'"]\s*val\s*[\'"]', 875 '[\'"]\s*base\s*[\'"]\s*\.\s*[\'"]\s*64\s*[\'"]\s*\.\s*[\'"]\s*decode\s*[\'"]', 876 '\$\w+\s*=\s*[\'"][a-z]{1,3}[\'"]\s*;\s*\$\w+\s*=\s*[\'"][a-z]{1,3}[\'"]\s*;\s*\$\w+\s*=\s*\$\w+\s*\.\s*\$\w+\s*\.\s*[\'"](tem|val|sert)[\'"]\s*;', 877 'ob_implicit_flush\s*\(\s*true\s*\)\s*;[\s\S]{0,160}\bob_end_flush\s*\(', 878 '(?s)(?:OPENSSL_RAW_DATA.*substr\s*\(\s*hash\s*\(\s*[\'"]sha256[\'"]|substr\s*\(\s*hash\s*\(\s*[\'"]sha256[\'"].*OPENSSL_RAW_DATA|[\'"]<\s*\/?\s*scr?\s*[\'"]\s*\.\s*[\'"]r?ipt\s*>[\'"])', 879 '(?s)\$[A-Za-z_]\w*\s*=\s*\$_(?:POST|REQUEST)\s*;.*?isset\s*\(\s*\$[A-Za-z_]\w*\s*\[[\'"][a-z0-9_]{3,}[\'"]\]\s*\).*?\$\w+\s*\(\s*\.\.\.\$\w+\s*\)', 880 '(?s)readfile\s*\(\s*base64_decode\s*\(\s*["\'][^"\']{8,}["\']\s*\)\s*\)\s*;.*?eval\s*\(\s*.*?ob_get_clean\s*\(\s*\)\s*\)\s*;', 881 'function\s*uPqmvR\s*\(', 882 'function\s*yh1\s*\(', 883 '\bUpVwwHRQ\s*\(', 884 'array_map\(\s*[\'"]md5[\'"]\s*,\s*\$_COOKIE', 885 '\$gi6\[\d+\]\s*\(\s*\$_(?:COOKIE|POST|REQUEST)', 886 'include\s*\(\s*base64_decode\s*\(\s*\$[A-Za-z_]\w*\s*\)\s*(?:\.\s*)?\)\s*;', 887 'call_user_func\s*\(\s*new\s+LiteSpeedMetaDataStore' 888 ]; 836 889 } 890 891 protected function wpfa_get_patterns() : array { 892 return [ 893 '^\x7fELF', 894 '^MZ', 895 '^\xCF\xFA\xED', 896 '\b(?:require|require_once|include|include_once)\s*\(?\s*(?:@?\s*)?(?:base64_decode|str_rot13|gzinflate|gzuncompress)\s*\(', 897 'error_reporting\\s*\\(\\s*0\\s*\\)\\s*;\\s*\\$LlCam\\s*=\\s*array\\s*\\(', 898 '\\$\\{\\s*\\$LlCam\\s*\\[\\s*0\\s*\\]\\s*\\}', 899 '@?require_once\\s*[\\\'\\"][^\\\'\\\"]{3,256}[\\\'\\"]', 900 'ed110bebce9\\.tmp', 901 'ycycsUnT3uBLqyUrzfdIDg23r', 902 '\b(?:fopen|fwrite|fputs|file_put_contents|file_get_contents|fclose|chmod|unlink)\s*\([^)]*base64_decode\s*\(', 903 'basename\s*\(\s*__FILE__\s*,\s*base64_decode\s*\(', 904 '\b(?:exec|shell_exec|system|passthru|proc_open|popen|pcntl_exec)\s*\([^)]*base64_decode\s*\(', 905 '\b(?:exec|shell_exec|system|passthru|proc_open|popen|pcntl_exec)\s*\(\s*\$_(?:GET|POST|REQUEST|COOKIE|SERVER)\b', 906 '>\s*\/dev\/null\s*2>\s*\/dev\/null\s*&', 907 '(?:base64_encode\s*\(\s*){2,}[^)]*\)', 908 '(?:base64_decode\s*\(\s*){2,}[^)]*\)', 909 'openssl_(?:en|de)crypt\s*\([^,]+,\s*[\'"]?\s*aes\s*[-_ ]?(?:128|192|256)\s*[-_ ]?cbc[\'"]?\s*,[^)]*hash\s*\(\s*[\'"]sha256[\'"]\s*,\s*[\'"][^\'"]{8,}[\'"]\s*,\s*true\s*\)[^)]*\)', 910 'substr\s*\(\s*hash\s*\(\s*[\'"]sha256[\'"]\s*,\s*[\'"][^\'"]{8,}[\'"]\s*,\s*true\s*\)\s*,\s*0\s*,\s*16\s*\)', 911 '\b(?:include|require|include_once|require_once)\s*\(\s*base64_decode\s*\(', 912 '\b(?:include|require|include_once|require_once|file_get_contents|fopen)\s*\([^)]*(?:php:\/\/input|php:\/\/filter|data:\/\/)', 913 'md5\s*\(\s*uniqid\s*\([^)]*\)\s*\)\s*\.\s*[\'"]\.(?:php|phtml)\b', 914 'curl_init\s*\([^)]*\)\s*;[^;]*CURLOPT_(?:HTTPHEADER|COOKIE)[^;]*(?:Authorization|Cookie)[^;]*token\s*=\s*', 915 'wp_remote_request\s*\([^)]*\bheaders\b[^)]*(?:Authorization|Cookie)[\'"]\s*=>\s*[\'"][^\'"]*token=', 916 '`[^`]{1,200}`', 917 '[\'"]<\s*sc[\'"]\s*\.\s*[\'"]ript\s*>[\'"]', 918 '[\'"]<\/\s*scr[\'"]\s*\.\s*[\'"]ipt\s*>[\'"]', 919 'array\s*\(\s*(?:\s*[\'"][a-z0-9][\'"]\s*,){3,}\s*[\'"][a-z0-9][\'"]\s*\)', 920 '\$[A-Za-z_]\w*\s*=\s*\$\w+\s*\.\s*\$\w+\s*\.\s*[\'"](tem|xec)[\'"]', 921 '(?s)readfile\s*\(\s*base64_decode\s*\(.*?\)\s*\).*?eval\s*\(\s*.*?ob_get_clean\s*\(\s*\).*?\)', 922 '\$[A-Za-z_]\w*\s*=\s*\$[A-Za-z_]\w*\s*\[[\'"][a-z0-9_]{3,}[\'"]\]\s*;.*\$\w+\s*\(\s*\.\.\.\$\w+\s*\)', 923 'function\s*uPqmvR\s*\(', 924 'function\s*yh1\s*\(', 925 '\bUpVwwHRQ\s*\(', 926 'array_map\(\s*[\'"]md5[\'"]\s*,\s*\$_COOKIE', 927 '\$gi6\[\d+\]\s*\(\s*\$_(?:COOKIE|POST|REQUEST)', 928 'include\s*\(\s*base64_decode\s*\(\s*\$[A-Za-z_]\w*\s*\)\s*(?:\.\s*)?\)\s*;', 929 'call_user_func\s*\(\s*new\s+LiteSpeedMetaDataStore' 930 ]; 931 } 932 } -
folder-auditor/trunk/readme.txt
r3379504 r3380286 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 4. 38 Stable tag: 4.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 93 93 == Changelog == 94 94 95 = 4.4 = 96 * Added new infection patterns to find bad files 97 95 98 = 4.3 = 96 99 * Setup MainWP bridge for unlock relock when running updates … … 195 198 == Upgrade Notice == 196 199 200 = 4.4 = 201 * Added new infection patterns to find bad files 202 197 203 = 4.3 = 198 204 * Setup MainWP bridge for unlock relock when running updates
Note: See TracChangeset
for help on using the changeset viewer.