|
|
@@ -0,0 +1,56 @@
|
|
|
+#include <stdio.h>
|
|
|
+#include <stdlib.h>
|
|
|
+#include <string.h>
|
|
|
+#include <sys/system_properties.h>
|
|
|
+
|
|
|
+/**
|
|
|
+ * Verificador de Vulnerabilidad HyperOS / Android (Marzo 2026)
|
|
|
+ * Basado en el nivel de parche y estado del servicio mqsas/adbd.
|
|
|
+ */
|
|
|
+
|
|
|
+void check_vulnerability() {
|
|
|
+ char patch_date[PROP_VALUE_MAX];
|
|
|
+ char adb_status[PROP_VALUE_MAX];
|
|
|
+ char device_model[PROP_VALUE_MAX];
|
|
|
+
|
|
|
+ // Obtener propiedades del sistema
|
|
|
+ __system_property_get("ro.build.version.security_patch", patch_date);
|
|
|
+ __system_property_get("init.svc.adbd", adb_status);
|
|
|
+ __system_property_get("ro.product.model", device_model);
|
|
|
+
|
|
|
+ printf("====================================================\n");
|
|
|
+ printf(" DIAGNÓSTICO DE SEGURIDAD - %s\n", device_model);
|
|
|
+ printf("====================================================\n");
|
|
|
+ printf("[+] Nivel de parche actual: %s\n", patch_date);
|
|
|
+ printf("[+] Estado de ADB (Daemon): %s\n", (strcmp(adb_status, "running") == 0) ? "ACTIVO" : "Inactivo");
|
|
|
+
|
|
|
+ // Lógica de validación para marzo de 2026
|
|
|
+ // Comparamos si la fecha es anterior a 2026-03-01
|
|
|
+ if (strcmp(patch_date, "2026-03-01") < 0) {
|
|
|
+ printf("\n[!] ESTADO: VULNERABLE\n");
|
|
|
+ printf("[-] Tu sistema no incluye los parches críticos de este mes.\n");
|
|
|
+
|
|
|
+ if (strcmp(adb_status, "running") == 0) {
|
|
|
+ printf("[CRÍTICO] ADB está activo. El vector de ataque está ABIERTO.\n");
|
|
|
+ } else {
|
|
|
+ printf("[AVISO] El riesgo es latente si activas la Depuración USB.\n");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ printf("\n[OK] ESTADO: PROTEGIDO\n");
|
|
|
+ printf("[+] Tienes el parche de seguridad de marzo de 2026 o superior.\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ // Comprobación adicional del servicio mqsas (Xiaomi específico)
|
|
|
+ printf("\n[+] Verificando servicio mqsas (Xiaomi-specific)...\n");
|
|
|
+ if (system("service check mqsas | grep -q 'found'") == 0) {
|
|
|
+ printf("[!] Servicio mqsas detectado. Asegúrate de revocar permisos ADB.\n");
|
|
|
+ } else {
|
|
|
+ printf("[i] Servicio mqsas no detectado o restringido.\n");
|
|
|
+ }
|
|
|
+ printf("====================================================\n");
|
|
|
+}
|
|
|
+
|
|
|
+int main() {
|
|
|
+ check_vulnerability();
|
|
|
+ return 0;
|
|
|
+}
|