Active Members Fi8sVrs Posted August 2, 2011 Active Members Report Posted August 2, 2011 Yet Another Email Verifier 1.0Verify emails by checking the "RCPT TO" return code from the SMTP server.Hints:The output is separated by commas, so you can easily import it to another application (e.g. MS Excel).Create an address list by using the Smashing Email eXtractor!Failed checks are added at the bottom (! <domain>)Requirements:python (tested with python 2.6.2)dnspythonUsage:yaev.py <file>file: absolute path to email-address listExample:[B]$ cat addresses.txt[/B][B]...[/B]wolfgang.schaeuble@wk.bundestag.degm.schulz@gmail.comjan.sipocz@gmail.combrigitte.kopinits@gmail.comr.buchmann@amag.atannimarie.schaffer@gmail.comiggy.popovic@gmail.comerich.gabis@gmail.comKovacs.maria4@gmail.comandreas.schimon@gmail.combarbarajungreithmair@gmail.commichael.gabis@gmail.com[B]$ ./yaev.py addresses.txt > checked_emails.txt$ cat checked_emails.txt...[/B]wolfgang.schaeuble@wk.bundestag.de,mail1.dbtg.de,554,5.7.1 Service unavailable; Client host [83.187.177.131] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=83.187.177.131gm.schulz@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 6si6034pxi.95jan.sipocz@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 13si2013478pxi.35brigitte.kopinits@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 27si2008921pxi.56r.buchmann@amag.at,srxx0055.amag.at,503,5.0.0 Need MAIL before RCPTannimarie.schaffer@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 35si2021257pxi.2iggy.popovic@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 37si2019611pxi.5erich.gabis@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 2si2010789pxi.52Kovacs.maria4@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 42si2017013pxi.17andreas.schimon@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 9si2018016pxi.13barbarajungreithmair@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 40si2003494pxi.87michael.gabis@gmail.com,alt2.gmail-smtp-in.l.google.com,250,2.1.5 OK 37si2019846pxi.5!gmx.deCode: #!/usr/bin/env python# -*- coding: utf-8 -*-## yaev.py## Version: 1.0## Copyright (C) 2009 novacane novacane[at]dandies[dot]org## This program is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.## DO NOT FORGET TO INSTALL DNSPYTHON - http://www.dnspython.org/## For more information visit:# http://dandies.org/files/41b1d9240cf1df328f4e63d087769440-44.html#import osimport sysimport smtplibimport dns.resolverdef main(path_to_src_file): """ Get SMTP return code Verify emails by checking the "RCPT TO" return code from the SMTP server. NOTE: dropped vrfy command because provider disabled it to prevent attacks """ failed_domains = [] try: # Open the Source-File. file_emails = open(path_to_src_file) except IOError: print "Error reading file!" print "!> " + path_to_src_file sys.exit(1) # Loop through addresses. Each line represents an email-address. for line in file_emails: # Remove Linefeed. line = line.replace("\n", "") # The actual domain. domain = line.split("@")[1] # Do nothing if domain is already in the failed_domain list. if not domain in failed_domains: try: # Make a MX DNS query. answers = dns.resolver.query(domain, "MX") # OR: mx = str(answers[1].exchange)[:-1] for rdata in answers: # Remove the dot from rdata.exchange. mx = str(rdata.exchange)[:-1] try: # Connect to SMTP server. smtp = smtplib.SMTP(mx) # Polite people say hello first. smtp.docmd("HELO microsoft.com") # Indicates who is sending the mail. smtp.docmd("MAIL FROM:", "<asdf@microsoft.com>") # Indicates who is recieving the mail. rcpt = smtp.docmd("RCPT TO:", "<" + line + ">") # Print output. print line + "," + mx + "," + \ str(rcpt[0]) + "," + str(rcpt[1]) # Close SMTP connection. smtp.quit() except smtplib.SMTPServerDisconnected: # Add domain to list. failed_domains.append(domain) # Use only the first server-address. break # Raise exception if DNS query failed. except dns.resolver.NXDOMAIN: # Add domain to list. failed_domains.append(domain) # Close the Source-File. file_emails.close() # Output failed domains. if failed_domains: for item in failed_domains: print "!" + itemif __name__ == '__main__': if len(sys.argv) != 2: print "\n\t[*] yet another email verifier 1.0 [*]" print "\n\tUsage: yaev.py <file>" sys.exit(2) main(sys.argv[1])Dounload source Quote
bugwak Posted December 21, 2023 Report Posted December 21, 2023 Does this script still working? Quote
Moderators Dragos Posted December 24, 2023 Moderators Report Posted December 24, 2023 Protocol hasn't changed, but you can get IP banned from most of email providers today for using this method. Quote