-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize the document of Quark Script CWE-312 and CWE-798 #48
Open
JerryTasi
wants to merge
8
commits into
quark-engine:main
Choose a base branch
from
JerryTasi:patch-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
haeter525
requested changes
Dec 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove CWE-312/agent.js since it's an empty file. What do you think?
That sounds great. |
haeter525
approved these changes
Dec 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank @JerryTasi.
mv -vn $GITHUB_WORKSPACE/CWE-*/*.js test_ground/
This reverts commit f0db960.
runs-on: ubuntu-22.04
Delete CWE-312/agent.js
mv -vn $GITHUB_WORKSPACE/CWE-*/*.js test_ground/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Detect CWE-312 in Android Application
This scenario seeks to find cleartext storage of sensitive data in the APK file.
CWE-312: Cleartext Storage of Sensitive Information
We analyze the definition of CWE-312 and identify its characteristics.
See CWE-312 for more details.
Code of CWE-312 in ovaa.apk
We use the ovaa.apk sample to explain the vulnerability code of CWE-312.
CWE-312 Detection Process Using Quark Script API
Let’s use the above APIs to show how the Quark script finds this vulnerability.
We have designed a Frida script
agent.js
to hook a specified method and get the arguments when the method is called. It can be found in quark-engine/quark/script/frida.To begin with, we hook the method
putString
to catch its arguments. Then, we check if sensitive information like email or password is passed. Finally, we usecheckClearText
imported from Ares to check if the arguments are cleartext. If both YES, CWE-312 vulnerability might be caused.Quark Script: CWE-312.py
Frida Script: agent.js
Quark Script Result
Detect CWE-798 in Android Application
This scenario seeks to find hard-coded credentials in the APK file.
CWE-798: Use of Hard-coded Credentials
We analyze the definition of CWE-798 and identify its characteristics.
See CWE-798 for more details.
Code of CWE-798 in ovaa.apk
We use the ovaa.apk sample to explain the vulnerability code of CWE-798.
CWE-798 Detection Process Using Quark Script API
Let’s use the above APIs to show how the Quark script finds this vulnerability.
First, we design a detection rule
findSecretKeySpec.json
to spot on behavior using the constructorSecretKeySpec
. Second, we get all the parameter values from this constructor. Then, we parse the AES key from the parameter values. Finally, we check if the AES key is hardcoded in the APK file. If the answer is YES, BINGO!!! We find hard-coded credentials in the APK file.Quark Script: CWE-798.py
Quark Rule: findSecretKeySpec.json
Quark Script Result