Skip to content

Commit 892a5cd

Browse files
authored
Update README.md
1 parent 60b55fa commit 892a5cd

File tree

1 file changed

+81
-22
lines changed

1 file changed

+81
-22
lines changed

README.md

Lines changed: 81 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,81 +35,140 @@
3535

3636
Quark-Engine is also bundled with [Kali Linux](https://tools.kali.org/tools-listing), [BlackArch](https://blackarch.org/mobile.html).
3737
:shipit: A trust-worthy, practical tool that's ready to boost up your malware reverse engineering. <https://twitter.com/quarkengine>
38-
# Quark Script - Ecosystem for Mobile Security Tools
39-
### Innovative & Interactive
38+
39+
## Quark Script - Ecosystem for Mobile Security Tools
40+
41+
#### Innovative & Interactive
4042
The goal of Quark Script aims to provide an innovative way for mobile security researchers to analyze or pentest the targets.
4143

4244
Based on Quark, we integrate decent tools as Quark Script APIs and make them exchange valuable intelligence to each other. This enables security researchers to __interact__ with staged results and perform __creative__ analysis with Quark Script.
4345

44-
### Dynamic & Static Analysis
46+
#### Dynamic & Static Analysis
4547
In Quark script, we integrate not only static analysis tools (e.g. Quark itself) but also dynamic analysis tools (e.g. [objection](https://github.com/sensepost/objection)).
4648

47-
### Re-Usable & Sharable
49+
#### Re-Usable & Sharable
4850
Once the user creates a Quark script for specific analysis scenario. The script can be used in another targets. Also, the script can be shared to other security researchers. This enables the exchange of knowledges.
4951

50-
### More APIs to come
52+
#### More APIs to come
5153
Quark Script is now in a beta version. We'll keep releasing practical APIs and analysis scenarios.
5254

53-
## Introduce of Quark Script APIs
55+
### Introduce of Quark Script APIs
56+
57+
<details>
58+
<summary><b> Rule(rule.json) </b></summary>
59+
60+
<br>
5461

55-
### Rule(rule.json)
5662
* Description: Making detection rule a rule instance
5763
* params: Path of a single Quark rule
5864
* return: Quark rule instance
5965

60-
### runQuarkAnalysis(SAMPLE_PATH, ruleInstance)
66+
</details>
67+
68+
<details>
69+
<summary><b> runQuarkAnalysis(SAMPLE_PATH, ruleInstance) </b></summary>
70+
71+
<br>
72+
6173
* Description: Given detection rule and target sample, this instance runs the basic Quark analysis.
6274
* params: 1. Target file 2. Quark rule object
6375
* return: quarkResult instance
6476

65-
### quarkResultInstance.behaviorOccurList
77+
</details>
78+
<details>
79+
<summary><b> quarkResultInstance.behaviorOccurList </b></summary>
80+
81+
<br>
82+
6683
* Description: List that stores instances of detected behavior in different part of the target file.
6784
* params: none
6885
* return: detected behavior instance
6986

70-
### behaviorInstance.firstAPI.fullName
87+
</details>
88+
<details>
89+
<summary><b> behaviorInstance.firstAPI.fullName </b></summary>
90+
91+
<br>
92+
7193
* Description: Show the name of the first key API called in this behavior.
7294
* params: none
7395
* return: API name
7496

75-
### behaviorInstance.secondAPI.fullName
97+
</details>
98+
<details>
99+
<summary><b> behaviorInstance.secondAPI.fullName </b></summary>
100+
101+
<br>
102+
76103
* Description: Show the name of the second key API called in this behavior.
77104
* params: none
78105
* return: API name
79106

80-
### behaviorInstance.hasUrl(none)
107+
</details>
108+
<details>
109+
<summary><b> behaviorInstance.hasUrl(none) </b></summary>
110+
111+
<br>
112+
81113
* Description: Check if the behavior contains urls.
82114
* params: none
83115
* return: python list containing all detected urls.
84116

85-
### behaviorInstance.methodCaller
117+
</details>
118+
<details>
119+
<summary><b> behaviorInstance.methodCaller </b></summary>
120+
121+
<br>
122+
86123
* Description: Find method who calls this behavior (API1 & API2).
87124
* params: none
88125
* return: method instance
89126

90-
### methodInstance.getXrefFrom(none)
127+
</details>
128+
<details>
129+
<summary><b> methodInstance.getXrefFrom(none) </b></summary>
130+
131+
<br>
132+
91133
* Description: Find out who call this method.
92134
* params: none
93135
* return: python list containing caller methods.
94136

95-
### methodInstance.getXrefTo(none)
137+
</details>
138+
<details>
139+
<summary><b> methodInstance.getXrefTo(none) </b></summary>
140+
141+
<br>
142+
96143
* Description: Find out who this method called.
97144
* params: none
98145
* return: python list containing tuples (callee methods, index).
99146

100-
### Objection(none)
147+
</details>
148+
<details>
149+
<summary><b> Objection(none) </b></summary>
150+
151+
<br>
152+
101153
* Description: Create an instance for Objection (dynamic analysis tool).
102154
* params: Monitoring IP:port
103155
* return: objection instance
104156

105-
### objInstance.hookMethod(method, watchArgs, watchBacktrace, watchRet)
157+
</details>
158+
<details>
159+
<summary><b> objInstance.hookMethod(method, watchArgs, watchBacktrace, watchRet) </b></summary>
160+
161+
<br>
162+
106163
* Description: Hook the target method with Objection.
107164
* params: 1. method: the tagrget API. (type: str or method instance) 2. watchArgs: Return Args information if True. (type: boolean) 3. watchBacktrace: Return backtrace information if True. (type: boolean) 4. watchRet: Return the return information of the target API if True (type: boolean).
108165
* return: none
109166

110-
## Analyzing real case (InstaStealer) using Quark Script
167+
</details>
168+
169+
### Analyzing real case (InstaStealer) using Quark Script
111170

112-
### Quark Script that dynamic hooks the method containing urls
171+
#### Quark Script that dynamic hooks the method containing urls
113172
The scenario is simple! We'd like to dynamic hooking the methods in the malware that contains urls. We can use APIs above to write Quark Script.
114173

115174
```python
@@ -164,13 +223,13 @@ print("\nSee the hook results in Objection's terminal.")
164223
> 3. Or a rooted Android Device (Google Pixel 6) with frida installed.\
165224
Check the root guideline [here](https://forum.xda-developers.com/t/guide-root-pixel-6-with-magisk-android-12-1.4388733/), frida install guideline is the [same](https://frida.re/docs/android/) with Android Virtual Machine.
166225

167-
### Quark Script Result
226+
#### Quark Script Result
168227
![](https://i.imgur.com/elztZdC.png)
169228

170-
### Logs on the Objection terminal (hooking)
229+
#### Logs on the Objection terminal (hooking)
171230
![](https://i.imgur.com/XrtfgjY.jpg)
172231

173-
### Method (callComponentMethod) with urls is detected triggered!
232+
#### Method (callComponentMethod) with urls is detected triggered!
174233
![](https://i.imgur.com/ryV3f57.jpg)
175234

176235
## Quark Web Report

0 commit comments

Comments
 (0)