nmap / GVA_gui.py
enotkrutoy's picture
Update GVA_gui.py
b7c1b6a verified
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()