πŸ”„ SCP Upload

Sometimes, your target network might allow outbound SSH (TCP port 22) connections. If so β€” jackpot! 🎰 You can use SCP (Secure Copy Protocol) to upload files from your Pwnbox to the target machine securely over SSH! πŸ”πŸ“‘


πŸ“ Uploading a File Using SCP

Let’s say we want to upload the sensitive /etc/passwd file to our attacker target machine.

Here’s the command you'd run from your Pwnbox:

z3tssu@htb[/htb]$ scp /etc/passwd htb-student@10.129.86.90:/home/htb-student/

πŸ”‘ What Happens Next?

You'll be prompted for the target's SSH user password:

htb-student@10.129.86.90's password: 

πŸŽ‰ If authenticated successfully, the file will be copied to the target!


⚠️ Heads-Up!

  • This only works if:

    • SSH is allowed outbound from the compromised host βœ…

    • The target IP is running an SSH server and reachable 🌐

    • You have valid credentials to log in πŸ”


Last updated