- Write a Python script to perform a dictionary attack on a Linux password file.
- Copy /etc/shadow file to your local directory. Study the format of this file.
- Add the following 3 lines to the /etc/shadow file. For speed purposes remove all other lines.
tommy:$6$HFQQdE2g$g0eyz6UN.c4Pg1tiQgdPPPXdQ1fEOwttCwzSah/Jo4RE9Eac4H7pgksaNLI/WSIyN8tNtCX4NaAq6Uwz.o.4W1:17400:0:99999:7:::
mathis:$6$niptplk1$.mMMVx4T375WhFkDN5RWEaD93HcmDCx3aBQrn2ZalbiRpl4FB2Rww/BeCPEfSYbegjPvoHM2llQmk/VBbSxWj.:17400:0:99999:7:::
tristan:$6$MWwusFJx$KCoO1wiWKtE.7j/7UiwD.1jXmOckMb5X4GGt1DotLS0laXdFga5n3wGfu43FC/Opxki7mY6Yf9XT.cBGN.pkp0:17400:0:99999:7:::
- Use the “crypt” library crypt function to create your hash.
- Use the “hmac” library compare_hash function to compare hashes from the /etc/shadow file to the hashes produced from your guesses.
- Use the string split() function to separate the separate the password lines from the shadow file by the ‘:’ delimiter to isolate the userid and the hash from an entry in the shadow file.
- Calculate the appropriate hash (using the method specified for the entry from the shadow file) for each word in this wordlist (http://www.openwall.com/passwords/wordlists/password-2011.lst (Links to an external site.)), compare the hash, and stop comparing when you find a match.
- Attempt the dictionary attack for each entry in the shadow file.
- Remember you need to provide the word from the dictionary, the method, and the salt to the crypt() function.
- Print the userid and password when a match is found:
“Match found for userid [userid]. Password = [password]” - Print the “No match was found for [userid]” when there no match in the dictionary.
UPDATE: Your program should run with the following command line:
>> python3 dictionary.py [shadow filename] [dictionary filename]
“CUSTOM PAPER”
QUALITY: 100% ORIGINAL – NO PLAGIARISM
(USA, AUS, UK & CA PhD. Writers)
CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS
About Our Service
We are an online academic writing company that connects talented freelance writers with students in need of their services. Unlike other writing companies, our team is made up of native English speakers from countries such as the USA, UK, Canada, Australia, Ireland, and New Zealand.
Qualified Writers
- At ClassicWritersBay.com, most of our writers are degree-holding native speakers of English who are familiar with various writing styles. Our writers are proficient in many fields, including Economics, Business, Accounting, Finance, Medicine, Chemistry, Literature, Mathematics, Statistics, and many others.
- Making our customers happy is an important part of our service. So do not be surprised if you get your paper well before the deadline!
- We pay a lot of attention to ensuring that you get excellent customer service. You can contact our Customer Support Representatives 24/7. When you order from us, you can even track the progress of your paper as it is being written!
- We are attentive to the needs of our customers. Therefore, we follow all your instructions carefully so that you can get the best paper possible.
- It matters to us who writes for you, and we are serious about selecting the best candidates.
- Our writers are always learning something new, so they are familiar with the latest developments in the scientific world and can write papers with updated information and the latest findings.
Our Guarantees:
- Quality original papers that follow your instructions carefully.
- On time delivery – you get the paper before the specified deadline.
- Attentive Customer Support Representatives available 24/7.
- Complete confidentiality – we do not share you details or papers with anybody else.