Lab 1 Setting up ssh

cat ~/.ssh/id_rsa.pub | ssh @HOST "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"







1. SSH config for VM unclear if it is completed need lab 1

2.1 Fixed Hosts --done

2.2  
sudo apt-get install resolvconf
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
sudo systemctl status resolvconf.service

sudo nano /etc/resolvconf/resolv.conf.d/head

make edits
nameserver 8.8.8.8

save
reboot 0

cat /etc/resolv.conf  should have edits

2.3 Knowledge of Apt

3 Install Apache

install synaptic search apache2
install apache 

or sudo apt install apache2


3.2 Install Mysql
-install from apt use password given

3.3 install php

sudo apt update
sudo apt install php libapache2-mod-php

sudo systemctl restart apache2

check: firefox localhost/group.php

3.4
gedit /etc/sudoers
serveroperator ALL=(ALL) /sbin/reboot 
serveroperator ALL=(ALL) /sbin/service apache2 restart



Eval
cat /etc/resolv.conf   ---> contains 8.8.8.8

cat /etc/hosts ---> contains correct hostname

mysql -u root –p  --> works with password

firefox localhost/group.php ---> works

su serveroperator  ---> exists
sudo reboot 0 ---> works as serveroperator
sudo service apache2 restart ---> works as serveroperator



Lab 3
1 . 
sudo apt install openssl dhex

2.1 (no submission) “openssl enc <ciphertype> -e -in plain.txt -out cipher.bin -k <key_string> -iv <iv_string>”


2.2
Get IU image: 
wget https://git.pluricorp.com/dfpena/jack/raw/master/iu.bmp
-aes-128-cbc
-aes-128-ecb



ls - l 4320122

head -c 54 iu.bmp > cbc.bmp
head -c 54 iu.bmp > ecb.bmp

openssl enc -aes-128-cbc -e -in iu.bmp -out cbc.bin -k jacks 
openssl enc -aes-128-ecb -e -in iu.bmp -out ecb.bin -k jacks

tail -c 4320068 cbc.bin >> cbc.bmp
tail -c 4320068 ecb.bin >> ecb.bmp


sudo mv ecb.bmp /var/www/html/ecb.bmp
sudo mv cbc.bmp /var/www/html/cbc.bmp


CBC looks like white noise in the shape of the old image
EBC You can see the structure of the underlying image

2.3

openssl enc -aes-128-cbc -e -in test.txt -out cbc.bin -k jacks 
openssl enc -aes-128-ecb -e -in test.txt -out ecb.bin -k jacks
openssl enc -aes-128-ofb -e -in test.txt -out ofb.bin -k jacks 


