网络检测
dig 域名: 检测域名解析,如果域名后端使用了lvs则解析出的ip为vip nslookup 域名:检测域名解析是否正常 ping ip或域名:检测网络是否通畅,使用-c 选项可以指定ping的次数 telnet ip或域名 port :检测是否能连接远程主机的特定端口 nc -vv host port : 检测远程主机的端口能否联通 host ip:获得对应的主机名 curl ip.cn traceroute 域名 追踪数据包到达指定地址经过的路径,使用-n选项可以指定ip地址 watch ifconfig 监控网络流量 watch -d ifconfig 监控网络流量,标记发生变化的部分 watch -d ifconfig eth0 监控网卡eth0的网络流量,并标记发生变化的部分
网络配置
ifconfig :查看网络配置 ifdown 网卡名 :禁用网卡 ifup 网卡名 :启用网卡
网络抓包
tcpdump命令 tcpdump -i eth1 抓取网卡eth1的数据包 tcpdump port number 抓取端口号为number的数据包 tcpdump port number -nnx 以十六进制及asciii码显示 tcpdump tcp port 23 and host 210.27.48.1使用and同时指定主机和端口号,抓取telent包 tcpdump host www.baidu.com抓取来自和去往www.baidu.com主机的数据包 tcpdump host 119.75.218.70 抓取来自和去往地址为119.75.218.70主机的数据包 tcpdump host helios and ( hot or ace )抓取helios 与 hot 或者与 ace 主机通信的数据包 tcpdump host 210.27.48.1 and \ (210.27.48.2 or 210.27.48.3 \ ) 抓取主机210.27.48.1 和主机210.27.48.2 或210.27.48.3主机通信的数据包 tcpdump ip|tcp|udp host ace and not helios抓取ace主机与helios主机以外的主机通信的IP|TCP|UDP 数据包 tcpdump ip|tcp|udp host 210.27.48.1 and ! 210.27.48.2抓取主机210.27.48.1与主机210.27.48.2之外的主机通信的IP|TCP|UDP数据包 tcpdump -i eth0 src host hostname 抓取主机hostname发送的所有数据包 tcpdump -i eth0 dst host hostname 抓取主机hostname收到的所有数据包 tcpdump tcp -i eth1 -t -s 0 -c 100 and dst port ! 22 and src net 192.168.1.0/24 -w ./target.cap tcp udp ip icmp arp rarp:用于过滤数据包类型 -i eth1 : 只抓经过接口eth1的包 -t : 不显示时间戳 -s 0 :抓取完整的数据包,默认抓取长度为68字节。 -c 100 : 只抓取100个数据包 dst port ! 22 : 不抓取目标端口是22的数据包 src net 192.168.1.0/24 : 数据包的源地址为192.168.1.0/24 -w ./target.cap : 保存成cap文件,从而使用wireshark分析
网络嗅探
nmap 网络扫描以及嗅探
- 5.
Linux网络相关
最新推荐文章于 2024-01-12 04:28:08 发布