-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/OWASP/owasp-mastg into pr…
…/titze/3056
- Loading branch information
Showing
35 changed files
with
538 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
!printf "\n\n" | ||
?e;?e | ||
|
||
!printf "Uses of SecKeyCreateRandomKey:\n" | ||
?e Uses of SecKeyCreateRandomKey: | ||
afl~SecKeyCreateRandomKey | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to SecKeyCreateRandomKey:\n" | ||
?e xrefs to SecKeyCreateRandomKey: | ||
axt @ 0x1000078ac | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "Use of reloc.kSecAttrKeySizeInBits as input for SecKeyCreateRandomKey:\n" | ||
?e Use of reloc.kSecAttrKeySizeInBits as input for SecKeyCreateRandomKey: | ||
pd 1 @ sym.func.1000046f8 | ||
|
||
!printf "...\n" | ||
?e ... | ||
|
||
pd 9 @ 0x10000484c | ||
|
||
!printf "...\n" | ||
?e ... | ||
|
||
pd-- 2 @ 0x1000049a0 | ||
|
12 changes: 6 additions & 6 deletions
12
demos/ios/MASVS-CRYPTO/MASTG-DEMO-0013/sec_hardcoded_rsa.r2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
e asm.bytes = false | ||
e asm.bytes=false | ||
e scr.color=false | ||
e asm.var=false | ||
|
||
!printf "Uses of SecKeyCreateWithData:\n" | ||
?e Uses of SecKeyCreateWithData: | ||
afl~SecKeyCreateWithData | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to SecKeyCreateWithData:\n" | ||
?e xrefs to SecKeyCreateWithData: | ||
axt @ 0x100007904 | ||
|
||
!printf "\n" | ||
?e | ||
|
||
pdf @ sym.func.10000491c > function.asm | ||
|
||
px 607 @ 0x1000100c8 > key.asm | ||
px 607 @ 0x1000100c8 > key.asm |
14 changes: 7 additions & 7 deletions
14
demos/ios/MASVS-CRYPTO/MASTG-DEMO-0014/cryptokit_hardcoded_ecdsa.r2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
e asm.bytes = false | ||
e asm.bytes=false | ||
e scr.color=false | ||
e asm.var=false | ||
|
||
!printf "Uses of CryptoKit.P256.Signing.PrivateKey:\n" | ||
?e Uses of CryptoKit.P256.Signing.PrivateKey: | ||
afl~CryptoKit.P256.Signing.PrivateKey | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to CryptoKit.P256.Signing.PrivateKey.rawRepresentation:\n" | ||
?e xrefs to CryptoKit.P256.Signing.PrivateKey.rawRepresentation: | ||
axt @ 0x100007388 | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "Use of CryptoKit.P256.Signing.PrivateKey.rawRepresentation:\n" | ||
?e Use of CryptoKit.P256.Signing.PrivateKey.rawRepresentation: | ||
|
||
pd-- 9 @ 0x1000048d4 | ||
|
||
pdf @ sym.func.1000046dc > function.asm | ||
|
||
px 32 @ 0x1000100c8 > key.asm | ||
px 32 @ 0x1000100c8 > key.asm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
!printf "\n\n" | ||
?e;?e | ||
|
||
!printf "Uses of CommonCrypto hash function:\n" | ||
?e Uses of CommonCrypto hash function: | ||
afl~CC_ | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to CC_MD5:\n" | ||
?e xrefs to CC_MD5: | ||
axt @ 0x1000071a8 | ||
|
||
!printf "xrefs to CC_SHA1:\n" | ||
?e xrefs to CC_SHA1: | ||
axt @ 0x1000071b4 | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "Use of MD5:\n" | ||
?e Use of MD5: | ||
pd-- 5 @ 0x1000048c4 | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "Use of SHA1:\n" | ||
?e Use of SHA1: | ||
pd-- 5 @ 0x10000456c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
!printf "\n\n" | ||
?e;?e | ||
|
||
!printf "Uses of CryptoKit.Insecure functions:\n" | ||
?e Uses of CryptoKit.Insecure functions: | ||
afl~Insecure. | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to CryptoKit.Insecure.MD5:\n" | ||
?e xrefs to CryptoKit.Insecure.MD5: | ||
axt @ 0x100007280 | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to CryptoKit.Insecure.SHA1:\n" | ||
?e xrefs to CryptoKit.Insecure.SHA1: | ||
axt @ 0x10000728c | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "Use of MD5:\n" | ||
?e Use of MD5: | ||
pd-- 5 @ 0x1000046d8 | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "Use of SHA1:\n" | ||
?e Use of SHA1: | ||
pd-- 5 @ 0x100004214 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
demos/ios/MASVS-STORAGE/MASTG-DEMO-0019/isExcludedFromBackup.r2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
e asm.bytes = false | ||
e asm.bytes=false | ||
e scr.color=false | ||
e asm.var=false | ||
|
||
!printf "Uses of isExcludedFromBackup:\n" | ||
?e Uses of isExcludedFromBackup: | ||
afl~isExcludedFromBackup | ||
|
||
!printf "\n" | ||
?e | ||
|
||
!printf "xrefs to isExcludedFromBackup:\n" | ||
?e xrefs to isExcludedFromBackup: | ||
axt @ 0x10000cc28 | ||
|
||
!printf "\n" | ||
!printf "Use of isExcludedFromBackup:\n" | ||
?e | ||
?e Use of isExcludedFromBackup: | ||
|
||
pd-- 5 @ 0x100004594 | ||
|
||
!printf "\n" | ||
!print "Search for secret.txt" | ||
?e | ||
?e Search for secret.txt: | ||
/ secret.txt | ||
|
||
!printf "\n" | ||
!printf "Use of the string secret.txt:\n" | ||
?e | ||
?e Use of the string secret.txt: | ||
pd-- 5 @ 0x10000443c | ||
|
||
|
||
pdf @ 0x100004594 > function.asm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Obtaining Compiler Provided Security Features | ||
platform: android | ||
--- | ||
|
||
Run @MASTG-TOOL-0028 on the target binary, for example a shared library and grep for the keywords you'd like to check for. | ||
|
||
```sh | ||
rabin2 -I lib/x86_64/libnative-lib.so | grep -E "canary|pic" | ||
canary false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: Obtaining Information about the APK Signature | ||
platform: android | ||
--- | ||
|
||
## Verify APK Signatures | ||
|
||
@MASTG-TOOL-0123 can be used to verify APK signatures: | ||
|
||
```bash | ||
$ apksigner verify --verbose example.apk | ||
Verifies | ||
Verified using v1 scheme (JAR signing): false | ||
Verified using v2 scheme (APK Signature Scheme v2): true | ||
Verified using v3 scheme (APK Signature Scheme v3): true | ||
Verified using v3.1 scheme (APK Signature Scheme v3.1): false | ||
Verified using v4 scheme (APK Signature Scheme v4): false | ||
Verified for SourceStamp: false | ||
Number of signers: 1 | ||
``` | ||
|
||
## Additional Signature Information | ||
|
||
Additional information about the signature including fields from the signing certificate, digest and key information can be also examined with @MASTG-TOOL-0123: | ||
|
||
```bash | ||
$ apksigner verify --print-certs --verbose example.apk | ||
[...] | ||
Signer #1 certificate DN: CN=Example Developers, OU=Android, O=Example | ||
Signer #1 certificate SHA-256 digest: 1fc4de52d0daa33a9c0e3d67217a77c895b46266ef020fad0d48216a6ad6cb70 | ||
Signer #1 certificate SHA-1 digest: 1df329fda8317da4f17f99be83aa64da62af406b | ||
Signer #1 certificate MD5 digest: 3dbdca9c1b56f6c85415b67957d15310 | ||
Signer #1 key algorithm: RSA | ||
Signer #1 key size (bits): 2048 | ||
Signer #1 public key SHA-256 digest: 296b4e40a31de2dcfa2ed277ccf787db0a524db6fc5eacdcda5e50447b3b1a26 | ||
Signer #1 public key SHA-1 digest: 3e02ebf64f1bd4ca85732186b3774e9ccd60cb86 | ||
Signer #1 public key MD5 digest: 24afa3496f98c66343fc9c8a0a7ff5a2 | ||
``` |
Oops, something went wrong.