| 文件 | /proc/net/tcp、/proc/net/udp、/proc/net/unix |
|---|---|
| 要点 | 地址为小端十六进制,inode 在固定列 |
解码与关联
解码与关联
awk 'NR>1 {print $2, $3, $4, $10}' /proc/net/tcp | head
python3 -c "import socket,struct; print(socket.inet_ntoa(struct.pack('<I',int('0100007F',16))))"0100007F:0019 解码后是 127.0.0.1:25,端口同样按十六进制转换。