Using the traceroute tool, find the route from your computer to the websites onet.pl
and kurnik.pl
.
$ tracert onet.pl
$ tracert kurnik.pl
Compare with mtr
on Linux.
Use the site http://www.spy-ip.com/ to check where the IP addresses are located, through which the route passes. Try the tracert command also for other websites. Is the route always the way you expect?
Using the Whois program (called in cmd) find a contact for administrators/domain owners of: amu.edu.pl, google.com, facebook.com.
$ whois amu.edu.pl
Is the information always complete? Try the command also for other sites you know.
Log in to the university mail server using the telnet
tool
$ telnet pp.amu.edu.pl 587
Say hello to the server with the command helo
.
helo pp.amu.edu.pl
Try to send a message as rectorof@amu.edu.pl to the address of the teacher
mail from: <rectorof@amu.edu.pl>
rcpt to: <bikol@amu.edu.pl>
What is the response from the server?Since the server rejects our request, let us try to login. For this purpose, we will use the extended SMTP-AUTH protocol. The ehlo
command returns a list of options supported by the server.
ehlo pp.amu.edu.pl
auth plain
AHVzZXIAcGFzcw==
AHVzZXIAcGFzcw==
is a base64 encoded login and password. For example, you can do this in the following way.
$ echo -n -e '\0user\0pass' | base64
Fortunately, the server will reject our request (regardless of providing correct data). Why?
AUTH PLAIN
authentication?AGR0aW4uMjAxOGxAZ21haWwuY29tAGR0aW5AdWFt
).We establish an encrypted connection with the Gmail server:
$ openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587
ehlo
command changed?We log in to the server
ehlo smtp.gmail.com
auth plain
AGR0aW4uMjAxOGxAZ21haWwuY29tAGR0aW5AdWFt
Then we send the message to your teacher just like in the original SMTP protocol:
mail from: <dtin.2018l@gmail.com>
rcpt to: <bikol@wmi.amu.edu.pl>
data
Enter the message (do not forget about the period at the end)
Date: 30 Jan 18 21:21:21
From: dtin.2018l@gmail.com
To: rmiw@amu.edu.pl
Subject: subject
message
.
We finish the session with the quit
command.
To create an OpenPGP key, use the gpg
command. The default values of most parameters are appropriate. Please enter correct data (name, surname and email address) - this will be needed for the homework.
$ gpg --gen-key
The next step will be to add the generated key to the server (instead of 3303CE03
insert your key id):
$ gpg --send-keys --keyserver keyserver.ubuntu.com 3303CE03
Basic tasks are checked automatically, hence it is important to send to the appropriate address and keep the indicated message title. Email bikol@wmi.amu.edu.pl is a completely different email account than bikol@amu.edu.pl (how to check it?).
The results of tasks are available in the text file at http://kino.vm.wmi.amu.edu.pl/dtin/######.txt, where ###### is a six-digit student index number.
Send an e-mail from a given, non-existent address (test@test.pl) and with a retrospective date (January 1, 2000) to the address bikol@wmi.amu.edu.pl. Message title: “[DTIN] Z2.1 ######”, where ###### is a six-digit student index number.
Send a digitally signed e-mail by OpenPGP using the OpenPGP certificate generated during classes to bikol@wmi.amu.edu.pl. Message title: “[DTIN] Z2.2 ######”, where ###### is a six-digit student index number. The signature of the message should be placed in the attachment.
Send an encrypted by OpenPGP e-mail to bikol@wmi.amu.edu.pl using the certificate with key ID : 3303CE03
. Message title: “[DTIN] Z2.3 ######”, where ###### is a six-digit student index number.
You need to write a bash script reading an e-mail (in a student-defined form) from a given mailbox and then executing the message’s content as a Bash shell command. The result of calling these commands should also be sent back as an e-mail. The script should be run regularly, eg every minute using the cron
utility. The whole should be implemented on the student virtual machine.
Useful tools:
cron
fetchmail
procmail
ripmime
bash
sendemail