You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: ...
for name [ [ in [ word ... ] ] ; ] do list ; done
The list of words following in is expanded, generating a list of items. The variable name is set
to each element of this list in turn, and list is executed each time. If the in word is omitted,
the for command executes list once for each positional parameter that is set (see PARAMETERS
below). The return status is the exit status of the last command that executes. If the expansion
of the items following in results in an empty list, no commands are executed, and the return
status is 0.
echo displays a line of text
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.
The -T fields -e is used to specify the fields you want to show
The sort command is used to sort lines of text files
The -u command is used to show the output of only the first of an equal run
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)'
The date command prints or sets the system date and time
The +Time is used to set time
The %X command is used to set the systems time
The %x command is used to set the date -> with () is used to put () around the date
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
The cat command is used to concatenate files and print on the standard output
The enc command is used to encrypt or decrypt a file
The -a command is used if encryption is taking place the data is base64 encoded after encryption. If decryption is set then the input data is base64 decoded before being decrypted
The -d command is used to decrypt
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-----