Skip to content

Commit

Permalink
Merge pull request #50 from dwisiswant0/dev
Browse files Browse the repository at this point in the history
Prep v2.5.2
  • Loading branch information
dwisiswant0 authored Jun 27, 2021
2 parents c28cf36 + 61746a7 commit 6ee5a80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.5.1
v2.5.2
9 changes: 6 additions & 3 deletions apkleaks/apkleaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, args):
self.output = tempfile.mkstemp(suffix=".%s" % ("json" if self.json else "txt"), prefix=self.prefix)[1] if args.output is None else args.output
self.fileout = open(self.output, "%s" % ("w" if self.json else "a"))
self.pattern = os.path.join(str(Path(self.main_dir).parent), "config", "regexes.json") if args.pattern is None else args.pattern
self.jadx = find_executable("jadx") if find_executable("jadx") is not None else os.path.join(str(Path(self.main_dir).parent), "jadx", "bin", "jadx%s" % (".bat" if os.name == "nt" else ""))
self.jadx = find_executable("jadx") if find_executable("jadx") is not None else os.path.join(str(Path(self.main_dir).parent), "jadx", "bin", "jadx%s" % (".bat" if os.name == "nt" else "")).replace("\\","/")
self.out_json = {}
self.scanned = False
logging.config.dictConfig({"version": 1, "disable_existing_loggers": True})
Expand Down Expand Up @@ -94,6 +94,7 @@ def decompile(self):
except Exception:
pass
comm = "%s" % (" ".join(quote(arg) for arg in args))
comm = comm.replace("\'","\"")
os.system(comm)

def extract(self, name, matches):
Expand All @@ -102,8 +103,10 @@ def extract(self, name, matches):
util.writeln("\n" + stdout, col.OKGREEN)
self.fileout.write("%s" % (stdout + "\n" if self.json is False else ""))
for secret in matches:
if name == "LinkFinder" and re.match(r"^.(L[a-z]|application|audio|fonts|image|layout|multipart|plain|text|video).*\/.+", secret) is not None:
continue
if name == "LinkFinder":
if re.match(r"^.(L[a-z]|application|audio|fonts|image|kotlin|layout|multipart|plain|text|video).*\/.+", secret) is not None:
continue
secret = secret[len("'"):-len("'")]
stdout = ("- %s" % (secret))
print(stdout)
self.fileout.write("%s" % (stdout + "\n" if self.json is False else ""))
Expand Down
9 changes: 4 additions & 5 deletions config/regexes.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Facebook_Access_Token": "EAACEdEose0cBA[0-9A-Za-z]+",
"Facebook_Secret_Key": "([f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K]|[f|F][b|B])(.{0,20})?['\"][0-9a-f]{32}",
"Facebook_OAuth": "[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*['|\"][0-9a-f]{32}['|\"]",
"Facebook_ClientID": "(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}",
"Facebook_ClientID": "[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K](.{0,20})?['\"][0-9]{13,17}",
"Firebase": "[a-z0-9.-]+\\.firebaseio\\.com",
"GitHub": "[g|G][i|I][t|T][h|H][u|U][b|B].*['|\"][0-9a-zA-Z]{35,40}['|\"]",
"Generic_API_Key": "[a|A][p|P][i|I][_]?[k|K][e|E][y|Y].*['|\"][0-9a-zA-Z]{32,45}['|\"]",
Expand All @@ -40,16 +40,15 @@
"Square_Access_Token": "sq0atp-[0-9A-Za-z\\-_]{22}",
"Square_OAuth_Secret": "sq0csp-[0-9A-Za-z\\-_]{43}",
"Twilio_API_Key": "SK[0-9a-fA-F]{32}",
"Twitter_ClientID": "(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}",
"Twitter_ClientID": "[t|T][w|W][i|I][t|T][t|T][e|E][r|R](.{0,20})?['\"][0-9a-z]{18,25}",
"Twitter_Access_Token": "[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*[1-9][0-9]+-[0-9a-zA-Z]{40}",
"Twitter_Secret_Key": "(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}",
"Twitter_Secret_Key": "[t|T][w|W][i|I][t|T][t|T][e|E][r|R](.{0,20})?['\"][0-9a-z]{35,44}",
"Twitter_OAuth": "[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*['|\"][0-9a-zA-Z]{35,44}['|\"]",
"Artifactory_API_Token": "(?:\\s|=|:|\"|^)AKC[a-zA-Z0-9]{10,}",
"Artifactory_Password": "(?:\\s|=|:|\"|^)AP[\\dABCDEF][a-zA-Z0-9]{8,}",
"Authorization_Basic": "basic\\s[a-zA-Z0-9_\\-:\\.=]+",
"Authorization_Bearer": "bearer\\s[a-zA-Z0-9_\\-:\\.=]+",
"Basic_Auth_Credentials": "(?<=:\/\/)[a-zA-Z0-9]+:[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z]+",
"Cloudinary_Basic_Auth": "cloudinary:\/\/[0-9]{15}:[0-9A-Za-z]+@[a-z]+",
"Mailto": "(?<=mailto:)[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9.-]+",
"Vault_Token": "[sb]\\.[a-zA-Z0-9]{24}"
"Mailto": "(?<=mailto:)[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9.-]+"
}

0 comments on commit 6ee5a80

Please sign in to comment.