support home

Back to website
Welcome
Login  Sign up

Virus in ubenda_cookie_solution.php

Ciao Roberto, non saprei che antivirus stai utilizzando, ma l'indicazione che ti fornisce è indubbiamente sbagliata ed il nostro plugin non contiene alcun virus, come chiunque può riscontrare all'interno del codice.
  • Buongiorno, l'antivirus mi segnala winnow.trojan.ts.xss.2.UNOFFICIAL FOUND all'interno di questo file wp-content/plugins/iubenda-cookie-wp-plugin-master/iubenda_cookie_solution.php Vi mando il codice del file. Non riesco ad individuarlo (.*)/sU'); /*************************************** * * Add Iubenda JS script to the header * ****************************************/ function iub_header(){ ob_start(); $iub_code = get_option('iub_code'); echo stripslashes($iub_code); } add_action('wp_head', 'iub_header'); /*********************************** * * Encode all the javascript/html content fetched from this comments: * * * * * * AND * * [iub-cookie-solution] * * code * * [/iub-cookie-solution] * ************************************/ function strpos_array($haystack, $needle){ if(is_array($needle)){ foreach($needle as $need){ if(strpos($haystack, $need) !== false){ return true; } } }else{ if(strpos($haystack, $need) !== false) { return true; } } return false; } function create_tags_ai($html){ $auto_script_tags = array( 'platform.twitter.com/widgets.js', 'apis.google.com/js/plusone.js', 'connect.facebook.net', 'www.youtube.com/iframe_api' ); $auto_iframe_tags = array( 'youtube.com' ); $elements = $html->find("*"); $js = ''; foreach($elements as $e){ switch($e->tag){ case 'script': if($e->type != "text/plain"){ //async tag script $s = $e->innertext; if (strpos_array($s, $auto_script_tags) !== false) { $js.= ''; }else{ //sync tag script $src = $e->src; if (strpos_array($src, $auto_script_tags) !== false) { $js.=''; }else{ $js.= $e->outertext; } } }else{ $js.=$e->outertext; } break; case 'iframe': $s = $e->src; if (strpos_array($s, $auto_iframe_tags) !== false) { $new_src = "data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+"; $class = $e->class; $e->suppressedsrc = $s; $e->src = $new_src; $e->class = $class . ' _iub_cs_activate'; $js.= $e->outertext; } break; } } return $js; } function create_tags($html){ $elements = $html->find("*"); $js = ''; foreach($elements as $e){ switch($e->tag){ case 'script': $s = $e->innertext; $js.= ''; break; default: $js.= ''; $js.= $e->outertext; $js.= ''; break; } } return $js; } add_action('shutdown', function() { $final = ''; // We'll need to get the number of ob levels we're in, so that we can iterate over each, collecting // that buffer's output into the final output. $levels = count(ob_get_level()); for ($i = 0; $i < $levels; $i++){ $final .= ob_get_clean(); } // Apply any filters to the final output echo apply_filters('final_output', $final); }, 0); add_filter('final_output', function($output) { /* Replace all the comments with js/html encoded code */ preg_match_all(IUB_REGEX_PATTERN, $output, $scripts); if(is_array($scripts[1])){ $js_scripts = array(); foreach($scripts[1] as $script){ $html = str_get_html($script); $js_scripts[] = create_tags($html); } /* Replace every script in the same position */ $output = preg_replace_callback(IUB_REGEX_PATTERN, function($m)use(&$js_scripts){ return array_shift($js_scripts); }, $output); } /******************************* AUTO MATCH SCRIPT *******************************/ unset($scripts); preg_match_all("/(<\s*script[^>]*>.*?<\s*\/script[^>]*>)/is", $output, $scripts); if(is_array($scripts[1])){ $js_scripts = array(); foreach($scripts[1] as $script){ $html = str_get_html($script); $js_scripts[] = create_tags_ai($html); } $output = preg_replace_callback("/(<\s*script[^>]*>.*?<\s*\/script[^>]*>)/is",function($m)use(&$js_scripts){ return array_shift($js_scripts); }, $output); } /******************************* AUTO MATCH IFRAME *******************************/ unset($scripts); preg_match_all("/(<\s*iframe[^>]*>.*?<\s*\/iframe[^>]*>)/is", $output, $scripts); if(is_array($scripts[1])){ $js_scripts = array(); foreach($scripts[1] as $script){ $html = str_get_html($script); $js_scripts[] = create_tags_ai($html); } $output = preg_replace_callback("/(<\s*iframe[^>]*>.*?<\s*\/iframe[^>]*>)/is",function($m)use(&$js_scripts){ return array_shift($js_scripts); }, $output); } return $output; }); function iub_func($atts, $content = "") { /* Shortcode function */ $html = str_get_html($content); return create_tags($html); } add_shortcode('iub-cookie-policy', 'iub_func'); /*********************************** * * Add menù item on the admin * ************************************/ function iub_admin_actions() { add_options_page(VOICE_MENU, VOICE_MENU, 1, URL_MENU, 'iub_admin'); } function iub_admin(){ /* Handling POST DATA and FETCHING from DB */ if($_POST['iub_update_form'] == 1) { $iub_code = $_POST['iub_code']; update_option('iub_code', $iub_code); echo '

    Opzioni salvate

    '; } else { $iub_code = get_option('iub_code'); } echo '

    iubenda Cookie Policy Solution

    Iubenda settings

    Codice iubenda
    '.stripslashes($iub_code).'

    Per informazioni ed istruzioni su questo plugin, visita questa guida:
    https://www.iubenda.com/it/help/posts/810

    '; } add_action('admin_menu', 'iub_admin_actions'); ?> Grazie Cordiali saluti
Login or Signup to post a comment