Lecture slides: here
Introduction to lab environment, accounts setup, working with virtual systems in the lab, review of the Linux system basics
The script you create in this task will be assessed from a viewpoint of a system administrator, whose task is to keep the network secure and find all user-created servers. It is not enough to run the script just once (some servers may be temporarily switched off and will not be reported by scanning), but rather run it from time to time to report all suspicious servers in a local network.
For testing purposes, a following cSMTP onversation may be used:
220 cyber.ict.pwr.wroc.pl ESMTP Sendmail 8.9.3 Mon, 17 Apr 2000 21:00:00 +0200 (MET DST) ehlo okapi.ict.pwr.wroc.pl 250-cyber.ict.pwr.wroc.pl Hello ts@okapi [156.17.42.30], pleased to meet you mail from: <santa@heaven.org> 250 <santa@heaven.org>... Sender ok rcpt to: <xx@cyber.ict.pwr.wroc.pl> 250 <xx@cyber.ict.pwr.wroc.pl>... Recipient ok rcpt to: <zxcvbnm@heaven.org> 550 <zxcvbnm@heaven.org>... User not local, go awayThe 550 error in the above example means, that the server is not an open relay (it rejected mail being relayed through it). If the attempt to send non-local mail resulted in "250 ..." or "252 ..." answer code (the same as for the preceding xx@cyber.ict.pwr.wroc.pl recipient address), the server would be declared to be an open relay.
Create CA, create server certificate, sign it with CA,install apache to use this certificate
Create user certificates, configure server to use them to allow access to some directories based on identity of a client, checked by the client certificate. Provide also some common directory for all clients signing with certificates issued by your CA.
Download a binary application from this directory. Add execution bit (chmod a+x keygen-en) and run it. If you give user number "0" and password "12345678" it will say that "you passed". If user number is other than zero, the password is not so simple :-)
Your task is to find out what password should be entered if you give your student ID number as user ID.
Use the gnu debugger (gdb) or other tools (maybe some code de-compilers?) to find out what this program does, how the password is generated. The program does not have a symbol table, so in order to start it under the debugger, set breakpoint to:
break __libc_start_mainthen
runto start the program and catch it when it enters the
main
function. Another useful gdb command to use:
set disassemble-next-line onThis will automatically disassemble few next lines every time the gdb stops program. At any time you may also issue
disassemble
command to see disassembled code of the sorrounding area, and use commands such as
si
(step instruction)
or
ni
(next instruction)
to do step-by-step program execution to find how it works.
Also, remember about the
p
or
print
commands to inspect variables and registers, and
x
command to inspect the memory at a given address.