Plugin Directory

Changeset 3160150


Ignore:
Timestamp:
10/01/2024 01:33:34 AM (17 months ago)
Author:
wordpressdr
Message:

Add vulnerability checker.
Bug fix.

Location:
wpinfecscanlite/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wpinfecscanlite/trunk/readme.txt

    r3126958 r3160150  
    1 === WPDoctor Malware Scanner Lite ===
     1=== WPDoctor Malware Scanner & Vulnerability Checker Lite ===
    22Contributors: wordpressdr
    3 Tags: malware, virus, check, detection, scanning
     3Tags: malware, vulnerability, check, detection, scanning
    44Requires at least: 4.6
    55Tested up to: 6.6
    6 Stable tag: 1.0.4
     6Stable tag: 1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99Requires PHP: 5.6
    1010
    11 This plug-in can exhaustively scan program files on the site to detect malware.
     11This plug-in can exhaustively scan program files on the site to detect malware and vulnerability.
    1212
    1313== Description ==
     14**Try it out on your free dummy site: Click here => [https://tastewp.org/plugins/wpinfecscanlite/](https://tastewp.org/plugins/wpinfecscanlite/)**
    1415
    1516* This plugin is a simple malware inspection plugin developed by a leading company in Japan that is engaged in malware removal and security-related business for WordPress sites.
     
    1920* Malware scans can be set to run automatically, with email notifications when malware is detected.
    2021* False positives can be whitelisted to prevent detection again.
     22* Vulnerability checker will check if there are valunability in your site's plugin and wordpress. This function checks most used valunability for hacking that has over CVSS 9.0 point. Detects approximately 500 vulnerabilities created by the NIST vulnerability database.
    2123* This plugin is free and does not require any registration to use the above features! Simply install and press the Malware Scanning button for easy and powerful detection of malware!
    2224
     
    5153
    5254== Changelog ==
     55
     56= 1.1 =
     57
     58Add vulnerability checker.
     59Bug fix.
    5360
    5461= 1.0.4 =
  • wpinfecscanlite/trunk/scannerdata/getscanprocess_inc.php

    r3107788 r3160150  
    5757            if($row->infectedflag==1){
    5858               
    59                 $dbinfecdata=$dbinfecdata."<tr id='detect_".esc_html($row->id)."' class='class_".esc_html($row->filehash)."'><td><span class='dashicons dashicons-portfolio' style='font-size: 20px;color:#ababab;'></span><td>".esc_html($row->filepath)."<b>".esc_html($row->filename)."</b></td><td><div class='mfound'><img src='".esc_html($purl)."images/".esc_html(__('patternmatched.png','wpinfecscanlite'))."'>". esc_html(__("This data contains malicious code patterns.",'wpinfecscanlite'))."</div><small>*" . $infeccount ." ". esc_html(__("Pattern matched",'wpinfecscanlite'))."</small></td><td><a class='ceditbt' href='javascript:void(0);' onClick='showcode(\"".esc_html($row->filepath)."\",\"".esc_html($row->filename)."\",\"".esc_html($row->matchline)."\",\"detect_".esc_html($row->id)."\")'><span class='dashicons dashicons-text-page'></span><br>".esc_html(__("Display",'wpinfecscanlite'))."</a>
     59                $dbinfecdata=$dbinfecdata."<tr id='detect_".esc_html($row->id)."' class='class_".esc_html($row->filehash)."'><td><span class='dashicons dashicons-portfolio' style='font-size: 20px;color:#ababab;'></span><td>".esc_html($row->filepath)."<b>".esc_html($row->filename)."</b></td><td><div class='mfound'><img src='".esc_html($purl)."images/".esc_html(__('patternmatched.png','wpinfecscanlite'))."'>". esc_html(__("This data contains malicious code patterns.",'wpinfecscanlite'))."</div><small>*" . $infeccount ." ". esc_html(__("Pattern matched",'wpinfecscanlite'))."</small></td><td><a class='ceditbt' href='javascript:void(0);' onClick='showcode(\"".esc_html($row->filepath)."\",\"".esc_html($row->filename)."\",\"".esc_html($row->matchline)."\",\"detect_".esc_html($row->id)."\")'><span class='dashicons dashicons-format-aside'></span><br>".esc_html(__("Display",'wpinfecscanlite'))."</a>
    6060                </td><td><button class='autorestorebt' href='javascript:void(0);' onClick='whitelistfile(\"".esc_html($row->filepath)."\",\"".esc_html($row->filename)."\",\"".esc_html($row->filehash)."\")'><span class='dashicons dashicons-admin-post'></span><br>".esc_html(__("Add to whitelist",'wpinfecscanlite'))."</button></td></tr>"; ////edited2
    6161               
  • wpinfecscanlite/trunk/scannerdata/getscanprocess_inc2.php

    r3107788 r3160150  
    4040            <div class='mfound'><img src='".esc_html($purl)."images/".esc_html(__('patternmatched.png','wpinfecscanlite'))."'>
    4141            ". esc_html(__("This data contains malicious code patterns.",'wpinfecscanlite'))."</div><small>*" . esc_html($infeccount) ." ". esc_html(__("Pattern matched",'wpinfecscanlite'))."</small></td>
    42             <td><a class='ceditbt' href='javascript:void(0);' onClick='showcode(\"".esc_html($row->filepath)."\",\"".esc_html($row->filename)."\",\"".esc_html(implode(",",$infeclines))."\",\"detect_".$row->id."\")'><span class='dashicons dashicons-text-page'></span><br>".esc_html(__("Display",'wpinfecscanlite'))."</a>
     42            <td><a class='ceditbt' href='javascript:void(0);' onClick='showcode(\"".esc_html($row->filepath)."\",\"".esc_html($row->filename)."\",\"".esc_html(implode(",",$infeclines))."\",\"detect_".$row->id."\")'><span class='dashicons dashicons-format-aside'></span><br>".esc_html(__("Display",'wpinfecscanlite'))."</a>
    4343            </td><td><button class='autorestorebt' href='javascript:void(0);' onClick='whitelistfile(\"".esc_html($row->filepath)."\",\"".esc_html($row->filename)."\",\"".esc_html($row->filehash)."\")'><span class='dashicons dashicons-admin-post'></span><br>".esc_html(__("Add to whitelist",'wpinfecscanlite'))."</button></td>
    4444            </tr>";////edited2
  • wpinfecscanlite/trunk/tab_morefuture.php

    r3107788 r3160150  
    3535            <p><?php esc_html_e("*The video is an English version. The actual plug-in is available in multiple languages including English, Japanese, French, German, Italian, Spanish, and Dutch.","wpinfecscanlite");?></p>
    3636            <h3 style="font-size:22px">
    37                <?php esc_html_e("From detection of 1,000 patterns to detection of more than 16,000 patterns of malware that are constantly updated","wpinfecscanlite");?>
     37               <?php esc_html_e("From detection of 1,000 patterns to detection of more than 18,000 patterns of malware that are constantly updated","wpinfecscanlite");?>
    3838            </h3>
    3939          </div>
     
    4747          </div>
    4848          <div class="col-md-5">
    49             <p><?php esc_html_e("The WP-Doctor Malware Scanner Lite is limited to scanning by approximately 1,000 malware detection patterns, which are the most frequently detected patterns. The Pro version has 16,000 registered malware detection patterns and is always automatically updated with the latest detection patterns to detect and remove more malware.","wpinfecscanlite");?> </p>
     49            <p><?php esc_html_e("The WP-Doctor Malware Scanner Lite is limited to scanning by approximately 1,000 malware detection patterns, which are the most frequently detected patterns. The Pro version has 18,000 registered malware detection patterns and is always automatically updated with the latest detection patterns to detect and remove more malware.","wpinfecscanlite");?> </p>
    5050          </div>
    5151      </div>
     
    9292          <div class="col-lg-12">
    9393            <h3 style="font-size:22px">
    94                <?php esc_html_e("1,600 vulnerability checks","wpinfecscanlite");?>
     94               <?php esc_html_e("more than 1,600 vulnerability checks","wpinfecscanlite");?>
    9595            </h3>
    9696          </div>
     
    157157          <div class="col-md-7">
    158158            <div class="vcontainer">
    159               <iframe class="yvideo" src="https://www.youtube.com/embed/j7zxQfcd-H8?si=wyNh4fZt-kIZx783" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> /div>
     159              <iframe class="yvideo" src="https://www.youtube.com/embed/j7zxQfcd-H8?si=wyNh4fZt-kIZx783" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
    160160            </div>
    161161          </div>
  • wpinfecscanlite/trunk/wpinfecscanlite.php

    r3112100 r3160150  
    11<?php
    22/**
    3 Plugin Name: WPDoctor Malware Scanner Lite
     3Plugin Name: WPDoctor Malware Scanner & Vulnerability Checker Lite
    44Plugin URI: https://wordpress.org/plugins/wpinfecscanlite/
    5 description: Based on the most frequently detected malware detection patterns, this plug-in can exhaustively scan program files on the site to detect malware.
    6 Version: 1.0.4
     5description: Based on the most frequently detected malware detection patterns, this plug-in can exhaustively scan program files on the site to detect malware and vulnerability.
     6Version: 1.1
    77Text Domain: wpinfecscanlite
    88Domain Path: /languages
     
    7777    delete_option( 'wpinfectlitescanner_hidealert_info' );
    7878   
     79    delete_option( 'wpinfectlitescanner_valncheck');
     80    delete_option( 'wpinfectlitescanner_valnchecktime');
     81   
    7982}
    8083register_deactivation_hook (__FILE__, 'wpinfectlitescannercron_deactivate');
     
    112115add_action( 'wp_ajax_wpinfectlitescanner_realtimerun', 'wpinfectlitescanner_realtimerun' );
    113116
     117function wpinfectlitescanner_valncheck(){
     118   
     119    if ( ! current_user_can( 'manage_options' ) ) {
     120        die();
     121    }
     122   
     123    if ( ! check_ajax_referer('wpinfecscanlite', 'nonce', false)) {
     124        die();
     125    }
     126   
     127    $chackdata=sanitize_text_field($_POST['chackdata']);
     128
     129    if(empty($chackdata)){
     130        die();
     131    }
     132   
     133    $checkdata = json_decode(hex2bin(str_rot13($chackdata)),false);
     134   
     135    $vulnerabilitiestxt = file_get_contents(__DIR__ . "/scannerdata/vulnerabilities.json");
     136    $vulnerabilities = json_decode($vulnerabilitiestxt);
     137   
     138   
     139    if($checkdata && count($vulnerabilities)>10){
     140       
     141        $resultdata=array();
     142       
     143        foreach($checkdata as $onedata){
     144            if(count($onedata)!=4){
     145                continue;
     146            }
     147           
     148            $dataname = trim($onedata[0]);
     149            $type= trim($onedata[1]);
     150            $versiondata = trim($onedata[2]);
     151           
     152            $foundvaln = false;
     153            $cve = "";
     154           
     155            foreach($vulnerabilities as $vulnerabilitie){
     156                if($vulnerabilitie->productdataname == $dataname){
     157                    $valnversion = explode("\n",$vulnerabilitie->versioninfo);
     158                    for($i=0;$i<count($valnversion);$i++){
     159                        $ptn = trim($valnversion[$i]);
     160                        if (strlen($ptn)>1){
     161                            $ptnar = explode(" ",$ptn);
     162                            if(strpos($ptn,'&') === false){
     163                                $hikaku = "";
     164                                $versionhikaku = "";
     165                                for($ii=0;$ii<count($ptnar);$ii++){
     166                                    if(strpos(trim($ptnar[$ii]),'>') !== false || strpos(trim($ptnar[$ii]),'<') !== false || strpos(trim($ptnar[$ii]),'=') !== false){
     167                                        $hikaku=trim($ptnar[$ii]);
     168                                    }
     169                                    if (preg_match("/[0-9]/", trim($ptnar[$ii]))) {
     170                                        $versionhikaku=trim($ptnar[$ii]);
     171                                    }
     172                                }
     173                                if($hikaku=="="){
     174                                    $hikaku="==";
     175                                }
     176                                if($hikaku!="" && $versionhikaku!=""){
     177                                   
     178                                    $versionresult = version_compare($versiondata,$versionhikaku,$hikaku);
     179                                   
     180                                    if($versionresult){
     181                                        $cve.=$vulnerabilitie->cveid.",";
     182                                        $foundvaln=true;
     183                                    }
     184                                }
     185                            }else{
     186                                $ptnar=explode("&",$ptn);
     187                                $ptnar1 = explode(" ",$ptnar[0]);
     188                                $ptnar2 = explode(" ",$ptnar[1]);
     189                                $hikaku1 = "";
     190                                $versionhikaku1 = "";
     191                                $hikaku2 = "";
     192                                $versionhikaku2 = "";
     193                                for($ii=0;$ii<count($ptnar1);$ii++){
     194                                    if(strpos(trim($ptnar1[$ii]),'>') !== false || strpos(trim($ptnar1[$ii]),'<') !== false || strpos(trim($ptnar1[$ii]),'=') !== false){
     195                                        $hikaku1=trim($ptnar1[$ii]);
     196                                    }
     197                                    if (preg_match("/[0-9]/", trim($ptnar1[$ii]))) {
     198                                        $versionhikaku1=trim($ptnar1[$ii]);
     199                                    }
     200                                }
     201                                for($ii=0;$ii<count($ptnar2);$ii++){
     202                                    if(strpos(trim($ptnar2[$ii]),'>') !== false || strpos(trim($ptnar2[$ii]),'<') !== false || strpos(trim($ptnar2[$ii]),'=') !== false){
     203                                        $hikaku2=trim($ptnar2[$ii]);
     204                                    }
     205                                    if (preg_match("/[0-9]/", trim($ptnar2[$ii]))) {
     206                                        $versionhikaku2=trim($ptnar2[$ii]);
     207                                    }
     208                                }
     209                                if($hikaku1=="="){
     210                                    $hikaku1="==";
     211                                }
     212                                if($hikaku2=="="){
     213                                    $hikaku2="==";
     214                                }
     215                                if($hikaku1!="" && $versionhikaku1!="" && $hikaku2!="" && $versionhikaku2!=""){
     216                                    $versionresult = version_compare($versiondata,$versionhikaku1,$hikaku1);
     217                                   
     218                                    $versionresult2 = version_compare($versiondata,$versionhikaku2,$hikaku2);
     219                                   
     220                                    if($versionresult || $versionresult2){
     221                                        $cve.=$vulnerabilitie->cveid.",";
     222                                        $foundvaln=true;
     223                                    }
     224                                }
     225                            }
     226                        }
     227                    }
     228                }
     229            }
     230           
     231            if($foundvaln){
     232                $resultdata[]=array($onedata[0],$onedata[1],$onedata[2],$cve,$onedata[3]);
     233            }else{
     234                $resultdata[]=array($onedata[0],$onedata[1],$onedata[2],"0",$onedata[3]);
     235            }
     236               
     237           
     238        }
     239       
     240        if(is_array($resultdata)){
     241            update_option( 'wpinfectlitescanner_valncheck',json_encode($resultdata));
     242            update_option( 'wpinfectlitescanner_valnchecktime',date_i18n ("Y/m/d H:i:s"));
     243        }
     244       
     245        echo json_encode($resultdata);
     246    }
     247   
     248    die();
     249}
     250add_action( 'wp_ajax_wpinfectlitescanner_valncheck', 'wpinfectlitescanner_valncheck' );
     251
    114252include_once('scannerdata/getscanprocess_inc.php');
    115253
     
    134272        die();
    135273    }
    136 
    137274
    138275    global $wpdb;
     
    575712                <p class="lead"></p>
    576713               
    577                 <p><small style="font-size:12px">Version 1.0.4</small></p>
     714                <p><small style="font-size:12px">Version 1.1</small></p>
    578715                   
    579716                    <p class="lead">
     
    592729            <li class="nav-item"><a href="#ContentA" data-bs-toggle="tab" class="nav-link active"><?php esc_html_e('Malware scan','wpinfecscanlite'); ?></a></li>
    593730            <li class="nav-item"><a href="#ContentD" data-bs-toggle="tab" class="nav-link"><?php esc_html_e('Whitelist','wpinfecscanlite'); ?></a></li>
     731            <li class="nav-item"><a href="#ContentE" data-bs-toggle="tab" class="nav-link"><?php esc_html_e('Vulnerability check','wpinfecscanlite'); ?></a></li>
    594732            <li class="nav-item"><a href="#ContentB" id="ContentBtab" data-bs-toggle="tab" class="nav-link"><?php esc_html_e('Setting','wpinfecscanlite'); ?></a></li>
    595733            <li class="nav-item"><a href="#ContentC" data-bs-toggle="tab" class="nav-link"><?php esc_html_e('Detect more recent malware','wpinfecscanlite'); ?></a></li>
     
    600738                <?php require_once('tab_malwrescan.php'); ?>
    601739                <?php require_once('tab_whitelist.php'); ?>
     740                <?php require_once('tab_valn.php'); ?>
    602741                <?php require_once('tab_setting.php'); ?>
    603742                <?php require_once('tab_morefuture.php');?>
Note: See TracChangeset for help on using the changeset viewer.