Advertisement
Guest User

CNW2 praktijkexamen

a guest
Jul 29th, 2017
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.02 KB | None | 0 0
  1. // Test 22/05/2017
  2.  
  3. 1) #Give a list of all words with 14, 15 or 16 unique letters. The output format should look like this:
  4. Words with 14 letters: word1 word2 word3
  5. Words with 15 letters: word4 word5
  6. ...
  7.  
  8. for n in 14 15 16; do echo "Words with $n letters:" $(grep -P "^.{$n}$" dutch | grep -vP '(.).*\1'); done
  9.  
  10. 2) #Give a list of the usernames tried in ftp_bruteforce.pcap. You can only use tshark and sort
  11.  
  12. tshark -r ftp_bruteforce.pcap -Y 'ftp.request.command == USER' -T fields -e ‘ftp.request.arg’ | sort -u
  13.  
  14. 3) #Give the current time (format: Time= hh:mm:ss (dd-mm-yyyy))
  15.  
  16. echo 'Time=' $(date +'%T (%x)') | tr / -
  17.  
  18. 4) #Write a oneliner to decode the following file "secret" (contents: RGUgcHVudGVuIG9wIGRlemUgdnJhYWcgemlqbiBhbCBiaW5uZW4uCg==)
  19.  
  20. #The file ends with '==' indicating base64 padding:
  21. openssl enc -d -base64 < secret
  22.  
  23. 5) #Write a oneliner to display the fingerprint, serial and public key of wiki.uclllabs.be
  24.  
  25. echo | openssl s_client -connect wiki.uclllabs.be:443 2>/dev/null | openssl x509 -fingerprint -serial -pubkey -noout
  26.  
  27.  
  28. // Test 24/05/2017
  29.  
  30. 1) #There is a website running - https://darthvader.uclllabs.be/nw2/lab1 - which is only accessible from 193.191.177.1. That is the IP address of leia.uclllabs.be. Create an ssh tunnel between server leia and the webserver darthvader
  31.  
  32. ssh -L 10000:darthvader.uclllabs.be:443 user@leia.uclllabs.be -p 22345
  33.  
  34. 2) #Give a list of words with 5 letters that are also palindromes.
  35.  
  36. grep -P '^(.)(.).\2\1$' dutch
  37.  
  38. 3) #Show the file /etc/debconf.conf on screen without comment lines (i.e. lines starting with a #).
  39.  
  40. grep -vP '^#' /etc/debconf.conf
  41.  
  42. 4) #Give a list of the usernames tried in ftp_bruteforce.pcap. You can only use tshark and sort
  43.  
  44. tshark -r ftp_bruteforce.pcap -Y 'ftp.request.command == USER' -T fields -e ‘ftp.request.arg’ | sort -u
  45.  
  46. 5) #Write a oneliner to display the fingerprint, serial and public key of wiki.uclllabs.be
  47.  
  48. echo | openssl s_client -connect wiki.uclllabs.be:443 2>/dev/null | openssl x509 -fingerprint -serial -pubkey -noout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement