zz7061098 发表于 2010-1-18 19:53:26

利用CMD shell查看 3389

利用CMDshell查看3389端口VBS版方法,很多时候我们只能暂时取得肉鸡的Cmd 权限,很多时候肉鸡的3389端口已经被更改,在这种情况下,大家不妨

用这个方法来查看一下,使用方法,完全复制,粘贴到cmd上,回车即可!

Echo Dim ReadComputerName >>misswe.vbs
Echo Set ReadComputerName=WScript.CreateObject("WScript.Shell") >>misswe.vbs
Echo Dim TSName,TSRegPath >>misswe.vbs
Echo TSRegPath="HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber" >>misswe.vbs
Echo TSName=ReadComputerName.RegRead(TSRegPath) >>misswe.vbs
Echo WScript.Echo("TermService port is:"^&TSName) >>misswe.vbs
Cscript misswe.vbs


方法1 : VBS 版
Dim ReadComputerName
Set ReadComputerName=WScript.CreateObject("WScript.Shell")
Dim TSName,TSRegPath
TSRegPath="HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber"
TSName=ReadComputerName.RegRead(TSRegPath)
WScript.Echo("终端端口为:"&TSName)
WScript.Echo


将以上内容保存后缀名为VBS即可 。
方法2 :bat 版
@echo off
mode con cols=32 lines=6
for /f "skip=4 tokens=1,2 delims=x" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "PortNumber"') do (
set pnL=%%a
set pnR=%%b
)
set /a pn=%pnL:~-1%x%pnR%
echo. & echo 你的终端端口为 : %pn%
echo. & echo 按任意键退出 & pause>nul
页: [1]
查看完整版本: 利用CMD shell查看 3389