anais-apk-forensic 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +249 -0
- package/anais.sh +669 -0
- package/analysis_tools/__pycache__/apk_basic_info.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/apk_basic_info.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/check_zip_encryption.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/check_zip_encryption.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/detect_obfuscation.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/detect_obfuscation.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/dex_payload_hunter.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/entropy_analyzer.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/error_logger.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/error_logger.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/find_encrypted_payload.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/fix_apk_headers.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/fix_apk_headers.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/manifest_analyzer.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/manifest_analyzer.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/network_analyzer.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/network_analyzer.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/report_generator.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/report_generator.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/report_generator_modular.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/sast_scanner.cpython-313.pyc +0 -0
- package/analysis_tools/__pycache__/sast_scanner.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/so_string_analyzer.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/yara_enhanced_analyzer.cpython-314.pyc +0 -0
- package/analysis_tools/__pycache__/yara_results_processor.cpython-314.pyc +0 -0
- package/analysis_tools/apk_basic_info.py +85 -0
- package/analysis_tools/check_zip_encryption.py +142 -0
- package/analysis_tools/detect_obfuscation.py +650 -0
- package/analysis_tools/dex_payload_hunter.py +734 -0
- package/analysis_tools/entropy_analyzer.py +335 -0
- package/analysis_tools/error_logger.py +75 -0
- package/analysis_tools/find_encrypted_payload.py +485 -0
- package/analysis_tools/fix_apk_headers.py +154 -0
- package/analysis_tools/manifest_analyzer.py +214 -0
- package/analysis_tools/network_analyzer.py +287 -0
- package/analysis_tools/report_generator.py +506 -0
- package/analysis_tools/report_generator_modular.py +885 -0
- package/analysis_tools/sast_scanner.py +412 -0
- package/analysis_tools/so_string_analyzer.py +406 -0
- package/analysis_tools/yara_enhanced_analyzer.py +330 -0
- package/analysis_tools/yara_results_processor.py +368 -0
- package/analyzer_config.json +113 -0
- package/apkid/__init__.py +32 -0
- package/apkid/__pycache__/__init__.cpython-313.pyc +0 -0
- package/apkid/__pycache__/__init__.cpython-314.pyc +0 -0
- package/apkid/__pycache__/apkid.cpython-313.pyc +0 -0
- package/apkid/__pycache__/apkid.cpython-314.pyc +0 -0
- package/apkid/__pycache__/main.cpython-313.pyc +0 -0
- package/apkid/__pycache__/main.cpython-314.pyc +0 -0
- package/apkid/__pycache__/output.cpython-313.pyc +0 -0
- package/apkid/__pycache__/rules.cpython-313.pyc +0 -0
- package/apkid/apkid.py +266 -0
- package/apkid/main.py +98 -0
- package/apkid/output.py +177 -0
- package/apkid/rules/apk/common.yara +68 -0
- package/apkid/rules/apk/obfuscators.yara +118 -0
- package/apkid/rules/apk/packers.yara +1197 -0
- package/apkid/rules/apk/protectors.yara +301 -0
- package/apkid/rules/dex/abnormal.yara +104 -0
- package/apkid/rules/dex/anti-vm.yara +568 -0
- package/apkid/rules/dex/common.yara +60 -0
- package/apkid/rules/dex/compilers.yara +434 -0
- package/apkid/rules/dex/obfuscators.yara +602 -0
- package/apkid/rules/dex/packers.yara +761 -0
- package/apkid/rules/dex/protectors.yara +520 -0
- package/apkid/rules/dll/common.yara +38 -0
- package/apkid/rules/dll/obfuscators.yara +43 -0
- package/apkid/rules/elf/anti-vm.yara +43 -0
- package/apkid/rules/elf/common.yara +54 -0
- package/apkid/rules/elf/obfuscators.yara +991 -0
- package/apkid/rules/elf/packers.yara +1128 -0
- package/apkid/rules/elf/protectors.yara +794 -0
- package/apkid/rules/res/common.yara +43 -0
- package/apkid/rules/res/obfuscators.yara +46 -0
- package/apkid/rules/res/protectors.yara +46 -0
- package/apkid/rules.py +77 -0
- package/bin/anais +3 -0
- package/dist/cli.js +82 -0
- package/dist/index.js +123 -0
- package/dist/types/index.js +2 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/output.js +44 -0
- package/dist/utils/paths.js +107 -0
- package/docs/ARCHITECTURE.txt +353 -0
- package/docs/Workflow and Reference.md +445 -0
- package/package.json +70 -0
- package/rules/yara_general_rules.yar +323 -0
- package/scripts/dynamic_analysis_helper.sh +334 -0
- package/scripts/frida/dpt_dex_dumper.js +145 -0
- package/scripts/frida/frida_dex_dump.js +145 -0
- package/scripts/frida/frida_hooks.js +437 -0
- package/scripts/frida/frida_websocket_extractor.js +154 -0
- package/scripts/setup.sh +206 -0
- package/scripts/validate_framework.sh +224 -0
- package/src/cli.ts +91 -0
- package/src/index.ts +123 -0
- package/src/types/index.ts +44 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/output.ts +50 -0
- package/src/utils/paths.ts +72 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2023 RedNaga. https://rednaga.io
|
|
3
|
+
* All rights reserved. Contact: rednaga@protonmail.com
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* This file is part of APKiD
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* Commercial License Usage
|
|
10
|
+
* ------------------------
|
|
11
|
+
* Licensees holding valid commercial APKiD licenses may use this file
|
|
12
|
+
* in accordance with the commercial license agreement provided with the
|
|
13
|
+
* Software or, alternatively, in accordance with the terms contained in
|
|
14
|
+
* a written agreement between you and RedNaga.
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* GNU General Public License Usage
|
|
18
|
+
* --------------------------------
|
|
19
|
+
* Alternatively, this file may be used under the terms of the GNU General
|
|
20
|
+
* Public License version 3.0 as published by the Free Software Foundation
|
|
21
|
+
* and appearing in the file LICENSE.GPL included in the packaging of this
|
|
22
|
+
* file. Please visit http://www.gnu.org/copyleft/gpl.html and review the
|
|
23
|
+
* information to ensure the GNU General Public License version 3.0
|
|
24
|
+
* requirements will be met.
|
|
25
|
+
*
|
|
26
|
+
**/
|
|
27
|
+
|
|
28
|
+
include "common.yara"
|
|
29
|
+
|
|
30
|
+
rule arxan_guardit : obfuscator
|
|
31
|
+
{
|
|
32
|
+
meta:
|
|
33
|
+
description = "Arxan GuardIT"
|
|
34
|
+
url = "https://www.arxan.com"
|
|
35
|
+
sample = "0da79f5202b4c29c4ef43f769d5703a3d4ebfa65e49ea967abb49965d4ac3ba4"
|
|
36
|
+
author = "Eduardo Novella"
|
|
37
|
+
|
|
38
|
+
strings:
|
|
39
|
+
// guardit4j.fin -- in root of apk; contains GuardIT version
|
|
40
|
+
$cfg = { 00 67 75 61 72 64 69 74 34 6A 2E 66 69 6E }
|
|
41
|
+
|
|
42
|
+
condition:
|
|
43
|
+
is_apk and #cfg > 1
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
rule gemalto_protector : obfuscator
|
|
47
|
+
{
|
|
48
|
+
meta:
|
|
49
|
+
description = "Gemalto"
|
|
50
|
+
url = "https://www.gemalto.com"
|
|
51
|
+
author = "Eduardo Novella"
|
|
52
|
+
sample = "294f95298189080a25b20ef28295d60ecde27ee12361f93ad2f024fdcb5bdb0b"
|
|
53
|
+
|
|
54
|
+
strings:
|
|
55
|
+
$l1 = "lib/arm64-v8a/libmedl.so"
|
|
56
|
+
$l2 = "lib/armeabi-v7a/libmedl.so"
|
|
57
|
+
$l3 = "lib/armeabi/libmedl.so"
|
|
58
|
+
$l4 = "lib/mips/libmedl.so"
|
|
59
|
+
$l5 = "lib/mips64/libmedl.so"
|
|
60
|
+
$l6 = "lib/x86/libmedl.so"
|
|
61
|
+
$l7 = "lib/x86_64/libmedl.so"
|
|
62
|
+
|
|
63
|
+
condition:
|
|
64
|
+
any of them and is_apk
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
rule androidrepublic : obfuscator
|
|
68
|
+
{
|
|
69
|
+
meta:
|
|
70
|
+
description = "AndroidRepublic"
|
|
71
|
+
url = "https://androidrepublic.org/"
|
|
72
|
+
sample = "b893b45852ccfe4e037a356348042e613c47ae56e554943d8b3998c0cbb3ffb9"
|
|
73
|
+
author = "Eduardo Novella"
|
|
74
|
+
|
|
75
|
+
strings:
|
|
76
|
+
$asset1 = "assets/emt.androidrepublic/config.png"
|
|
77
|
+
$asset2 = "assets/emt.androidrepublic/monkey.png"
|
|
78
|
+
$asset3 = "assets/emt.androidrepublic/system.png"
|
|
79
|
+
$asset4 = "assets/emt.androidrepublic/system_000.png"
|
|
80
|
+
$asset5 = "assets/emt.androidrepublic/system_001.png"
|
|
81
|
+
$asset6 = "assets/emt.androidrepublic/system_002.png"
|
|
82
|
+
$asset7 = "assets/emt.androidrepublic/system_003.png"
|
|
83
|
+
$asset8 = "assets/emt.androidrepublic/system_004.png"
|
|
84
|
+
$asset9 = "assets/emt.androidrepublic/system_005.png"
|
|
85
|
+
|
|
86
|
+
condition:
|
|
87
|
+
is_apk and any of them
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
rule androidrepublic_vip : obfuscator
|
|
91
|
+
{
|
|
92
|
+
meta:
|
|
93
|
+
description = "AndroidRepublic VIP"
|
|
94
|
+
url = "https://androidrepublic.org/"
|
|
95
|
+
sample = "ea1c69b7ba4f43ddcfb615e3fc5ff87d599232e6df089845a0e663d4bea761e0"
|
|
96
|
+
author = "Eduardo Novella"
|
|
97
|
+
|
|
98
|
+
strings:
|
|
99
|
+
$asset1 = /assets\/androidrepublic\.org\/(.*)\.png/
|
|
100
|
+
|
|
101
|
+
condition:
|
|
102
|
+
is_apk and all of them
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
rule obfuscapk_libencryption : obfuscator
|
|
106
|
+
{
|
|
107
|
+
meta:
|
|
108
|
+
description = "Obfuscapk - LibEncryption plugin"
|
|
109
|
+
url = "https://github.com/ClaudiuGeorgiu/Obfuscapk"
|
|
110
|
+
author = "Simone Aonzo - https://twitter.com/packm4d"
|
|
111
|
+
sample = "4957d9c1b423ae045f27d97b1d0b1f32ba6a2ce56525a2e93bda7172ec18ad0c"
|
|
112
|
+
|
|
113
|
+
strings:
|
|
114
|
+
$lib_arm = /assets\/lib\.arm(eabi|64)-v[0-9a-zA-Z]{2}\.[!-~]+\.so/
|
|
115
|
+
$lib_x86 = /assets\/lib\.x86(_64)?\.[!-~]+\.so/
|
|
116
|
+
condition:
|
|
117
|
+
any of them and is_apk
|
|
118
|
+
}
|