I've been messing around with P4wnP1, trying to do pen testing with MacOS. In order for my program to work, I need to save a local IP address in a text file using HID Script.
The code goes as follows:
//Language and typing speed
layout('us')
typingSpeed(0,0)
//Open terminal
press(“GUI” + “SPACE”)
type(“terminal”)
press(“ENTER”)
delay(500)
//Find local IP address
type(“export IP_ADDR=/ipconfig getifaddr en0”)
press(“ENTER”)
//**Export IP_ADDR to .txt file in pi0w home directory**
Currently, I can get the correct output, but I do not know how to extract the data
Edit: I forgot to mention, HIDScript is based on JavaScript, with common libraries available
If the requirement is to capture the IP in a text file then you can use a pipe like this:
You could set up mass storage device in USB settings and save the text file there also..