zaebaka/README.md
2024-11-27 20:12:36 +03:00

44 lines
982 B
Markdown

# zaebaka
bash cat with a pipe
... or in another words, spawn N processes running someting and kill them when done.
# Usage
```
$ python zaebaka.py -h
usage: zaebaka [-h] -s SCRIPT [-c COUNT] [-t TEMPLATE]
bash cat with a pipe
options:
-h, --help show this help message and exit
-s, --script SCRIPT script to run in shell
-c, --count COUNT instances count
-t, --template TEMPLATE
template placeholder for instance id substitution
```
This tool can spawn N processes running specified script and substitute instance number in specific template `{{template}}` or other, if set.
# Example
DoS your API (or your system)
`poke.sh`
```bash
#!/bin/bash
url="$1"
instance="$2"
for num in $(seq 1 1000000) ; do
curl -s "$url" -H "Content-Type: application/json" --request POST --data "{\"user_id\": $num}"
done
```
`stdin`
```bash
python zaebaka.py --script "bash poke.sh https://localhost:8080/get_profile {{instance}}"
```