V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
hijoker
V2EX  ›  Linux

Linux 怎么知道自己端口是否被人狂扫描?

  •  
  •   hijoker · Feb 11, 2020 · 8619 views
    This topic created in 2272 days ago, the information mentioned may be changed or developed.
    我只知道在 ubuntu 有个 var/log/auth.log 是查看登陆失败, centos 是 /var/logsecure

    除了不使用应用的默认端口外还有其他什么好的策略么?
    Supplement 1  ·  Feb 13, 2020
    嗯,这个是要提供对外 http 服务的机器,不是内部使用的,ip 白名单之类和 iptables deny 之类的不行.
    我只是想知道怎么记录被扫描, 因为有的只是扫描而不尝试登陆
    14 replies    2020-02-13 10:38:06 +08:00
    opengps
        1
    opengps  
       Feb 11, 2020
    堡垒机,VNC 远程,防火墙 IP 白名单等
    外加非常规端口,非常规账号名
    akira
        2
    akira  
       Feb 11, 2020
    改端口 + 密钥
    Nitroethane
        3
    Nitroethane  
       Feb 11, 2020 via iPhone
    装个 suricata,enable 几个规则集,然后把规则集里跟 nmap 相关的规则取消注释,最后让 suricata 跑起来,看日志就行。
    不过应该还有一种更简单的方法,就是只需开启 iptables 的日志功能就 ok
    easylee
        4
    easylee  
       Feb 11, 2020
    一楼提到的 IP 白名单就很不错,基本够应付了。
    darknoll
        5
    darknoll  
       Feb 11, 2020
    这个不清楚,不过我只用公钥认证登录。
    snoopygao
        6
    snoopygao  
       Feb 11, 2020
    tcpdump port 22 and host not x.x.x.x(the ip address where you login)
    snoopygao
        7
    snoopygao  
       Feb 11, 2020
    wanguorui123
        8
    wanguorui123  
       Feb 11, 2020
    每天都有肉鸡狂扫我服务器的端口,我通过路由器入站日志发现的。除了关闭不必要的端口,提高密码安全性,IP 白名单,修改默认端口,定期升级软件,添加一定的身份认证门槛外好像没什么别的方法了。
    LokiSharp
        9
    LokiSharp  
       Feb 11, 2020
    端口只开了 22,80,443 扫就扫了,无所谓
    tankren
        10
    tankren  
       Feb 11, 2020
    fail2ban
    xuboying
        11
    xuboying  
       Feb 11, 2020
    两步认证。不想改系统服务的话可以拉一个 container,用 container 接管 ssh 服务接入。
    izoabr
        12
    izoabr  
       Feb 11, 2020
    或者装个 snort
    ps1aniuge
        13
    ps1aniuge  
       Feb 12, 2020
    powershell 版 ssh-denyhost
    ps1 下载:
    https://pan.baidu.com/s/16deKKe3ZnCg809lffiVZWg
    yimimi
        14
    yimimi  
       Feb 13, 2020
    利用 iptables 防火墙记录 drop 的日志你就知道有没有人在扫描你的服务器了,我就是这么做的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2349 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 11:24 · PVG 19:24 · LAX 04:24 · JFK 07:24
    ♥ Do have faith in what you're doing.