Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
plko345
V2EX  ›  Linux

请教一个通过端口获取进程的问题

  •  
  •   plko345 · Mar 21, 2022 · 3465 views
    This topic created in 1697 days ago, the information mentioned may be changed or developed.

    服务器 A 的 8080 端口一直收到来自 服务器 B 的请求, 但 A 上并没有进程监听在 8080 上, 但 B 上某个 SB 进程总是用随机的高端口非常频繁的发, 导致有大量 RST 报文.

    想问下, 我在 B 上, 要怎么找到是哪个进程在搞事, 因为非常快速就消失了, ss 根本无法定位.

    明天去公司想用 iptables 做个 drop 规则不知道会不会让这个连接保留一段时间.

    3 replies  •  2022-03-22 18:13:41 +08:00
    zerofiny
    zerofiny
    Mar 22, 2022❤️1
    1
    bcc-tools(redhat yum install bcc-tools -y) 工具 tcplift -D 8080 (连接远程 8080 的进程 id 都会打印)
    # ./tcplife -D 80
    PID COMM LADDR LPORT RADDR RPORT TX_KB RX_KB MS
    27448 curl 100.66.11.247 54146 54.154.224.174 80 0 1 263.85
    27450 curl 100.66.11.247 20618 54.154.164.22 80 0 1 243.62
    27452 curl 100.66.11.247 11480 54.154.43.103 80 0 1 231.16
    27454 curl 100.66.11.247 31382 54.154.15.7 80 0 1 249.95

    参考: https://www.brendangregg.com/blog/2016-11-30/linux-bcc-tcplife.html
    tomychen
    tomychen
    Mar 22, 2022
    2
    netstat -antp,如果不行,就再加上 watch
    plko345
    plko345
    OP
    Mar 22, 2022 via Android
    3
    @tomychen 不行,0.0 几秒可能就没了,一楼的先试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4383 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 08:53 · PVG 16:53 · LAX 00:53 · JFK 03:53
    ♥ Do have faith in what you're doing.