2019 oplossingen Testexamen - Lars Lemmens

Met dank aan de Github van Martijn en natuurlijk Lars Lemmens

Exercise 1

Create a CLI oneliner to match all words with 14, 15 or 16 unique letters. The output shouldlook like:

Words with 14 letters: EHBO-diploma's bruiloftsdagen katrolschijven verontschuldig ...
Words with 15 letters: dampkringslucht sandwichformule ...
Words with 16 letters: ...
'user@:~$'for foo in 14 15 16; do echo "Words with $foo letters:" $(grep -vP '(.).*\1' /usr/ share/dict/dutch | grep -P "^.{$foo}$");done

Exercise 2

Create a linux CLI oneliner to extract an overview of the different FTP usernames in the file ftp_bruteforce.pcap. Only the commands tshark and sort are allowed.

'user@:~$' • tshark -r ftp_bruteforce.pcap -Y 'ftp.request.command == USER' -T fields -e ftp.request.arg |sort -u

Exercise 3

Create a oneliner to show ‘Time = 15:44:25 (11/10/1901)' or 'Time = 15:44:25 (11-10-1901)’ each time with the current time and date.

'user@:~$' • date '+Time = %X (%x)'

Exercise 4

Create a linux CLI oneliner to decode the following string ‘RGUgcHVudGVuIG9wIGRlemUgdnJhYWcgemlqbiBhbCBiaW5uZW4uCg==’. (/home/logs/secret)

'user@:~$' • cat /home/logs/secret | openssl enc -a -d

Exercise 5

Create a CLI oneliner using openssl to retrieve the certificate of the server wiki.uclllabs.beand to display only it’s fingerprint, serial and public key.Sample output:

SHA1 Fingerprint=8C:CB:D9:A1:F3:3C:78:C2:2E:F6:EB:1C:CD:4B:F3:39:1B:9A:EE:4Eserial=0966DB4115B74092EE07D6DA585547D8-----BEGIN PUBLIC KEY-----MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2NHdNb3iWbb7mx9UFYzbv05YvUe+uBD8IunSnpj4SSol+5RG5EKZhFAcXwH9FCUxXE7ZZP3FDLNG0qG8cLSHjg==-----END PUBLIC KEY-----
'user@:~$'echo | openssl s_client -connect wiki.uclllabs.be:443 2>/dev/null | openssl x509 -noout -fingerprint -serial -pubkey

Revision #1
Created 17 June 2021 14:16:30 by Jasper G.
Updated 3 December 2021 22:13:09 by Jasper G.