预装软件:
(1)安装 VS 2017 community 版本;
(2)安装 OpenSSL-Win64;
(3)安装 Python 2.7.18 版本;
(4)安装 JDK 1.8版本,我的是 1.8.0_191;
(5)安装 Android SDK,NDK;
(6)安装 git;
环境变量设置:
(1)ANDROID_HOME 指向Android SDK 目录;
(2)ANDROID_SDK 指向 ANDROID_HOME 同样路径;
(3)ANDROID_NDK 指向 NDK 目录;
(4)JAVA_HOME 指向 Java 安装目录;
(5)PYTHONPATH 指向 Python 安装目录;
(6)INCLUDE 指向openssl头文件位置,C:Program FilesOpenSSL-Win64include
(7)LIB 指向 openssl lib库文件位置 C:Program FilesOpenSSL-Win64lib
(8)PATH 添加ndk目录,pyhton 目录,java bin路径,如下图:
取代码和安装必备:
~ git clone https://github.com/linkedin/qark ~ cd qark ~ pip install -r requirements.txt ~ pip install . ~ qark --help
安装成功后,qark 会被安装到 C:Python374scripts 目录下,然后就可以使用了。
E:srcqark_src>where qark
C:Python374scriptsqark.exe
E:srcqark_src>qark --help
Usage: qark [OPTIONS]
Options:
--sdk-path DIRECTORY Path to the downloaded SDK directory if
already downloaded. only necessary if
--exploit-apk is passed. If --exploit-apk is
passed and this flag is not passed,QARK will
attempt to use the ANDROID_SDK_HOME,
ANDROID_HOME, ANDROID_SDK_ROOT environment
variables (in that order) for a path.
--build-path DIRECTORY Path to place decompiled files and exploit
APK. [default: build]
--debug / --no-debug Show debugging statements (helpful for
issues). [default: False]
--apk PATH APK to decompile and run static analysis. If
passed, the --java option is not used.
--java PATH A directory containing Java code, or a Java
file, to run static analysis. If passed,the
--apk option is not used.
--report-type [html|xml|json|csv]
Type of report to generate along with
terminal output. [default: html]
--exploit-apk / --no-exploit-apk
Create an exploit APK targetting a few
vulnerabilities. [default: False]
--report-path DIRECTORY report output path.
--keep-report / --no-keep-report
Append to final report file. [default:
False]
--version Show the version and exit.
--help Show this message and exit.
qark 内置 dex2jar 用来将 dex 文件转码成 jar 包,这个程序比较老,无人维护了,解包会有很多问题,不推荐使用。
推荐的方式是使用 jadx 将 apk 文件反编译解码,然后使用 qark 对解码目录进行扫描。
(1)下载并解压 jadx 程序,目前最新版本是 1.2.0;网址: https://github.com/skylot/jadx
(2)将 jadx 路径添加到环境变量;
(3)使用 jadx 反编译 apk 文件
E:test>jadx test.apk INFO - loading ... INFO - processing ... INFO - done E:test>
反编译内容如下:
(4)使用 qark 扫描反编译代码;
E:test>qark --java E:testtestsources --report-path . Decompiling... Running scans... Finish scans... Writing report... Finish writing report to E:testreport.html ...
然后就能看 report 网页文件了。



