/courses/cs100/cs197/USERNAMEcopy files from assignment directory:
cp -r /courses/cs100/cs197u/cs197u/assignment/assign-6/* /courses/cs100/cs197u/USERNAME/assign-6/2. How many network interfaces do you have on your own Ubuntu machine (or virtual machine), what are they? What are their IP address(es), and what command do you use? (It should look like x.x.x.x. If you don't see your wireless interface in virtualbox, just report the other one(s)) 3. Write a command that outputs
only the IP addressof your active network interface. (you will need awk) 4. What is the IP address of edlab server:
www-edlab.cs.umass.edu? what is the command that you use that can covert this into IP address? Write your answers into file
espn.go.comis alive? What is the average round trip time from your machine to ESPN's server (take 10 samples)?
www.bbc.com, but the connection is a bit slow. What command can I use to track the data packets going from UMass (or your home) to BBC website? If I don't have this tool, what is the command that I should issue to install the tool? ( this part should be done on your own Ubuntu (or virtual box), not on your Mac or Ed-lab server )
tracertin Windows command prompt, which does the same thing. Remember to specify that in your answers-6.txt)
./script.sh | lessand study the code to understand what it does. Look up the
manand on the web for this. 2. Edit the script so that instead of
text/alice.txtit takes in the first command line argument. Add code that will check whether the first command line argument is set. If it is set, the line with the
trcommand should be run. If no argument is given, print out "Need file as argument 1" and do nothing further. Run your script with different files as input, such as
text/hamlet.txtfor testing the encryption. ( Hint: you can refer to lecture 6 for detectng arguments.) 3. Edit
script.shfurther to take the key as a second command line argument. Also add code that does the following: If "-" is given as second argument, use the default key in
script.sh, otherwise change the key to use the second command line argument. Run your script with different keys for testing. 4. Edit
script.shwith a third command line argument (which acts as a flag):
a.) Add code so that the flag can be set to "encrypt" for encrypting the file with the key, and to "decrypt" for decrypting;
b.) Add code so that for any other string given as the third argument (or if it is missing), the code should do nothing;
c.) Add code for the "decrypt" case: if the flag is set to "decrypt", decrypt an encrypted text back to lower-case using the key.
Run your code to verify that encryption and decryption work correctly. Note that for running decryption, you should first run "encrypt" and save the output to a file, and then use that as input with the "decrypt" flag next time. What happens if your key is shorter than the alphabet, or if it contains duplicate letters?Write your answers into file
sudo wiresharkto open wireshark, click the top-left icon to choose an active interface that you want to monitor, and click
wget -N www-edlab.cs.umass.edu/cs197u/wget.html. When the webpage is downloaded (should be within a second), click the
stopicon on wireshark toolbar to stop packet sniffing.
HTTP(in green) and identfy your own connection(s) to edlab server. (with the IP addresses of your machine and the edlab server in the source/destination column - edlab Web IP: 126.96.36.199).
HTTP 200 OK (text/html)in the
Line-based text data: text/html).
http://www-edlab.cs.umass.edu/cs197u/wget.htmland compare the results.
restartbutton at the wireshark toolbar (the fifth button, you can choose to save the previous results or not).
scp USERNAME@elnux7.cs.umass.edu:/courses/cs100/cs197u/cs197u/public_html/wget.html ./scp.html(replace USERNAME with your edlab username). Then you'll download the same webpage from edlab server by
scp, and will save it with the new name:
SSHin the protocol column (in light purple) and identify your own connection(s) to edlab server (elnux7 IP: 188.8.131.52).