Skip to main content

I wanted to find a way to save the winPeas output to a text file with all the colors intact so I could view the file offline with cat in Kali and see the same colored output. I looked at tmux first since that is what I use. I found a way to do this with the Advanced-Use piping-pane-changes in tmux. With pipe-pane you can pipe the output to a command. The command I am doing this with is one that can read and write output. It's called is tee. The option I'm using is -a.

$ tee --help
Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.

  -a, --append              append to the given FILEs, do not overwrite

If you are on a Linux target machine you could do this without tmux:

$ ./lse.sh -l 1 -i | tee -a lse_l1i_output.txt
$ cat lse_l1i_output.txt | more

Then you'd have to copy the text file from the target over to your Kali machine. If you didn't want to or couldn't do that, you could use pipe-pane in tmux and then save the buffer to a log file in Kali when you're done.

If you are on a Windows target, you can't run tee so the only way to make this work is to pipe the output with tmux. In the pane where you are going to run winPEAS, you press whatever your tmux prefix is, such as Ctrl-A, and then Shift-Colon so you can set it up with the command. If you are familiar with vim, it looks the same and you should be used to pressing Shift-Colon all the time.

Ctrl-A
Shift-:
pipe-pane 'tee -a winPEAS_output.txt'

Example of tmux panes at the bottom of terminator window:

pipe-pane panes

Example of using pipe-pane:

pine-pane commands

When you're done you can capture and save the buffer to a log file. You'll need to capture the pane, save the buffer and delete the saved buffer, if you have other panes you want to save.

$ tmux capture-pane -b temp-capture-buffer -S -
$ tmux save-buffer -b temp-capture-buffer /home/kali/tmux_buffers/projectName_060722_2-netcat.log
$ tmux delete-buffer -b temp-capture-buffer

After that you can now run the log file with cat and see the winPEAS output with all the colors.

If you haven't used tmux before, here's my old tmux configuration that I still use sometimes. Now I mostly use Oh my tmux.