Skip to content

Improve Frida util: Decode Flags #3454

@bernhste

Description

@bernhste

Based on #3365

Sometimes there are interesting flags we need to decode. We can decide if frida should decode them or we can do it after the json was created.

For example in https://mas.owasp.org/MASTG/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/MASTG-DEMO-0027

  // Map flag values to names
  const flagNames = {
    [Authenticators.BIOMETRIC_WEAK.value]: "BIOMETRIC_WEAK",
    [Authenticators.BIOMETRIC_STRONG.value]: "BIOMETRIC_STRONG",
    [Authenticators.DEVICE_CREDENTIAL.value]: "DEVICE_CREDENTIAL"
  };

  // Map result codes to messages
  const resultMessages = {
    [BiometricManager.BIOMETRIC_SUCCESS.value]: "BIOMETRIC_SUCCESS",
    [BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE.value]: "BIOMETRIC_ERROR_NO_HARDWARE",
    [BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE.value]: "BIOMETRIC_ERROR_HW_UNAVAILABLE",
    [BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED.value]: "BIOMETRIC_ERROR_NONE_ENROLLED"
  }; 

or https://mas.owasp.org/MASTG/demos/ios/MASVS-AUTH/MASTG-DEMO-0044/MASTG-DEMO-0044/

const AccessControlFlags = {
    kSecAccessControlUserPresence: 1 << 0,
    kSecAccessControlBiometryAny: 1 << 1,
    kSecAccessControlBiometryCurrentSet: 1 << 3,
    kSecAccessControlDevicePasscode: 1 << 4,
    kSecAccessControlWatch: 1 << 5,
    kSecAccessControlOr: 1 << 14,
    kSecAccessControlAnd: 1 << 15,
    kSecAccessControlPrivateKeyUsage: 1 << 30,
    kSecAccessControlApplicationPassword: 1 << 31,
  };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions