File size: 2,254 Bytes
b7c1b6a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import cowsay
from components.passbeaker import PasswordCracker

# Функция для имитации взлома пароля
def crack_password(password_hash, wordlist_file, algorithm, salt, parallel, complexity, min_length, max_length, character_set, brute_force):
    Cracker = PasswordCracker(
        password_hash=password_hash,
        wordlist_file=wordlist_file,
        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()  # Возвращаем статистику вместо печати

# Интерфейс Streamlit
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"):
        st.spinner("Cracking...")
        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(f"Password Cracked! {stats}")
        st.balloons()

if __name__ == "__main__":
    main()