The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
MartinWu
0D

如何获取包的原 IP 跟目标 IP?

  •  
  •   MartinWu ·
    Martwu · Apr 14, 2020 · 2431 views
    This topic created in 2399 days ago, the information mentioned may be changed or developed.
    我现在只知道可以通过 pcap 来抓包,然后包里 ethernet.DstMAC.String()来获取目标的 MAC 地址。那如何可以拿到对应的 IP 呢?
    4 replies  •  2020-04-15 11:22:40 +08:00
    Nitroethane
    Nitroethane
    Apr 15, 2020 via iPhone
    1
    如果是用 Go 的话,Google 开发了一个包叫 gopacket,可以看一下
    songn80
    songn80
    Apr 15, 2020
    2
    建议学习一下流量包的格式,一层层解开
    MartinWu
    MartinWu
    OP
    Apr 15, 2020
    3
    @Nitroethane #1 嗯嗯,正在使用这个。
    MartinWu
    MartinWu
    OP
    Apr 15, 2020
    4
    @songn80 #2 好,感谢你的建议。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   808 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 17:22 · PVG 01:22 · LAX 09:22 · JFK 12:22
    ♥ Do have faith in what you're doing.