Python Forum
Brute force for CTF (easy one) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Brute force for CTF (easy one) (/thread-24527.html)



Brute force for CTF (easy one) - JokerTux - Feb-18-2020

Hi Guys !

So I m learing python and I found this website "hackthissite.org" and I decided to make some exercises. One of them was to write a python script that takes a list of passwords from a file and compare it to a password given by the site. Becouse hackthisstie is down , I've randomly chosen a password "maniek". I managed to write the script and it works !! But I want only to see the massage " Password Found : <passw>" and not every try to find it.

I will show you the code :

import time

passw = "maniek" 

with open("wordlist.txt", "r") as inside:
    for line in inside:
        line = line.replace("\n", "")
        line = line.replace("\r", "")
        if line == passw:
            print("Password Found : "+ passw)
        else:
            print("Password not found !")
Sorry for my poor english skills. I want to see only the massage "Pass found : " or if its not in there "Password not found !".

Thank you !


RE: Brute force for CTF (easy one) - JokerTux - Feb-18-2020

stupid question sry guys pls delete this ... what a shame ...