def get_personalized_dictionaries(target: WirelessAccessPoint) -> List[TextIO]:
"""
Create and return dictionary personalized by available AP details.
:type target: WirelessAccessPoint
:param target: targeted AP
:rtype: List[TextIO]
:return: list of opened personalized dictionaries
"""
dictionaries = []
if re.match(r'^UPC\d{7}$', target.essid):
t = pipes.Template()
t.prepend('upc_keys {} {}'.format(target.essid, '24'), '.-')
t.append('grep " -> WPA2 phrase for "', '--')
t.append('sed "s/^ -> WPA2 phrase for \S* = \'\(.*\)\'$/\\1/"', '--')
d = t.open('dictionary-pipeline', 'r')
dictionaries.append(d)
return dictionaries
评论列表
文章目录