master
Reading
-
SSH, The Secure Shell - Introduction to SSH
-
SSH Protocol - RFC 4251
- Abstract
-
- Introduction
- 4.4. Security Properties
-
SSH Connection Protocol - RFC 4254
-
SSH Man Page -
man ssh
- DESCRIPTION (first paragraph)
- -L flag
- -R flag
- -D flag
- SSH Port Forwarding - Stack Exchange
Lab
SSH Setup
- Login to virtual machine inside the vmware console
- Record its public IP address (
ip addr) - Return to your mac and open up the
Terminalapplication - ssh into the virtual machine
ssh ubuntu@<vm IP address>
- Examine the networks that are accessible from this machine (ignore any vmnets which may be lingering)
- What are the subnets accessible from the vm?
- What IP addresses are assigned to the vm?
- What are the names of these interfaces?
- ssh to the next machine at
10.0.0.2
ubuntu@ubuntu:~$ ssh ubuntu@10.0.0.2
- Confirm you are on a different network segment (
ip addr)
- What are the subnets accessible from this new location?
- What IP addresses are assigned to the this location?
- What are the names of these interfaces?
- Exit back to your macbook bash session (
exittwo times)
Port Forwarding: Basic
- Setup a local port forward to the next target (T1) IP address
10.0.0.2
MacBook-Pro:~$ ssh ubuntu@<vm IP address> -L 2222:10.0.0.2:22
- In a new terminal ssh to the (T1) target IP address via the new local listener
MacBook-Pro:~$ ssh ubuntu@localhost -p 2222
- Bonus: Manipulate the first command to setup the port forward in the background. This should allow you to continute to ssh to the (T1) target without opening a second terminal.
IP Scanning: Basic
- The next hop in this lab will not be given to you.
Create a ping sweep command to discover the next target (T2).
- Which location should this ping sweep be run from?
- Why wouldn’t this work from your host machine.
- Create a new localhost port forward to reach the (T2) target ssh
MacBook-Pro:~$ ssh ubuntu@localhost -p 2222 -L 2223:<T2 IP>:22MacBook-Pro:~$ ssh ubuntu@localhost -p 2223
- Enumerate the new location:
- What are the subnets accessible from this new location?
- What IP addresses are assigned to the this location?
- What are the names of these interfaces?
Port Scanning: Basic
- From the (T1) target location launch a port scan against the third host
- Create a local ssh port forward (from your mac) to this location
- Connect to the forwarded port with your browser
Continue
- There are more networks in this lab, use your new port forwarding skills to continue through to T4