Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Effective Python Penetration Testing

You're reading from   Effective Python Penetration Testing Pen test your system like a pro and overcome vulnerabilities by leveraging Python scripts, libraries, and tools

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785280696
Length 164 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rejah Rehim Rejah Rehim
Author Profile Icon Rejah Rehim
Rejah Rehim
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Python Scripting Essentials FREE CHAPTER 2. Analyzing Network Traffic with Scapy 3. Application Fingerprinting with Python 4. Attack Scripting with Python 5. Fuzzing and Brute-Forcing 6. Debugging and Reverse Engineering 7. Crypto, Hash, and Conversion Functions 8. Keylogging and Screen Grabbing 9. Attack Automation 10. Looking Forward

Dictionary attack


Tests with all possible passwords begin with words that have a higher possibility of being used as passwords, such as names and places. This method is the same as we did for injections.

We can read the password from a dictionary file and try it in the application as follows:

with open('password-dictionary.txt') as f: 
    for password in f: 
        try: 
                # Use the password to try login 
  
                print "[+] Password Found: %s" % password 
                break; 
        except : 
                print "[!] Password Incorrect: %s" % password 

Here we read the dictionary file and try each password in our script. When a specific password works it will print it in the console.

Tip

You can download the whole list of fuzz database here: https://github.com/fuzzdb-project/fuzzdb.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime