πŸ” SSH Downloads with scp

Need to securely transfer files between machines? Enter the SCP command, your encrypted copy-paste hero! πŸ¦Έβ€β™‚οΈ

SCP (Secure Copy) is a simple, powerful tool that uses SSH to securely copy files:

  • βœ… From your machine ➑️ a remote one

  • βœ… From a remote machine ➑️ your machine


🧰 Enable SSH on Your Machine (e.g., Pwnbox)

To receive files, your Pwnbox needs an SSH server running. Let’s set it up:

πŸš€ Enable the SSH Server:

sudo systemctl enable ssh

▢️ Start the SSH Server:

sudo systemctl start ssh

πŸ› οΈ Verify SSH is Listening:

netstat -lnpt

Look for:

tcp   0   0 0.0.0.0:22   0.0.0.0:*   LISTEN

πŸ“‘ That means SSH is ready to accept connections on port 22.


πŸ“₯ Download Files from Target to Pwnbox with SCP

Now, you can grab files from the remote Linux target to your Pwnbox:

scp plaintext@192.168.49.128:/root/myroot.txt .

πŸ“Œ Breakdown:

  • scp: invokes secure copy

  • plaintext@192.168.49.128: login user and IP of the target

  • :/root/myroot.txt: the full path of the file on the target

  • .: download it to the current folder

✨ Done! You now have the file in your directory β€” securely copied over SSH.


πŸ” Pro Tip: Use a Temporary User

πŸ’‘ Instead of using root or your main user:

  • Create a temporary user on the target machine just for transfers

  • It’s safer and keeps your real credentials secure πŸ”’


πŸ” Upload a file to a target (Hacker Machine)

No problem! Just flip the direction:

scp myscript.sh user@192.168.49.128:/tmp/

That uploads myscript.sh to the /tmp/ folder of the target machine.


Last updated