@@ -26,7 +26,7 @@ def parse_hostname(self, hostname):
26
26
log .debug (f"{ host = } " )
27
27
if host :
28
28
_domain = re .search (
29
- r"[\w-]+[.](com|co.uk|ru|org|co|in|ai|sh|io|jp|com.cn|cn|cz|de|net|fr|it|au|ca|ir|br|com.br|co.kr|gov|uk|kz|tech|shop|moscow|store|me)$" ,
29
+ r"[\w-]+[.](рф| com|co.uk|ru|org|co|in|ai|sh|io|jp|com.cn|cn|cz|de|net|fr|it|au|ca|ir|br|com.br|co.kr|gov|uk|kz|tech|shop|moscow|store|me)$" ,
30
30
host ,
31
31
)
32
32
log .debug (f"{ _domain = } " )
@@ -110,10 +110,10 @@ def run(self):
110
110
print ("." .join (_s ) + "." + d )
111
111
_s [index ] = j
112
112
if self .args .cartesian :
113
- _deque = deque ()
113
+ _deque = []
114
114
subs_list = []
115
115
pattern = re .compile ('((?<!\d)\d{1,2}(?!\d))' )
116
- for index , _s in enumerate ( s ) :
116
+ for _s in s :
117
117
log .debug (_s )
118
118
_list = pattern .split (_s )
119
119
if len (_list ) == 1 :
@@ -122,8 +122,12 @@ def run(self):
122
122
else :
123
123
for x in _list :
124
124
try :
125
- if type (int (x )) == int :
126
- _deque .append ([str (i ).zfill (len (x )) for i in range (10 if len (x ) < 2 else 100 )])
125
+ if int (x ) or x in ("0" , "00" ):
126
+ x_lenght = len (x )
127
+ if x_lenght <= 2 :
128
+ _deque .append ([str (i ).zfill (x_lenght ) for i in range (10 if x_lenght == 1 else 100 )])
129
+ else :
130
+ _deque .append ([x ])
127
131
except ValueError :
128
132
# filter out empty str
129
133
if x != "" :
@@ -136,15 +140,14 @@ def run(self):
136
140
137
141
for p in itertools .product (* subs_list ):
138
142
log .debug (p )
139
- log .debug (self .join_product_tuples (p ))
140
143
print (self .join_product_tuples (p ) + "." + d )
141
144
142
145
for p in self .pnk (s ):
143
146
print ("." .join (p ) + "." + d )
144
147
145
148
def produce_wordlist (self ):
146
149
"""TODO: see https://github.com/storenth/pnk/issues/1
147
- Read the wordlist and returns lines generator
150
+ Read the wordlist and return lines generator
148
151
"""
149
152
wordlist = self .args .wordlist if self .args .wordlist else pathlib .Path (__file__ ).parent / 'wordlist.txt'
150
153
with open (wordlist , 'r' , encoding = 'UTF-8' ) as file :
0 commit comments