ali - 生成 HTTP 负载并实时绘制结果

Created at: 2020-09-12 08:11:21
Language: Go
License: MIT

阿里

释放 去参考

一种负载测试工具能够执行实时分析的,通过激发贝吉塔jplot

截屏

ali
带有基于终端的嵌入式 UI,你可以在其中实时绘制指标,因此你可以在终端上执行实时分析。

安装

二进制版本可通过此处获得

通过家酿

brew install nakabonne/ali/ali

通过 MacPorts

sudo port selfupdate
sudo port install ali

通过 APT

wget https://github.com/nakabonne/ali/releases/download/v0.7.3/ali_0.7.3_linux_amd64.deb
apt install ./ali_0.7.3_linux_amd64.deb

通过 RPM

rpm -ivh https://github.com/nakabonne/ali/releases/download/v0.7.3/ali_0.7.3_linux_amd64.rpm

通过吃豆子

pacman -S ali

通过 APK

之后使社区回购

apk add ali

通过 Go

请注意,你可能会遇到问题,因为它下载了未标记的二进制文件。

go get github.com/nakabonne/ali

通过 Docker

docker run --rm -it nakabonne/ali ali

用法

快速开始

ali http://host.xz

替换

http://host.xz
为你要向其发出请求的目标。出现 UI 时按 Enter,然后将使用默认选项(速率 = 50,持续时间 = 10 秒)启动攻击。

选项

ali -h
Usage:
  ali [flags] <target URL>

Flags:
  -b, --body string                A request body to be sent.
  -B, --body-file string           The path to file whose content will be set as the http request body.
      --cacert string              PEM ca certificate file
      --cert string                PEM encoded tls certificate file to use
  -c, --connections int            Amount of maximum open idle connections per target host (default 10000)
      --debug                      Run in debug mode.
  -d, --duration duration          The amount of time to issue requests to the targets. Give 0s for an infinite attack. (default 10s)
  -H, --header stringArray         A request header to be sent. Can be used multiple times to send multiple headers.
      --insecure                   Skip TLS verification
      --key string                 PEM encoded tls private key file to use
      --local-addr string          Local IP address. (default "0.0.0.0")
  -M, --max-body int               Max bytes to capture from response bodies. Give -1 for no limit. (default -1)
  -W, --max-workers uint           Amount of maximum workers to spawn. (default 18446744073709551615)
  -m, --method string              An HTTP request method for each request. (default "GET")
      --no-http2                   Don't issue HTTP/2 requests to servers which support it.
  -K, --no-keepalive               Don't use HTTP persistent connection.
      --query-range duration       The results within the given time range will be drawn on the charts (default 30s)
  -r, --rate int                   The request rate per second to issue against the targets. Give 0 then it will send requests as fast as possible. (default 50)
      --redraw-interval duration   The time interval to redraw charts (default 250ms)
      --resolvers string           Custom DNS resolver addresses; comma-separated list.
  -t, --timeout duration           The timeout for each request. 0s means to disable timeouts. (default 30s)
  -v, --version                    Print the current version.
  -w, --workers uint               Amount of initial workers to spawn. (default 10)

Examples:
  ali --duration=10m --rate=100 http://host.xz

Author:
  Ryo Nakao <ryo@nakao.dev>

有效时间单位为“ns”、“us”(或“µs”)、“ms”、“s”、“m”、“h”。

例子

基本用法:

ali --rate=500 --duration=5m http://host.xz

对于无限攻击:

ali --duration=0 http://host.xz

对于使用 POST 方法的攻击:

ali --body-file=/path/to/foo.json --method=POST http://host.xz

图表

l
(或
h
)切换显示的图表。在所有图表上,你可以单击并拖动以选择要放大的区域。

潜伏

截屏

X 轴表示请求计数,Y 轴表示以毫秒为单位的延迟。

百分位数

截屏

你可以看到第 50 个、第 90 个、第 95 个和第 99 个百分位数是如何变化的。

字节

待定

直方图

待定

特征

实时绘制

截屏

可视化攻击进度

这将在长时间的测试中为你提供帮助。

截屏

鼠标支持

借助mum4k/termdash可以直观地使用。

截屏

致谢

如果没有许多个人和项目的努力,这个项目是不可能实现的,尤其是vegeta的灵感和强大的 API。此外,它

ali
是用termdash(以及termbox-go)构建的,用于在终端上渲染所有这些花哨的图形。它们显然激发了创造的动力。非常感谢你!” 向所有帮助过的人致敬。