简体   繁体   English

带有jQuery.min.js的Avast JS:Pdfka-PK感染警告,但jQuery.js效果很好

[英]Avast JS:Pdfka-PK infection warning with jQuery.min.js but jQuery.js works good

In our Client site we got Avast JS:Pdfka-PK in one of our page which has swf file. 在我们的客户站点中,我们的其中一个具有swf文件的页面中提供了Avast JS:Pdfka-PK And avast is not allowing us to open this page at all. 而且avast根本不允许我们打开此页面。 I already spent one whole day and not sure where the issue is. 我已经花了一整天的时间,不知道问题出在哪里。

在此处输入图片说明

Any help is greatly appreciated. 任何帮助是极大的赞赏。 Thanks in advance. 提前致谢。

I am using Mac Mountain Lion and Chrome 33 and Avast latest version. 我正在使用Mac Mountain Lion和Chrome 33和Avast最新版本。

More Googling I found this link yes we download some files from from remote server and show. 更多Google搜索,我发现此链接是的,我们从远程服务器下载了一些文件并显示。 But those files are not harmful, like to know how to overcome this. 但是那些文件并没有害处,喜欢知道如何克服这个问题。

My Apologies for scattered details. 我的歉意分散的细节。

Following are my latest findings. 以下是我的最新发现。

Following is the code which is giving the Avast warning. 以下是发出Avast警告的代码。

surveyAccept: function() {
    var page = "http://" + window.location.hostname;
    var windowprops = "width=100,height=100,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes";
    var PopWindow = window.open(page, "_blank", "", windowprops);

    window.setTimeout(window.focus, 500);

    if (PopWindow) {
        exitSurveyHTML = this.getNewWindowHTML();
        PopWindow.document.write(exitSurveyHTML);
        PopWindow.document.close( );

        if (navigator.userAgent.indexOf('Chrome/') > 0){
            window.focus();
        }

        PopWindow.blur();

        if (navigator.userAgent.indexOf('Firefox/4') > 0){
            window.open("", "_self", "");
        }
    }

},

getNewWindowHTML : function (){
    var exitSurveyLink = "sample link";

    windowHTML = '';
    windowHTML += '<!DOCTYPE HTML>';
    windowHTML += '<html>';
    windowHTML += '<script type="text/javascript">';
    windowHTML += 'var i;';
    windowHTML += 'var lastseen = window.opener.location.hostname;';
    windowHTML += 'function CheckParent() {';
    windowHTML += 'try {';
    windowHTML += 'var host = window.opener.location.hostname;';
    windowHTML += 'if (host != lastseen){';
    windowHTML += 'lastseen = host;';
    windowHTML += '}';
    windowHTML += 'return;';
    windowHTML += '} catch(error){';
    windowHTML += 'clearInterval(i);';
    windowHTML += 'moveTo(screen.width/2-450,screen.height/2-300);';
    windowHTML += 'resizeTo(900,600);';
    windowHTML += 'this.focus();';
    windowHTML += 'this.location="' + exitSurveyLink + '";';
    windowHTML += '}';
    windowHTML += '}';
    windowHTML += 'i = setInterval("CheckParent()", 500);';
    windowHTML += '<\/script>';
    windowHTML += '<\/body>';
    windowHTML += '<\/html>';
    return windowHTML;
}

The lines after Check parent is giving Avast warning if we user jQuery.min.js if I use jQuery.js I do not get Avast warning. 如果我使用jQuery.js,如果我们使用jQuery.min.js,则Check parent后面的行将向Avast警告,但不会收到Avast警告。 If I compress jQuery.js using YUI compressor online I am not getting any issues with Avast. 如果我使用YUI压缩器在线压缩jQuery.js,Avast不会出现任何问题。

I have also tried introducing lot of string concordination in the code still I get the Avast warning. 我仍然尝试在代码中引入很多字符串协调,但仍然收到Avast警告。

I like to know why I get Avast warning when I user jQuery.min.js which is given by jQuery but not in jQuery.js. 我想知道为什么当我使用jQuery给出的jQuery.min.js而不是jQuery.js时收到Avast警告。

This is really strange. 这真是奇怪。

Some of the normal code behaviour are mostly similar to a malware activity. 一些正常的代码行为大部分类似于恶意软件活动。

Its impossible to build a perfect detection system for any antivirus, i am hopping that auto virus detection that avast is using is conflicting with the same code structucture in the minified jquery file you have. 无法为任何防病毒软件构建完美的检测系统,我希望avast正在使用的自动病毒检测与您所拥有的缩小的jquery文件中的相同代码结构相冲突。

work around: 解决:

just download a min version from google cdn or jquery cdn and try to use it (if its not detected as any malware) 只需从google cdn或jquery cdn下载一个最低版本并尝试使用它(如果未将其检测为恶意软件)

i have faced similar issue with Panda Internet security auto detection mechanism. 我曾经遇到过熊猫互联网安全自动检测机制的类似问题。 some times more secure detection algorithm falsely catches a non malware code too. 有时,更安全的检测算法也会错误地捕获非恶意软件代码。

you can report false positives here . 您可以在此处报告误报。

and wait for avast to update their database to resolve this issue. 并等待avast更新其数据库以解决此问题。

Can you try replacing the your code with the following code: 您可以尝试将您的代码替换为以下代码:

var exitSurveyLink = "http://survey.confirmit.com/";
function openSurveyPopUp()
{
    var windowprops = "width=100,height=100,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes";
    var PopWindow = window.open(exitSurveyLink, "_blank", "", windowprops);
    if (PopWindow) {
        var surveyHTML = this.getPopUpWindowHTMLContent();
        PopWindow.document.write(surveyHTML);
        PopWindow.document.close( );
    }
}

function getPopUpWindowHTMLContent()
{
    var windowHTML = '';
    windowHTML += '<script type="text/javascript">';
    windowHTML += 'var i;';
    windowHTML += 'var lastseen = window.opener.location.hostname;';
    windowHTML += 'function CheckParent() {';
    windowHTML += 'console.log("CheckParent"+lastseen);try {';
    windowHTML += 'var host = window.opener.location.hostname;';
    windowHTML += 'if (host != lastseen){';
    windowHTML += 'lastseen = host;';
    windowHTML += '}';

windowHTML += 'document.body.innerHTML = "<center>'+new Date()+' - Please close the   parent window<\/center>";';
    windowHTML += 'return;';
    windowHTML += '} catch(error){';  //THERE IS NO PARENT WINDOW SO IT WILL END UP IN ERROR
    windowHTML += 'clearInterval(i);';
    windowHTML += 'moveTo(screen.width/2-450,screen.height/2-300);';
    windowHTML += 'resizeTo(900,600);';
    windowHTML += 'this.focus();';
    windowHTML += 'this.location="' + exitSurveyLink + '";';
    windowHTML += '}';
    windowHTML += '}';
    windowHTML += 'i = setInterval("CheckParent()", 500);';
    windowHTML += '<\/script>';
    return windowHTML;
}

changes i have made: 我所做的更改:

you were writing 'html' and 'body' in document write, which wasn't necessary 您在文档编写中编写了“ html”和“ body”,这不是必需的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM