I have this .rb file with the command:
cd /users/someusername/documents
The problem is that instead of "someusername", i would like to get the actual username of my target pc(which is my own pc used for penetration testing).
Update: Just to clarify: I am running the resource script using the :resource: command from my meterpreter session. I guess this is different from running meterpreter scripts since the way I am doing it, runs every line in the file as a meterpreter command. Any idea of how I could get the target's username from the file then? I mean the ENV does not seem to work with this approach. I am open for all suggestions!
Thanks! Much appreciated!