|
4 | 4 |
|
5 | 5 | **MobileAudit** - SAST and Malware Analysis for Android Mobile APKs |
6 | 6 |
|
7 | | -- [Mobile Audit](#mobile-audit) |
8 | | - - [Components](#components) |
9 | | - - [Docker Base images](#docker-base-images) |
10 | | - - [Main features](#main-features) |
11 | | - - [Patterns](#patterns) |
12 | | - - [Models](#models) |
13 | | - - [Virus Total (API v3)](#virus-total-api-v3) |
14 | | - - [Defect Dojo (API v2)](#defect-dojo-api-v2) |
15 | | - - [MalwareDB \& Maltrail](#malwaredb--maltrail) |
16 | | - - [Installation](#installation) |
17 | | - - [API v1](#api-v1) |
18 | | - - [Usage](#usage) |
19 | | - - [Swagger](#swagger) |
20 | | - - [ReDoc](#redoc) |
21 | | - - [Endpoints](#endpoints) |
22 | | - - [TLS](#tls) |
23 | | - - [Pre-requirements](#pre-requirements) |
24 | | - - [Nginx configuration](#nginx-configuration) |
25 | | - - [Docker configuration](#docker-configuration) |
26 | | - - [Environment variables](#environment-variables) |
| 7 | +A Django web application to perform static analysis and detect malicious content inside Android APKs. The project extracts app metadata, scans source code for weaknesses, and aggregates results (SAST findings, best practices, certificate info, strings, databases, files, VirusTotal, and more) into a browsable dashboard and API. |
| 8 | + |
| 9 | +DeepWiki documentation: https://deepwiki.com/mpast/mobileAudit |
| 10 | + |
| 11 | +- [Components](#components) |
| 12 | +- [Docker Base images](#docker-base-images) |
| 13 | +- [Main features](#main-features) |
| 14 | +- [Patterns](#patterns) |
| 15 | +- [Models](#models) |
| 16 | +- [Installation](#installation) |
| 17 | +- [API v1](#api-v1) |
| 18 | + - [Usage](#usage) |
| 19 | + - [Swagger](#swagger) |
| 20 | + - [ReDoc](#redoc) |
| 21 | + - [Endpoints](#endpoints) |
| 22 | +- [TLS](#tls) |
| 23 | + - [Pre-requirements](#pre-requirements) |
| 24 | + - [Nginx configuration](#nginx-configuration) |
| 25 | + - [Docker configuration](#docker-configuration) |
| 26 | +- [Environment variables](#environment-variables) |
27 | 27 | --------------------------------------- |
28 | 28 |
|
29 | | -Django Web application for performing Static Analysis and detecting malware in Android APKs |
30 | | - |
31 | 29 |  |
32 | 30 |
|
33 | 31 | In each of the scans, it would have the following information: |
34 | 32 |
|
35 | | -* Application Info |
36 | | -* Security Info |
37 | | -* Components |
38 | | -* SAST Findings |
39 | | -* Best Practices Implemented |
40 | | -* Virus Total Info |
41 | | -* Certificate Info |
42 | | -* Strings |
43 | | -* Databases |
44 | | -* Files |
| 33 | +- APK information and analysis: Application info, security info, components, certificate info, strings, databases, files |
| 34 | +- SAST findings categorized with CWE and Mobile Top 10 mapping |
| 35 | +- Pattern engine with toggleable rules |
| 36 | +- Malware domain checks against MalwareDB & Maltrail |
| 37 | +- VirusTotal (API v3) lookup & optional upload (disabled by default) |
| 38 | +- DefectDojo integration (API v2) (optional) for exporting findings |
| 39 | +- API with Swagger and ReDoc, plus token-based authentication |
| 40 | +- Export scan reports to PDF |
| 41 | +- Findings editable with false-positive triage |
45 | 42 |
|
46 | 43 |  |
47 | 44 |
|
@@ -71,53 +68,35 @@ Image is based on python buster. Link to [Docker Hub image](https://hub.docker.c |
71 | 68 | | mpast/mobile_audit | 1.0.0 | python:3.9.0-buster | |
72 | 69 |
|
73 | 70 | ### Main features |
74 | | - |
75 | | -- [x] Uses Docker for easy deployment in multiplatform environment |
76 | | -- [x] Extract all information of the APK |
77 | | -- [x] Analyze all the source code searching for weaknesses |
78 | | -- [x] All findings are categorized and follows **CWE standards** |
79 | | -- [x] All findings are categorized and include **Mobile Top 10 Risk** |
80 | | -- [x] Also highlight the **Best Practices in Secure Android Implementation** in the APK |
81 | | -- [x] The findings can be edited and the **false positives can be triaged and deleted** |
82 | | -- [x] All scan results can be **exported to PDF** |
83 | | -- [x] User authentication and user management |
84 | | -- [x] API v1 with Swagger and ReDoc |
85 | | -- [x] TLS |
86 | | -- [x] Dynamic page reload (WIP) |
87 | | -- [ ] LDAP integration |
88 | | -- [ ] Export to Markdown |
89 | | -- [ ] Export to CSV |
| 71 | +- Runs in Docker for easy, reproducible deployment |
| 72 | +- Extracts and shows detailed APK information |
| 73 | +- SAST rules that map to CWE and Mobile Top 10 risks |
| 74 | +- Malware indicators detection (MalwareDB / Maltrail) |
| 75 | +- Integration points for VirusTotal and DefectDojo (optional) |
| 76 | +- Export scan results to PDF |
| 77 | +- User authentication, management, and token-based API |
| 78 | +- Swagger and ReDoc documentation |
| 79 | +- TLS-ready Nginx configuration for production |
| 80 | + |
| 81 | +Planned / wishlist |
| 82 | +- LDAP integration |
| 83 | +- Export to Markdown / CSV |
| 84 | +- Dynamic page reload improvements (WIP) |
90 | 85 |
|
91 | 86 | ### Patterns |
92 | | - |
93 | | -The application has an engine with different rules and patterns that are used though the findings scanning phase to detect vulnerabilities and/or malicious code into the apk. |
94 | | - |
95 | | -These can be activated and deactivated in `/patterns` |
| 87 | +- The app includes a rule/pattern engine that detects potential vulnerabilities and malicious snippets inside APKs. |
| 88 | +- Patterns are configurable and can be enabled/disabled from the `/patterns` UI. |
| 89 | +- Note: Some hardcoded patterns are derived from the apkleaks project: https://github.com/dwisiswant0/apkleaks |
96 | 90 |
|
97 | 91 |  |
98 | 92 |
|
99 | | -Note: some of the hardcoded patterns are from [apkleaks](https://github.com/dwisiswant0/apkleaks) |
100 | | - |
101 | 93 | ### Models |
102 | 94 | The application has an created models for each of the entities of the scans' information to be able to create relations an abtain the best conclusions for each of the apks. |
103 | 95 |
|
104 | 96 |  |
105 | 97 |
|
106 | 98 | To see the whole model schema, go to [models](app/static/models.png) |
107 | 99 |
|
108 | | -### Integrations |
109 | | - |
110 | | -#### Virus Total (API v3) |
111 | | - |
112 | | -It checks if there has been an scan of the APK and extract all its information. Also, there is the possibility of uploading the APK is selected a property in the environment (Disabled by default). |
113 | | - |
114 | | -#### Defect Dojo (API v2) |
115 | | - |
116 | | -It is possible to upload the findings to the defect manager. |
117 | | - |
118 | | -#### MalwareDB & Maltrail |
119 | | - |
120 | | -It checks in the database if there are URLs in the APK that are related with Malware. |
121 | 100 |
|
122 | 101 | ### Installation |
123 | 102 |
|
@@ -227,29 +206,13 @@ By default, there is a volume in `docker-compose.yml` with the configuration wit |
227 | 206 |
|
228 | 207 | ### Environment variables |
229 | 208 |
|
230 | | -All the environment variables are in a `.env` file, there is an `.env.example` with all the variables needed. Also there are collected in `app/config/settings.py`: |
231 | | - |
232 | | -```python |
233 | | -CWE_URL = env('CWE_URL', 'https://cwe.mitre.org/data/definitions/') |
| 209 | +All the environment variables are in a `.env` file, there is an `.env.example` with all the variables needed. Also there are collected in `app/config/settings.py` |
| 210 | +Suggested minimum `.env` adjustments for local dev |
| 211 | +- Set SECRET_KEY, DB credentials, and admin user credentials. |
| 212 | +- Leave VirusTotal / DefectDojo disabled unless you have valid API keys and services available. |
234 | 213 |
|
235 | | -MALWARE_ENABLED = env('MALWARE_ENABLED', True) |
236 | | -MALWAREDB_URL = env('MALWAREDB_URL', 'https://www.malwaredomainlist.com/mdlcsv.php') |
237 | | -MALTRAILDB_URL = env('MALTRAILDB_URL', 'https://raw.githubusercontent.com/stamparm/aux/master/maltrail-malware-domains.txt') |
238 | | -
|
239 | | -VIRUSTOTAL_ENABLED = env('VIRUSTOTAL_ENABLED', False) |
240 | | -VIRUSTOTAL_URL = env('VIRUSTOTAL_URL', 'https://www.virustotal.com/') |
241 | | -VIRUSTOTAL_FILE_URL = env('VIRUSTOTAL_FILE_URL', 'https://www.virustotal.com/gui/file/') |
242 | | -VIRUSTOTAL_API_URL_V3 = env('VIRUSTOTAL_API_URL_V3', 'https://www.virustotal.com/api/v3/') |
243 | | -VIRUSTOTAL_URL_V2 = env('VIRUSTOTAL_API_URL_V2', 'https://www.virustotal.com/vtapi/v2/file/') |
244 | | -VIRUSTOTAL_API_KEY = env('VIRUSTOTAL_API_KEY', '') |
245 | | -VIRUSTOTAL_UPLOAD = env('VIRUSTOTAL_UPLOAD', False) |
246 | | -
|
247 | | -DEFECTDOJO_ENABLED = env('DEFECTDOJO_ENABLED', False) |
248 | | -DEFECTDOJO_URL = env('DEFECTDOJO_URL', 'http://defectdojo:8080/finding/') |
249 | | -DEFECTDOJO_API_URL = env('DEFECTDOJO_API_URL', 'http://defectdojo:8080/api/v2/') |
250 | | -DEFECTDOJO_API_KEY = env('DEFECTDOJO_API_KEY', '') |
251 | | -``` |
| 214 | +### Contributing |
252 | 215 |
|
253 | 216 | If you like to contribute, see [Contributing](CONTRIBUTING.md) |
254 | 217 |
|
255 | | ---- |
| 218 | +--- |
0 commit comments