Unfortunately, I'm dealing with a situation where my deceased father is gaining access to his PC emails.
Man never told anyone passwords
Included anywhere, kept records or written down.
Including any other places where passwords might be found
- Password managers
- Browser autofill
- Notes apps on devices
- Sticky notes on the computer monitor
Possible ways to gain access
Here are some possible ways to gain access to the emails without the password:
- Resetting the password through email recovery options
- Using a password reset disk if one was created
- Using a keylogger to capture the password
- Using social engineering techniques to trick the email provider into giving up the password
Code examples for password recovery
import imaplib
import email
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login('username', 'app-specific password')
mail.select('inbox')
typ, data = mail.search(None, 'ALL')
for num in data[0].split():
typ, message_data = mail.fetch(num, '(RFC822)')
raw_email = message_data[0][1]
email_message = email.message_from_bytes(raw_email)
for part in email_message.walk():
if part.get_content_type() == 'text/plain':
print(part.get_payload())