Add CWE-338 Script#475
Conversation
Codecov ReportPatch and project coverage have no change.
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #475 +/- ##
=======================================
Coverage 78.76% 78.76%
=======================================
Files 63 63
Lines 4850 4850
=======================================
Hits 3820 3820
Misses 1030 1030
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
@Commuter95 Thanks for the PR. Welcome. Also, here are some suggestions for quark script.
|
|
@Commuter95 It seems that there is some conflict happening. |
Detect CWE-338 in Android Application (pivva.apk)
This scenario aims to detect the Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG). See CWE-338 for more details.
To demonstrate how the Quark script finds this vulnerability, we will use the pivaa APK file and the above APIs.
First, we design a detection rule useMethodOfPRNG.json to spot on behavior that uses Pseudo Random Number Generator (PRNG). Then, we use API
getXrefFrom()to get the caller method of PRNG. Finally, we use some keywords such as “token”, “password”, and “encrypt” to check if the PRNG is for credential usage.Quark Script CWE-338.py
useMethodOfPRNG.json
{ "crime": "Use method of PRNG", "permission": [], "api": [ { "class": "Ljava/util/Random;", "method": "<init>", "descriptor": "()V" }, { "class": "Ljava/util/Random;", "method": "nextInt", "descriptor": "(I)I" } ], "score": 1, "label": [] }Quark Script Result