telnet开启脚本代码

简介:
on error resume next 
set outstreem=wscript.stdout 
if (lcase(right(wscript.fullname,11))="wscript.exe") then 
set objShell=wscript.createObject("wscript.shell") 
objShell.Run("cmd.exe /k cscript //nologo "&chr(34)&wscript.scriptfullname&chr(34)) 
wscript.quit 
end if 
if wscript.arguments.count<5 then 
usage() 
wscript.echo "Not enough parameters." 
wscript.quit 
end if 
ipaddress=wscript.arguments(0) 
username=wscript.arguments(1) 
password=wscript.arguments(2) 
ntlm=wscript.arguments(3) 
port=wscript.arguments(4) 
if not isnumeric(ntlm) or ntlm<0 or ntlm>2 then 
usage() 
wscript.echo “The value of NTML is wrong.” 
wscript.quit 
end if 
if not isnumeric(port) then 
usage() 
wscript.echo “The value of port is wrong.” 
wscript.quit 
end if 
usage() 
outstreem.write “Conneting “&ipaddress&”….” 
set objlocator=createobject(”wbemscripting.swbemlocator”) 
set objswbemservices=objlocator.connectserver(ipaddress,”root/default”,username,password) 
showerror(err.number) 
outstreem.write “Setting NTLM=”&ntlm&”….” 
set objinstance=objswbemservices.get(”stdregprov”) 
set objmethod=objinstance.methods_(”SetDWORDvalue”) 
set objinparam=objmethod.inparameters.spawninstance_() 
objinparam.hdefkey=&h80000002 

objinparam.ssubkeyname=”SOFTWARE\Microsoft\TelnetServer\1.0〃 



 本文转自 simeon2005 51CTO博客,原文链接:http://blog.51cto.com/simeon/67885

相关文章
|
移动开发 网络安全 Python
|
移动开发 Python 测试技术
Telnet弱口令猜解【Python脚本】
telnet 弱口令猜解脚本   测试环境:window2003、centos7   #! /usr/bin/env python # _*_ coding:utf-8 _*_ import telnetlib username_list=['xiaozi','adm...
2048 0
|
Linux 网络安全
linux端口连通性测试telnet、wget、ssh、curl
linux端口连通性测试telnet、wget、ssh、curl
562 0
|
安全 Linux
Linux安装Telnet
Linux安装Telnet
517 0
|
安全 网络协议 Linux
telnet在windows和linux上的使用方法
Telnet是一个简单且强大的网络工具,广泛用于远程管理和网络诊断。尽管存在安全风险,但在受控环境中,Telnet仍然是一个非常有用的工具。通过本文的介绍,您应该能够在Windows和Linux系统上安装并使用Telnet进行各种网络操作。
3772 18
|
Linux
Linux telnet安装及端口测试联通性
Linux telnet安装及端口测试联通性
490 10
|
安全 Ubuntu Linux
Linux 网络操作命令Telnet
Linux 网络操作命令Telnet
685 0
Linux 网络操作命令Telnet
|
安全 网络协议 Linux
linux命令之telnet
linux命令之telnet
1621 4