//Cyber Battlefield/Build-a-WLAN Lab

Do not close this web page. Open two copies of this web page in your browser.

A. Preparation

Before you begin assembling the network, follow the steps below:

Follow these steps to open an Administrator shell in Windows:
  1. Press the System (Windows) key
  2. Type in: cmd
  3. Right-click cmd.exe to bring up the context menu.
  4. Select Run as administrator.
  1. Be careful while connecting and disconnecting your Ethernet cables, the physical port on your laptop is delicate.
  2. Verify nk works.
    1. Open a Windows shell
    2. Enter the command: C:>nk
    3. If you do not see a usage statement, then download nk (see below)
      nk usage statement:
      nk (netkitteh): Send/receive bytes using TCP or UDP.
      
      Usage: nk [-h] [-u] [-l port] [host port]
             -h = print this help message
             -u = use UDP
             -l = listen on 'port'
           host = name of a server listening on 'port'
                  (hostname, domainname, or IP address)
      
      Examples: TCP server: nk -l 12345
                    client: nk foo.bar.net 12345
                UDP server: nk -u -l 12345
                    client: nk -u 128.56.19.80 12345

    As required, download nk:

    1. Download (Right click, Save link as ...) this program: nk.exe and save it to C:\SI110Programs\ as nk.exe.
    2. Reverify nk works.
      Failure to have nk working on your laptop will result in a grade deduction on the lab, and/or the instructor option portion of your grade.
  3. The commands in the black boxes on this web page are set up so that you can copy and paste the command into your Windows Administrator shell. Some commands are LONG, so be sure you have copied the entire command (triple-click!)
  4. Notify your instructor if there are any errors with any shell commands or actions taken during lab!
  5. Keep this browser window open during lab - you cannot get to the USNA network after you complete these Preparation steps. Also, once you start entering in data into the page and generating commands, if you refresh or leave the page and use the BACK button - you will lose the pre-configured commands for your host and need to generate the commands again by re-entering your host IP Address and Subnet mask.
  6. Start a Windows Administrator shell. All the network configuration commands (starting with the very next item!) should be given in this shell, because they require super-user privileges.
    Suggestion: Have two or three Windows shells open, multiple cmd processes, to assist with the various lab activities.
  7. Issue the following command (in an Administrator shell!), which will clear your old network settings to include your IP address, your subnet mask, your default gateway router, etc:
    ipconfig /release
  8. Click on icon for wireless connections (i.e. the "bars" icon) at the bottom right of your screen. Click on GNBA-M and click on the disconnect button.
  9. You can turn the Windows firewall off with the GUI by the following: From the Windows Start Menu, navigate to the "Windows Firewall" control panel (Start→Control Panel→System and Security→Windows Firewall) and click on the "Turn Windows Firewall on or off" option from the left panel. From this new menu, turn off the firewall for all three network locations and click OK.
    Issue the following command (in an administrator shell!), which will turn off the Windows Firewall:
    netsh advfirewall set allprofiles state off
  10. Silence is Golden. When successful, arp -d * will not return any output.
    Issue the following command (in an administrator shell!) which will clear your ARP cache:
    arp -d *
 ↑ Worksheet Check Off Items! 

B. Build a Wireless Network

4 computers connected to a single switch. In this first part of the lab, you will create a wireless 802.11 network to communicate with your classmates. As discussed in class, the most basic wireless network consists of a Base Station and host stations. Step 1 of creating a wired network was to connect each host to your switch (with cables of course). So right off the bat things are different with wireless. The problem we have is this: there are 5 Base Stations in the room, each of which has the default SSID "dlink". In order to connect to your group's Base Station, you need to give it its own unique SSID — i.e. its own name. However, in order to give the Base Station its own SSID, you need to connect to it. We seem to have a chicken-egg kind of problem! The solution is to connect one of your group's laptops to the Base Station with an Ethernet cable, and to configure the Base Station's SSID that way. Then you can remove the cable and all connect wirelessly!
Note: Before you start the steps below, you need to reset the Base Station, i.e. erase any prior configuration changes and restore it to its factory settings. You do this by using a pen to press and hold the reset button on the back of the Base Station immediately after plugging the Base Station in. You should hold the reset button down for at least ten seconds.
Step B.0: Setting the Base Station's SSID (ESSID) [Done by group leader only! Other group members follow along!]
One member of your group must connect his laptop to your group's Base Station with an Ethernet cable so that you can configure the SSID. That one person must set the IP address and subnet mask for his "Ethernet" (as opposed to "Wi-Fi") to the private IP address 192.168.0.51 and 255.255.255.0 with the following command (Important: must be run in an administrator shell)
netsh interface ipv4 set address name="Ethernet" source=static address=192.168.0.51 mask=255.255.255.0
NOTE: ANY group member that enters this command will also be able to access the configuration site via Ethernet, and therefore perform the group leader tasks in lab. So, if the group decides to change who the leader is throughout lab, then everyone should enter this command into their shell.
  • The Base Station's configuration is controlled through a web page — which means that the Base Station actually runs a basic web server whose sole purpose is to host the configuration settings web pages.
  • You can connect using HTTP or HTTPS. Does it matter which you use at this point?
  • So ... Connect to your Base Station's administration web page by entering the private network address 192.168.0.50 in your browser's address bar.
  • You will be greeted with a login page, the username is admin and there is no password.
  • Choose Basic Settings and then Wireless from the left-hand-side of the web page.
  • There is a field for SSID, which by default is set to dlink. That means that, right now, all 30 of the Base Stations are sitting there broadcasting their names as dlink. That's why we have to change things!
  • Make up a unique name without spaces or punctuation characters! Change the SSID from dlink to the group's chosen SSID in the configuration window. Make sure it is unique, and make sure you remember it! This is government equipment, so no obscene or inappropriate names. Do not choose your group and group number (i.e. "group3") as your SSID because the other fives sections of meeting right now have the same exact groups and numbers!
  • Save this change by:
    1. Click the Save button.
    2. Click on the Configuration tab.
    3. Click on Save and Activate in the little pop-up that results.
  • The access point will tell you to wait 60 seconds.
  • Now, disconnect the Ethernet cable.

All group members will record the group SSID on their worksheets.  ← Worksheet B.0 

Step B.1: ALL GROUP MEMBERS Setting each group member's IP Address and Subnet Mask
Normally, hosts on a wireless network get their IP addresses and subnet masks via DHCP. However, we're not in a position to setup a DHCP server for this lab, so we will set these manually (as we did in the Build-a-LAN lab last week). You must coordinate with your group members when setting your IP addresses to prevent having two hosts with the same IP address. Use the table below to assign IP addresses for your group.
Group Number   Assigned IP Addresses   Subnet Mask
Group 1   85.170.15.1   - 85.170.15.5   255.255.255.224
Group 2   85.170.15.33  - 85.170.15.36   255.255.255.224
Group 3   85.170.15.65  - 85.170.15.68   255.255.255.224
Group 4   85.170.15.97  - 85.170.15.100   255.255.255.224
Group 5   85.170.15.129 - 85.170.15.132   255.255.255.224

All group members record their IP address and subnet mask on their worksheet.  ← Worksheet B.1 

  1. Press the System key (Windows key)
  2. Enter (type and press Enter) the following in the search box: ncpa.cpl
    This will bring up this Control Panel window:
    ncpa.cpl
  3. Right-click on the Wi-Fi icon and select Properties.
    Wi-Fi Properties
  4. Click yes in the User Account Control dialog window.
  5. In the resulting Wi-Fi Status window click the Properties button.
    Wi-Fi Status
  6. In the resulting Wi-Fi Properties window select Internet Protocol Version 4 (TCP/IPv4) and click the Properties button.
    Wi-Fi Properties - TCP/IPv4
    Do not change the checkbox status for any of the checkboxes (leave the checkboxes alone)
  7. In the resulting Internet Protocol Version 4 (TCP/IPv4) Properties window click the Use the following IP address: option.
    Internet Protocol Version 4 (TCP/IPv4) Properties
  8. Type in your IP address, as coordinated with your group members, and type in your subnet mask.
  9. Confirm the changes in all of the network dialogs by clicking the OK button. You shall click the OK button until you are back to the Network Connections window, then close that window as well.
    ncpa.cpl
Step B.2: ALL GROUP MEMBERS Connecting to the Base Station & Testing connectivity
Now that you have set your Base Station's SSID and set your own IP Addresses, it is time to actually connect to the Base Station and test your connection to the other members of your group.
  1. Click on icon for wireless connections (i.e. the "bars" icon) at the bottom right of your screen.
    • Click on the SSID you gave your Base Station.
    • Click the Connect button.
    • Note: you might get an error message after 10 or 20 seconds, but if you dismiss it and click again on the wireless connections icon, you should see that it lists you as "connected".
  2. Verify your IP address and subnet mask are correct by executing ipconfig in a Windows shell.
    Note: If they're not set correctly, then repeat the steps in B.1. again.
  3. Ping the other members of your group to verify you are all connected.
  4. If nk is not working, try using nc:
    C:> nc -l -p 3389
    Carry on a netkitten (nk) chat with another member of your group, to further test you network.
    Recall: The server runs nk -l 4 while the client connects to the server with nk remoteIPAddress 4 . Of course you can use whatever port number you like. Recall: You can use Ctrl-c to end the netkitten connection/session.

Congratulations! at this point you have a functioning (but isolated!) wireless network. Update your worksheet.
 ↑ Worksheet B.2 

Group/Port Mapping
9876
1 2 3 4
5      
5432

C. Connect the Network to Other Networks

ALL GROUP MEMBERS: Launch the Xirrus WiFi Inspector program, and find your Base Station. You should be able to read off interesting information about it, like its BSSID and the channel (frequency band) it's using. Recall that a BSSID is a MAC address which is a 48-bit number represented as 12 hex characters. Record your BSSID and the channel found in Xirrus on your worksheet.  ← Worksheet C.0 
Now look at the many, many Base Stations broadcasting. There are the other four networks from your classroom, plus GNBA-Guest, and probably Base Stations from nearby classrooms where other sections are going through this lab. At this point, you could join a different network if you wanted (don't, we don't have time!). That would allow you to communicate with a different network, but then you would no longer be able to communicate with the other hosts on your group's network! In other words, none of these networks are controlling who accesses their network. There is no wire to connect to a switch, the access point is simply broadcasting the SSID and if your host can "see" the SSID, then that means it is within range and can choose to send/receive on the same frequency and channel. So, in theory, any host can join any network in range.

As you are hopefully aware by now, communication between hosts on different networks requires routers. If you connect the Base Station to a router port, that router will act like a host on your network, even though it's not using WiFi like the others. The router can be a host on your network because both Ethernet and 802.11 (WiFi) use MAC addresses for Link Layer addressing!

  1. Connect your Base Station to the router using the table to the right to determine where to plug into the router.  ← Worksheet C.1 
  2. Find the IP address of a member of another group, and ping it. What error message did you get? Why didn't the ping work? Hint: Type ipconfig in your shell, and examine your Wireless LAN adapter Wireless Network Configuration settings.  ← Worksheet C.2 
  3. When a host sends a packet to a host on another network, that packet must go to the host's gateway router. So, set your host's Default Gateway address based on your group number. The complete table is below:
    Group Number   Assigned IP Addresses   Subnet Mask   Default Gateway
    Group 1   85.170.15.1   - 85.170.15.4   255.255.255.224   85.170.15.30
    Group 2   85.170.15.33  - 85.170.15.36   255.255.255.224   85.170.15.62
    Group 3   85.170.15.65  - 85.170.15.68   255.255.255.224   85.170.15.94
    Group 4   85.170.15.97  - 85.170.15.100   255.255.255.224   85.170.15.126
    Group 5   85.170.15.129 - 85.170.15.132   255.255.255.224   85.170.15.158
    1. Repeat the steps from B.1 as needed to return to the Internet Protocol Version 4 (TCP/IPv4) Properties window.
      Internet Protocol Version 4 (TCP/IPv4) Properties
    2. Type in your Gateway Router IP Address for Default gateway.
      Internet Protocol Version 4 (TCP/IPv4) Properties
    3. Click the OK button.
    4. Open a shell and enter the command: ipconfig. You should see the default gateway that you just assigned in the output.

    Just as in the wired network lab, you may or may not see a box like this pop up.
    Set Network Location
    Just choose Public network. This limits the amount of information other hosts can discover about your host.

    Update your Worksheet.  ← Worksheet C.3 
  4. Test connectivity to other networks by pinging a host on another network.  ← Worksheet C.3 
  5. Do a netkitten chat with a classmate on a different network. ← Worksheet C.3 
  6. Traceroute using the -d option to a host on another network to verify that your packets really are sent via the gateway router; like this: tracert -d IP_ADDR. The -d option will not perform a DNS lookup for each IP address along the way. Which would fail anyway. Briefly discuss with your teammates why a DNS request from your host would fail.  ← Worksheet C.4 
  7. Read the paragraph C.5 on your worksheet and answer the two questions. ← Worksheet C.5 and C.6 
  8. Give the command arp -a and examine the results. You should see an IP address which looks like it might be on your network and that maps to the physical address ff-ff-ff-ff-ff-ff. This IP address is the broadcast address, and any packet with it as the destination IP gets sent to all hosts on the network. With the help of UDP, we'll try using the broadcast address. Choose one member of your group to be the sender. The rest are receivers. All the receivers should give the following command:
    nk -u -l  4
    In other words, receivers are listening on UDP port 4. The sender then gives the command
    nk -u BROADCAST-IP 4
    ... where BROADCAST-IP is the broadcast IP address for your network, which you read off of the ARP table. The sender then types a message and hits enter. All other group members (receivers) should receive that same message simultaneously, but they cannot respond. You can then use Ctrl-c to end the open connection and you can switch which group member is the sender, so that others have a chance to broadcast to the group.  ← Worksheet C.7 
Extra Fun: Connect with your phone [OPTIONAL] not to impede with Instructor Demos

After you've done the UDP broadcast, and you have some time to kill you might like to try this: If you have a smart phone, you can connect to the access point using your phone. Set your phone's IP address, subnet mask, and gateway router, and then your phone is like any other host. We have listed iPhone directions, but you could do the same with an Android phone.

  1. Choose Settings, then Wifi, click on the little pointer to the right of your base station's ESSID, and fill in IP Address, Subnet Mask and [gateway] Router. Use an IP Address that is the next available number after the four/five in your group's range.
  2. Have one of your classmates ping the IP Address you just used ... it should work! If she checks in her ARP table (arp -av) she should see your phone's IP and MAC addresses. You can verify that she's really got your phone's MAC: check Settings, General, About and look for "Wifi Address".
  3. For real fun, you can have a classmate pretend to be a web server and pull up his "page" with your phone's browser. Here's how:
    1. Friend does nk -l 80
    2. You enter his IP in your phone's browser address bar
    3. Friend should see your browser's HTTP request pop up, and respond by pasting in the following code (and then hitting enter a couple of times):
      HTTP/1.1 200 OK
      Content-Length: 56
      Content-Type: text/html
      
      <HTML>
      <BODY>
      This is a real web server!
      </BODY>
      </HTML>

D. Instructor Demo I

STOP AND WAIT FOR INSTRUCTOR DEMO!!

When all groups are connected - or enough are connected - your instructor is going to go through a little demo with you. Pay attention and answer the associated questions on the lab worksheet.

 ↑ Worksheet Section D  

E. Securing Your Wireless Network

All group members: disconnect from your wireless network by clicking on the "bars icon" at the bottom right, and clicking on your ESSID, and clicking on the disconnect button.  ← Worksheet E.0  

NOTE: At this point, you can change group leaders so that someone else in the group configures the Base station, however this means the new group leader must first enter in the command from step B0, if not already done.

Group leader only: (other group members follow along!) Reconnect via Ethernet cable to your Base Station. Point your browser at 192.168.0.50 and login to the Base Station's administration page with username admin and no password.
  1. Task: Change Administrator password! Recall, your instructor was able to log in to your base station using the default administrator password. This is not the network access key. So it is not used to join the network, it is only used to log into the web page to configure the base station.

  2. xkcd.com/416/
    Task: Turn on WEP Recall that your instructor was able to read the unencrypted packets travelling from host to the Base Station.
  3. Reconnect your Base Station to the router.
All group members: reconnect to your wireless network. You will be prompted to enter your WEP key (and you can't join the network if you don't have it!). Do not check the "hide characters" box when you enter the key! Verify that you are really on the network by pinging the members of your group, and by pinging an outside group member.
 ↑ Worksheet E.3  

F. Instructor Demo II

STOP AND WAIT FOR INSTRUCTOR DEMO!!
When all groups have WEP enabled - your instructor is going to go through a little demo with you. Pay attention and answer the associated question on the lab worksheet.
 ↑ Worksheet Section F  

G. Post-Lab Restoration

Setting up a new network requires configuration changes to every host added to the network, as you saw today. Before you reconnect to the USNA network, you must undo the changes you made in lab.
    Note: You can again change who is the group leader as long as the new leader enters (or previously entered) the command on Step B.0 into an Administrator shell.
  1. Group Leader: Pull up your Base Station's configuration manager and reset its SSID to dlink, turn off WEP, and reset its admin password to be no password. Save configurations as described above. When it is done, take a pen and use it to press and hold for ten seconds the reset button on the back of the Base Station.  ← Worksheet G.0  
  2. You can turn the Windows firewall off with the GUI with the following: From the Windows Start Menu, navigate to the "Windows Firewall" control panel (Start->Control Panel->System and Security->Windows Firewall) and click on the "Turn Windows Firewall on or off" option from the left panel. From this new menu, turn on the firewall for all three network locations and click OK.
    Important: ALL GROUP MEMBERS - Issue the following command (in an administrator shell!), which will turn the Windows Firewall back on
    netsh advfirewall set allprofiles state on
     ← Worksheet G.1  
  3. Reenable DHCP for both your wired and wireless networks.
    1. Repeat the steps from B.1 to return the Internet Protocol Version 4 (TCP/IPv4) Properties window.
      For the wired network, right click on the Local Area Connection icon.
      Internet Protocol Version 4 (TCP/IPv4) Properties
    2. Select the Obtain an IP address automatically and the Obtain DNS server address automatically.
      Internet Protocol Version 4 (TCP/IPv4) Properties
  4. Update your Worksheet.  ← Worksheet G.2  

  5. Now, connect to the USNA wireless network and ensure you check intranet connectivity by going to USNA's Intranet web site.  ← Worksheet G.3  
  6. It is also a good idea to re-boot your computer.