2

在我们的客户站点中,我们在其中一个具有 swf 文件的页面中获得了Avast JS:Pdfka-PK 。而 avast 根本不允许我们打开这个页面。我已经花了一整天的时间,不确定问题出在哪里。

在此处输入图像描述

任何帮助是极大的赞赏。提前致谢。

我正在使用 Mac Mountain Lion 和 Chrome 33 以及 Avast 最新版本。

更多谷歌搜索我发现这个链接是的,我们从远程服务器下载一些文件并显示。但那些文件是无害的,想知道如何克服这一点。

对于分散的细节,我深表歉意。

以下是我的最新发现。

以下是给出 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;
}

如果我们使用 jQuery.min.js,如果我使用 jQuery.js,Check parent 之后的行会发出 Avast 警告,但我不会收到 Avast 警告。如果我使用 YUI 压缩器在线压缩 jQuery.js,我不会遇到 Avast 的任何问题。

我还尝试在代码中引入大量字符串协调,但仍然收到 Avast 警告。

我想知道为什么当我使用 jQuery.min.js 时会收到 Avast 警告,这是由 jQuery 给出的,但在 jQuery.js 中没有。

这真的很奇怪。

4

2 回答 2

1

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.

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)

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.

于 2014-03-24T06:27:24.343 回答
0

您可以尝试用以下代码替换您的代码:

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;
}

我所做的更改:

您在文档写入中编写了“html”和“body”,这不是必需的

于 2014-03-24T10:40:22.930 回答