mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
优化处理
This commit is contained in:
@@ -121,8 +121,10 @@ def gen_word_subdomains(expression, path):
|
|||||||
word = line.strip().lower()
|
word = line.strip().lower()
|
||||||
if len(word) == 0:
|
if len(word) == 0:
|
||||||
continue
|
continue
|
||||||
if not word.isascii():
|
if not utils.is_subname(word):
|
||||||
continue
|
continue
|
||||||
|
if word.startswith('.'):
|
||||||
|
word = word[1:]
|
||||||
if word.endswith('.'):
|
if word.endswith('.'):
|
||||||
word = word[:-1]
|
word = word[:-1]
|
||||||
subdomain = expression.replace('*', word)
|
subdomain = expression.replace('*', word)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import string
|
||||||
import random
|
import random
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -586,3 +587,11 @@ def get_massdns_path(massdns_dir):
|
|||||||
logger.log('INFOR', 'Please try to compile massdns yourself and specify the path in the configuration')
|
logger.log('INFOR', 'Please try to compile massdns yourself and specify the path in the configuration')
|
||||||
exit(0)
|
exit(0)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
def is_subname(name):
|
||||||
|
chars = string.ascii_lowercase + string.digits + '.-'
|
||||||
|
for char in name:
|
||||||
|
if char not in chars:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user