记录每次进入3389远程桌面IP的批处理bat
时间:2021-11-13 15:30:18|栏目:DOS/BAT|点击: 次
下面的代码复制一下存成一个批处理文件后双击即可!
MD C:\WINDOWS\PDPLOG
echo date /t ^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
echo time /t ^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
echo netstat -n -p tcp ^| find ":3389"^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
echo start Explorer >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
:: 添加用户每次进入远程桌面时自动记录下来所用IP,可用来发现黑客踪迹!
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" /v fInheritInitialProgram /t REG_DWORD /d "00000000" /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" /v WorkDirectory /t REG_SZ /d C:\WINDOWS\PDPLOG\ /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" /v InitialProgram /t REG_SZ /d "C:\WINDOWS\PDPLOG\PdPLOG.CMD" /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v fInheritInitialProgram /t REG_DWORD /d "00000000" /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v WorkDirectory /t REG_SZ /d C:\WINDOWS\PDPLOG\ /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v InitialProgram /t REG_SZ /d "C:\WINDOWS\PDPLOG\PdPLOG.CMD" /f
Echo 记录远程桌面IP策略添加完毕! 请按任意键退出!
PAUSE >nul
echo netstat -n -p tcp ^| find ":3389"^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
上面一句中有个3389数字,这个是远程桌面的默认端口。
如果更改远程桌面的朋友,需要将3389替换为你更改的端口。
查看记录的地方在C:\WINDOWS\PDPLOG\RDPlog.txt
复制代码 代码如下:
MD C:\WINDOWS\PDPLOG
echo date /t ^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
echo time /t ^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
echo netstat -n -p tcp ^| find ":3389"^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
echo start Explorer >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
:: 添加用户每次进入远程桌面时自动记录下来所用IP,可用来发现黑客踪迹!
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" /v fInheritInitialProgram /t REG_DWORD /d "00000000" /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" /v WorkDirectory /t REG_SZ /d C:\WINDOWS\PDPLOG\ /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" /v InitialProgram /t REG_SZ /d "C:\WINDOWS\PDPLOG\PdPLOG.CMD" /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v fInheritInitialProgram /t REG_DWORD /d "00000000" /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v WorkDirectory /t REG_SZ /d C:\WINDOWS\PDPLOG\ /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v InitialProgram /t REG_SZ /d "C:\WINDOWS\PDPLOG\PdPLOG.CMD" /f
Echo 记录远程桌面IP策略添加完毕! 请按任意键退出!
PAUSE >nul
echo netstat -n -p tcp ^| find ":3389"^>^>RDPlog.txt >>C:\WINDOWS\PDPLOG\PdPLOG.CMD
上面一句中有个3389数字,这个是远程桌面的默认端口。
如果更改远程桌面的朋友,需要将3389替换为你更改的端口。
查看记录的地方在C:\WINDOWS\PDPLOG\RDPlog.txt
栏 目:DOS/BAT
本文地址:http://www.codeinn.net/misctech/183427.html