OSCP-CPTS NOTES
TwitterGithubLinkedinInstagramDiscord
  • oscp-cpts-notes
  • Pivoting & Tunneling
    • Local Port Forwarding
    • Remote Port Forwarding
    • Dynamic Port Forwarding
    • Ligolo-ng
  • Linux Privilege Escalation
    • Gathering Information of the System
    • Capabilities
    • Group Based
    • SUID Privilege Escalation
    • Cron Job
    • Exploiting NFS weak Permission
    • Sudo + LD_PRELOAD (Shared Libraries)
    • Shared Object Manipulation
    • Python Library Hijacking
  • Windows Privilege Escalation
    • Gathering Information of the System
    • User Privileges
      • SeImpersonatePrivilege and SeAssignPrimaryToken
      • SeDebugPrivilege
      • SeTakeOwnershipPrivilege
    • Group Privileges
      • Backup Operators
      • DnsAdmins
      • Server Operators
      • Always Install Elevated
      • Print Operators
      • Event Log Readers
      • Hyper-V Administrators
    • Credential Theft
  • Active Directory Attacks
    • Enumeration
    • Initial Foothold
    • Gathering Users & Password Policies
    • Password Spraying
    • Credentialed Enumeration From Linux
    • Credentialed Enumeration From Windows
    • Kerberoasting - From Linux
    • Kerberoasting - From Windows
  • Beyond OSCP - CPTS
    • RED TEAMING
      • Windows Local Persistence
        • Tampering With Unprivileged Accounts
        • Backdooring Files
        • Abusing Services
        • Abusing Scheduled Tasks
        • Logon Triggered Persistence
        • Backdooring the Login Screen / RDP
        • Persisting Through Existing Services
Powered by GitBook
On this page
  • Setup
  • To forward multiple ports

Was this helpful?

Edit on GitHub
  1. Pivoting & Tunneling

Local Port Forwarding

Local port forwarding is a technique used to forward traffic from a local port on the attacker's machine to a specified remote IP address and port through an intermediary (usually an SSH server). This method allows access to services on the remote server that might not be directly accessible due to firewall rules or network restrictions

Setup

dollarboysushil@kali$ ssh -L 4567:localhost:80 ubuntu@10.10.15.130
ubuntu@10.10.15.130's password:

-L indicates local port forwarding, and we are forwarding the web app running on port 80 of remote server to port 4567 on our attacker machine. Which means, website on attackers_ip (10.10.15.130:80) can be accessed on our_ip:4567

Once the SSH session is established, any request sent to http://localhost:4567 on your attacker machine will be securely forwarded to http://localhost:80 on the remote server (10.10.15.130).

To forward multiple ports

dollarboysushil@kali$ ssh -L 4567:localhost:80 -L 6789:localhost:3306 ubuntu@10.10.15.130

PreviousPivoting & TunnelingNextRemote Port Forwarding

Last updated 7 months ago

Was this helpful?