前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >一个图形化PING测试工具

一个图形化PING测试工具

作者头像
网络工程师笔记
发布2023-10-24 16:23:08
2440
发布2023-10-24 16:23:08
举报

1

介绍

gping能够以折线图的方式,实时展示 ping 的结果,支持 Windows、Linux 和 macOS 操作系统。并且支持多个目标同时Ping同时展示折线图方便对比。下面扩展一下ICMP及ICMP隧道。

ICMP消息结构:

ICMP消息是由一个类型字段、一个代码字段、一个校验和字段和与特定消息类型相关的数据字段组成的。类型字段和代码字段一起确定了消息的类型和子类型,而数据字段可以携带各种信息,具体取决于消息的类型和代码。以下是常规ICMP报文格式:

灵活性:

ICMP协议设计灵活,允许在数据字段中携带各种信息。这种灵活性使得可以将数据包封装在ICMP消息中,并通过网络传输,因为数据字段的内容并不受到太多的限制,只要它在特定的消息类型和代码下合法。

封装和解封装:发送端将要传输的数据包封装在一个ICMP消息中,然后将该ICMP消息封装在一个IP数据包中,以便将其发送到目标。接收端首先解封装IP数据包,然后解封装包含原始数据包的ICMP消息,最终提取出原始数据包。

隧道技术:

ICMP隧道技术利用了ICMP消息的封装和解封装能力,使得数据包可以在ICMP消息中进行传输。通常,ICMP隧道软件会将要传输的数据分割成小块,并将每个小块封装在不同的ICMP消息中,然后发送到目标。在目标端,ICMP隧道软件会解析接收到的ICMP消息,提取出原始数据,并将其还原成完整的数据包。

隐蔽性:

ICMP隧道通常不太容易被网络审查或防火墙检测到,因为ICMP消息在网络中非常常见,用于各种网络管理任务。这使得ICMP隧道成为一种潜在的隐蔽通信方法。

TTL以及其他ICMP的具体机制下次一定

2

对比

传统Ping:

单目标Gping:

双目标Gping:

3

使用

代码语言:javascript
复制
$ gping --help
Ping, but with a graph.

Usage: gping [OPTIONS] [HOSTS_OR_COMMANDS]...

Arguments:
  [HOSTS_OR_COMMANDS]...  Hosts or IPs to ping, or commands to run if --cmd is provided. Can use cloud shorthands like aws:eu-west-1.

Options:
      --cmd
          Graph the execution time for a list of commands rather than pinging hosts
  -n, --watch-interval <WATCH_INTERVAL>
          Watch interval seconds (provide partial seconds like '0.5'). Default for ping is 0.2, default for cmd is 0.5.
  -b, --buffer <BUFFER>
          Determines the number of seconds to display in the graph. [default: 30]
  -4
          Resolve ping targets to IPv4 address
  -6
          Resolve ping targets to IPv6 address
  -i, --interface <INTERFACE>
          Interface to use when pinging
  -s, --simple-graphics
          Uses dot characters instead of braille
      --vertical-margin <VERTICAL_MARGIN>
          Vertical margin around the graph (top and bottom) [default: 1]
      --horizontal-margin <HORIZONTAL_MARGIN>
          Horizontal margin around the graph (left and right) [default: 0]
  -c, --color <color>
          Assign color to a graph entry. This option can be defined more than once as a comma separated string, and the order which the colors are provided will be matched against the hosts or commands passed to gping. Hexadecimal RGB color codes are accepted in the form of '#RRGGBB' or the following color names: 'black', 'red', 'green', 'yellow', 'blue', 'magenta','cyan', 'gray', 'dark-gray', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan', and 'white'
  -h, --help
          Print help information
  -V, --version
          Print version information
      --clear
          Clear the graph from the terminal after closing the program

gping --help

4

安装

Linux

代码语言:javascript
复制
wget https://github.com/orf/gping/releases/download/gping-v1.14.0/gping-Linux-x86_64.tar.gz

┌──(root㉿kali)-[~]
└─# mv gping /usr/local/bin          

┌──(root㉿kali)-[~]
└─# gping
Error: At least one host or command must be given (i.e gping google.com). Use --help for a full list of arguments.
#安装成功

Windows

将可执行文件放入C:/Windows目录下

参考文献:

1. php - WordPress: How to create a rewrite rule for a file in a custom plugin - Stack Overfloworf/gping: Ping, but with a graph (github.com)

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2023-10-18,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 网络工程师笔记 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档