-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshield-plus.py
More file actions
188 lines (155 loc) · 7.4 KB
/
shield-plus.py
File metadata and controls
188 lines (155 loc) · 7.4 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import re
from colorama import Fore, Style, init
import requests
import os
import time
import datetime
init(autoreset=True)
def display_banner():
banner = """
╭─────[By 0xSaikat]──────────────────────────────────╮
│ │
│ _____ __ _ __ __ │
│ / ___// /_ (_)__ / /___/ / __ │
│ \__ \\/ __ \\/ / _ \\/ / __ /_/ /_ │
│ ___/ / / / / / __/ / /_/ /_ __/ │
│ /____/_/ /_/_/\\___/_/\\__,_/ /_/ │
│ │
│ │
╰──────────────────────────────[hackbit.org]─────────╯
"""
print(Fore.CYAN + banner + Style.RESET_ALL)
def download_rockyou_file():
url = 'https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt'
response = requests.get(url)
with open('rockyou.txt', 'wb') as file:
file.write(response.content)
def is_password_in_rockyou(password):
if not os.path.isfile('rockyou.txt'):
download_rockyou_file()
with open('rockyou.txt', 'r', encoding='latin-1') as file:
for line in file:
if password == line.strip():
return True
return False
def password_strength(password):
length = len(password)
complexity = 0
suggestions = []
if length >= 8:
complexity += 1
else:
suggestions.append("🔸 " + Fore.YELLOW + "Make your password at least 8 characters long.")
if re.search(r"[a-z]", password):
complexity += 1
else:
suggestions.append("🔸 " + Fore.YELLOW + "Include at least one lowercase letter.")
if re.search(r"[A-Z]", password):
complexity += 1
else:
suggestions.append("🔸 " + Fore.YELLOW + "Include at least one uppercase letter.")
if re.search(r"\d", password):
complexity += 1
else:
suggestions.append("🔸 " + Fore.YELLOW + "Include at least one digit.")
if re.search(r"[!@#$%^&*(),.?\":{}|<>]", password):
complexity += 1
else:
suggestions.append("🔸 " + Fore.YELLOW + "Include at least one special character (e.g., !, @, #, $, etc.).")
if re.search(r"(.)\1{2,}", password):
complexity -= 1
suggestions.append("🔸 " + Fore.YELLOW + "Avoid sequences of the same character (e.g., 'aaa').")
if complexity == 0:
strength = "Very Weak"
color = Fore.RED
emoji = "🔴"
elif complexity == 1:
strength = "Weak"
color = Fore.RED
emoji = "🟠"
elif complexity == 2:
strength = "Moderate"
color = Fore.YELLOW
emoji = "🟡"
elif complexity == 3:
strength = "Strong"
color = Fore.GREEN
emoji = "🟢"
elif complexity == 4:
strength = "Very Strong"
color = Fore.GREEN
emoji = "🟢"
else:
strength = "Excellent"
color = Fore.CYAN
emoji = "🔵"
return f"{color}Password Strength: {strength} {emoji}", suggestions, strength
def save_password(password, description=""):
if not os.path.exists("passwords"):
os.mkdir("passwords")
today = datetime.datetime.now().strftime("%Y-%m-%d")
date_dir = os.path.join("passwords", today)
if not os.path.exists(date_dir):
os.mkdir(date_dir)
timestamp = datetime.datetime.now().strftime("%H-%M-%S")
filename = f"password_{timestamp}.txt"
file_path = os.path.join(date_dir, filename)
with open(file_path, "w") as file:
file.write(f"Password: {password}\n")
if description:
file.write(f"Description: {description}\n")
file.write(f"Date saved: {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
return file_path
def main():
os.system('cls' if os.name == 'nt' else 'clear')
display_banner()
linkedin_saikat = "https://www.linkedin.com/in/0xsaikat/"
hackbit_url = "https://hackbit.org"
link_saikat = f"\033]8;;{linkedin_saikat}\033\\@0xSaikat\033]8;;\033\\"
link_hackbit = f"\033]8;;{hackbit_url}\033\\hackbit.org\033]8;;\033\\"
while True:
user_password = input(Fore.GREEN + "🔑 Enter your password to check its strength (or press 'q' to quit): " + Style.RESET_ALL)
if user_password.lower() == 'q':
print(Fore.CYAN + "Goodbye! 👋")
break
print()
if is_password_in_rockyou(user_password):
print(Fore.RED + "[+] " + Style.RESET_ALL + "Your password is weak and exposed on the internet...!")
secure_choice = input(Fore.RED + "[+] " + Style.RESET_ALL + "Do you want to secure your password and make it strong (yes/no)? " + Style.RESET_ALL)
if secure_choice.lower() == 'yes':
print("\n🔸 Use a mix of uppercase and lowercase letters.")
print("🔸 Include at least one digit.")
print("🔸 Add special characters like !, @, #, $, etc.")
print("🔸 Make your password at least 12 characters long.")
print("🔸 Avoid using common words or easily guessable information.")
print("🔸 Avoid using sequences of the same character.\n")
else:
print(Fore.CYAN + "Goodbye! 👋")
break
else:
strength, suggestions, strength_level = password_strength(user_password)
print(Fore.RED + "[+] " + Style.RESET_ALL + "Your password is safe...!")
print(strength + "\n")
if suggestions:
print(Fore.RED + "[+] " + Style.RESET_ALL + "Here are some recommendations to make a good password:")
for suggestion in suggestions:
print(suggestion)
if strength_level in ["Strong", "Very Strong", "Excellent"]:
save_choice = input(Fore.GREEN + "[+] " + Style.RESET_ALL + "Would you like to save this password? (yes/no): " + Style.RESET_ALL)
if save_choice.lower() == 'yes':
description = input(Fore.GREEN + "[+] " + Style.RESET_ALL + "Enter a description for this password: " + Style.RESET_ALL)
saved_path = save_password(user_password, description)
print(Fore.GREEN + "[+] " + Style.RESET_ALL + f"Password saved to: {saved_path}")
secure_choice = input(Fore.RED + "[+] " + Style.RESET_ALL + "Do you want to make the password more strong (yes/no)? " + Style.RESET_ALL)
if secure_choice.lower() == 'yes':
print("\n🔸 Use a mix of uppercase and lowercase letters.")
print("🔸 Include at least one digit.")
print("🔸 Add special characters like !, @, #, $, etc.")
print("🔸 Make your password at least 12 characters long.")
print("🔸 Avoid using common words or easily guessable information.")
print("🔸 Avoid using sequences of the same character.\n")
else:
print(Fore.CYAN + "Goodbye! 👋")
break
if __name__ == "__main__":
main()