cd to the directory on i5.nyu.edu to which you want to download the file pwd lynx -source http://i5.nyu.edu/~mm64/x52.9547/src/local > local ls -l local
Get your loginame and secret password for i5.nyu.edu. One way to get the secure shell software to connect is by picking up the free NYU CD at one of the labs. You can also log in from a lab.
Play with the binary calculator bc. Run the command
arp -ato see the Ethernet address of i5.nyu.edu. Run
ifconfig -ato see the IP version 4 address of i5.nyu.edu. Column 1 of
netstat -an -f inet -P tcp | morewill show the TCP port numbers of the processes on i5.nyu.edu currently talking via TCP segments carried in IP datagrams. Try these commands on whatever other Unix systems you have an account on.
In the Craig Hunt book, read up to p. 23. Look at the diagrams of an IP datagram on pp. 14 and 679, a TCP segment on pp. 19, 682, a UDP chunk on p. 18, and an ICMP chunk on p. 683.
Run localhosts.c or localhosts.pl in Handout 1, pp. 25–29. If you have an account on a Unix machine other than i5.nyu.edu, give localhosts the IP version 4 address and the netmask of that other host.
To see the four packets of Dialog 1 in Handout 2,
cd ~mm64/public_html/x52.9547/src/snoop pwd /usr/sbin/snoop -i arp_icmp.snoop -ta -p 1,1 -v | cat -n /usr/sbin/snoop -i arp_icmp.snoop -ta -p 2,2 -v | cat -n /usr/sbin/snoop -i arp_icmp.snoop -ta -p 3,3 -v | cat -n /usr/sbin/snoop -i arp_icmp.snoop -ta -p 4,4 -v | cat -n
cd ~mm64/public_html/x52.9547/src/snoop pwd /usr/sbin/snoop -i arp_icmp.snoop -ta -p 1,1 -v | cat -n /usr/sbin/snoop -i arp_icmp.snoop -ta -p 2,2 -v | cat -n etc.
/usr/sbin/snoop -i udp.snoop -ta -p 1,1 -v | cat -n /usr/sbin/snoop -i udp.snoop -ta -p 2,2 -v | cat -n etc.Run the program udp.pl on Handout 2, p. 20 (or the C program udp.c on pp. 17–19). The command
/bin/netstat -a -f inet -P udpwill show you all the currently active UDP sockets. Insert the statement
print `netstat
Expand forkexecwait.pl in Handout 7, p. 14 into a more fully-featured shell, and hand it in. Instead of hardwiring in the name of program that the child should turn into (the grep in line 9), let the program read the name from the standard input. Print a prompt (e.g., $ and a blank) before letting the user type their choice. Do this in a loop so that it happens until the user types control-d to terminate the standard input. Line 47 of mytelnet.pl in Handout 8, p. 4 shows how to do this. Each time you execute line 47, it reads one line of standard input and stores it in the variable $_. Remove the trailing newline from this variable with the chomp in line 6 of parent.pl in Handout 7, p. 7. Then pass the variable to the Perl function exec. Extra credit: if the lines ends with an ampersand (immediately before the newline that you chomp off),
while (chomp off the ampersand and skip the call to wait. This will run the child in the background. Unfortunately, the zombie children will be left behind, but well fix it next week.)) { chomp $_; #As in awk, a Perl regular expression is enclosed in slashes. if ($_ =~ /&$/) { #etc.
Play with the binary calculator bc. Use nslookup and dig to see if www.microsoft.com really has eight IPv4 addresses. Admire last semesters class photo and click on each nose.
In the Craig Hunt book, read up to p. 23. Look at the diagrams of an IP datagram on pp. 14 and 679, a TCP segment on pp. 19, 682, a UDP chunk on p. 18, and an ICMP chunk on p. 683.
Try the two following commands, to whatever host you want. ping sends out and recieves ICMP chunks carried in IP datagrams. traceroute sends out UDP chunks carried in IP datagrams, and recieves ICMP chunks of bad news, carried in IP datagrams. When you traceroute from i5.nyu.edu to any destination, is the first stop along the way always WWITSGW-VLAN-13.NET.NYU.EDU (128.122.253.129)? See Handout 1, pp. 20–21. In Windows, traceroute is called tracert.
ping aixmita1.urz.uni-heidelberg.de traceroute aixmita1.urz.uni-heidelberg.de
Modify the localhosts.pl program in Handout 1, pp. 23–27, so that its first argument is the address of the network rather than the address of an arbitrary host on the network. This modification will make the program simpler. (The address of our network is 128.122.253.128; see Handout 1, p. 21.) Hand in the first page of output.
Hand in Homework 2.1 (Ethernet). Run lines 4–6 at the bottom of Handout 2, p. 5. In other words, examine the arp cache before and after you ping all the hosts on the local network.
Read about the formats of the headers of the packets in the IP, ICMP, UDP, and TCP protocols. See pp. 12–23, 679–684 in the textbook, or read the RFCs directly:
Admire the class photo. Next week well make it touch sensitive.
ifconfig -a netstat -r netstat -nrbefore the connection is made and then while youre connected. Did making the connection put new entries into the routing table?
ps -Af | grep in.namedIf so, kill every copy that youre running.
Hand in Homework 7.1. (The Perl program in Handout 7, pp. 1–2 is correct as written: we have to call alarm each time around the loop. And each new call to alarm cancels the previous request for an alarm.) Run the C program in Handout 7, pp. 11–12 or the Perl program in Handout 7, p. 14, but dont hand it in. See pp. 20–21 of
man -M /usr/perl5/5.6.1/man perlfuncto see why the first argument of the Perl exec function must be a variable.
Handout 7, p. 22, showed how to get the loginnames of people logged in at Heidelberg by telneting to port 79. You could use the login.ex expect script to log into their accounts, if you knew their password. Try all the words in our /usr/dict/words file. Also, try those words with a digit at the end. In other words, try the following passwords:
typical_word typical_word0 typical_word1 typical_word2 etc.Write a shellscript with triply nested loops: one for each login name that you know of, one for each word in /usr/dict/words, and one for each string in the series "", "0", "1", "2", ..., "9". If you do discover someones password, do no damage.
/usr/sbin/arp i5.nyu.edusays that the Ethernet address of i5.nyu.edu is
08:00:20:d8:d7:af
.
The first three bytes
08:00:20
are the "Organizationally Unique Identifier"
that tells who manufactured the hardware.
Look up the manufacturer in the lists at the
IEEE
(type 6 hex digits, no colons) and
Cave Bear.