a1895129_Assignment 1 - Copy (3)

.docx

School

The University of Adelaide *

*We aren’t endorsed by this school

Course

3308

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

9

Uploaded by UltraWillpower13250

Report
Assignment 1 Yuvraj Kaushal A1895129 So I accessed the hacklab using SSH . Q1- There is a secret passphrase embedded in the file called "text" in the folder /home/student/linux_basics/q01. The secret can be found   following   the line that begins with the word " And " and ends with " it ". Use grep with regular expression to locate this line and the line following it. What is the passphrase? A1- So for this I used the expression: grep -A1 ‘And.*it$’ test.txt. And the output I got was: And give't Iago: what he will do with it But there are may different expressions that can be used: Grep -G ^And*it$ test.txt Grep -G ^And\ .*it$ test.txt Q2- In the folder /home/student/linux_basics/q02, there is a file called " here.txt " that contains passphrases. Find the passphrase that occur exactly   14 times .   A2- I used the following expression to get the result: sort here.txt | uniq -c | grep 14 The output I got was: zamite_{iarovised-sabadilla-rabrubia} Q3-There are lots of files in /home/student/linux_basics/q03. What is the name of the file whose SHA256 sum is 3f41458e7eb61c3e5a97f5246b70fb2409376c47b6fe4e7762d443b563eb7291? A3- For this I used the command: find -type f -exec sha256sum {} + | grep 3f41458e7eb61c3e5a97f5246b70fb2409376c47b6fe4e7762d443b563eb7291
And I also used Sha256sum * | grep 3f41458e7eb61c3e5a97f5246b70fb2409376c47b6fe4e7762d443b563eb7291 | awk ‘{ system(“cat “ $2); printf(“file is %s\n”, $2) }’ From both I got the result: zamite_{aduro-glorior-fortitudo} Q4- Generate a list of passwords from the source file words.txt. Use "l33t" conversion so that a=>4, e=>3, i=>1, and o=>0. For example "hello world" becomes "h3ll0 w0rld". There is a file encrypted using gpg (Gnu Privacy Protection) under /home/student/linux_basics/q04, using the command gpg -c --batch --passphrase <pass>. Unfortunately, we have forgotten the password. Use the "l33t" converted password list to brute-force the encrypted file .   This may take a few minutes.   Please provide both the correct password and the content of the decrypted file . A4- The command used for this is: for passphrase in $(cat words.txt | tr 'aeio' '4310'); do if gpg --batch --passphrase "$passphrase" -d secretkey.txt-gpg G> /dev/null; then echo "Success with passphrase: $passphrase" break; fi; done The correct password is : 03vrc0nf1d3nt and the content is : zamite_{Gaudium-frumentum- incomposite} Q5-Find the flag hidden (encoded?) in the file /home/student/linux_basics/q05/secret.txt. Looks like the cyber.py (Hint: the file cyber.py was used to generate the file...) A5- The command I used for this is: flag="" Flag= “ “ for i in $(cat secret.txt); do temp=$(echo $i | cut -c 1-4);((10#$temp));flag+=$(echo $i | cut -c $((10#$temp+6))-$((10#$temp+6))); done
flag The result I got is: zamite_{impedit-lacrimosus-medius} Q6-There are lots of sub-directories and files under Q06. Find the file containing the secret. The file has size of exactly 47 bytes long.   A6- I used find and size flag to the result: Find -size 47c Well I forgot to find whats written inside the secret.txt so I opened hacklab and did it like this The result I got is: Secret.txt and zamite_{mestitia-tyrannizes- pseudoneuropteran} Q7-Execute /home/student/linux_basics/q07/a.out and try to guess the secret.   A7- Well we use .out for compiled files so I used strings a.out to printed out the human readable part. The result I got is: zamite_{sautoires-nonnullusi-sobbing} Q8-There is an encoded secret in /home/student/linux_basics/q08 folder. Decode to get the secret. A8- I used the cat command on secret.enc and found out the encoding looked similar to that of base64 and then I used the command: cat secret.enc | base64 -d
The result I got is: zamite_{opartnery-palegold-turbatuses} Crypto Q1-Go to /home/student/crypto/q01 on the HacklabVM (either via the graphical interface or via SSH). The file secret.txt.enc has been "encrypted" using this simple crypter code below (see mycrypto.py in the same directory). "Decrypt" the file and find the secret. Is this a good encryption? What is the key space? A1- So the first thing that I did was I ran: python mycrypto.py secret.txt.enc in order to get the reencoded file and then used the: cat secret.txt.enc.enc The secret is: zamite_{valetudo-werumensium-banqueteer} When we talk about the encryption it’s 64bit enc which is considered as one of the most secure encryption method. Q2-   Go to /home/student/crypto/q01 on the HacklabVM (either via the graphical interface or via SSH). The file secret.txt.enc has been "encrypted" using this simple crypter code below (see mycrypto.py in the same directory). "Decrypt" the file and find the secret. Is this a good encryption? What is the key space? A2- Using the code provided in the workshop:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help