Skip to content

Fix: handle tuple results from re.findall in __ak_and_sk__ #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions libs/core/parses.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,18 @@ def __get_string_by_file__(self, file_path):
def __ak_and_sk__(self, name, ak_rule, content):
akAndSkList = re.compile(ak_rule).findall(content)
for akAndSk in akAndSkList:
ak = ("[%s]-->:%s") % (name, akAndSk.strip())
if isinstance(akAndSk, tuple):
value = akAndSk[-1].strip()
else:
value = akAndSk.strip()

# 过滤空值
if not value:
continue

ak = ("[%s]-->:%s") % (name, value)
self.result_list.append(ak)
print(("[+] [%s] AK or SK in %s:") % (name, akAndSk.strip()))
print(("[+] [%s] AK or SK in %s:") % (name, value))

def __parse_string__(self, result):
# 通过正则筛选需要过滤的字符串
Expand Down