
Androidモバイルデバイスの堅牢化
Androidモバイルデバイスのハードニングツール(Python3製)。
Android版のPObY-A(Privacy Owned by You - Android)は、マルウェアと設定のスキャン機能を備え、Playストアで入手可能です。ソースコードはこちらで見つかります。
AMDHは、Androidデバイス上のインストール済みアプリケーションのスキャンを自動化し、既知のマルウェアを検出し、プライバシーを保護するために作成されました。
$ git clone https://github.com/SecTheTech/AMDH.git; cd AMDH
$ python3 -m venv amdh
$ source amdh/bin/activate
(amdh) $ pip install -r requirement.txt
注意:Windowsの場合は、ADBのパスを指定するか、
config/main.py内の変数adb_windows_pathを編集してください。
警告:
-l引数を使用し、-t eで有効なアプリケーションを指定すると、システムアプリが一覧表示されます。システムアプリのアンインストールはAndroidシステムを破壊する可能性があります。システムアプリではuninstallではなくdisableを使用することを推奨します。
$ python amdh.py -h
usage: amdh.py [-h] [-d DEVICES] [-sS] [-sA] [-H] [-a ADB_PATH] [-t {e,d,3,s}] [-D APKS_DUMP_FOLDER]
[-rar] [-R] [-l] [-P] [-S SNAPSHOT_DIR] [-cS SNAPSHOT_REPORT] [-rS SNAPSHOT_TO_RESTORE] [-o OUTPUT_DIR]
Android Mobile Device Hardening
optional arguments:
-h, --help show this help message and exit
-d DEVICES, --devices DEVICES
list of devices separated by comma or "ALL" for all connected devices
-sS Scan the system settings
-sA Scan the installed applications
-H Harden system settings /!\ Developer Options and ADB will be disabled /!\
-a ADB_PATH, --adb-path ADB_PATH
Path to ADB binary
-t {e,d,3,s} Type of applications:
e: enabled Apps
d: disabled Apps
3: Third party Apps
s: System Apps
-D APKS_DUMP_FOLDER, --dump-apks APKS_DUMP_FOLDER
Dump APKs from device to APKS_DUMP_FOLDER directory
-rar Remove admin receivers: Remove all admin receivers if the app is not a system App
Scan application option "-sA" is required
-R For each app revoke all dangerous permissions
Scan application option "-sA" is required
-l List numbered applications to disable, uninstall or analyze
-P List current users processes
-S SNAPSHOT_DIR, --snapshot SNAPSHOT_DIR
Snapshot the current state of the phone to a json file and backup applications into SNAPSHOT_DIR
-cS SNAPSHOT_REPORT, --cmp-snapshot SNAPSHOT_REPORT
Compare SNAPSHOT_REPORT with the current phone state
-rS SNAPSHOT_TO_RESTORE, --restore-snapshot SNAPSHOT_TO_RESTORE
Restore SNAPSHOT_TO_RESTORE
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Output directory for reports and logs. Default: out
付与された権限をファイルmalware_perms.jsonに記述された権限と比較します。このファイルには3つのノードが含まれています:
malware_only権限は、マルウェアのみが使用する権限です。分析されたマルウェアは以下のリポジトリからのものです:
権限のダンプにはコマンドaaptが使用されました。次に、正規アプリ(約400アプリ)の権限をダンプしました。malware_only権限とは、マルウェアが使用し、分析された正規アプリケーションには決して現れない権限です。
すべての権限は、マルウェアと正規アプリケーションの両方で使用されます。値は、マルウェアがこれらの権限を正規アプリと比較してどの程度使用したかの割合です。
スナップショットは、システム状態を監視し、電話データをバックアップするのに役立ちます:
pm revokeコマンドは終了コード成功を返しますが、一部のマルウェアに対して権限を取り消しません。スキャン
(amdh)$ python amdh.py -d SERIAL1,SERIAL2,SERIAL3 -sA -o reports