File size: 2,584 Bytes
b6b30ff
 
e9c162a
b6b30ff
 
e9c162a
 
 
 
b24a33b
b6b30ff
e9c162a
b6b30ff
 
 
 
 
e9c162a
b6b30ff
b24a33b
d1afbb4
b24a33b
e9c162a
b24a33b
d1afbb4
b6b30ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e9c162a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b6b30ff
 
26da11f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import streamlit as st
from components.passbeaker import PasswordCracker
import io

def crack_password(password_hash, wordlist_file, algorithm, salt, parallel, complexity, min_length, max_length, character_set, brute_force):
    # Сохранение содержимого загруженного файла в локальную переменную
    wordlist_content = wordlist_file.read().decode("latin-1")
    
    # Создание экземпляра PasswordCracker
    cracker = PasswordCracker(
        password_hash=password_hash,
        wordlist_file=wordlist_content,
        algorithm=algorithm,
        salt=salt,
        parallel=parallel,
        complexity_check=complexity
    )
    
    if brute_force:
        cracker.crack_passwords_with_brute_force(min_length, max_length, character_set)
    else:
        cracker.crack_passwords_with_wordlist()
    
    return cracker.get_statistics()

def main():
    st.title("GVA Password Cracker")

    st.sidebar.header("Settings")
    password_hash = st.sidebar.text_input("Password Hash")
    wordlist_file = st.sidebar.file_uploader("Upload Wordlist File", type=['txt'])
    algorithm = st.sidebar.selectbox("Hash Algorithm", ["md5", "sha1", "sha256", "sha512"])
    salt = st.sidebar.text_input("Salt (optional)")
    parallel = st.sidebar.checkbox("Use Parallel Processing")
    complexity = st.sidebar.checkbox("Check for Password Complexity")
    min_length = st.sidebar.number_input("Minimum Password Length", min_value=1, value=1)
    max_length = st.sidebar.number_input("Maximum Password Length", min_value=1, value=6)
    character_set = st.sidebar.text_input("Character Set", "abcdefghijklmnopqrstuvwxyz0123456789")
    brute_force = st.sidebar.checkbox("Perform Brute Force Attack")

    if st.sidebar.button("Crack Password"):
        if wordlist_file:
            cracking_spinner = st.spinner("Cracking...")
            with cracking_spinner:
                stats = crack_password(
                    password_hash=password_hash,
                    wordlist_file=wordlist_file,
                    algorithm=algorithm,
                    salt=salt,
                    parallel=parallel,
                    complexity=complexity,
                    min_length=min_length,
                    max_length=max_length,
                    character_set=character_set,
                    brute_force=brute_force
                )
            st.success(stats)
            st.balloons()
        else:
            st.error("Please upload a wordlist file.")

if __name__ == "__main__":
    main()