• [20190213]测试服务端打开那些端口.txt


    [20190213]测试服务端打开那些端口.txt

    --//前几天测试使用发送信息到/dev/tcp/ip_address/port,测试端口是否打开.写简单写一个脚本验证看看.

    $ seq 1 65000 | xargs -I{} echo "echo a > /dev/tcp/192.168.100.40/{} 2>/dev/null 2&>1 ; echo ok=$?,{}" | bash 2>/dev/null | grep ok=0 | cut -d, -f2
    22
    80
    111
    113
    443
    1521
    3306
    32768
    39063

    --//在192.168.100.40验证看看打开那些tcp端口.
    # netstat -tnlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
    tcp        0      0 0.0.0.0:32768               0.0.0.0:*                   LISTEN      2723/rpc.statd
    tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      3005/mysqld
    tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2703/portmap
    tcp        0      0 0.0.0.0:113                 0.0.0.0:*                   LISTEN      2913/xinetd
    tcp        0      0 :::80                       :::*                        LISTEN      3033/httpd
    tcp        0      0 :::1521                     :::*                        LISTEN      8513/tnslsnr
    tcp        0      0 :::22                       :::*                        LISTEN      2898/sshd
    tcp        0      0 :::39063                    :::*                        LISTEN      12661/ora_d000_book
    tcp        0      0 :::443                      :::*                        LISTEN      3033/httpd

    --//OK完全正确.

    --//使用nc快许多.
    $ echo a | nc -w 1 -n -v  192.168.100.40 1-65000 2>/dev/null | grep "succeeded"
    Connection to 192.168.100.40 22 port [tcp/*] succeeded!
    Connection to 192.168.100.40 80 port [tcp/*] succeeded!
    Connection to 192.168.100.40 111 port [tcp/*] succeeded!
    Connection to 192.168.100.40 113 port [tcp/*] succeeded!
    Connection to 192.168.100.40 443 port [tcp/*] succeeded!
    Connection to 192.168.100.40 1521 port [tcp/*] succeeded!
    Connection to 192.168.100.40 3306 port [tcp/*] succeeded!
    Connection to 192.168.100.40 32768 port [tcp/*] succeeded!
    Connection to 192.168.100.40 39063 port [tcp/*] succeeded!

  • 相关阅读:
    Database Corruption ->> Fix Database In Suspect State
    Index & Statistics ->> Rebuild Index会不会覆盖原先Index的WITH选项设置
    Data Flow ->> CDC Control Task, CDC Source, CDC Splitter
    CDC ->> 在某个SQL Server中开启CDC功能
    使用OPENROWSET(BULK...)从平面文件加载数据
    Data Flow ->> DQS Cleansing
    db2look和db2move详解
    查询数据库记录数最快方法
    linux系统ftp命令
    Linux上如何查看物理CPU个数,核数,线程数
  • 原文地址:https://www.cnblogs.com/lfree/p/10368332.html
Copyright © 2020-2023  润新知