linux关闭3389端口,判断windows 3389端口和linux操作系统的脚本

#!/bin/bash

###by gavin

##date:2012-10-12

##This is about scan windows and linux system,it can create remote'files that you use it on windows. you just only copy or mv this *.rdp  files to "C:\Documents and Settings\Administrator\My Documents" ,Okey you can use command "msts" ,seeing IP that can be remoted

##

cat>>rmote<

screen mode id:i:2

desktopwidth:i:1680

desktopheight:i:1050

session bpp:i:32

winposstr:s:0,1,22,200,822,800

compression:i:1

keyboardhook:i:2

displayconnectionbar:i:1

disable wallpaper:i:1

disable full window drag:i:1

allow desktop composition:i:0

allow font smoothing:i:0

disable menu anims:i:1

disable themes:i:0

disable cursor setting:i:0

bitmapcachepersistenable:i:1

full address:s:IP

audiomode:i:0

redirectprinters:i:1

redirectcomports:i:0

redirectsmartcards:i:1

redirectclipboard:i:1

redirectposdevices:i:0

autoreconnection enabled:i:1

authentication level:i:0

prompt for credentials:i:0

negotiate security layer:i:1

remoteapplicationmode:i:0

alternate shell:s:

gatewayusagemethod:i:4

gatewaycredentialssource:i:4

gatewayprofileusagemethod:i:0

promptcredentialonce:i:1

username:s:administrator

EOF

#for i in {1..254};do

# cat 255.rdp>$IP.$i.rdp

# sed -i s/IP/$IP.$i.rdp/ ./$IP.$i.rdp

#done

IP=`ifconfig eth0 |grep "inet addr"| cut -f 2 -d ":"|cut -f 1 -d " "|awk -F. '{print $1"."$2"."$3}'`

PORT=3389

for I in {1..254};do

nmap -sS $IP.$I -p 3389|grep open

if [ $? == 0 ];then

echo "$IP.$I:$PORT" >>./windows.txt

cat rmote >$IP.$I.rdp

sed -i 's/IP/$IP.$I/g' ./$IP.$I.rdp

fi

nmap -sS $IP.$I -p 22|grep open

if [ $? == 0 ];then

echo "$IP.$I" >>linux.txt

fi

done

echo "The windows.txt is windows system'ip,and it's 3389 port is opened !!"

echo "The linux.txt is linux system'ip,and it

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值