Skip to content

Want to execute command repeatedly without workache? Here is shloop born for it!

License

Notifications You must be signed in to change notification settings

dwisiswant0/shloop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shLoop

Want to execute command repeatedly without workache? Here is shloop born for it!

Install

The installation is easy!

  • You can download a prebuilt binary from releases page, unpack and run! or
  • If you have Go compiler installed and configured:
> go get github.com/dwisiswant0/shloop/...

Configuration

shLoop just reads environment values to run.

  • SHLOOP_COUNT is the number of times the command is repeated (default: 5),
  • SHLOOP_THREAD to specify the number of executed command concurrently (default: 1), and
  • SHLOOP_VERBOSE to display information on what command is being executed (default: false).

Usage

Simply, shloop can be run with:

▶ shloop [command...]

Variables

We also support variables, meanwhile we have variables as:

  • i will generate digit incrementally (depending on SHLOOP_COUNT value),
  • str will generate a random ASCII string with length N,
  • int will generate a random string of length N consists of ASCII digits (note it can start with 0), and
  • uuid (version 4) will generate a random unique identifier based upon random nunbers.
    • Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Workarounds

As an example, I want to repeat the echo command 10 times.

export SHLOOP_COUNT=10
▶ shloop echo "Hello, world!"
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!

In case if you want to test race conditions on an endpoint with curl.

export SHLOOP_COUNT=10
▶ export SHLOOP_THREAD=5
▶ shloop curl -X POST https://httpbin.org/post -d "foo=bar"

Using variables

Example of using incremental variable:

export SHLOOP_COUNT=5
▶ shloop echo "No. {{i}}"
No. 1
No. 2
No. 3
No. 4
No. 5

Have IDOR endpoints? Intruder on it!

export SHLOOP_COUNT=100
▶ export SHLOOP_VERBOSE=true
▶ shloop curl -s "https://domain/api/orders/{{int 8}}"

Another one:

export SHLOOP_COUNT=100
▶ export SHLOOP_VERBOSE=true
▶ shloop curl -s "https://domain/profile.php?id={{uuid}}"