Skip to content

Commit 12767bd

Browse files
committed
Revert "Optimize the document of Quark Script CWE-312"
This reverts commit 67d628e.
1 parent 08477de commit 12767bd

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

CWE-312/README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
# Detect CWE-312 in Android Application
22

3-
This scenario seeks to find **cleartext storage of sensitive data** in the APK file.
43

5-
## CWE-312: Cleartext Storage of Sensitive Information
4+
This scenario seeks to find **cleartext storage of sensitive data** in
5+
the APK file.
6+
7+
## CWE-312 Cleartext Storage of Sensitive Information
68

79
We analyze the definition of CWE-312 and identify its characteristics.
810

9-
See [CWE-312](https://cwe.mitre.org/data/definitions/312.html) for more details.
11+
See [CWE-312](https://cwe.mitre.org/data/definitions/312.html) for more
12+
details.
1013

11-
![image](https://imgur.com/mD2uXUy.jpg)
14+
![image](https://i.imgur.com/cy2EiZx.jpg)
1215

1316
## Code of CWE-312 in ovaa.apk
1417

15-
We use the [ovaa.apk](https://github.com/oversecured/ovaa) sample to explain the vulnerability code of CWE-312.
16-
17-
![image](https://imgur.com/MfnYIYy.jpg)
18-
19-
## CWE-312 Detection Process Using Quark Script API
20-
21-
Let’s use the above APIs to show how the Quark script finds this vulnerability.
18+
We use the [ovaa.apk](https://github.com/oversecured/ovaa) sample to
19+
explain the vulnerability code of CWE-312.
2220

23-
We have designed a [Frida](https://frida.re/) 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](https://github.com/quark-engine/quark-engine/tree/master/quark/script/frida).
24-
25-
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 use ``checkClearText`` imported from [Ares](https://github.com/bee-san/Ares) to check if the arguments are cleartext. If both **YES**, CWE-312 vulnerability might be caused.
21+
![image](https://i.imgur.com/KsFsxTu.jpg)
2622

27-
![image](https://imgur.com/eNjm3ES.jpg)
23+
## Quark Script CWE-312.py
2824

29-
## Quark Script: CWE-312.py
25+
Let\'s use the above APIs to show how the Quark script finds this
26+
vulnerability.
3027

31-
![image](https://imgur.com/rxMPZX8.jpg)
28+
First, we designed a [Frida](https://frida.re) script `agent.js` to hook
29+
the target method and get the arguments when the target method is
30+
called. Then we hook the method `putString` to catch its arguments.
31+
Finally, we use [Ares](https://github.com/bee-san/Ares) to check if
32+
the arguments are encrypted.
3233

33-
```python
34+
``` python
3435
from quark.script.frida import runFridaHook
3536
from quark.script.ares import checkClearText
3637

@@ -61,7 +62,7 @@ for putString in fridaResult.behaviorOccurList:
6162

6263
## Frida Script: agent.js
6364

64-
```javascript
65+
``` javascript
6566
// -*- coding: utf-8 -*-
6667
// This file is part of Quark-Engine - https://github.com/quark-engine/quark-engine
6768
// See the file 'LICENSE' for copying permission.
@@ -124,7 +125,7 @@ rpc.exports["watchMethodCall"] = (classAndMethodName, methodParamTypes) => watch
124125

125126
## Quark Script Result
126127

127-
```TEXT
128+
``` TEXT
128129
$ python3 CWE-312.py
129130
The CWE-312 vulnerability is found. The cleartext is "[email protected]"
130131
The CWE-312 vulnerability is found. The cleartext is "password"

0 commit comments

Comments
 (0)