SSH Tunneling In Windows

in #security6 years ago

Ever wanted to use SSH on Windows? There are several tools we can use to do so including Plink/Putty/Bitvise. While these solutions do work, they're a bit less natural than just firing up a terminal and hopping onto another box. Let's use git to offer native SSH functionality to Windows terminals.

Steps for setup:

  1. Install Chocolatey
  2. Use Chocolatey to install git:

choco install git -params "/GitAndUnixToolsOnPath"
Quick side note: The passed parameter takes care of local environment variables.

You may need to use the following as well to set the local environment variables:

$new_path = "$env:PATH;C:/Program Files/Git/usr/bin"
$env:PATH=$new_path
[Environment]::SetEnvironmentVariable("path", $new_path, "Machine")

Excellent, let's try it out:
Close out your terminal and open a new PowerShell instance. Let's hop into a Kali box with the SSH service running:

Now let's try the inverse, going from a Linux machine to Windows:

SSH Linux to Windows

References:
Hacking and Coffee [https://hackingandcoffee.com]
Matt Wrock's Writeup [http://www.hurryupandwait.io/blog/need-an-ssh-client-on-windows-dont-use-putty-or-cygwinuse-git]
Chocolatey.org

Sort:  

this information is awesome