Ethical Hacking Projects
Top 10 ethical hacking projects Ethical hacking is a proactive defense strategy where authorized professionals test systems for vulnerabilities before malicious actors misuse them. In this article, we’ll explore ten intriguing ethical hacking projects designed to enhance your skills and contribute positively to the cybersecurity landscape. These projects cover a wide range of ethical hacking activities, from creating viruses for educational purposes to developing phishing website checkers. Let’s dip in and explore each ethical hacking project idea. 1. User Authentication System User authentication is like a lock that protects sensitive information. It guarantees that only authorized individuals have access to digital spaces. However, the growing complexity of cyber threats makes these systems vulnerable. The User Authentication System ethical hacking project aims to strengthen the security of sensitive information. Developers and security professionals can use ethical hacking principles to build robust authentication systems to withstand cyber threats. This project combines security and ethical practices to provide a safer digital experience for users everywhere. Pyton import sqlite3 import hashlib import os def hash_password(password): salt = os.urandom(32) key = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) return salt + key def verify_password(username, password): connection = sqlite3.connect('users.db') cursor = connection.cursor() cursor.execute('SELECT salt, key FROM users WHERE username = ?', (username,)) user = cursor.fetchone() connection.close() if user: salt = user[0] key = user[1] hashed_password = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) return hashed_password == key else: return False def register(username, password): try: connection = sqlite3.connect('users.db') cursor = connection.cursor() hashed_password = hash_password(password) cursor.execute('INSERT INTO users (username, salt, key) VALUES (?, ?, ?)', (username, hashed_password[:32], hashed_password[32:])) connection.commit() print(f"User {username} registered successfully!") except sqlite3.IntegrityError: print(f"User {username} already exists!") finally: connection.close() def login(username, password): connection = sqlite3.connect('users.db') cursor = connection.cursor() cursor.execute('SELECT * FROM users WHERE username = ?', (username,)) user = cursor.fetchone() connection.close() if user: if user[2] >= 3: print("Account locked. Too many failed login attempts.") else: salt = user[1] key = user[2] hashed_password = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) if hashed_password == key: print(f"Welcome back, {username}!") else: print("Invalid username or password.") connection = sqlite3.connect('users.db') cursor = connection.cursor() cursor.execute('UPDATE users SET attempts = attempts + 1 WHERE username = ?', (username,)) connection.commit() connection.close() else: print("Invalid username or password.") def change_password(username, old_password, new_password): if verify_password(username, old_password): connection = sqlite3.connect('users.db') cursor = connection.cursor() hashed_password = hash_password(new_password) cursor.execute('UPDATE users SET salt = ?, key = ? WHERE username = ?', (hashed_password[:32], hashed_password[32:], username)) connection.commit() connection.close() print(f"Password changed successfully for {username}!") else: print("Invalid username or password.") def reset_password(username, new_password): connection = sqlite3.connect('users.db') cursor = connection.cursor() hashed_password = hash_password(new_password) cursor.execute('UPDATE users SET salt = ?, key = ? WHERE username = ?', (hashed_password[:32], hashed_password[32:], username)) connection.commit() connection.close() print(f"Password reset successfully for {username}!") def main(): connection = sqlite3.connect('users.db') cursor = connection.cursor() # Create a table to store user credentials cursor.execute(''' CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, salt TEXT NOT NULL, key TEXT NOT NULL, attempts INTEGER DEFAULT 0 ); ''') connection.commit() connection.close() # Register a user register('alice', 'password123') # Login with the registered user login('alice', 'password123') # Try to register the same user again register('alice', 'password123') # Try to login with incorrect credentials login('alice', 'wrongpassword') # Change password change_password('alice', 'password123', 'newpassword456') # Login with the new password login('alice', 'newpassword456') # Reset password reset_password('alice', 'resetpassword789') # Login with the reset password login('alice', 'resetpassword789') if __name__ == "__main__": main() import sqlite3 import hashlib import os def hash_password(password): salt = os.urandom(32) key = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) return salt + key def verify_password(username, password): connection = sqlite3.connect('users.db') cursor = connection.cursor() cursor.execute('SELECT salt, key FROM users WHERE username = ?', (username,)) user = cursor.fetchone() connection.close() if user: salt = user[0] key = user[1] hashed_password = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) return hashed_password == key else: return False def register(username, password): try: connection = sqlite3.connect('users.db') cursor = connection.cursor() hashed_password = hash_password(password) cursor.execute('INSERT INTO users (username, salt, key) VALUES (?, ?, ?)', (username, hashed_password[:32], hashed_password[32:])) connection.commit() print(f"User {username} registered successfully!") except sqlite3.IntegrityError: print(f"User {username} already exists!") finally: connection.close() def login(username, password): connection = sqlite3.connect('users.db') cursor = connection.cursor() cursor.execute('SELECT * FROM users WHERE username = ?', (username,)) user = cursor.fetchone() connection.close() if user: if user[2] >= 3: print("Account locked. Too many failed login attempts.") else: salt = user[1] key = user[2] hashed_password = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) if hashed_password == key: print(f"Welcome back, {username}!") else: print("Invalid username or password.") connection = sqlite3.connect('users.db') cursor = connection.cursor() cursor.execute('UPDATE users SET attempts = attempts + 1 WHERE username = ?', (username,)) connection.commit() connection.close() else: print("Invalid username or password.") def change_password(username, old_password, new_password): if verify_password(username, old_password): connection = sqlite3.connect('users.db') cursor = connection.cursor() hashed_password = hash_password(new_password) cursor.execute('UPDATE users SET salt = ?, key = ? WHERE username = ?', (hashed_password[:32], hashed_password[32:], username)) connection.commit() connection.close() print(f"Password changed successfully for {username}!") else: print("Invalid username or password.") def reset_password(username, new_password): connection = sqlite3.connect('users.db') cursor = connection.cursor() hashed_password = hash_password(new_password) cursor.execute('UPDATE users SET salt = ?, key = ? WHERE username = ?', (hashed_password[:32], hashed_password[32:], username)) connection.commit() connection.close() print(f"Password reset successfully for {username}!") def main(): connection = sqlite3.connect('users.db') cursor = connection.cursor() # Create a table to store user credentials cursor.execute(''' CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, salt TEXT NOT NULL, key TEXT NOT NULL, attempts INTEGER DEFAULT 0 ); ''') connection.commit() connection.close() # Register a user register('alice', 'password123') # Login with the registered user login('alice', 'password123') # Try to register the same user again register('alice', 'password123') # Try to login with incorrect credentials login('alice', 'wrongpassword') # Change password change_password('alice', 'password123', 'newpassword456') # Login with the new password login('alice', 'newpassword456') # Reset password reset_password('alice', 'resetpassword789') # Login with the reset password login('alice', 'resetpassword789') if __name__ == "__main__": main() 2. Phishing Simulation Phishing simulation is a way to test and train people to recognize and stop phishing attacks. These attacks trick people into sharing sensitive information by pretending to be trustworthy sources. The project aims to help individuals and organizations understand these tactics and protect against them. The phishing simulation system creates fake phishing emails or messages to imitate real-world scenarios. It includes fake links, deceptive content,