Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Dakalo-Ndonde15/Azure-Network-Protocols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Network Security Groups (NSGs) and Inspecting Traffic Between Azure Virtual Machines using Wireshark

In this tutorial, we observe various network traffic to and from Azure Virtual Machines with Wireshark as well as experiment with Network Security Groups.

Environments and Technologies Used

  • Microsoft Azure (Virtual Machines/Compute)
  • Remote Desktop
  • Various Command-Line Tools
  • Various Network Protocols (ICMP, SSH, DHCP, DNS, RDP)
  • Wireshark (Protocol Analyzer)

Operating Systems Used

  • Windows 10 (21H2)
  • Ubuntu Server 20.04

High-Level Steps

  • Create a Resource Group
  • Create a Virtual Machine
  • Observe ICMP Traffic
  • Observe SSH Traffic
  • Observe DHCP Traffic
  • Observe DNS Traffic
  • Observe RDP Traffic

Actions and Observations



Set up your virtual environment


First, let's create our Resource Group inside our Azure subscription.

Resource Group

Now create your Windows virtual machine. I typically create the VM in (US) East US.

While creating the VM, select the previously created Resource Group and allow it to create a new Virtual Network (Vnet) and Subnet. Make sure to use the password option under the Administrator Account section:

Windows VM

Create an Ubuntu virtual machine.

While creating the VM, select the previously created Resource Group and allow it to create a new Virtual Network (Vnet) and Subnet. Make sure to use the password option under the Administrator Account section (not seen in image):

Ubuntu VM

Observe Your Virtual Network within Network Watcher:

Network Watcher



Now let's observe some ICMP traffic


Remote into your Windows 10 Virtual Machine, install Wireshark, open it and filter for ICMP traffic only.

Microsoft Remote Desktop - Mac

Retrieve the private IP address of the Ubuntu VM and attempt to ping it from within the Windows 10 VM. Observe ping requests and replies within WireShark:

Ubuntu private IP ICMP traffic - private IP

Attempt to ping a public website (such as www.google.com) and observe the traffic in WireShark:

ICMP traffic - public IP

Initiate a perpetual/non-stop ping from your Windows 10 VM to your Ubuntu VM:

ICMP traffic - perpetual ping

Open the Network Security Group your Ubuntu VM is using and disable incoming (inbound) ICMP traffic, while back in the Windows 10 VM, observe the ICMP traffic in WireShark and the command line Ping activity:

ICMP traffic - perpetual ping ICMP traffic - ICMP denied

Re-enable ICMP traffic for the Network Security Group in your Ubuntu VM and back in the Windows 10 VM, observe the ICMP traffic in WireShark and the command line ping activity (should start working again).Finally, stop the ping activity:

ICMP traffic - ICMP re-enabled



Time to observe SSH traffic


Back in Wireshark, filter for SSH traffic only and from your Windows 10 VM, “SSH into” your Ubuntu virtual machine (via its private IP address). Type commands (ls, pwd, etc) into the linux SSH connection and observe SSH traffic spam in WireShark.

Exit the SSH connection by typing ‘exit’ and pressing [return]:

SSH traffic



Next, we're going to observe DHCP Traffic


Back in Wireshark, filter for DHCP traffic only. From your Windows 10 VM, attempt to issue your VM a new IP address from the command line (ipconfig /renew)

Observe the DHCP traffic appearing in WireShark:

DHCP traffic



Let's now observe our DNS traffic next


Back in Wireshark, filter for DNS traffic only.

From your Windows 10 VM within a command line, use nslookup to see what google.com and disney.com’s IP addresses are and observe the DNS traffic being shown in WireShark:

DNS traffic



Finally, we will observe RDP traffic to finish up this tutorial


Back in Wireshark, filter for RDP traffic only using "tcp.port==3389".

You'll be obseving a non-stop stream of traffic. Do you know why there is constant traffic in our tcp.port==3389?

The answer is because the RDP (protocol) is constantly showing you a live stream from one computer to another, therefor traffic is always being transmitted:

RDP traffic

Now that we're finished observing the network, DON'T FORGET TO CLEAN UP YOUR AZURE ENVIRONMENT! This will prevent you from incurring additional charges and you won't be left surprised!

Close your Remote Desktop connection, delete the Resource Group(s) created at the beginning of this tutorial, and verify Resource Group deletion. You'll typically be notified or can click unde the bell notification just to make sure.