Spaces:
Sleeping
Sleeping
import streamlit as st | |
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() | |
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"): | |
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(f"Password Cracked! {stats}") | |
st.balloons() | |
if __name__ == "__main__": | |
main() | |