Skip to content
Snippets Groups Projects
Commit 0e1c092b authored by alejper's avatar alejper
Browse files

Upload New File

parent 1bedd39e
Branches
No related tags found
No related merge requests found
from requests import get
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Comprobaciones sobre las apps
RED_FLAGS = {
# Test OWASP sobre acceso al almacenamiento externo
"OWASP MASTG-TEST-0202":
["android.permission.READ_EXTERNAL_STORAGE",
"android.permission.WRITE_EXTERNAL_STORAGE"],
# Cambio en la política de Google sobre el acceso a todos los archivos
"Google Policy Review Requirements - All files access":
["android.permission.MANAGE_EXTERNAL_STORAGE"],
# Cambio en la política de Google sobre el acceso a fotografías y videos
"Google Policy Review Requirements - Photo and Video access":
["android.permission.READ_MEDIA_IMAGES",
"android.permission.READ_MEDIA_VIDEO"]
}
# Nombres de paquete de las apps a analizar
GALLERY_APPS = [
"com.simplemobiletools.gallery.pro",
"com.vincentengelsoftware.vesandroidimagecompare",
"deckers.thibault.aves.libre",
"org.fossify.gallery",
"rocks.poopjournal.metadataremover",
"ru.tech.imageresizershrinker"]
# URL de consulta a App-PIMD
APP_PIMD_URL = "https://apkfalcon.infor.uva.es:8080/get/app/package?package={}"
# Función que analiza las apps listadas en función a las red flags definidas
def analyze_apps(apps_list, red_flags):
print("Iniciando análisis de {} apps.\n".format(len(apps_list)), flush=True)
results = {}
for app in apps_list:
print("Obteniendo metadatos de {}. ".format(app), end="", flush=True)
req = get(APP_PIMD_URL.format(app), verify=False)
print("✔️" if req.status_code == 200 else "", flush=True)
if req.status_code == 200:
print("Analizando {} en busca de red flags. ".format(app), end="", flush=True)
result_i = {}
j = 0
for red_flag in red_flags:
i = 0
for permission in red_flags[red_flag]:
i += 1 if permission in req.text else 0
j += i
result_i[red_flag] = i
print("{} red flags encontradas.\n".format(j), flush=True)
results[app] = result_i
print("\nReporte del análisis:\n", flush=True)
for app in results:
print(app + ":", flush=True)
for red_flag in results[app]:
print("\t {:<60} \t {:>1}/{}".format(red_flag, results[app][red_flag], len(red_flags[red_flag])), flush=True)
print()
print("Análisis completo.", flush=True)
if __name__ == "__main__":
analyze_apps(GALLERY_APPS, RED_FLAGS)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment