V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
raysonx
V2EX  ›  宽带症候群

简单测试本地运营商屏蔽了哪些 TCP 端口

  •  
  •   raysonx · 2018-11-20 18:07:18 +08:00 · 23112 次点击
    这是一个创建于 1956 天前的主题,其中的信息可能已经有所发展或是发生改变。

    写了个简单的脚本测试了一下本地 ISP (某地电信)对个人用户屏蔽了哪些 TCP 端口。

    测试方法:

    1. 设置本地路由器的防火墙默认的入站规则为 Reject,即用 ICMP 消息拒绝对未开放端口的连接。
    2. 找一台远程的机器(跨 ISP,防止出现两台机器在同一个防火墙区域的情况),使用 nc 依次连接 1-9999 端口,超时时间 1 秒左右。如果显示” Connection Refused “则表示这个端口是由本地路由器拒绝的,如果显示” Connection timed out “,则表示被 ISP 屏蔽了(这里有一个假设的前提是,ISP 屏蔽端口的方式是丢包)。 注意:可能会有误测,为了结果可靠就多测试几遍吧。

    参考脚本: https://gist.github.com/vfreex/32b7de2e36422dbee94454afc762305e

    经测试,楼主所在地的 ISP 屏蔽了以下 TCP 端口:

    42
    80
    135
    136
    137
    138
    139
    443
    539
    901
    1023
    1025
    1068
    1434
    2745
    3127
    3128
    3129
    3130
    3332
    3333
    4444
    5554
    5800
    5900
    6129
    6176
    6667
    6669
    8080
    8998
    9437
    9995
    9996
    
    20 条回复    2020-09-21 00:18:51 +08:00
    bclerdx
        1
    bclerdx  
       2018-11-20 18:20:01 +08:00
    具体应该如何操作与实施,看着有些迷茫!
    afc
        2
    afc  
       2018-11-20 18:22:17 +08:00
    我们公司的专线是备案过才开通 80 端口的,最近又给电信封上了
    bclerdx
        3
    bclerdx  
       2018-11-20 18:35:08 +08:00
    @afc 为啥?理由?依据?
    des
        4
    des  
       2018-11-20 18:44:33 +08:00 via Android   ❤️ 3
    sudo nmap -sA -Pn -F 195.172.xx.xx

    一条命令解决
    CloudnuY
        5
    CloudnuY  
       2018-11-20 19:02:10 +08:00
    10000 以内的端口 ISP 封了以下几个:

    25/tcp filtered smtp
    80/tcp filtered http
    135/tcp filtered msrpc
    139/tcp filtered netbios-ssn
    445/tcp filtered microsoft-ds
    5800/tcp filtered vnc-http
    5900/tcp filtered vnc
    8080/tcp filtered http-proxy
    CloudnuY
        6
    CloudnuY  
       2018-11-20 19:03:32 +08:00
    @CloudnuY #5 应该说所有端口里面只封了这几个
    des
        7
    des  
       2018-11-20 19:07:41 +08:00 via Android
    @des
    @CloudnuY
    可能有些误导了,我写的那个是最常用的 100 个。
    想要 1 到 10000 这样用
    sudo nmap -sA -Pn 195.172.xx.xx -p1-10000
    CloudnuY
        8
    CloudnuY  
       2018-11-20 19:15:20 +08:00
    @des #7 和我前一段时间全端口扫描的结果基本是一样的,看来非常用端口 ISP 也没屏蔽😂
    skyeycirno
        9
    skyeycirno  
       2018-11-20 19:26:04 +08:00
    没看懂。能不能具体说下。。
    bclerdx
        10
    bclerdx  
       2018-11-20 20:14:53 +08:00
    @CloudnuY udp 协议的呢?封了哪些?
    bclerdx
        11
    bclerdx  
       2018-11-20 20:16:12 +08:00
    @CloudnuY ISP 没有能力把 65536 全部封锁,如果那样的话,末日就到了。
    leido
        12
    leido  
       2018-11-20 22:09:23 +08:00 via Android
    @bclerdx 全封了你怎么上网
    bclerdx
        13
    bclerdx  
       2018-11-20 22:35:28 +08:00
    @leido 嗯,也对。国家与运营商从心底里不就希望让屁民如此?否则哪来的中华局域网、清真局域网之说的口头禅呢?
    Archeb
        14
    Archeb  
       2018-11-20 22:46:50 +08:00
    我们只封了 80....连 443 都没事
    Danswerme
        15
    Danswerme  
       2018-11-20 23:29:23 +08:00 via Android
    @des 用 vps 扫了一下家里路由器..

    Host is up (0.31s latency).Not shown: 9976 unfiltered portsPORT STATE SERVICE
    80/tcp filtered http
    135/tcp filtered msrpc
    136/tcp filtered profile
    137/tcp filtered netbios-ns
    138/tcp filtered netbios-dgm
    139/tcp filtered netbios-ssn
    443/tcp filtered https
    445/tcp filtered microsoft-ds
    593/tcp filtered http-rpc-epmap
    901/tcp filtered samba-swat
    1433/tcp filtered ms-sql-s
    1614/tcp filtered unknown
    1999/tcp filtered tcp-id-port
    2745/tcp filtered unknown
    3127/tcp filtered unknown
    3128/tcp filtered squid-http
    3333/tcp filtered dec-notes
    4444/tcp filtered krb524
    5554/tcp filtered sgi-esphttp
    6129/tcp filtered unknown
    6667/tcp filtered irc
    7306/tcp filtered unknown
    7626/tcp filtered unknown
    8080/tcp filtered http-proxy
    Nmap done: 1 IP address (1 host up) scanned in 9879.99 seconds
    justs0o
        16
    justs0o  
       2018-11-21 09:39:01 +08:00
    @bclerdx 有些东西度娘一下自己就了解了
    zhouyut001
        17
    zhouyut001  
       2018-11-24 20:25:05 +08:00
    老家的服務器,電信只被封這些。
    25/tcp filtered smtp
    80/tcp filtered http
    135/tcp filtered msrpc
    139/tcp filtered netbios-ssn
    443/tcp filtered https
    445/tcp filtered microsoft-ds
    3128/tcp filtered squid-http
    5800/tcp filtered vnc-http
    5900/tcp filtered vnc
    8080/tcp filtered http-proxy
    sheephe
        18
    sheephe  
       2019-08-28 13:04:57 +08:00
    Shanghai ChinaNet:

    Not shown: 91 unfiltered ports
    PORT STATE SERVICE
    80/tcp filtered http
    135/tcp filtered msrpc
    139/tcp filtered netbios-ssn
    443/tcp filtered https
    445/tcp filtered microsoft-ds
    1025/tcp filtered NFS-or-IIS
    3128/tcp filtered squid-http
    5900/tcp filtered vnc
    8080/tcp filtered http-proxy
    sheephe
        19
    sheephe  
       2019-08-28 13:08:23 +08:00
    Guangdong Foshan:

    Not shown: 97 unfiltered ports
    PORT STATE SERVICE
    80/tcp filtered http
    445/tcp filtered microsoft-ds
    8080/tcp filtered http-proxy


    同时电信的情况下,看起来每个地区的规律都不一样,还是说 80/445/8080 外其他端口随机封锁的可能?
    a1gslyghmqnl
        20
    a1gslyghmqnl  
       2020-09-21 00:18:51 +08:00
    https://www.comcdn.com/help/article/66.html
    > 接到电信运营商的通知,为了增强网络安全性,中国电信将于北京时间 2017 年 09 月 28 日 00:00 开始在全国范围的 IDC 机房电信链路网络出口添加病毒防护策略,屏蔽部分端口(详细参看下列清单),届时对这些端口的访问将被阻断。建议您检查您的业务中是否包含下述端口的服务,更换端口以免受到影响。

    具体屏蔽的端口如下:

    目的端口:137-139,协议:TCP/UDP

    目的端口:593,协议:TCP/UDP

    目的端口:445,协议:TCP/UDP

    目的端口:4444,协议:TCP/UDP

    目的端口:135,协议:TCP/UDP

    目的端口:3332,协议:TCP

    目的端口:9996,协议:TCP/UDP

    目的端口:6669,协议:TCP

    目的端口:1434,协议:TCP/UDP

    目的端口:3127-3130,协议:TCP

    目的端口:42,协议:TCP

    目的端口:1068,协议:TCP/UDP

    目的端口:5554,协议:UDP

    目的端口:17185,协议:UDP
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2939 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 14:03 · PVG 22:03 · LAX 07:03 · JFK 10:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.