Spaces:
Build error
Build error
import streamlit as st | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
from wordlist_generator import generate_wordlist # A mock-up function for your project | |
from dotenv import load_dotenv | |
import os | |
load_dotenv() # Load environment variables from .env file | |
access_token = os.getenv("HUGGINGFACE_ACCESS_TOKEN") | |
# Page configuration | |
st.set_page_config(page_title="ReconNinja Wordlists", page_icon="💬", layout="wide") | |
# Header section | |
st.title("💬 ReconNinja Wordlists") | |
st.subheader("Tailored wordlists for efficient penetration testing") | |
st.markdown( | |
""" | |
This application generates customized wordlists for use in network reconnaissance and penetration testing. | |
Adjust the parameters to generate wordlists suited for your specific testing scenario. | |
""" | |
) | |
# Sidebar for user input | |
st.sidebar.header("Customize Your Wordlist") | |
st.sidebar.markdown( | |
""" | |
Adjust the following parameters to create wordlists optimized for your penetration testing tasks. | |
""" | |
) | |
# Wordlist customization settings | |
wordlist_size = st.sidebar.slider("Wordlist Size", min_value=50, max_value=10000, value=1000, step=50) | |
min_length = st.sidebar.slider("Minimum Word Length", min_value=3, max_value=12, value=6) | |
max_length = st.sidebar.slider("Maximum Word Length", min_value=3, max_value=12, value=8) | |
include_special_chars = st.sidebar.checkbox("Include Special Characters", value=False) | |
include_numbers = st.sidebar.checkbox("Include Numbers", value=True) | |
# Display wordlist generation results | |
st.header("Generated Wordlist Preview") | |
# Call to a mock-up function for wordlist generation (you will replace this with your actual logic) | |
wordlist = generate_wordlist( | |
size=wordlist_size, | |
min_length=min_length, | |
max_length=max_length, | |
special_chars=include_special_chars, | |
numbers=include_numbers | |
) | |
# Display the first 20 items in the wordlist | |
st.write(f"Preview of {wordlist_size} words:") | |
st.write(wordlist[:20]) # Show the first 20 words for brevity | |
# Download link for the full wordlist | |
st.markdown("### Download Full Wordlist") | |
csv_data = pd.Series(wordlist).to_csv(index=False).encode() | |
st.download_button( | |
label="Download Wordlist as CSV", | |
data=csv_data, | |
file_name="reconninja_wordlist.csv", | |
mime="text/csv" | |
) | |
# Visualize wordlist statistics (for example, word length distribution) | |
st.header("Wordlist Statistics") | |
word_lengths = [len(word) for word in wordlist] | |
word_length_df = pd.DataFrame(word_lengths, columns=["Word Length"]) | |
# Create a histogram to show the distribution of word lengths | |
fig, ax = plt.subplots(figsize=(8, 6)) | |
sns.histplot(word_length_df["Word Length"], kde=True, bins=20, ax=ax) | |
ax.set_title("Word Length Distribution") | |
ax.set_xlabel("Word Length") | |
ax.set_ylabel("Frequency") | |
st.pyplot(fig) | |
# Advanced Feature - Analyzing Wordlist Security | |
st.header("Analyze Wordlist Security") | |
# Slider for password entropy calculation | |
entropy_slider = st.slider( | |
"Select Entropy Multiplier", | |
min_value=1.0, | |
max_value=10.0, | |
value=3.0, | |
step=0.1 | |
) | |
# Simulate password entropy calculation (simple calculation for demonstration) | |
entropy = np.log2(len(wordlist) ** entropy_slider) | |
st.write(f"Estimated Entropy: {entropy:.2f} bits") | |
# Showcase a mock security analysis (this would be expanded in your actual app) | |
if entropy < 50: | |
st.warning("Low entropy detected! This wordlist might be vulnerable to brute-force attacks.") | |
else: | |
st.success("Good entropy! This wordlist is secure against most brute-force attempts.") | |
# Footer | |
st.markdown("---") | |
st.markdown( | |
"Made with ❤️ by Canstralian. For more information on ReconNinja, visit our [GitHub](https://github.com/Canstralian)." | |
) | |