Skip to content

Commit 1c179ca

Browse files
authored
docs: Clarify usage of --pkg option
1 parent 831a97b commit 1c179ca

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ Example usage:
9191
python Jiyu_udp_attack -t 192.168.106.100 --pkg test.txt 1024 hello
9292
```
9393

94+
---
95+
9496
其中目标 ip 的指定,可以:
9597

9698
+ 指定具体 ip,如 `192.168.3.103`
@@ -104,6 +106,25 @@ Example usage:
104106
+ 指定 ip 段,如 `192.168.3.0/24`,这将被转换到广播地址 `192.168.3.255`
105107
+ 使用极域的组播地址 `224.50.50.42`
106108

109+
---
110+
111+
`--pkg` 用于发送格式化的数据包,可以指定参数,首个参数作为格式化字符串,其余参数被应用于字符串的格式化。格式化字符串的内容为 16 进制编码的数据包,因此需要保证应用格式化后字符串为合法的 16 进制编码串。
112+
113+
处理时使用了自定义的类型包装参数,如果一个参数可以解释为十进制数,则它的类型为 `int`,否则为 `str`;此外,还定义了 `rand16` 作为可用变量。
114+
115+
目前支持的属性包括(以位置 `0` 为例):
116+
117+
- `int`
118+
+ `{0}`:直接输出十进制数字,无前导零。
119+
+ `{0.big_<size>}`:将数转为 `<size>` 位字节,大端序编码;
120+
+ `{0.little_<size>}`:将数转为 `<size>` 位字节,小端序编码。
121+
- `str`
122+
+ `{0}`:直接输出字符串本身,因此此时应保证字符串为 16 进制码;
123+
+ `{0.size_<size>}`:将字符串转化为 `utf-16le` 编码,并填充 `\x00``<size>` 位。
124+
- `rand16`
125+
+ `{rand16}`:生成一个随机字节;
126+
+ `{rand16.size_<size>}`:生成 `<size>` 个随机字节。
127+
107128
## Jiyu API
108129

109130
记录抓包得到的极域 udp 包格式。

0 commit comments

Comments
 (0)