diff --git a/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/hooks.js b/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/hooks.js new file mode 100644 index 00000000000..e13807b4462 --- /dev/null +++ b/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/hooks.js @@ -0,0 +1,23 @@ +var target = { + category: "CRYPTO", + hooks: [ + { + class: "javax.crypto.Cipher", + method: "init", + overloads: [ + { args: ["int", "java.security.Key"] }, + ], + maxFrames: 3 + }, + { + class: "java.security.Signature", + methods: ["initSign", "initVerify"], + maxFrames: 10 + }, + { + class: "android.security.keystore.KeyGenParameterSpec$Builder", + methods: ["$init"], + maxFrames: 10 + } + ] +}; diff --git a/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/output.json b/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/output.json new file mode 100644 index 00000000000..49f7ad1db85 --- /dev/null +++ b/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/output.json @@ -0,0 +1,254 @@ +{ + "type": "summary", + "hooks": [ + { + "class": "javax.crypto.Cipher", + "method": "init", + "overloads": [ + { + "args": [ + "int", + "java.security.Key" + ] + } + ] + }, + { + "class": "java.security.Signature", + "method": "initSign", + "overloads": [ + { + "args": [ + "java.security.PrivateKey" + ] + }, + { + "args": [ + "java.security.PrivateKey", + "java.security.SecureRandom" + ] + } + ] + }, + { + "class": "java.security.Signature", + "method": "initVerify", + "overloads": [ + { + "args": [ + "java.security.PublicKey" + ] + }, + { + "args": [ + "java.security.cert.Certificate" + ] + } + ] + }, + { + "class": "android.security.keystore.KeyGenParameterSpec$Builder", + "method": "$init", + "overloads": [ + { + "args": [ + "android.security.keystore.KeyGenParameterSpec" + ] + }, + { + "args": [ + "java.lang.String", + "int" + ] + } + ] + } + ], + "totalHooks": 7, + "errors": [], + "totalErrors": 0 +} +{ + "id": "14535033-08ea-4063-897c-eacd4a885d8b", + "type": "hook", + "category": "CRYPTO", + "time": "2025-12-14T16:02:21.782Z", + "class": "android.security.keystore.KeyGenParameterSpec$Builder", + "method": "$init", + "instanceId": 35486102, + "stackTrace": [ + "android.security.keystore.KeyGenParameterSpec$Builder.(Native Method)", + "org.owasp.mastestapp.MastgTest.generateKey(MastgTest.kt:97)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:41)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [ + { + "declaredType": "java.lang.String", + "value": "MultiPurposeKey" + }, + { + "declaredType": "int", + "value": 15 + } + ], + "returnValue": [ + { + "declaredType": "void", + "value": "void" + } + ] +} +{ + "id": "4c109cd7-3330-492e-9d24-d8d78d424e1e", + "type": "hook", + "category": "CRYPTO", + "time": "2025-12-14T16:02:21.914Z", + "class": "javax.crypto.Cipher", + "method": "init", + "instanceId": 27044119, + "stackTrace": [ + "javax.crypto.Cipher.init(Native Method)", + "org.owasp.mastestapp.MastgTest.encrypt(MastgTest.kt:126)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:47)" + ], + "inputParameters": [ + { + "declaredType": "int", + "value": 1 + }, + { + "declaredType": "java.security.Key", + "value": { + "modulusHex": "bb6c0a74ddcd5b9cef1dc6921c613f33062c0aea25305eb692055f167e46fc418a7655d0e9b83a843e3cd6cd9fd62ad23f1098725ea7c7e2d178b1e55bcc7302d8b52611d55b575f3a36e9af2f03a7b7c53c3b2c6c218a3652ce571b1cfbc82771e5844237b519531ca749830af18117bbe5a7d40e0046bd351558daa8421509aea41c6ac511c46960b3168176c6411cf8396b0923c1bd104a9d5cfd5d2582ffac4dbd859db53fef8085ef8718b5ef6bcbd27f447d2748db705984be15ed90e9366948b306808b4947f7808838e60bc1166c9d50b36b0e88392ed628931d4978ba92875d93a7b06f724b17ceee6f84d988e3a82cdb030d03729167dcb318acf9", + "modulusBitLength": 2048, + "publicExponentDec": "65537", + "keyHash": -195910326 + }, + "runtimeType": "com.android.org.conscrypt.OpenSSLRSAPublicKey", + "instanceId": "167981316", + "instanceToString": "OpenSSLRSAPublicKey{modulus=bb6c0a74ddcd5b9cef1dc6921c613f33062c0aea25305eb692055f167e46fc418a7655d0e9b83a843e3cd6cd9fd62ad23f1098725ea7c7e2d178b1e55bcc7302d8b52611d55b575f3a36e9af2f03a7b7c53c3b2c6c218a3652ce571b1cfbc82771e5844237b519531ca749830af18117bbe5a7d40e0046bd351558daa8421509aea41c6ac511c46960b3168176c6411cf8396b0923c1bd104a9d5cfd5d2582ffac4dbd859db53fef8085ef8718b5ef6bcbd27f447d2748db705984be15ed90e9366948b306808b4947f7808838e60bc1166c9d50b36b0e88392ed628931d4978ba92875d93a7b06f724b17ceee6f84d988e3a82cdb030d03729167dcb318acf9,publicExponent=10001}" + } + ], + "returnValue": [ + { + "declaredType": "void", + "value": "void" + } + ] +} +{ + "id": "51045998-e573-40f9-a7a4-075c9f9a32cc", + "type": "hook", + "category": "CRYPTO", + "time": "2025-12-14T16:02:21.933Z", + "class": "javax.crypto.Cipher", + "method": "init", + "instanceId": 157501165, + "stackTrace": [ + "javax.crypto.Cipher.init(Native Method)", + "org.owasp.mastestapp.MastgTest.decrypt(MastgTest.kt:145)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:55)" + ], + "inputParameters": [ + { + "declaredType": "int", + "value": 2 + }, + { + "declaredType": "java.security.Key", + "value": { + "modulusHex": "bb6c0a74ddcd5b9cef1dc6921c613f33062c0aea25305eb692055f167e46fc418a7655d0e9b83a843e3cd6cd9fd62ad23f1098725ea7c7e2d178b1e55bcc7302d8b52611d55b575f3a36e9af2f03a7b7c53c3b2c6c218a3652ce571b1cfbc82771e5844237b519531ca749830af18117bbe5a7d40e0046bd351558daa8421509aea41c6ac511c46960b3168176c6411cf8396b0923c1bd104a9d5cfd5d2582ffac4dbd859db53fef8085ef8718b5ef6bcbd27f447d2748db705984be15ed90e9366948b306808b4947f7808838e60bc1166c9d50b36b0e88392ed628931d4978ba92875d93a7b06f724b17ceee6f84d988e3a82cdb030d03729167dcb318acf9", + "modulusBitLength": 2048, + "keyHash": -195910326 + }, + "runtimeType": "android.security.keystore2.AndroidKeyStoreRSAPrivateKey", + "instanceId": "120559906", + "instanceToString": "android.security.keystore2.AndroidKeyStoreRSAPrivateKey@58c7453e" + } + ], + "returnValue": [ + { + "declaredType": "void", + "value": "void" + } + ] +} +{ + "id": "23ab5c42-17f7-4d00-9620-8b42a369579a", + "type": "hook", + "category": "CRYPTO", + "time": "2025-12-14T16:02:21.960Z", + "class": "java.security.Signature", + "method": "initSign", + "instanceId": 96101609, + "stackTrace": [ + "java.security.Signature.initSign(Native Method)", + "org.owasp.mastestapp.MastgTest.sign(MastgTest.kt:163)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:60)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [ + { + "declaredType": "java.security.PrivateKey", + "value": { + "modulusHex": "bb6c0a74ddcd5b9cef1dc6921c613f33062c0aea25305eb692055f167e46fc418a7655d0e9b83a843e3cd6cd9fd62ad23f1098725ea7c7e2d178b1e55bcc7302d8b52611d55b575f3a36e9af2f03a7b7c53c3b2c6c218a3652ce571b1cfbc82771e5844237b519531ca749830af18117bbe5a7d40e0046bd351558daa8421509aea41c6ac511c46960b3168176c6411cf8396b0923c1bd104a9d5cfd5d2582ffac4dbd859db53fef8085ef8718b5ef6bcbd27f447d2748db705984be15ed90e9366948b306808b4947f7808838e60bc1166c9d50b36b0e88392ed628931d4978ba92875d93a7b06f724b17ceee6f84d988e3a82cdb030d03729167dcb318acf9", + "modulusBitLength": 2048, + "keyHash": -195910326 + }, + "runtimeType": "android.security.keystore2.AndroidKeyStoreRSAPrivateKey", + "instanceId": "5383534", + "instanceToString": "android.security.keystore2.AndroidKeyStoreRSAPrivateKey@58c7453e" + } + ], + "returnValue": [ + { + "declaredType": "void", + "value": "void" + } + ] +} +{ + "id": "af8354c2-dda9-4ec6-913a-c6be9cb24fd6", + "type": "hook", + "category": "CRYPTO", + "time": "2025-12-14T16:02:21.975Z", + "class": "java.security.Signature", + "method": "initVerify", + "instanceId": 192259087, + "stackTrace": [ + "java.security.Signature.initVerify(Native Method)", + "org.owasp.mastestapp.MastgTest.verify(MastgTest.kt:177)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:67)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [ + { + "declaredType": "java.security.PublicKey", + "value": { + "modulusHex": "bb6c0a74ddcd5b9cef1dc6921c613f33062c0aea25305eb692055f167e46fc418a7655d0e9b83a843e3cd6cd9fd62ad23f1098725ea7c7e2d178b1e55bcc7302d8b52611d55b575f3a36e9af2f03a7b7c53c3b2c6c218a3652ce571b1cfbc82771e5844237b519531ca749830af18117bbe5a7d40e0046bd351558daa8421509aea41c6ac511c46960b3168176c6411cf8396b0923c1bd104a9d5cfd5d2582ffac4dbd859db53fef8085ef8718b5ef6bcbd27f447d2748db705984be15ed90e9366948b306808b4947f7808838e60bc1166c9d50b36b0e88392ed628931d4978ba92875d93a7b06f724b17ceee6f84d988e3a82cdb030d03729167dcb318acf9", + "modulusBitLength": 2048, + "publicExponentDec": "65537", + "keyHash": -195910326 + }, + "runtimeType": "com.android.org.conscrypt.OpenSSLRSAPublicKey", + "instanceId": "195927196", + "instanceToString": "OpenSSLRSAPublicKey{modulus=bb6c0a74ddcd5b9cef1dc6921c613f33062c0aea25305eb692055f167e46fc418a7655d0e9b83a843e3cd6cd9fd62ad23f1098725ea7c7e2d178b1e55bcc7302d8b52611d55b575f3a36e9af2f03a7b7c53c3b2c6c218a3652ce571b1cfbc82771e5844237b519531ca749830af18117bbe5a7d40e0046bd351558daa8421509aea41c6ac511c46960b3168176c6411cf8396b0923c1bd104a9d5cfd5d2582ffac4dbd859db53fef8085ef8718b5ef6bcbd27f447d2748db705984be15ed90e9366948b306808b4947f7808838e60bc1166c9d50b36b0e88392ed628931d4978ba92875d93a7b06f724b17ceee6f84d988e3a82cdb030d03729167dcb318acf9,publicExponent=10001}" + } + ], + "returnValue": [ + { + "declaredType": "void", + "value": "void" + } + ] +} diff --git a/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/run.sh b/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/run.sh index 7a6bfe87ac2..44068ba587f 100755 --- a/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/run.sh +++ b/demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/run.sh @@ -1,7 +1,3 @@ #!/bin/bash -frida \ - -U \ - -f org.owasp.mastestapp \ - -l script.js \ - -o output.txt +../../../../utils/frida/android/run.sh ./hooks.js diff --git a/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/hooks.js b/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/hooks.js new file mode 100644 index 00000000000..d8668a52d8a --- /dev/null +++ b/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/hooks.js @@ -0,0 +1,23 @@ +var target = { + category: "STORAGE", + hooks: [ + { + class: "android.app.KeyguardManager", + method: "isDeviceSecure", + overloads: [ + { + "args": [] + } + ] + }, + { + class: "android.hardware.biometrics.BiometricManager", + method: "canAuthenticate", + overloads: [ + { + args: ["int"] + } + ] + } + ] +}; diff --git a/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/output.json b/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/output.json new file mode 100644 index 00000000000..e0b7755cb3c --- /dev/null +++ b/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/output.json @@ -0,0 +1,83 @@ +{ + "type": "summary", + "hooks": [ + { + "class": "android.app.KeyguardManager", + "method": "isDeviceSecure", + "overloads": [ + { + "args": [] + } + ] + }, + { + "class": "android.hardware.biometrics.BiometricManager", + "method": "canAuthenticate", + "overloads": [ + { + "args": [ + "int" + ] + } + ] + } + ], + "totalHooks": 2, + "errors": [], + "totalErrors": 0 +} +{ + "id": "fddff36f-e11f-49ec-adec-fd775db3e998", + "type": "hook", + "category": "STORAGE", + "time": "2025-12-14T16:07:38.487Z", + "class": "android.app.KeyguardManager", + "method": "isDeviceSecure", + "instanceId": 33293371, + "stackTrace": [ + "android.app.KeyguardManager.isDeviceSecure(Native Method)", + "org.owasp.mastestapp.MastgTest.isDeviceSecure(MastgTest.kt:24)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:10)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [], + "returnValue": [ + { + "declaredType": "boolean", + "value": false + } + ] +} +{ + "id": "09e6ee6b-6db0-40d4-9c65-37522aaabcd0", + "type": "hook", + "category": "STORAGE", + "time": "2025-12-14T16:07:38.497Z", + "class": "android.hardware.biometrics.BiometricManager", + "method": "canAuthenticate", + "instanceId": 35486102, + "stackTrace": [ + "android.hardware.biometrics.BiometricManager.canAuthenticate(Native Method)", + "org.owasp.mastestapp.MastgTest.checkStrongBiometricStatus(MastgTest.kt:38)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:11)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [ + { + "declaredType": "int", + "value": 15 + } + ], + "returnValue": [ + { + "declaredType": "int", + "value": 11 + } + ] +} diff --git a/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/run.hooks.sh b/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/run.hooks.sh new file mode 100755 index 00000000000..44068ba587f --- /dev/null +++ b/demos/android/MASVS-RESILIENCE/MASTG-DEMO-0027/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/android/run.sh ./hooks.js diff --git a/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/hooks.js b/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/hooks.js new file mode 100644 index 00000000000..9f494551136 --- /dev/null +++ b/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/hooks.js @@ -0,0 +1,28 @@ +var target = { + category: "STORAGE", + hooks: [ + { + class: "android.content.ContentResolver", + method: "insert", + overloads: [ + { + args: ["android.net.Uri", "android.content.ContentValues"] + } + ] + }, + { + native: true, + module: "libc.so", + symbol: "open", + // maxFrames: 15, + filterEventsByStacktrace: "org.owasp.mastestapp", + args: [ + { type: "string", + name: "path", + filter: ["/sdcard", "/storage/emulated"] + } + ] + } + ] +}; + diff --git a/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/output.json b/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/output.json new file mode 100644 index 00000000000..9e3fa78170d --- /dev/null +++ b/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/output.json @@ -0,0 +1,107 @@ +{ + "type": "native-summary", + "hooks": [ + { + "module": "libc.so", + "symbol": "open" + } + ], + "totalHooks": 1, + "errors": [], + "totalErrors": 0 +} +{ + "type": "summary", + "hooks": [ + { + "class": "android.content.ContentResolver", + "method": "insert", + "overloads": [ + { + "args": [ + "android.net.Uri", + "android.content.ContentValues" + ] + } + ] + } + ], + "totalHooks": 1, + "errors": [], + "totalErrors": 0 +} +{ + "id": "3c68ba87-a2e8-4b52-82f5-b098c1ac4fd1", + "type": "native-hook", + "category": "STORAGE", + "time": "2025-12-14T16:10:35.209Z", + "module": "libc.so", + "symbol": "open", + "address": "0x753727c130", + "stackTrace": [ + "libcore.io.Linux.open(Native Method)", + "libcore.io.ForwardingOs.open(ForwardingOs.java:563)", + "libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)", + "libcore.io.ForwardingOs.open(ForwardingOs.java:563)", + "android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8063)", + "libcore.io.IoBridge.open(IoBridge.java:560)", + "java.io.FileOutputStream.(FileOutputStream.java:236)", + "java.io.FileOutputStream.(FileOutputStream.java:186)", + "org.owasp.mastestapp.MastgTest.mastgTestApi(MastgTest.kt:26)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:16)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [ + { + "name": "path", + "type": "string", + "value": "/storage/emulated/0/Android/data/org.owasp.mastestapp/files/secret.txt" + } + ] +} +{ + "id": "4f8ca771-9e45-4ed3-8ae3-2ae4d6c20f9b", + "type": "hook", + "category": "STORAGE", + "time": "2025-12-14T16:10:35.219Z", + "class": "android.content.ContentResolver", + "method": "insert", + "instanceId": 27044119, + "stackTrace": [ + "android.content.ContentResolver.insert(Native Method)", + "org.owasp.mastestapp.MastgTest.mastgTestMediaStore(MastgTest.kt:44)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:17)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", + "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", + "java.lang.Thread.run(Thread.java:1012)" + ], + "inputParameters": [ + { + "declaredType": "android.net.Uri", + "value": "content://media/external/downloads", + "runtimeType": "android.net.Uri$HierarchicalUri", + "instanceId": "167981316", + "instanceToString": "content://media/external/downloads" + }, + { + "declaredType": "android.content.ContentValues", + "value": "", + "runtimeType": "android.content.ContentValues", + "instanceId": "157501165", + "instanceToString": "_display_name=secretFile9.txt mime_type=text/plain relative_path=Download" + } + ], + "returnValue": [ + { + "declaredType": "android.net.Uri", + "value": "content://media/external/downloads/1000000064", + "runtimeType": "android.net.Uri$HierarchicalUri", + "instanceId": "37273523", + "instanceToString": "content://media/external/downloads/1000000064" + } + ] +} diff --git a/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/run.hooks.sh b/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/run.hooks.sh new file mode 100755 index 00000000000..44068ba587f --- /dev/null +++ b/demos/android/MASVS-STORAGE/MASTG-DEMO-0002/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/android/run.sh ./hooks.js diff --git a/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/hooks.js b/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/hooks.js index 15dcbeac650..f445f9470a8 100644 --- a/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/hooks.js +++ b/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/hooks.js @@ -1,6 +1,5 @@ var target = { category: "STORAGE", - demo: "0060", hooks: [ { class: "androidx.security.crypto.EncryptedSharedPreferences$Editor", diff --git a/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/output.json b/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/output.json index 748974bfffb..bcdbc5c5735 100644 --- a/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/output.json +++ b/demos/android/MASVS-STORAGE/MASTG-DEMO-0060/output.json @@ -1,258 +1,357 @@ { - "id": "219ea51c-506a-45f0-a295-34febdad2ca5", + "type": "summary", + "hooks": [ + { + "class": "androidx.security.crypto.EncryptedSharedPreferences$Editor", + "method": "putString", + "overloads": [ + { + "args": [ + "java.lang.String", + "java.lang.String" + ] + } + ] + }, + { + "class": "androidx.security.crypto.EncryptedSharedPreferences$Editor", + "method": "putStringSet", + "overloads": [ + { + "args": [ + "java.lang.String", + "java.util.Set" + ] + } + ] + }, + { + "class": "android.app.SharedPreferencesImpl$EditorImpl", + "method": "putString", + "overloads": [ + { + "args": [ + "java.lang.String", + "java.lang.String" + ] + } + ] + }, + { + "class": "android.app.SharedPreferencesImpl$EditorImpl", + "method": "putStringSet", + "overloads": [ + { + "args": [ + "java.lang.String", + "java.util.Set" + ] + } + ] + } + ], + "totalHooks": 4, + "errors": [], + "totalErrors": 0 +} +{ + "id": "ea9f902c-2dfd-4db4-84d1-18bbc4cd0811", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.158Z", + "time": "2025-12-14T16:15:57.685Z", "class": "android.app.SharedPreferencesImpl$EditorImpl", "method": "putString", + "instanceId": 47484326, "stackTrace": [ "android.app.SharedPreferencesImpl$EditorImpl.putString(Native Method)", "com.google.crypto.tink.integration.android.SharedPrefKeysetWriter.write(SharedPrefKeysetWriter.java:70)", - "com.google.crypto.tink.KeysetHandle.write(KeysetHandle.java:158)", - "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:299)", - "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)", - "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)", - "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:120)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:23)" + "com.google.crypto.tink.KeysetHandle.writeWithAssociatedData(KeysetHandle.java:869)", + "com.google.crypto.tink.KeysetHandle.write(KeysetHandle.java:858)", + "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.generateKeysetAndWriteToPrefs(AndroidKeysetManager.java:353)", + "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:292)", + "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:169)", + "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:131)" ], "inputParameters": [ { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "__androidx_security_crypto_encrypted_prefs_key_keyset__" }, { - "type": "java.lang.String", - "value": "12a901f5a4c43d49ce7ca6c207fb4d3f7711aba5131cbbd7951bd838c6c154e3528704bf527d554ad3facc098ad4645b1d2ed0a707c1c28f12ebf24e5a9ea08c57088e7c1b43ee84272605fe1ecbf9426509054974640b23e273b73d21a1d48029e4ef3787b6b1fc9c31d590b7e37663ea81e3135b3f0d3eb067148fcbb0e37b7d5909ad7a2cfc55bc11b4f8c00e79cebbf5cbeee2aca68f7558a65b86e888aa343caeea9551d82895a0956c1a4408cdaecffd04123c0a30747970652e676f6f676c65617069732e636f6d2f676f6f676c652e63727970746f2e74696e6b2e4165735369764b6579100118cdaecffd042001" + "declaredType": "java.lang.String", + "value": "12a7017d21bea75b78cae82fd11b43499928d13c8879eb52a49f207e86ec80fbbf460628e33e0121541aec6afc1049585f89f0edde9656e5abb33d6d8260bdee298831ed74e3b24d6110eea71f22e6bc9c540d9054b40f5a374eb73d8a8caedf5a66818f651784bcb2440effdbc60bc65cf32d1aac10b7bfba0c8fdf1d32568a130938a8e2d603ed13971d0662425acb1fc67a34b54bc5db8f3bd9ade395d4396987de639c8ea965557d1a4208b397c418123b0a30747970652e676f6f676c65617069732e636f6d2f676f6f676c652e63727970746f2e74696e6b2e4165735369764b6579100118b397c4182001" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "android.app.SharedPreferencesImpl$EditorImpl", + "instanceId": "47484326", + "instanceToString": "android.app.SharedPreferencesImpl$EditorImpl@2d48da6" } ] } { - "id": "2726948e-87f4-4088-a4fd-b5a3facfe460", + "id": "a9d9725c-e38f-466a-93f2-359350a74d09", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.203Z", + "time": "2025-12-14T16:15:57.723Z", "class": "android.app.SharedPreferencesImpl$EditorImpl", "method": "putString", + "instanceId": 157300285, "stackTrace": [ "android.app.SharedPreferencesImpl$EditorImpl.putString(Native Method)", "com.google.crypto.tink.integration.android.SharedPrefKeysetWriter.write(SharedPrefKeysetWriter.java:70)", - "com.google.crypto.tink.KeysetHandle.write(KeysetHandle.java:158)", - "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:299)", - "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)", - "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:160)", - "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:120)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:23)" + "com.google.crypto.tink.KeysetHandle.writeWithAssociatedData(KeysetHandle.java:869)", + "com.google.crypto.tink.KeysetHandle.write(KeysetHandle.java:858)", + "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.generateKeysetAndWriteToPrefs(AndroidKeysetManager.java:353)", + "com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:292)", + "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:174)", + "androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:131)" ], "inputParameters": [ { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "__androidx_security_crypto_encrypted_prefs_value_keyset__" }, { - "type": "java.lang.String", - "value": "1286013ebf2688905cdc7062581d934cf22d866c35f5b0c3a4617ef00a4b44c2a33bb9f8c49e2a82535763dadee05ed2587811270339d066bc335db019ab60a68108652cd14a90a77b324a90c5d9ce8fae1a2da0f317b10d71e92c49ae9c0a17ec321e6f3a0c4edcb41580f16e93adfea98518127706dfbee4bef3af57f7419fd7216e89efea8b3f3d1a4208fbc18150123b0a30747970652e676f6f676c65617069732e636f6d2f676f6f676c652e63727970746f2e74696e6b2e41657347636d4b6579100118fbc181502001" + "declaredType": "java.lang.String", + "value": "128801a023f82ba0596167843deae170d9bbb8b9a2f9d1a670b30139980ab572ba5e0b7532254493fda727d0bb713b2b7d53d23da1cc2de0ebd9bfb9d418d86fd5529cd9fb699164bf8fe460c49a1b28c5f5400acfbda852c920274a14f94b57395e58aa3c29ee92207f0ba9aabd8996b3697a2fa70b10a10c90362468d261d8a27619e04a4595ec6a22371a4408c6c9c7f007123c0a30747970652e676f6f676c65617069732e636f6d2f676f6f676c652e63727970746f2e74696e6b2e41657347636d4b6579100118c6c9c7f0072001" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "android.app.SharedPreferencesImpl$EditorImpl", + "instanceId": "157300285", + "instanceToString": "android.app.SharedPreferencesImpl$EditorImpl@960363d" } ] } { - "id": "9c495048-f0db-405b-807b-01e0cfbab573", + "id": "94195a2e-7bb8-40b1-99e7-1d700e326a31", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.220Z", + "time": "2025-12-14T16:15:57.740Z", "class": "android.app.SharedPreferencesImpl$EditorImpl", "method": "putString", + "instanceId": 203356473, "stackTrace": [ "android.app.SharedPreferencesImpl$EditorImpl.putString(Native Method)", - "androidx.security.crypto.EncryptedSharedPreferences$Editor.putEncryptedObject(EncryptedSharedPreferences.java:378)", - "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(EncryptedSharedPreferences.java:244)", + "androidx.security.crypto.EncryptedSharedPreferences$Editor.putEncryptedObject(EncryptedSharedPreferences.java:389)", + "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(EncryptedSharedPreferences.java:262)", "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(Native Method)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:32)", - "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$6$lambda$5(MainActivity.kt:55)", - "org.owasp.mastestapp.MainActivityKt.$r8$lambda$PtKdgqcXvbS9cMNZVWq3K3GGQKQ(Unknown Source:0)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:33)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)" ], "inputParameters": [ { - "type": "java.lang.String", - "value": "AU+z103BuqUQYnpJY8AyhGP4jbkz01jtCY5EQGG4pVwOPhVv" + "declaredType": "java.lang.String", + "value": "AQMRC7NJHrnwtE5suFMVSkzr7Zz0m55Yz/Gt4MQ8jXR9LQ+W" }, { - "type": "java.lang.String", - "value": "AQoAYPs27SgygktthcLjII2K6yyUMBoY8F59mzWbE1ps2WT5P87ChxB0QF8R4UuBc6WRy+9R0qwpD3WOKw==" + "declaredType": "java.lang.String", + "value": "AX4R5MZUHcm4oHxRHFkLTNs1gD0Z3nw+sIydsAhIzrrW2J6wPKo71e3M7u5rHokf1XOuV4fKuKZBfxl9Ag==" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "android.app.SharedPreferencesImpl$EditorImpl", + "instanceId": "203356473", + "instanceToString": "android.app.SharedPreferencesImpl$EditorImpl@c1ef939" } ] } { - "id": "60d32d3c-210a-4a44-926f-874e02ed02b0", + "id": "802c356a-0e12-4cc0-87d8-9e031ccfc5ba", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.214Z", + "time": "2025-12-14T16:15:57.732Z", "class": "androidx.security.crypto.EncryptedSharedPreferences$Editor", "method": "putString", + "instanceId": 195579136, "stackTrace": [ "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(Native Method)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:32)", - "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$6$lambda$5(MainActivity.kt:55)", - "org.owasp.mastestapp.MainActivityKt.$r8$lambda$PtKdgqcXvbS9cMNZVWq3K3GGQKQ(Unknown Source:0)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:33)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", "java.lang.Thread.run(Thread.java:1012)" ], "inputParameters": [ { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "EncryptedAWSKey" }, { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "AKIAABCDEFGHIJKLMNOP" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "androidx.security.crypto.EncryptedSharedPreferences$Editor", + "instanceId": "195579136", + "instanceToString": "androidx.security.crypto.EncryptedSharedPreferences$Editor@ba84d00" } ] } { - "id": "13976db9-4f60-4483-b2e3-46b0399f0222", + "id": "5ec3d780-08bc-4e03-a595-ce5a2091026b", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.228Z", + "time": "2025-12-14T16:15:57.747Z", "class": "android.app.SharedPreferencesImpl$EditorImpl", "method": "putString", + "instanceId": 203356473, "stackTrace": [ "android.app.SharedPreferencesImpl$EditorImpl.putString(Native Method)", - "androidx.security.crypto.EncryptedSharedPreferences$Editor.putEncryptedObject(EncryptedSharedPreferences.java:378)", - "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(EncryptedSharedPreferences.java:244)", + "androidx.security.crypto.EncryptedSharedPreferences$Editor.putEncryptedObject(EncryptedSharedPreferences.java:389)", + "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(EncryptedSharedPreferences.java:262)", "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(Native Method)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:33)", - "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$6$lambda$5(MainActivity.kt:55)", - "org.owasp.mastestapp.MainActivityKt.$r8$lambda$PtKdgqcXvbS9cMNZVWq3K3GGQKQ(Unknown Source:0)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:34)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)" ], "inputParameters": [ { - "type": "java.lang.String", - "value": "AU+z101V35Id7aRshk1QOi8IHsdlvcPXjNA885hbFak=" + "declaredType": "java.lang.String", + "value": "AQMRC7OWD6/h1iJseuzJVrClpwKE8swB8gOrGnsdaN4=" }, { - "type": "java.lang.String", - "value": "AQoAYPt6nO+4SoPqUjsZNEYzlPIZn7LtawLzrii1G0XDtQyVJOaSNNwo4OHjYx6CrYcOaSzjr8Fii72fhCSA2KTE5j0BphTnYoc0gz5j3CO/" + "declaredType": "java.lang.String", + "value": "AX4R5MY3Azxu9O7perhGfVSiZBorp7KHrLIa1O+ZIjh4h+PxEga/Z8Mew9qOgwaNEYFUC4R9c0coYoMWetDtwxMMdzYoya3rS8kcF2pJ+yeB" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "android.app.SharedPreferencesImpl$EditorImpl", + "instanceId": "203356473", + "instanceToString": "android.app.SharedPreferencesImpl$EditorImpl@c1ef939" } ] } { - "id": "29fc3b94-48ce-4d93-86ba-2a16d88ba1c5", + "id": "18c8609d-10e4-4ad3-957c-540ab3c6ebed", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.222Z", + "time": "2025-12-14T16:15:57.743Z", "class": "androidx.security.crypto.EncryptedSharedPreferences$Editor", "method": "putString", + "instanceId": 195579136, "stackTrace": [ "androidx.security.crypto.EncryptedSharedPreferences$Editor.putString(Native Method)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:33)", - "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$6$lambda$5(MainActivity.kt:55)", - "org.owasp.mastestapp.MainActivityKt.$r8$lambda$PtKdgqcXvbS9cMNZVWq3K3GGQKQ(Unknown Source:0)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:34)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", "java.lang.Thread.run(Thread.java:1012)" ], "inputParameters": [ { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "GitHubToken" }, { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "ghp_1234567890abcdefghijklmnopqrstuvABCD" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "androidx.security.crypto.EncryptedSharedPreferences$Editor", + "instanceId": "195579136", + "instanceToString": "androidx.security.crypto.EncryptedSharedPreferences$Editor@ba84d00" } ] } { - "id": "e5aa1f47-435e-458a-93ea-37b8c4d2ef1b", + "id": "a7f3b115-ee17-4512-b4e5-bede375b73d9", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.236Z", + "time": "2025-12-14T16:15:57.756Z", "class": "android.app.SharedPreferencesImpl$EditorImpl", "method": "putString", + "instanceId": 203356473, "stackTrace": [ "android.app.SharedPreferencesImpl$EditorImpl.putString(Native Method)", - "androidx.security.crypto.EncryptedSharedPreferences$Editor.putEncryptedObject(EncryptedSharedPreferences.java:378)", - "androidx.security.crypto.EncryptedSharedPreferences$Editor.putStringSet(EncryptedSharedPreferences.java:270)", + "androidx.security.crypto.EncryptedSharedPreferences$Editor.putEncryptedObject(EncryptedSharedPreferences.java:389)", + "androidx.security.crypto.EncryptedSharedPreferences$Editor.putStringSet(EncryptedSharedPreferences.java:287)", "androidx.security.crypto.EncryptedSharedPreferences$Editor.putStringSet(Native Method)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:34)", - "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$6$lambda$5(MainActivity.kt:55)", - "org.owasp.mastestapp.MainActivityKt.$r8$lambda$PtKdgqcXvbS9cMNZVWq3K3GGQKQ(Unknown Source:0)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:35)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)" ], "inputParameters": [ { - "type": "java.lang.String", - "value": "AU+z101iVWAe4pyZC7djOC9ugpEv9bxXAahqi4DNvuxcyA==" + "declaredType": "java.lang.String", + "value": "AQMRC7PmmtQeo27DnFbH7Ruc9Gwm36B+0IwxJVaN2xsfZw==" }, { - "type": "java.lang.String", - "value": "AQoAYPv4h47i7VnSEOZH5BBhnMHHb7hX8wPucI9srOw3GkBZBATxlaE5DGWP+AFn6uITZMiHZdhGXPuX6YxRr4dipYLV3hD98AlV613qYAY+seweUVfeQ6VJpVeSYmqHMyeQQEDPwqT9QJ5vKE6tWbOW95wGmGgR4D7I+NCEnV9rHoJfO1vjYdJDHzBv2akR5nY/EAWI0yXDt1wdSr1p31t/myCi7UDoknmD5Iq7MSEdzCOzP+J7LGP9Hb4EW1sjgZs5yuY42hzdfZ0QgeK8afeEIu84omuzqn0+icWc6Gkx3/rtBRJbnAGL3rOoV6MISqE5PshiVWzBflt4qPmxcn9S64ru6R9mcixn1MiKG5anG/Q=" + "declaredType": "java.lang.String", + "value": "AX4R5MYG741o4Z6Dhds6QSahfwD4jjJcJM0GRB6+d+tsaqhJFaToLbooxyC5LHQfw2AGsQwhV43ypQ0fJzXVRg5qe+vrx754QWYAKObgJtdaoLKMmAjZbZZPaaJS9k3fIqwtPiDEECFzHmvugWIbS/ryqtFixhCME2qs8nV6JjWMTtZJSmNNseXaToY2rOfKJmFuz0zAMZYhOdUW2rbcED6HDp3es12skdvSSQ7/5vyIekCQlezZIM4q9pGd7MYW6tZEezQYkBUN7RIzphO3fjwgAdkT60atEm2QcFQ43TkGxEfBrDYnFO6iXSEwtRrWjmCIg7Jgu6X9KdV2/xxcqgwEQsC9DBLT+/O7dDG7RubA9cE=" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "android.app.SharedPreferencesImpl$EditorImpl", + "instanceId": "203356473", + "instanceToString": "android.app.SharedPreferencesImpl$EditorImpl@c1ef939" } ] } { - "id": "53480382-6252-49e5-8b1a-bbe7cc0540f2", + "id": "62d3b800-337f-4844-899d-538e135cf0e0", + "type": "hook", "category": "STORAGE", - "time": "2025-09-22T20:53:10.230Z", + "time": "2025-12-14T16:15:57.751Z", "class": "androidx.security.crypto.EncryptedSharedPreferences$Editor", "method": "putStringSet", + "instanceId": 195579136, "stackTrace": [ "androidx.security.crypto.EncryptedSharedPreferences$Editor.putStringSet(Native Method)", - "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:34)", - "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$6$lambda$5(MainActivity.kt:55)", - "org.owasp.mastestapp.MainActivityKt.$r8$lambda$PtKdgqcXvbS9cMNZVWq3K3GGQKQ(Unknown Source:0)", + "org.owasp.mastestapp.MastgTest.mastgTest(MastgTest.kt:35)", + "org.owasp.mastestapp.MainActivityKt.MainScreen$lambda$12$lambda$11(MainActivity.kt:101)", + "org.owasp.mastestapp.MainActivityKt.$r8$lambda$Pm6AsbKBmypP53K-UABM21E_Xxk(Unknown Source:0)", "org.owasp.mastestapp.MainActivityKt$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)", "java.lang.Thread.run(Thread.java:1012)" ], "inputParameters": [ { - "type": "java.lang.String", + "declaredType": "java.lang.String", "value": "preSharedKeys" }, { - "type": "java.util.Set", - "value": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALfX7kbfFv3pc3JjOHQ=\n-----END PRIVATE KEY-----,-----BEGIN PRIVATE KEY-----\ngJXS9EwpuzK8U1TOgfplwfKEVngCE2D5FNBQWvNmuHHbigmTCabsA=\n-----END PRIVATE KEY-----" + "declaredType": "java.util.Set", + "value": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALfX7kbfFv3pc3JjOHQ=\n-----END PRIVATE KEY-----,-----BEGIN PRIVATE KEY-----\ngJXS9EwpuzK8U1TOgfplwfKEVngCE2D5FNBQWvNmuHHbigmTCabsA=\n-----END PRIVATE KEY-----", + "runtimeType": "java.util.HashSet", + "instanceId": "70626174", + "instanceToString": "[-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALfX7kbfFv3pc3JjOHQ=\n-----END PRIVATE KEY-----, -----BEGIN PRIVATE KEY-----\ngJXS9EwpuzK8U1TOgfplwfKEVngCE2D5FNBQWvNmuHHbigmTCabsA=\n-----END PRIVATE KEY-----]" } ], "returnValue": [ { - "type": "android.content.SharedPreferences$Editor", - "value": "" + "declaredType": "android.content.SharedPreferences$Editor", + "value": "", + "runtimeType": "androidx.security.crypto.EncryptedSharedPreferences$Editor", + "instanceId": "195579136", + "instanceToString": "androidx.security.crypto.EncryptedSharedPreferences$Editor@ba84d00" } ] } diff --git a/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/hooks.js b/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/hooks.js new file mode 100644 index 00000000000..9fe30fe6c78 --- /dev/null +++ b/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/hooks.js @@ -0,0 +1,50 @@ +var target = { + category: "AUTH", + hooks: [ + // SecAccessControlCreateWithFlags(allocator, protection, flags, &error) -> SecAccessControl + { + native: true, + symbol: "SecAccessControlCreateWithFlags", + maxFrames: -1, + args: [ + { name: "allocator", type: "pointer" }, + { name: "protection", type: "pointer" }, // CFString (e.g., kSecAttrAccessibleWhenUnlocked) + { name: "flags", type: "uint32" }, // SecAccessControlCreateFlags bitmask + { name: "error", type: "pointer" }, + { name: "accessControl", type: "pointer", returnValue: true, direction: "out" } + ] + }, + + // SecItemAdd(query CFDictionary, CFTypeRef* result) -> OSStatus + { + native: true, + symbol: "SecItemAdd", + maxFrames: -1, + args: [ + { name: "query", type: "CFDictionary" }, + { name: "result", type: "pointer" } + ] + }, + + // SecItemDelete(query CFDictionary) -> OSStatus + { + native: true, + symbol: "SecItemDelete", + maxFrames: -1, + args: [ + { name: "query", type: "CFDictionary" } + ] + }, + + // SecItemCopyMatching(query CFDictionary, CFTypeRef* result) -> OSStatus + { + native: true, + symbol: "SecItemCopyMatching", + maxFrames: -1, + args: [ + { name: "query", type: "CFDictionary" }, + { name: "result", type: "pointer" } + ] + } + ] +}; diff --git a/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/output.json b/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/output.json new file mode 100644 index 00000000000..82d4b4e33b4 --- /dev/null +++ b/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/output.json @@ -0,0 +1,195 @@ +{ + "type": "summary", + "hooks": [ + { + "type": "native", + "module": "", + "symbol": "SecAccessControlCreateWithFlags" + }, + { + "type": "native", + "module": "", + "symbol": "SecItemAdd" + }, + { + "type": "native", + "module": "", + "symbol": "SecItemDelete" + }, + { + "type": "native", + "module": "", + "symbol": "SecItemCopyMatching" + } + ], + "totalHooks": 4, + "errors": [], + "totalErrors": 0 +} +{ + "id": "0c214d31-9ab8-4dc3-bb4a-2b61f0f721f5", + "type": "native-hook", + "category": "AUTH", + "time": "2025-12-14T16:30:00.610Z", + "module": "", + "symbol": "SecAccessControlCreateWithFlags", + "address": "0x18203e4d4", + "stackTrace": [ + "0x102ee94c0 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:13:31", + "0x102eeba8c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "allocator", + "type": "pointer", + "value": "0x0" + }, + { + "name": "protection", + "type": "pointer", + "value": "0x1e6328aa8" + }, + { + "name": "flags", + "type": "uint32", + "value": 1 + }, + { + "name": "error", + "type": "pointer", + "value": "0x0" + }, + { + "name": "accessControl", + "type": "pointer", + "value": "i���\u0001" + } + ], + "retval": "0x6000002191a0" +} +{ + "id": "6b1e9ebb-d162-4f60-8d21-a8f3e31fd9ca", + "type": "native-hook", + "category": "AUTH", + "time": "2025-12-14T16:30:00.620Z", + "module": "", + "symbol": "SecItemDelete", + "address": "0x182061bfc", + "stackTrace": [ + "0x102ee975c MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:39:5", + "0x102eeba8c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "query", + "type": "CFDictionary", + "value": "{\"class\":\"genp\",\"v_Data\":\"ODc2NzA4NmI5ZjZmOTc2Zy1hOGRmNzY=\",\"accc\":\"\",\"acct\":\"com.mastg.sectoken\"}" + } + ] +} +{ + "id": "7fcfe68f-9216-48f4-9ef5-1270e9fae91b", + "type": "native-hook", + "category": "AUTH", + "time": "2025-12-14T16:30:00.627Z", + "module": "", + "symbol": "SecItemAdd", + "address": "0x1820603dc", + "stackTrace": [ + "0x102ee979c MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:40:23", + "0x102eeba8c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "query", + "type": "CFDictionary", + "value": "{\"class\":\"genp\",\"v_Data\":\"ODc2NzA4NmI5ZjZmOTc2Zy1hOGRmNzY=\",\"accc\":\"\",\"acct\":\"com.mastg.sectoken\"}" + }, + { + "name": "result", + "type": "pointer", + "value": "0x0" + } + ] +} +{ + "id": "d84265fc-ade3-4e68-8dac-b463473a2f77", + "type": "native-hook", + "category": "AUTH", + "time": "2025-12-14T16:30:00.629Z", + "module": "", + "symbol": "SecItemCopyMatching", + "address": "0x182061a18", + "stackTrace": [ + "0x102ee9a04 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:62:23", + "0x102eeba8c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "query", + "type": "CFDictionary", + "value": "{\"acct\":\"com.mastg.sectoken\",\"r_Data\":1,\"m_Limit\":\"m_LimitOne\",\"class\":\"genp\"}" + }, + { + "name": "result", + "type": "pointer", + "value": "0x16cfbdf30" + } + ] +} diff --git a/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/run.hooks.sh b/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/run.hooks.sh new file mode 100755 index 00000000000..c993f75b39b --- /dev/null +++ b/demos/ios/MASVS-AUTH/MASTG-DEMO-0043/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/ios/run.sh ./hooks.js diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/hooks.js b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/hooks.js new file mode 100644 index 00000000000..40c90c7e71a --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/hooks.js @@ -0,0 +1,57 @@ +var target = { + category: "CRYPTO", + hooks: [ + // Generate RSA key pair: SecKeyCreateRandomKey(attributes CFDictionary, &error) -> SecKey (private) + { + native: true, + symbol: "SecKeyCreateRandomKey", + maxFrames: -1, + // filterEventsByStacktrace: "MASTG-DEMO-0011", + args: [ + { name: "keyAttributes", type: "CFDictionary" }, + { name: "error", type: "pointer" }, + { name: "privateKey", type: "pointer", returnValue: true, direction: "out" } + ] + }, + // Capture signature creation: SecKeyCreateSignature(privateKey, algorithm, dataToSign CFData, &error) -> CFData signature + { + native: true, + symbol: "SecKeyCreateSignature", + maxFrames: -1, + // filterEventsByStacktrace: "MASTG-DEMO-0011", + args: [ + { name: "privateKey", type: "pointer" }, + { name: "algorithm", type: "pointer" }, + { name: "dataToSign", type: "CFData" }, + { name: "error", type: "pointer" }, + { name: "signature", type: "CFData", returnValue: true, direction: "out" } + ] + }, + + // Capture verification: SecKeyVerifySignature(publicKey, algorithm, dataToSign CFData, signature CFData, &error) -> bool + { + native: true, + symbol: "SecKeyVerifySignature", + maxFrames: -1, + args: [ + { name: "publicKey", type: "pointer" }, + { name: "algorithm", type: "pointer" }, + { name: "dataToSign", type: "CFData" }, + { name: "signature", type: "CFData" }, + { name: "error", type: "pointer" } + ] + }, + + // Capture external representation (DER) of keys + { + native: true, + symbol: "SecKeyCopyExternalRepresentation", + maxFrames: -1, + args: [ + { name: "key", type: "pointer" }, + { name: "error", type: "pointer" }, + { name: "der", type: "CFData", returnValue: true, direction: "out" } + ] + } + ] +}; diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/output.json b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/output.json new file mode 100644 index 00000000000..07ebca1bb2e --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/output.json @@ -0,0 +1,278 @@ +{ + "type": "summary", + "hooks": [ + { + "type": "native", + "module": "", + "symbol": "SecKeyCreateRandomKey" + }, + { + "type": "native", + "module": "", + "symbol": "SecKeyCreateSignature" + }, + { + "type": "native", + "module": "", + "symbol": "SecKeyVerifySignature" + }, + { + "type": "native", + "module": "", + "symbol": "SecKeyCopyExternalRepresentation" + } + ], + "totalHooks": 4, + "errors": [], + "totalErrors": 0 +} +{ + "id": "e2493608-9a4b-49a6-bafd-c6d404e13710", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:32:23.208Z", + "module": "", + "symbol": "SecKeyCreateRandomKey", + "address": "0x18206c97c", + "stackTrace": [ + "0x10264d788 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:18:32", + "0x102650ed0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "keyAttributes", + "type": "CFDictionary", + "value": "{\"private\":\"{\\n atag = {length = 22, bytes = 0x6f72672e6f776173702e6d61732e7273612d31303134};\\n perm = 1;\\n}\",\"bsiz\":1024,\"type\":\"42\"}" + }, + { + "name": "error", + "type": "pointer", + "value": "0x16d919f30" + }, + { + "name": "privateKey", + "type": "pointer", + "value": "i���\u0001" + } + ], + "retval": "0x600000c4c190" +} +{ + "id": "c33fca47-d7d1-4b03-a08b-f7e683f423b9", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:32:23.235Z", + "module": "", + "symbol": "SecKeyCopyExternalRepresentation", + "address": "0x182070484", + "stackTrace": [ + "0x10264d800 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:29:36", + "0x102650ed0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "key", + "type": "pointer", + "value": "0x600000c4c190" + }, + { + "name": "error", + "type": "pointer", + "value": "0x16d919f30" + }, + { + "name": "der", + "type": "CFData", + "value": "MIICXQIBAAKBgQCwrB5juV7dbUPSJcznCbLL3QbBr3v0QhkwIdaNw8RJfrHaVHuqysx2MIfhBuc5y7QjkRu32/DE0p/4Jd40mNJS+4cAxxBUqhAlekULvkcZvbwbvfFyuTHmL9cvvEcvys8wq4mG+QcCO1wVVqED+OBhXLtD5Tltnafit65Zh44dWwIDAQABAoGAE4jPH2Wqsz8BRbt/lCLYDdSANRWV1g8iQSvXUPt5Y6BKQq10CGa+BBTKTBD7AMKg8Lclt8buMJpoAlm6366aFVAPuFdoT1quv0e1SNmOx1XdiXhGl8mAkf9kehwfFMReuQ8PEVijb/i1S8H5K+51zDUCYS2sorXjJma+IOO4I8kCQQDyEhPFrIA4KMVtGfLL9sq+PeTgMDXjeExYG8ETkbEoWnHHuGHK+W0Qmi+2H/AKw8HHa8kR6QZnrxQ4tG4c0W1nAkEAutaqK/YDv+qsf1RFOuoen2qkdgFkNe9FOJ7kk0ILx0Y3DIK2zSfJVHJwbAhUUqpcMhOLc4u9sAYmhqKyCZtj7QJBAL5f0ybx7AC+p82Oy7D2zSnimV5q6+aSFFByu1y9hrr6rmLoshgkI08cQ4uTAIAmxf4k2YP5ZG0kdt3FoJePaN8CQGa+OzAXhjJYU2llpvhh3Fsf4rZ9x2SdYjxjrCCKdj2sEAOSMgIZOe51S/ssjWo0AqUK+Gme073jc/Yfq7X6vHUCQQDfzdoDLXtYa2veDX7GtlRQcn4wyNPhjsCxt9JGKziK9aFY089zrFd907WqRqVdbUiYRAp4bflVPq3QwSCgudGo", + "format": "base64" + } + ], + "retval": "0x103635fa0" +} +{ + "id": "4c997802-4d14-49a3-acd0-e7fb10b079e6", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:32:23.236Z", + "module": "", + "symbol": "SecKeyCopyExternalRepresentation", + "address": "0x182070484", + "stackTrace": [ + "0x10264d99c MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:39:35", + "0x102650ed0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "key", + "type": "pointer", + "value": "0x600000c31f30" + }, + { + "name": "error", + "type": "pointer", + "value": "0x16d919f30" + }, + { + "name": "der", + "type": "CFData", + "value": "MIGJAoGBALCsHmO5Xt1tQ9IlzOcJssvdBsGve/RCGTAh1o3DxEl+sdpUe6rKzHYwh+EG5znLtCORG7fb8MTSn/gl3jSY0lL7hwDHEFSqECV6RQu+Rxm9vBu98XK5MeYv1y+8Ry/KzzCriYb5BwI7XBVWoQP44GFcu0PlOW2dp+K3rlmHjh1bAgMBAAE=", + "format": "base64" + } + ], + "retval": "0x6000017513d0" +} +{ + "id": "5e151303-cac1-4e8b-b7c3-604d18c1b8a0", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:32:23.238Z", + "module": "", + "symbol": "SecKeyCreateSignature", + "address": "0x18206e284", + "stackTrace": [ + "0x10264dc70 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:52:31", + "0x102650ed0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "privateKey", + "type": "pointer", + "value": "0x600000c4c190" + }, + { + "name": "algorithm", + "type": "pointer", + "value": "0x1e632a0c8" + }, + { + "name": "dataToSign", + "type": "CFData", + "value": "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0", + "format": "base64" + }, + { + "name": "error", + "type": "pointer", + "value": "0x16d919f30" + }, + { + "name": "signature", + "type": "CFData", + "value": "fcGu/G8QmjEQOoy3jQjo4siGs7QlpLjI5bZmPIIEKpEIxc2SGq1QB3iWo428EwsaIiq6BvSJx/vmR7VgfKdR2lmg+n5Tzxgpxi+YTc6y/AX2o7dmsKb2Q2hsDCUGPOHAmNIe7GHVZP2gcER0PmrhrMcfkSlGBHR9l4Opye3OgeM=", + "format": "base64" + } + ], + "retval": "0x600001751710" +} +{ + "id": "889530c4-2b1a-43b7-a304-081a0706d233", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:32:23.239Z", + "module": "", + "symbol": "SecKeyVerifySignature", + "address": "0x18206ea54", + "stackTrace": [ + "0x10264ddf8 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:66:34", + "0x102650ed0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da431e6c SwiftUI!closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da437e20 SwiftUI!partial apply for closure #2 in PrimitiveButtonGestureCallbacks.dispatch(phase:state:)", + "0x1da914e58 SwiftUICore!", + "0x1daa8b2f4 SwiftUICore!", + "0x1d9951ed0 SwiftUI!", + "0x1d9c0e8e8 SwiftUI!" + ], + "inputParameters": [ + { + "name": "publicKey", + "type": "pointer", + "value": "0x600000c31f30" + }, + { + "name": "algorithm", + "type": "pointer", + "value": "0x1e632a0c8" + }, + { + "name": "dataToSign", + "type": "CFData", + "value": "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0", + "format": "base64" + }, + { + "name": "signature", + "type": "CFData", + "value": "fcGu/G8QmjEQOoy3jQjo4siGs7QlpLjI5bZmPIIEKpEIxc2SGq1QB3iWo428EwsaIiq6BvSJx/vmR7VgfKdR2lmg+n5Tzxgpxi+YTc6y/AX2o7dmsKb2Q2hsDCUGPOHAmNIe7GHVZP2gcER0PmrhrMcfkSlGBHR9l4Opye3OgeM=", + "format": "base64" + }, + { + "name": "error", + "type": "pointer", + "value": "0x16d919f30" + } + ] +} diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/run.hooks.sh b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/run.hooks.sh new file mode 100755 index 00000000000..c993f75b39b --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/ios/run.sh ./hooks.js diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/hooks.js b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/hooks.js new file mode 100644 index 00000000000..513f7197106 --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/hooks.js @@ -0,0 +1,29 @@ +var target = { + category: "CRYPTO", + hooks: [ + // CC_SHA1(const void *data, CC_LONG len, unsigned char *md) + { + native: true, + symbol: "CC_SHA1", + maxFrames: -1, + filterEventsByStacktrace: "MASTestApp", + args: [ + { name: "data", type: "bytes", lengthInArg: "len" }, + { name: "len", type: "uint32" }, + { name: "md", type: "bytes", length: 20, direction: "out" } // SHA1 digest length + ] + }, + // CC_MD5(const void *data, CC_LONG len, unsigned char *md) + { + native: true, + symbol: "CC_MD5", + maxFrames: -1, + filterEventsByStacktrace: "MASTestApp", + args: [ + { name: "data", type: "bytes", lengthInArg: "len" }, + { name: "len", type: "uint32" }, + { name: "md", type: "bytes", length: 16, direction: "out" } // MD5 digest length + ] + } + ] +}; diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/output.json b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/output.json new file mode 100644 index 00000000000..c2413b58c1d --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/output.json @@ -0,0 +1,112 @@ +{ + "type": "summary", + "hooks": [ + { + "type": "native", + "module": "", + "symbol": "CC_SHA1" + }, + { + "type": "native", + "module": "", + "symbol": "CC_MD5" + } + ], + "totalHooks": 2, + "errors": [], + "totalErrors": 0 +} +{ + "id": "60f70cf8-ef99-4d24-ace2-b59c882940ef", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:38:26.624Z", + "module": "", + "symbol": "CC_SHA1", + "address": "0x1d1ba2dac", + "stackTrace": [ + "0x1009456bc MASTestApp.debug.dylib!closure #1 in static MastgTest.generateSHA1Hash(data:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:9:17", + "0x100945854 MASTestApp.debug.dylib!partial apply for closure #1 in static MastgTest.generateSHA1Hash(data:) /:0", + "0x180b91f24 Foundation!__DataStorage.withUnsafeBytes(in:apply:)", + "0x180b978f8 Foundation!Data._Representation.withUnsafeBytes(_:)", + "0x180b90dac Foundation!Data.withUnsafeBytes(_:)", + "0x1009452a8 MASTestApp.debug.dylib!static MastgTest.generateSHA1Hash(data:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:8:14", + "0x100946b88 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:27:24", + "0x1009487e0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)" + ], + "inputParameters": [ + { + "name": "data", + "type": "bytes", + "value": "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0", + "format": "base64" + }, + { + "name": "len", + "type": "uint32", + "value": 21 + }, + { + "name": "md", + "type": "bytes", + "value": "5mbmf2b0A44MHS98Oiq+ryezEj8=", + "format": "base64" + } + ], + "retval": "0x600001715ee0" +} +{ + "id": "6d18b08c-5357-4c0b-872c-b541cc03d887", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:38:26.794Z", + "module": "", + "symbol": "CC_MD5", + "address": "0x1d1ba2a48", + "stackTrace": [ + "0x10094676c MASTestApp.debug.dylib!closure #1 in static MastgTest.generateMD5Hash(data:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:18:17", + "0x10094688c MASTestApp.debug.dylib!partial apply for closure #1 in static MastgTest.generateMD5Hash(data:) /:0", + "0x180b91f24 Foundation!__DataStorage.withUnsafeBytes(in:apply:)", + "0x180b978f8 Foundation!Data._Representation.withUnsafeBytes(_:)", + "0x180b90dac Foundation!Data.withUnsafeBytes(_:)", + "0x100946358 MASTestApp.debug.dylib!static MastgTest.generateMD5Hash(data:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:17:14", + "0x100946bbc MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:30:23", + "0x1009487e0 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter", + "0x1da436c90 SwiftUI!partial apply for closure #1 in closure #2 in closure #1 in _ButtonGesture.internalBody.getter", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)" + ], + "inputParameters": [ + { + "name": "data", + "type": "bytes", + "value": "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0", + "format": "base64" + }, + { + "name": "len", + "type": "uint32", + "value": 21 + }, + { + "name": "md", + "type": "bytes", + "value": "YCnyhWEBTNL8zvUSU75tuw==", + "format": "base64" + } + ], + "retval": "0x600000c3de50" +} diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/run.hooks.sh b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/run.hooks.sh new file mode 100755 index 00000000000..c993f75b39b --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/ios/run.sh ./hooks.js diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/hooks.js b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/hooks.js new file mode 100644 index 00000000000..6f679af789d --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/hooks.js @@ -0,0 +1,25 @@ +var target = { + category: "MASVS-CRYPTO", + hooks: [ + { + native: true, + symbol: "CCCrypt", + maxFrames: -1, + args: [ + { name: "op", type: "uint32", filter: [0] }, // kCCEncrypt + { name: "alg", type: "uint32", filter: [2] }, // kCCAlgorithm3DES + { name: "options", type: "uint32" }, + { name: "key", type: "bytes", lengthInArg: "keyLength" }, + { name: "keyLength", type: "uint32" }, + { name: "iv", type: "bytes", length: 8 }, + { name: "dataIn", type: "bytes", lengthInArg: "dataInLength" }, + { name: "dataInLength", type: "uint32" }, + { name: "dataOut", type: "bytes", lengthInArg: "dataOutMoved", direction: "out" }, + { name: "dataOutAvailable", type: "uint32" }, + { name: "dataOutMoved", type: "pointer" } + ], + debug: true + } + ] +}; + diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/output.json b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/output.json new file mode 100644 index 00000000000..51fdf48ad3a --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/output.json @@ -0,0 +1,102 @@ +{ + "type": "summary", + "hooks": [ + { + "type": "native", + "module": "", + "symbol": "CCCrypt" + } + ], + "totalHooks": 1, + "errors": [], + "totalErrors": 0 +} +{ + "id": "235af42a-0e4f-4bf1-83be-950dc16d17bc", + "type": "native-hook", + "category": "CRYPTO", + "time": "2025-12-14T16:40:40.405Z", + "module": "", + "symbol": "CCCrypt", + "address": "0x1d1ba1690", + "stackTrace": [ + "0x102d12124 MASTestApp.debug.dylib!closure #1 in closure #1 in static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:15:17", + "0x102d12d60 MASTestApp.debug.dylib!partial apply for closure #1 in closure #1 in static MastgTest.mastgTest(completion:) /:0", + "0x197571e14 libswiftCore.dylib!partial apply for closure #1 in _StringGuts.withCString(_:)", + "0x1973590a8 libswiftCore.dylib!String.withCString(_:)", + "0x102d11d04 MASTestApp.debug.dylib!closure #1 in static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:14:17", + "0x102d11de4 MASTestApp.debug.dylib!partial apply for closure #1 in static MastgTest.mastgTest(completion:) /:0", + "0x180b91f24 Foundation!__DataStorage.withUnsafeBytes(in:apply:)", + "0x180b978f8 Foundation!Data._Representation.withUnsafeBytes(_:)", + "0x180b90dac Foundation!Data.withUnsafeBytes(_:)", + "0x102d114d4 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:13:32", + "0x102d14464 MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()" + ], + "inputParameters": [ + { + "name": "op", + "type": "uint32", + "value": 0 + }, + { + "name": "alg", + "type": "uint32", + "value": 2 + }, + { + "name": "options", + "type": "uint32", + "value": 1 + }, + { + "name": "key", + "type": "bytes", + "value": "MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3", + "format": "base64" + }, + { + "name": "keyLength", + "type": "uint32", + "value": 24 + }, + { + "name": "iv", + "type": "bytes", + "value": "", + "format": "base64" + }, + { + "name": "dataIn", + "type": "bytes", + "value": "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0", + "format": "base64" + }, + { + "name": "dataInLength", + "type": "uint32", + "value": 21 + }, + { + "name": "dataOut", + "type": "bytes", + "value": "AuzY+uNaWuC5p0BFye68oukEdy7tjjM4", + "format": "base64" + }, + { + "name": "dataOutAvailable", + "type": "uint32", + "value": 29 + }, + { + "name": "dataOutMoved", + "type": "pointer", + "value": "0x16d255ef8" + } + ], + "retval": "0x0" +} diff --git a/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/run.hooks.sh b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/run.hooks.sh new file mode 100755 index 00000000000..c993f75b39b --- /dev/null +++ b/demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/ios/run.sh ./hooks.js diff --git a/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/hooks.js b/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/hooks.js new file mode 100644 index 00000000000..861d17adbfb --- /dev/null +++ b/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/hooks.js @@ -0,0 +1,19 @@ +var target = { + category: "STORAGE", + hooks: [ + { + native: true, + // module: "libc.so", + symbol: "open", + maxFrames: 5, + filterEventsByStacktrace: "MASTestApp", + args: [ + { type: "string", + name: "path", + filter: ["Containers/Data/Application/"] + } + ] + } + ] +}; + diff --git a/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/output.json b/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/output.json new file mode 100644 index 00000000000..b18ecc01e02 --- /dev/null +++ b/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/output.json @@ -0,0 +1,149 @@ +{ + "type": "summary", + "hooks": [ + { + "type": "native", + "module": "", + "symbol": "open" + } + ], + "totalHooks": 1, + "errors": [], + "totalErrors": 0 +} +{ + "id": "332af8ce-918f-4e6a-a087-fef218062849", + "type": "native-hook", + "category": "STORAGE", + "time": "2025-12-14T16:42:17.633Z", + "module": "", + "symbol": "open", + "address": "0x100cfb914", + "stackTrace": [ + "0x1810b8014 Foundation!_NSOpenFileDescriptor_Protected", + "0x180bc1204 Foundation!closure #1 in writeToFileNoAux(path:buffer:options:attributes:reportProgress:)", + "0x180bb9414 Foundation!closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180ba5394 Foundation!", + "0x180dde814 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180dde828 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x1808aeb0c Foundation!specialized Data._Representation.withUnsafeBytes(_:)", + "0x180ddd5fc Foundation!StringProtocol.write(to:atomically:encoding:)", + "0x100cb56c8 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:22:21", + "0x100cb738c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter" + ], + "inputParameters": [ + { + "name": "path", + "type": "string", + "value": "/Users/charlie/Library/Developer/CoreSimulator/Devices/196D4426-FBB3-4AD8-B1FA-B09E13C6B6E0/data/Containers/Data/Application/5F896191-75F7-4D5F-BA0C-61CCFD9CC84A/Documents/secret.json" + } + ] +} +{ + "id": "1d7049c7-ea14-4fdf-91fd-57de2ad4a020", + "type": "native-hook", + "category": "STORAGE", + "time": "2025-12-14T16:42:17.635Z", + "module": "", + "symbol": "open", + "address": "0x100cfb914", + "stackTrace": [ + "0x1810b8014 Foundation!_NSOpenFileDescriptor_Protected", + "0x180bc1204 Foundation!closure #1 in writeToFileNoAux(path:buffer:options:attributes:reportProgress:)", + "0x180bb9414 Foundation!closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180ba5394 Foundation!", + "0x180dde814 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180dde828 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x1808aeb0c Foundation!specialized Data._Representation.withUnsafeBytes(_:)", + "0x180ddd5fc Foundation!StringProtocol.write(to:atomically:encoding:)", + "0x100cb56c8 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:22:21", + "0x100cb738c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter" + ], + "inputParameters": [ + { + "name": "path", + "type": "string", + "value": "/Users/charlie/Library/Developer/CoreSimulator/Devices/196D4426-FBB3-4AD8-B1FA-B09E13C6B6E0/data/Containers/Data/Application/5F896191-75F7-4D5F-BA0C-61CCFD9CC84A/Library/Caches/secret.json" + } + ] +} +{ + "id": "ad573464-cf83-40f1-ae31-9ebc86ea067c", + "type": "native-hook", + "category": "STORAGE", + "time": "2025-12-14T16:42:17.637Z", + "module": "", + "symbol": "open", + "address": "0x100cfb914", + "stackTrace": [ + "0x1810b8014 Foundation!_NSOpenFileDescriptor_Protected", + "0x180bc1204 Foundation!closure #1 in writeToFileNoAux(path:buffer:options:attributes:reportProgress:)", + "0x180bb9414 Foundation!closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180ba5394 Foundation!", + "0x180dde814 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180dde828 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x1808aeb0c Foundation!specialized Data._Representation.withUnsafeBytes(_:)", + "0x180ddd5fc Foundation!StringProtocol.write(to:atomically:encoding:)", + "0x100cb56c8 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:22:21", + "0x100cb738c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter" + ], + "inputParameters": [ + { + "name": "path", + "type": "string", + "value": "/Users/charlie/Library/Developer/CoreSimulator/Devices/196D4426-FBB3-4AD8-B1FA-B09E13C6B6E0/data/Containers/Data/Application/5F896191-75F7-4D5F-BA0C-61CCFD9CC84A/Library/secret.json" + } + ] +} +{ + "id": "a6a04baa-ff8f-49d7-8ce1-6123a7c38517", + "type": "native-hook", + "category": "STORAGE", + "time": "2025-12-14T16:42:17.640Z", + "module": "", + "symbol": "open", + "address": "0x100cfb914", + "stackTrace": [ + "0x1810b8014 Foundation!_NSOpenFileDescriptor_Protected", + "0x180bc1204 Foundation!closure #1 in writeToFileNoAux(path:buffer:options:attributes:reportProgress:)", + "0x180bb9414 Foundation!closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180ba5394 Foundation!", + "0x180dde814 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x180dde828 Foundation!partial apply for closure #1 in writeToFile(path:data:options:attributes:reportProgress:)", + "0x1808aeb0c Foundation!specialized Data._Representation.withUnsafeBytes(_:)", + "0x180ddd5fc Foundation!StringProtocol.write(to:atomically:encoding:)", + "0x100cb56c8 MASTestApp.debug.dylib!static MastgTest.mastgTest(completion:) /Users/charlie/git/MASTestApp-iOS/MASTestApp/MastgTest.swift:22:21", + "0x100cb738c MASTestApp.debug.dylib!closure #1 in closure #1 in closure #1 in ContentView.body.getter /Users/charlie/git/MASTestApp-iOS/MASTestApp/ContentView.swift:25:31", + "0x1d9dbf428 SwiftUI!", + "0x1da4c02a0 SwiftUI!specialized static MainActor.assumeIsolated(_:file:line:)", + "0x1da48ac9c SwiftUI!ButtonAction.callAsFunction()", + "0x1d977a88c SwiftUI!", + "0x1d9d57214 SwiftUI!ButtonBehavior.ended()", + "0x1d9d5cd60 SwiftUI!partial apply for implicit closure #2 in implicit closure #1 in ButtonBehavior.body.getter" + ], + "inputParameters": [ + { + "name": "path", + "type": "string", + "value": "/Users/charlie/Library/Developer/CoreSimulator/Devices/196D4426-FBB3-4AD8-B1FA-B09E13C6B6E0/data/Containers/Data/Application/5F896191-75F7-4D5F-BA0C-61CCFD9CC84A/Library/Application Support/secret.json" + } + ] +} diff --git a/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/run.hooks.sh b/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/run.hooks.sh new file mode 100755 index 00000000000..c993f75b39b --- /dev/null +++ b/demos/ios/MASVS-STORAGE/MASTG-DEMO-0067/run.hooks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../../../utils/frida/ios/run.sh ./hooks.js