使用SNMP检查服务器中开放的TCP和UDP端口

TCP:

tcpConnLocalAddress

tcpConnLocalPort

tcpConnRemAddress

tcpConnRemPort

tcpConnState

 

UDP:
udpLocalAddress

udpLocalPort

 

示例:

snmpwalk -v2c -c public localhost tcpConnLocalPort

snmpwalk -v2c -c public localhost1.3.6.1.2.1.6.13.1.3

snmpwalk -v2c -c public localhost udpLocalPort

snmpwalk -v2c -c public localhost 1.3.6.1.2.1.7.5.1.2

C:\usr\bin>snmpwalk -v2c -c public localhost 1.3.6.1.2.1.6.13.1.3
TCP-MIB::tcpConnLocalPort.0.0.0.0.135.0.0.0.0.0 = INTEGER: 135
TCP-MIB::tcpConnLocalPort.0.0.0.0.445.0.0.0.0.0 = INTEGER: 445
TCP-MIB::tcpConnLocalPort.0.0.0.0.902.0.0.0.0.0 = INTEGER: 902
TCP-MIB::tcpConnLocalPort.0.0.0.0.912.0.0.0.0.0 = INTEGER: 912
TCP-MIB::tcpConnLocalPort.0.0.0.0.5040.0.0.0.0.0 = INTEGER: 5040
TCP-MIB::tcpConnLocalPort.0.0.0.0.49664.0.0.0.0.0 = INTEGER: 49664
TCP-MIB::tcpConnLocalPort.0.0.0.0.49665.0.0.0.0.0 = INTEGER: 49665
TCP-MIB::tcpConnLocalPort.0.0.0.0.49666.0.0.0.0.0 = INTEGER: 49666
TCP-MIB::tcpConnLocalPort.0.0.0.0.49667.0.0.0.0.0 = INTEGER: 49667
TCP-MIB::tcpConnLocalPort.0.0.0.0.49670.0.0.0.0.0 = INTEGER: 49670
TCP-MIB::tcpConnLocalPort.0.0.0.0.49676.0.0.0.0.0 = INTEGER: 49676
TCP-MIB::tcpConnLocalPort.127.0.0.1.5939.0.0.0.0.0 = INTEGER: 5939
TCP-MIB::tcpConnLocalPort.127.0.0.1.10000.0.0.0.0.0 = INTEGER: 10000
TCP-MIB::tcpConnLocalPort.127.0.0.1.49668.127.0.0.1.49669 = INTEGER: 49668
TCP-MIB::tcpConnLocalPort.127.0.0.1.49669.127.0.0.1.49668 = INTEGER: 49669
TCP-MIB::tcpConnLocalPort.192.168.0.3.139.0.0.0.0.0 = INTEGER: 139
TCP-MIB::tcpConnLocalPort.192.168.0.3.49681.40.90.189.152.443 = INTEGER: 49681
TCP-MIB::tcpConnLocalPort.192.168.0.3.49702.23.77.214.195.443 = INTEGER: 49702
TCP-MIB::tcpConnLocalPort.192.168.0.3.49720.222.163.206.101.443 = INTEGER: 49720
TCP-MIB::tcpConnLocalPort.192.168.0.3.49721.222.163.206.101.443 = INTEGER: 49721
TCP-MIB::tcpConnLocalPort.192.168.0.3.49722.222.163.206.101.443 = INTEGER: 49722
TCP-MIB::tcpConnLocalPort.192.168.0.3.49725.184.50.93.123.80 = INTEGER: 49725
TCP-MIB::tcpConnLocalPort.192.168.0.3.49726.184.50.93.123.80 = INTEGER: 49726
TCP-MIB::tcpConnLocalPort.192.168.0.3.49727.184.50.93.123.80 = INTEGER: 49727
TCP-MIB::tcpConnLocalPort.192.168.0.3.50848.140.207.135.104.443 = INTEGER: 50848
TCP-MIB::tcpConnLocalPort.192.168.0.3.50871.151.101.193.69.443 = INTEGER: 50871
TCP-MIB::tcpConnLocalPort.192.168.0.3.50872.192.0.73.2.443 = INTEGER: 50872
TCP-MIB::tcpConnLocalPort.192.168.0.3.50899.104.19.199.151.443 = INTEGER: 50899
TCP-MIB::tcpConnLocalPort.192.168.0.3.50911.47.99.1.159.443 = INTEGER: 50911
TCP-MIB::tcpConnLocalPort.192.168.0.3.50974.183.131.214.137.443 = INTEGER: 50974
TCP-MIB::tcpConnLocalPort.192.168.0.3.50989.203.107.41.32.9025 = INTEGER: 50989
TCP-MIB::tcpConnLocalPort.192.168.0.3.53796.52.98.73.18.443 = INTEGER: 53796
TCP-MIB::tcpConnLocalPort.192.168.0.3.53872.168.63.153.205.443 = INTEGER: 53872
TCP-MIB::tcpConnLocalPort.192.168.0.3.53876.203.208.40.56.443 = INTEGER: 53876
TCP-MIB::tcpConnLocalPort.192.168.0.3.53879.203.208.41.65.80 = INTEGER: 53879
TCP-MIB::tcpConnLocalPort.192.168.0.3.53896.168.63.153.205.443 = INTEGER: 53896
TCP-MIB::tcpConnLocalPort.192.168.0.3.53897.202.89.233.100.443 = INTEGER: 53897
TCP-MIB::tcpConnLocalPort.192.168.0.3.53902.104.78.21.107.443 = INTEGER: 53902
TCP-MIB::tcpConnLocalPort.192.168.0.3.53903.216.58.200.14.443 = INTEGER: 53903
TCP-MIB::tcpConnLocalPort.192.168.0.3.53904.216.58.200.14.443 = INTEGER: 53904
TCP-MIB::tcpConnLocalPort.192.168.0.3.53905.223.166.152.108.443 = INTEGER: 53905
TCP-MIB::tcpConnLocalPort.192.168.6.1.139.0.0.0.0.0 = INTEGER: 139
TCP-MIB::tcpConnLocalPort.192.168.111.1.139.0.0.0.0.0 = INTEGER: 139

C:\usr\bin>
C:\usr\bin>snmpwalk -v2c -c public localhost 1.3.6.1.2.1.7.5.1.2
UDP-MIB::udpLocalPort.0.0.0.0.161 = INTEGER: 161
UDP-MIB::udpLocalPort.0.0.0.0.5050 = INTEGER: 5050
UDP-MIB::udpLocalPort.0.0.0.0.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.0.0.0.0.5355 = INTEGER: 5355
UDP-MIB::udpLocalPort.0.0.0.0.50773 = INTEGER: 50773
UDP-MIB::udpLocalPort.0.0.0.0.53161 = INTEGER: 53161
UDP-MIB::udpLocalPort.0.0.0.0.54664 = INTEGER: 54664
UDP-MIB::udpLocalPort.0.0.0.0.63765 = INTEGER: 63765
UDP-MIB::udpLocalPort.127.0.0.1.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.127.0.0.1.50771 = INTEGER: 50771
UDP-MIB::udpLocalPort.127.0.0.1.55969 = INTEGER: 55969
UDP-MIB::udpLocalPort.192.168.0.3.137 = INTEGER: 137
UDP-MIB::udpLocalPort.192.168.0.3.138 = INTEGER: 138
UDP-MIB::udpLocalPort.192.168.0.3.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.192.168.0.3.2177 = INTEGER: 2177
UDP-MIB::udpLocalPort.192.168.0.3.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.192.168.0.3.55968 = INTEGER: 55968
UDP-MIB::udpLocalPort.192.168.6.1.137 = INTEGER: 137
UDP-MIB::udpLocalPort.192.168.6.1.138 = INTEGER: 138
UDP-MIB::udpLocalPort.192.168.6.1.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.192.168.6.1.2177 = INTEGER: 2177
UDP-MIB::udpLocalPort.192.168.6.1.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.192.168.6.1.55966 = INTEGER: 55966
UDP-MIB::udpLocalPort.192.168.111.1.137 = INTEGER: 137
UDP-MIB::udpLocalPort.192.168.111.1.138 = INTEGER: 138
UDP-MIB::udpLocalPort.192.168.111.1.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.192.168.111.1.2177 = INTEGER: 2177
UDP-MIB::udpLocalPort.192.168.111.1.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.192.168.111.1.55967 = INTEGER: 55967

C:\usr\bin>snmpwalk -v2c -c public localhost tcpConnLocalPort
TCP-MIB::tcpConnLocalPort.0.0.0.0.135.0.0.0.0.0 = INTEGER: 135
TCP-MIB::tcpConnLocalPort.0.0.0.0.445.0.0.0.0.0 = INTEGER: 445
TCP-MIB::tcpConnLocalPort.0.0.0.0.902.0.0.0.0.0 = INTEGER: 902
TCP-MIB::tcpConnLocalPort.0.0.0.0.912.0.0.0.0.0 = INTEGER: 912
TCP-MIB::tcpConnLocalPort.0.0.0.0.5040.0.0.0.0.0 = INTEGER: 5040
TCP-MIB::tcpConnLocalPort.0.0.0.0.49664.0.0.0.0.0 = INTEGER: 49664
TCP-MIB::tcpConnLocalPort.0.0.0.0.49665.0.0.0.0.0 = INTEGER: 49665
TCP-MIB::tcpConnLocalPort.0.0.0.0.49666.0.0.0.0.0 = INTEGER: 49666
TCP-MIB::tcpConnLocalPort.0.0.0.0.49667.0.0.0.0.0 = INTEGER: 49667
TCP-MIB::tcpConnLocalPort.0.0.0.0.49670.0.0.0.0.0 = INTEGER: 49670
TCP-MIB::tcpConnLocalPort.0.0.0.0.49676.0.0.0.0.0 = INTEGER: 49676
TCP-MIB::tcpConnLocalPort.127.0.0.1.5939.0.0.0.0.0 = INTEGER: 5939
TCP-MIB::tcpConnLocalPort.127.0.0.1.10000.0.0.0.0.0 = INTEGER: 10000
TCP-MIB::tcpConnLocalPort.127.0.0.1.49668.127.0.0.1.49669 = INTEGER: 49668
TCP-MIB::tcpConnLocalPort.127.0.0.1.49669.127.0.0.1.49668 = INTEGER: 49669
TCP-MIB::tcpConnLocalPort.192.168.0.3.139.0.0.0.0.0 = INTEGER: 139
TCP-MIB::tcpConnLocalPort.192.168.0.3.49681.40.90.189.152.443 = INTEGER: 49681
TCP-MIB::tcpConnLocalPort.192.168.0.3.49702.23.77.214.195.443 = INTEGER: 49702
TCP-MIB::tcpConnLocalPort.192.168.0.3.49720.222.163.206.101.443 = INTEGER: 49720
TCP-MIB::tcpConnLocalPort.192.168.0.3.49721.222.163.206.101.443 = INTEGER: 49721
TCP-MIB::tcpConnLocalPort.192.168.0.3.49722.222.163.206.101.443 = INTEGER: 49722
TCP-MIB::tcpConnLocalPort.192.168.0.3.49725.184.50.93.123.80 = INTEGER: 49725
TCP-MIB::tcpConnLocalPort.192.168.0.3.49726.184.50.93.123.80 = INTEGER: 49726
TCP-MIB::tcpConnLocalPort.192.168.0.3.49727.184.50.93.123.80 = INTEGER: 49727
TCP-MIB::tcpConnLocalPort.192.168.0.3.50848.140.207.135.104.443 = INTEGER: 50848
TCP-MIB::tcpConnLocalPort.192.168.0.3.50871.151.101.193.69.443 = INTEGER: 50871
TCP-MIB::tcpConnLocalPort.192.168.0.3.50974.183.131.214.137.443 = INTEGER: 50974
TCP-MIB::tcpConnLocalPort.192.168.0.3.50989.203.107.41.32.9025 = INTEGER: 50989
TCP-MIB::tcpConnLocalPort.192.168.0.3.53796.52.98.73.18.443 = INTEGER: 53796
TCP-MIB::tcpConnLocalPort.192.168.0.3.53914.202.89.233.100.443 = INTEGER: 53914
TCP-MIB::tcpConnLocalPort.192.168.0.3.53917.52.109.88.38.443 = INTEGER: 53917
TCP-MIB::tcpConnLocalPort.192.168.0.3.53922.216.58.199.14.443 = INTEGER: 53922
TCP-MIB::tcpConnLocalPort.192.168.0.3.53923.216.58.199.14.443 = INTEGER: 53923
TCP-MIB::tcpConnLocalPort.192.168.6.1.139.0.0.0.0.0 = INTEGER: 139
TCP-MIB::tcpConnLocalPort.192.168.111.1.139.0.0.0.0.0 = INTEGER: 139

C:\usr\bin>snmpwalk -v2c -c public localhost udpLocalPort
UDP-MIB::udpLocalPort.0.0.0.0.161 = INTEGER: 161
UDP-MIB::udpLocalPort.0.0.0.0.5050 = INTEGER: 5050
UDP-MIB::udpLocalPort.0.0.0.0.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.0.0.0.0.5355 = INTEGER: 5355
UDP-MIB::udpLocalPort.0.0.0.0.50773 = INTEGER: 50773
UDP-MIB::udpLocalPort.0.0.0.0.58935 = INTEGER: 58935
UDP-MIB::udpLocalPort.0.0.0.0.58936 = INTEGER: 58936
UDP-MIB::udpLocalPort.0.0.0.0.63765 = INTEGER: 63765
UDP-MIB::udpLocalPort.127.0.0.1.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.127.0.0.1.50771 = INTEGER: 50771
UDP-MIB::udpLocalPort.127.0.0.1.55969 = INTEGER: 55969
UDP-MIB::udpLocalPort.192.168.0.3.137 = INTEGER: 137
UDP-MIB::udpLocalPort.192.168.0.3.138 = INTEGER: 138
UDP-MIB::udpLocalPort.192.168.0.3.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.192.168.0.3.2177 = INTEGER: 2177
UDP-MIB::udpLocalPort.192.168.0.3.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.192.168.0.3.55968 = INTEGER: 55968
UDP-MIB::udpLocalPort.192.168.6.1.137 = INTEGER: 137
UDP-MIB::udpLocalPort.192.168.6.1.138 = INTEGER: 138
UDP-MIB::udpLocalPort.192.168.6.1.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.192.168.6.1.2177 = INTEGER: 2177
UDP-MIB::udpLocalPort.192.168.6.1.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.192.168.6.1.55966 = INTEGER: 55966
UDP-MIB::udpLocalPort.192.168.111.1.137 = INTEGER: 137
UDP-MIB::udpLocalPort.192.168.111.1.138 = INTEGER: 138
UDP-MIB::udpLocalPort.192.168.111.1.1900 = INTEGER: 1900
UDP-MIB::udpLocalPort.192.168.111.1.2177 = INTEGER: 2177
UDP-MIB::udpLocalPort.192.168.111.1.5353 = INTEGER: 5353
UDP-MIB::udpLocalPort.192.168.111.1.55967 = INTEGER: 55967

C:\usr\bin>
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值