Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
taller_lexdatum_2024_app-pimd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alejper
taller_lexdatum_2024_app-pimd
Commits
0e1c092b
Commit
0e1c092b
authored
9 months ago
by
alejper
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
1bedd39e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
analizar-galerias/analizar_galerias.py
+82
-0
82 additions, 0 deletions
analizar-galerias/analizar_galerias.py
with
82 additions
and
0 deletions
analizar-galerias/analizar_galerias.py
0 → 100644
+
82
−
0
View file @
0e1c092b
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
(
"
\n
Reporte 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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment