Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 4.3: Hashing Previously we covered the use of hashing in relation of password security. Hashing is a one way transformation of data into a

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Lab 4.3: Hashing Previously we covered the use of hashing in relation of password security. Hashing is a one way transformation of data into a fixed sized output, or hash, representing the integrity of that data. Each hashing algorithm has its own output length. For example, the MD5 hashing algorithm uses an output length of 16 bytes, and SHA-1 uses an output length of 20 bytes. A collision occurs in a hashing algorithm when two completely unique pieces of data are passed as input to the algorithm, which results in the same hash. Increasing the output length of the hashing algorithm allows for more unique hashes and should decrease the chance of a collision if it well written and well tested Task 1: Introduction to Hashing Tools and File Integrity Validation 1. Various hashing tools are available in your Kali Linux such as md5sum, sha1sum, and sha256sum, which can take a file as input and create a hash. Each hashing algorithm has a fixed length output, as shown in table below. Start Kali Linux VM and open Terminal. 2. Type the command shown in below screenshot, it will take you to particular folder. root@kali: \# cd/root/Labs/401.4/hash_lab 3. Type the command shown in below screenshot and press Enter. root(dkali: / Labs/401.4/hash_lab\# ls Apache Check.py f1lo1.txt stored hash 4. You can file.txt file in above screenshot. Now type the command shown in below screenshot. root@kali: /Labs/401.4/hash_lab\# cat filel.txt This is a file! As you can see, the file simply contains the sentence, "This is a file!". 5. Now you will run the file through a couple hashing algorithm tool by typing the command shown in below image. \[ \begin{array}{l} \text { root@kal1: } \sim / \text { Labs/401.4/hash_labA md5sum 3e4e987714352d113fo0f3f7f742ed Run the same command, and you should get the same result. Type "md5sum tag, as shown below.

A hash has been calculated against this page in its current state and is used in the 491.4 hash lab. If a single letter is changed in this document it should be detected! /p body > ht mi> After adding the word "DEFACED" as shown, click Save on the right and finally the X at the top-right corner of the gedit window. 8. Go back to the Terminal window running the "python Apache_Check.py" script, and you should see the following result: ALERT!!!!!!!1!! HASH MISMRTCHED!!!!!1!!!!!!!! Bad file copled to /root/Labs/401.4/hash_lab/mismatched.htmll Try runhing: diff mismatched.html stored_hash/index.html The script detected the change to the index.html file after you added the word "DEFACED". It also says that it copied the bad index html file to a filled called 'mismatched.html' 9. Try running the diff command as indicated in the output. The diff tool simply compares two files and prints out the difference between them. Verify that the file "mismatched.html" exists in your "/root/Labs/401.4/hash_lab" folder by typing 1s and pressing Enter, as shown here. reotekali: / Labs/401.4/hash_lab\# ls Apache_Check.py filel.txt mismatched.html stored hash Next, type "diff mismatched.html stored_hash/index.html" and press Enter, as shown. As you can see, the word "DEFACED" displays. Some of the output may differ on your screen. Lab 4.3: Hashing Previously we covered the use of hashing in relation of password security. Hashing is a one way transformation of data into a fixed sized output, or hash, representing the integrity of that data. Each hashing algorithm has its own output length. For example, the MD5 hashing algorithm uses an output length of 16 bytes, and SHA-1 uses an output length of 20 bytes. A collision occurs in a hashing algorithm when two completely unique pieces of data are passed as input to the algorithm, which results in the same hash. Increasing the output length of the hashing algorithm allows for more unique hashes and should decrease the chance of a collision if it well written and well tested Task 1: Introduction to Hashing Tools and File Integrity Validation 1. Various hashing tools are available in your Kali Linux such as md5sum, sha1sum, and sha256sum, which can take a file as input and create a hash. Each hashing algorithm has a fixed length output, as shown in table below. Start Kali Linux VM and open Terminal. 2. Type the command shown in below screenshot, it will take you to particular folder. root@kali: \# cd/root/Labs/401.4/hash_lab 3. Type the command shown in below screenshot and press Enter. root(dkali: / Labs/401.4/hash_lab\# ls Apache Check.py f1lo1.txt stored hash 4. You can file.txt file in above screenshot. Now type the command shown in below screenshot. root@kali: /Labs/401.4/hash_lab\# cat filel.txt This is a file! As you can see, the file simply contains the sentence, "This is a file!". 5. Now you will run the file through a couple hashing algorithm tool by typing the command shown in below image. \[ \begin{array}{l} \text { root@kal1: } \sim / \text { Labs/401.4/hash_labA md5sum 3e4e987714352d113fo0f3f7f742ed Run the same command, and you should get the same result. Type "md5sum tag, as shown below.

A hash has been calculated against this page in its current state and is used in the 491.4 hash lab. If a single letter is changed in this document it should be detected! /p body > ht mi> After adding the word "DEFACED" as shown, click Save on the right and finally the X at the top-right corner of the gedit window. 8. Go back to the Terminal window running the "python Apache_Check.py" script, and you should see the following result: ALERT!!!!!!!1!! HASH MISMRTCHED!!!!!1!!!!!!!! Bad file copled to /root/Labs/401.4/hash_lab/mismatched.htmll Try runhing: diff mismatched.html stored_hash/index.html The script detected the change to the index.html file after you added the word "DEFACED". It also says that it copied the bad index html file to a filled called 'mismatched.html' 9. Try running the diff command as indicated in the output. The diff tool simply compares two files and prints out the difference between them. Verify that the file "mismatched.html" exists in your "/root/Labs/401.4/hash_lab" folder by typing 1s and pressing Enter, as shown here. reotekali: / Labs/401.4/hash_lab\# ls Apache_Check.py filel.txt mismatched.html stored hash Next, type "diff mismatched.html stored_hash/index.html" and press Enter, as shown. As you can see, the word "DEFACED" displays. Some of the output may differ on your screen

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions