Plugin Directory

Changeset 1155457


Ignore:
Timestamp:
05/07/2015 03:09:56 PM (11 years ago)
Author:
yorman
Message:

Added. Integrity checks with unfixable files and better description

Location:
sucuri-scanner/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sucuri-scanner/trunk/inc/css/sucuriscan-default-css.css

    r1151297 r1155457  
    1010.sucuriscan-visible{}
    1111.sucuriscan-hidden{display:none !important}
     12.sucuriscan-opacity{opacity:0.6}
    1213.sucuriscan-monospace{font-family:Monospace, Courier}
    1314.sucuriscan-ellipsis{overflow:hidden;display:inline-block;white-space:nowrap;text-overflow:ellipsis}
  • sucuri-scanner/trunk/inc/tpl/integrity-corefiles.html.tpl

    r1155418 r1155457  
    5656                <td colspan="5">
    5757                    <p>
    58                         The action to restore the content of a file will only work with files that were
    59                         <b>modified</b> or <b>removed</b>, for files that were <b>added</b> you must
    60                         either remove or mark as fixed. Files marked as <b>fixed</b> will always be
    61                         ignored from the integrity checks, an attacker can use this option to hide a
    62                         malicious file, so always check what files are being ignored.
     58                        <strong>Note.</strong> This is not a malware scanner but an integrity checker
     59                        which is a completely different thing, if you want to check if your site is
     60                        generating malicious code then use the <a href="%%SUCURI.URL.Scanner%%">malware
     61                        scan</a> tool. If you see the text <em>"must be fixed manually"</em> in any of
     62                        these files that means that they do not have write permissions so you can not
     63                        fix them using this tool.
    6364                    </p>
    6465
  • sucuri-scanner/trunk/inc/tpl/integrity-corefiles.snippet.tpl

    r1155418 r1155457  
    22<tr class="%%SUCURI.CoreFiles.CssClass%% sucuriscan-hidden">
    33    <td class="check-column">
    4         <input type="checkbox" name="sucuriscan_integrity_files[]" value="%%SUCURI.CoreFiles.FilePath%%" />
    5         <input type="hidden" name="sucuriscan_integrity_types[]" value="%%SUCURI.CoreFiles.StatusType%%" />
     4        <input type="checkbox" name="sucuriscan_integrity_files[]"
     5        value="%%SUCURI.CoreFiles.FilePath%%" %%SUCURI.CoreFiles.IsFixtableFile%% />
     6        <input type="hidden" name="sucuriscan_integrity_types[]"
     7        value="%%SUCURI.CoreFiles.StatusType%%" %%SUCURI.CoreFiles.IsFixtableFile%% />
    68    </td>
    79    <td><span class="sucuriscan-label sucuriscan-label-%%SUCURI.CoreFiles.StatusType%%">%%SUCURI.CoreFiles.StatusType%%</span></td>
    810    <td><em title="%%SUCURI.CoreFiles.FileSizeNumber%% bytes">~%%SUCURI.CoreFiles.FileSizeHuman%%</em></td>
    911    <td>%%SUCURI.CoreFiles.ModifiedAt%%</td>
    10     <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.CoreFiles.FilePath%%</span></td>
     12    <td>
     13        <span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.CoreFiles.FilePath%%</span>
     14        <em>%%SUCURI.CoreFiles.IsNotFixable%%</em>
     15    </td>
    1116</tr>
  • sucuri-scanner/trunk/sucuri.php

    r1155418 r1155457  
    85378537                    }
    85388538
    8539                     // Generate the HTML code from the snippet template for this file.
     8539                    // Add extra information to the file list.
    85408540                    $css_class = ( $counter % 2 == 0 ) ? '' : 'alternate';
    85418541                    $file_size = @filesize( $full_filepath );
     8542                    $is_fixable_html = '';
     8543                    $is_fixable_text = '';
     8544
     8545                    // Check whether the file can be fixed automatically or not.
     8546                    if ( $file_info['is_fixable'] !== true ) {
     8547                        $css_class .= ' sucuriscan-opacity';
     8548                        $is_fixable_html = 'disabled="disbled"';
     8549                        $is_fixable_text = '(must be fixed manually)';
     8550                    }
     8551
     8552                    // Generate the HTML code from the snippet template for this file.
    85428553                    $template_variables['CoreFiles.List'] .= SucuriScanTemplate::get_snippet('integrity-corefiles', array(
    85438554                        'CoreFiles.CssClass' => $css_class,
     
    85488559                        'CoreFiles.FileSizeNumber' => number_format( $file_size ),
    85498560                        'CoreFiles.ModifiedAt' => SucuriScan::datetime( $file_info['modified_at'] ),
     8561                        'CoreFiles.IsFixtableFile' => $is_fixable_html,
     8562                        'CoreFiles.IsNotFixable' => $is_fixable_text,
    85508563                    ));
    85518564                    $counter += 1;
     
    86328645                $output['stable'][] = array(
    86338646                    'filepath' => $file_path,
     8647                    'is_fixable' => false,
    86348648                    'modified_at' => 0,
    86358649                );
    86368650            } else {
    86378651                $modified_at = @filemtime( $full_filepath );
     8652                $is_fixable = (bool) is_writable( $full_filepath );
    86388653                $output['modified'][] = array(
    86398654                    'filepath' => $file_path,
     8655                    'is_fixable' => $is_fixable,
    86408656                    'modified_at' => $modified_at,
    86418657                );
    86428658            }
    86438659        } else {
     8660            $is_fixable = is_writable( dirname( $full_filepath ) );
    86448661            $output['removed'][] = array(
    86458662                'filepath' => $file_path,
     8663                'is_fixable' => $is_fixable,
    86468664                'modified_at' => 0,
    86478665            );
     
    86618679            $full_filepath = ABSPATH . '/' . $file_path;
    86628680            $modified_at = @filemtime( $full_filepath );
     8681            $is_fixable = (bool) is_writable( $full_filepath );
    86638682            $output['added'][] = array(
    86648683                'filepath' => $file_path,
     8684                'is_fixable' => $is_fixable,
    86658685                'modified_at' => $modified_at,
    86668686            );
Note: See TracChangeset for help on using the changeset viewer.