mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-16 20:00:11 +01:00
df27bae6a0
* New command `dscanner`, enables one to scan signed APKs with Drozer * Drozer is a dynamic vulnerability scanner for Android * Drozer runs in a emulator or on-device, this new `dscanner` command... * starts a docker image with Drozer and the Android Emulator pre-installed, * loads the signed APK into the emulator * activates Drozer automated tests for the APK * gathers the report output and places it next to the original APK * The Drozer docker image can be: * cached locally for re-use (just don't run --clean*) * retrieved from dockerhub.com for more efficient runtime * or be built from scratch (in the new "./docker" directory) * New "Vulnerability Scanning" documentation section (run gendocs.sh)
49 lines
1.2 KiB
Makefile
49 lines
1.2 KiB
Makefile
SHELL := /bin/bash
|
|
ALIAS = "dscanner"
|
|
EXISTS := $(shell docker ps -a -q -f name=$(ALIAS))
|
|
RUNNED := $(shell docker ps -q -f name=$(ALIAS))
|
|
ifneq "$(RUNNED)" ""
|
|
IP := $(shell docker inspect $(ALIAS) | grep "IPAddress\"" | head -n1 | cut -d '"' -f 4)
|
|
endif
|
|
STALE_IMAGES := $(shell docker images | grep "<none>" | awk '{print($$3)}')
|
|
EMULATOR ?= "android-19"
|
|
ARCH ?= "armeabi-v7a"
|
|
|
|
COLON := :
|
|
|
|
.PHONY = build clean kill info
|
|
|
|
all: help
|
|
|
|
help:
|
|
@echo "usage: make {help|build|clean|kill|info}"
|
|
@echo ""
|
|
@echo " help this help screen"
|
|
@echo " build create docker image"
|
|
@echo " clean remove images and containers"
|
|
@echo " kill stop running containers"
|
|
@echo " info details of running container"
|
|
|
|
build:
|
|
@docker build -t "dscanner/fdroidserver:latest" .
|
|
|
|
clean: kill
|
|
@docker ps -a -q | xargs -n 1 -I {} docker rm -f {}
|
|
ifneq "$(STALE_IMAGES)" ""
|
|
@docker rmi -f $(STALE_IMAGES)
|
|
endif
|
|
|
|
kill:
|
|
ifneq "$(RUNNED)" ""
|
|
@docker kill $(ALIAS)
|
|
endif
|
|
|
|
info:
|
|
@docker ps -a -f name=$(ALIAS)
|
|
ifneq "$(RUNNED)" ""
|
|
$(eval ADBPORT := $(shell docker port $(ALIAS) | grep '5555/tcp' | awk '{split($$3,a,"$(COLON)");print a[2]}'))
|
|
@echo -e "Use:\n adb kill-server\n adb connect $(IP):$(ADBPORT)"
|
|
else
|
|
@echo "Run container"
|
|
endif
|