🐲
OSCP Notes
  • 🐲OSCP Notes
  • 🐲OSCP Methodology
  • 💡Misc
    • Metasploit
    • Antivirus Evasion
    • Password attacks
    • Reverse Shells
    • Port Forwarding, Tunneling and Pivoting
      • Local Port Forwarding
      • Remote Port Forwarding
      • Dynamic Port Forwarding
      • Lingolo-ng
    • Information Gathering
      • Passive Reconnaissance
        • Whois
        • Google Dorks
        • NetCraft
        • Git Repository
      • Active Reconnaissance
        • DNS Enumeration
        • Host Discovery
        • Port scanning
        • SMTP - 25
        • SNMP
  • Linux
    • Local Enumeration
    • Local Privileges Escalation
      • Scheduled tasks
      • Password Authentication
      • Monitor Processes
      • SetUID Binaries and Capabilities
      • Sudoers
      • Kernel Exploits
  • Windows
    • 🧠Mindmap
    • 🥝Mimikatz Basics
    • Enumeration
      • External Enumeration
      • Local Enumeration
      • Active Directory
        • PowerView
    • NTLM Hashes
    • Local Privilege Escalation
      • Service Binary Hijacking
      • Service DLL Hijacking
      • Unquoted Service Paths
      • Scheduled Tasks
      • Token impersonation
      • Backup Operators Group
    • Lateral Movement
      • WMI and WinRM
      • PsExec
      • Pass The Hash
      • Overpass The Hash
      • Pass The Ticket
      • DCOM
    • Persistence
      • Golden Ticket
      • Shadow Copy
    • Authentication Attacks
      • AS-REP Roasting
      • Kerberoasting
      • Password Spray
      • Silver Ticket
      • DC Sync
    • Client Side
    • NTLM Authentication
    • Kerberos Authentication
    • Cached Credentials
  • Web attacks
    • WordPress
    • SQL Injection (SQLi)
    • Command Injection
    • Directory Traversal
    • Local File Inclusion (LFI)
    • File Upload
Powered by GitBook
On this page
  • SSH
  • Plink
  1. Misc
  2. Port Forwarding, Tunneling and Pivoting

Remote Port Forwarding

PreviousLocal Port ForwardingNextDynamic Port Forwarding

Last updated 7 months ago

Remote forwarding allows you to forward a port on the SSH server to a port on your local machine. This is helpful when you want to make a service running on your local machine accessible to the remote server.

SSH

ssh -N -R <local_port>:<local_port>:<target_ip>:<target_port> <ssh_server_username>@<ssh_server_ip>

Plink

plink.exe is a command-line SSH client from the PuTTY suite. It's used for automating SSH tasks like connecting to remote servers, running commands, and port forwarding, without the need for a graphical interface. It's often used in scripts or for non-interactive SSH sessions.

C:\Windows\Temp\plink.exe -ssh -l <ssh_server_username> -pw <ssh_server_password> -R 127.0.0.1:<ssh_server_listening_port>:127.0.0.1:<target_port> <ssh_server_ip>
💡
Drawing