import random
import string
import time
def generate_creds(num_accounts):
"""Generate a list of decoy account credentials (username, password)."""
return [(''.join(random.choices(string.ascii_lowercase + string.digits, k=8)),
''.join(random.choices(string.ascii_letters + string.digits, k=12))) for _ in range(num_accounts)]
def monitor_access(accounts):
"""Simulate access attempts on decoy accounts and log unauthorized attempts."""
with open("access_log.txt", "a") as log_file:
for account in accounts:
unauthorized = random.choice([True, False]) # Randomly determine if the attempt is unauthorized
if unauthorized:
log_file.write(f"Unauthorized access attempt on {account[0]}\n") # Log the attempt
time.sleep(1) # Simulate delay for each access attempt
def main():
"""Main function to prompt user for account count, generate accounts, and monitor access."""
num_accounts = int(input("Enter the number of decoy accounts to create: ")) # Get user input for account count
accounts = generate_creds(num_accounts) # Generate the specified number of decoy accounts
print("Generated Decoy Accounts:", accounts) # Display generated accounts
monitor_access(accounts) # Monitor access attempts on the generated accounts
if __name__ == "__main__":
main() # Execute the main function