Skip to content

Commit

Permalink
fix bug && first release
Browse files Browse the repository at this point in the history
  • Loading branch information
hjc981024 committed May 10, 2018
1 parent c9b4de1 commit 76e963e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
12 changes: 5 additions & 7 deletions AD_Scanner_Base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def opt_handler(self):
self.base_redis.hset('base',x,self.info[x])
print('optiopns:\n')
for x in self.base_redis.hkeys('base'):
print(x+':'+self.base_redis.hget('base',x),end = ' ')
print(x+':'+self.base_redis.hget('base',x))
print('go')
time.sleep(1)

Expand Down Expand Up @@ -146,9 +146,9 @@ def print_data(self):
print('URL:'+self.url+'\n',file=self.data_file)

#爬虫模块数据输出
print('Burp_force_directory:\n--------------------------------------')
print('\nBurp_force_directory:\n--------------------------------------')
if self.file_status:
print('URL_Spider:\n--------------------------------------',file=self.data_file)
print('\nBurp_force_directory:\n--------------------------------------',file=self.data_file)
for x in ma.base_redis.smembers('Burp_force_directory_url'):
print(str(num+1)+':'+x)
if self.file_status:
Expand All @@ -160,7 +160,7 @@ def print_data(self):
#目录爆破模块的数据输出
print('\n\nURL_Spider:\n---------------------------------')
if self.file_status:
print('URL_Spider:\n--------------------------------------',file=self.data_file)
print('\n\nURL_Spider:\n--------------------------------------',file=self.data_file)
for x in ma.base_redis.smembers('Spider_full_urls'):
print(str(num+1)+':'+x)
if self.file_status:
Expand All @@ -179,11 +179,9 @@ def __init__(self):
self.url_type = self.base_redis.hget('base','url_type')
self.opt_handler()
'''各模块初始化'''
print(self.url_type)
#对传入的URL进行处理,增加http://前缀
if self.url_type == '2' or self.url_type == '3':
self.url = 'http://'+self.url
print(self.url)
self.spider = SpiderMain(self.url,self.save_pool)
self.burp_force_diectory = Scanner(self.url,self.save_pool)

Expand All @@ -201,7 +199,7 @@ def module_check(self):
ma.start_modules()
while False in ma.module_check() :
time.sleep(5)
print('stat:',ma.spider.is_finished(),ma.burp_force_diectory.is_finished())
print('stat: spider_finished:',ma.spider.is_finished(),' burp_finished:',ma.burp_force_diectory.is_finished(),end='\r',flush=True)
continue
print('finished')
input()
Expand Down
12 changes: 5 additions & 7 deletions Burp_force_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def more_threads(self):
threads = []
self.check = False
for k in range(0,len(self.dic_list)):
print(self.dic_list[k])
#print(self.dic_list[k])
#t = threading.Thread(target=self.combine_url,args=(self.dic_list[k],))
#threads.append(t)
self.combine_url(self.dic_list[k])
Expand All @@ -50,7 +50,7 @@ def combine_url(self,doc_name):
'''
从字典中逐行取出子目录,并将其与传入的网址组合
'''
print(doc_name)
#print(doc_name)
with open(r'Burp_force_directory\dictionary\\'+doc_name,'r') as file_obj:
for line in file_obj:
test_url = self.url + line
Expand All @@ -73,7 +73,7 @@ def judge(self, test_url):
k = self.request(test_url)
#print(k.status_code)
if k.status_code == 200:
<<<<<<< HEAD
'''
print(test_url)
self.get_url.append(test_url)
self.len = len(set(self.get_url))
Expand All @@ -87,14 +87,12 @@ def judge(self, test_url):
pass
#测试模式下开启报错
#print(p)

=======
'''
try:
print(test_url)
#print(test_url)
self.module_redis.sadd('Burp_force_directory_url',test_url)
except Exception as e:
print(e)
>>>>>>> 1aebc455bfe28de994345e8165bb738b1f964971
except requests.exceptions.Timeout:
pass
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion url_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def redis_get(self):
self.threadnum = self.spider_redis.hget('base', 'input_opt_spider_threads')

def redis_set(self, url):
print('spider add!')
#print('spider add!')
try:
self.spider_redis.sadd('Spider_full_urls', url)
except Exception as e:
Expand Down

0 comments on commit 76e963e

Please sign in to comment.