Pipping Linux Terminal Output as Input Parameters in a Zest Script

8 views
Skip to first unread message

fakuve

unread,
Sep 24, 2021, 11:33:39 PM9/24/21
to OWASP ZAP User Group

Hi there,


I have done this question in the IRC libera channel, but it doesn't look like I formulated it well or I just didn't understand the answer.

In order to run my script, I need to input some parameters which can be automatically grabbed from Linux Commands (I don't want to have to copy paste them each time I run the script).
For instance my script run the following variables which need to be assigned Manually but that could be done by just:

```
clientMac=`ip addr show dev wlp1s0 | grep ether | awk '{print $2}'`
clientMacTwo=`ip addr show dev wlp1s0 | grep ether | awk '{print $2}' | sed 's/\:/%25/g'`
clientMacThree=`ip addr show dev wlp1s0 | grep ether | awk '{print $2}' | sed 's/\:/%3A/g'`
```

How is this possibly done?

Thank you

fakuve

unread,
Sep 24, 2021, 11:48:35 PM9/24/21
to OWASP ZAP User Group
Also (sorry for the spamming) , how is the syntax to run this from the commandline?

I saw the video tutorial  Simon Bennetts actually runs one script by actually running the zest repo like

```
:~/zest$ ./gradlew run --args="-script /home/fakuve/.ZAP/scripts/scripts/standalone/zest-helloworld1.zst"

```
I'm running it this way , but I don't get much output of what it happened

```
:~/zest$ ./gradlew run --args="-script /home/fakuve/.ZAP/scripts/scripts/standalone/myZestScript.zst"
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :run
Warning: Zest version 0.3 is not the latest (0.8) and so may not be supported

BUILD SUCCESSFUL in 17s
3 actionable tasks: 1 executed, 2 up-to-date

```
Looks like it has been successfull , but I'm not really confident about that , as I didn't pass no arguments (although they are saved within Zap) , neither the actionable tasks of the Script are way more (if that is refered to actual Zest actions, the script have like 20 of them). So I doubt those are Assertions as well

Thanks guys keep it up , I'm actually quite happy that the script works, now I just need to run it from the CLI , and I will be happy :D
Reply all
Reply to author
Forward
0 new messages