Final exam Fall 2025#
Date: 12/16/2025, 6:40 pm - 9 pm.#
Number of exercises: 4. Each exercise has a maximum score.
In home directory of user hostadm, you need to create a new subdirectory, FINAL and a file within it, answers.txt, where you will be writing answers to the exam exercises.
In the file, first, put your name, then proceed with answering to the questions below.
All the exercises should be done on the virtual desktop (VD).
1. Code compilation and Makefile (max score 4)#
In directory FINAL, download a tar ball archive, containing two source codes, a header file, and a data file in it, from http://linuxcourse.rutgers.edu/Files/C_integrals.tgz
A) Copy file c_integrals_test.c into new file run.c.
Compile run.c and c_integrals.c together. Run the executable.
B) In the same directory, create a Makefile with targets:
to build library
libc_integrals.afromc_integrals.ccompile
run.cwith the above library into executablerun.xtarget ‘clean’ to remove compilation artifacts.
C) run
make
make clean
Check if the binary file, run.x, exists in the installation directory and runs fine.
2. Shell scripting (max score 6)#
In directory FINAL on the desktop, create a shell script,
params.sh,
A) to replace the values assigned to variables m, n, and test_num in file run.c with the ones defined in file params.dat.
Hint: source file params.dat and use command sed -E to replace the regular expression paterns matching the variable assignment, including spaces and any integer numbers, with the values defined in params.dat .
In the extended regular expressions, any integer number can be matched with [0-9]+ and any number of empty spaces with \s*.
Command sed can read the input from file c_integrals_test.c and save the updated content into file run.c. For multiple replacements with one sed command, use multiple -e replacement options.
B) Modify the script by adding command make and executing run.x
3. Python scripting (max score 6)#
Implement parts A and B from the exercise #2 in Python.
Hint: Use modules re and subprocess only
4. Password cracking (max score 4)#
Download file http://linuxcourse.rutgers.edu/Files/user_passwords.txt into directory FINAL.
Crack the password hashes of the 3 users in the file. Show the user passwords.