Skip to content

Commit 437cd25

Browse files
committed
Merge branch 'master' of github.com:cryptax/androidre
2 parents 3c2759a + 814c651 commit 437cd25

File tree

7 files changed

+63
-229
lines changed

7 files changed

+63
-229
lines changed

Dockerfile.re

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ RUN git clone https://github.com/skylot/jadx.git
66

77
FROM gradle:8.2 as build
88
WORKDIR /opt
9-
#COPY --from=clone /opt/axmlprinter /opt/axmlprinter
10-
#RUN cd /opt/axmlprinter && ./gradlew jar
119
#COPY --from=clone /opt/simplify /opt/simplify
1210
#RUN cd /opt/simplify && ./gradlew fatjar
1311
COPY --from=clone /opt/jadx /opt/jadx
@@ -17,24 +15,24 @@ RUN cd /opt/jadx && ./gradlew dist
1715
FROM ubuntu:22.04
1816

1917
MAINTAINER Axelle Apvrille
20-
ENV REFRESHED_AT 2023-12-05
18+
ENV REFRESHED_AT 2024-01-08
2119

2220
ARG DEBIAN_FRONTEND=noninteractive
2321
ARG SSH_PASSWORD
2422
ARG VNC_PASSWORD
2523
ENV AXMLPRINTER_VERSION "0.1.7"
26-
ENV APKTOOL_VERSION "2.9.0"
24+
ENV APKTOOL_VERSION "2.9.1"
2725
ENV DEX2JAR_VERSION "2.1-SNAPSHOT"
28-
ENV FRIDA_VERSION "16.1.3"
26+
ENV FRIDA_VERSION "16.1.8"
2927
ENV JD_VERSION "1.6.6"
30-
ENV PROCYON_VERSION "0.5.30"
3128
ENV SMALI_VERSION "2.5.2"
3229
ENV UBERAPK_VERSION "1.3.0"
3330

3431
# For DroidLysis: libxml2-dev libxslt-dev libmagic-dev
3532
# For SSH: openssh-server ssh
3633
# For VNC: xvfb x11vnc xfce4 xfce4-terminal
3734
# For Quark engine: graphviz libbz2-dev
35+
# For CRC32: libarchive-zip-perl
3836

3937
#RUN apt-get update && apt-get install -yqq default-jdk libpulse0 libxcursor1 adb python3-pip python3-dev python3-venv pkgconf pandoc curl \
4038
RUN apt-get update && apt-get install -yqq openjdk-8-jre openjdk-11-jre python3-pip python3-dev python3-venv pkgconf pandoc curl locate \
@@ -43,32 +41,23 @@ RUN apt-get update && apt-get install -yqq openjdk-8-jre openjdk-11-jre python3-
4341
openssh-server ssh \
4442
xvfb x11vnc xfce4 xfce4-terminal\
4543
libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev wkhtmltopdf \
46-
graphviz adb libbz2-dev file
44+
graphviz adb libbz2-dev file libarchive-zip-perl
4745

4846
RUN python3 -m pip install --upgrade pip && pip3 install wheel
4947

5048
# ----------------------------- RE Tools
5149

52-
# APKdiff
53-
RUN wget -q -O "/opt/apkdiffy.py" https://raw.githubusercontent.com/daniellockyer/apkdiff/master/apkdiff.py
54-
5550
# Androguard
5651
#RUN wget -q -O "/opt/andro.zip" https://github.com/androguard/androguard/archive/v${ANDROGUARD_VERSION}.zip && unzip /opt/andro.zip -d /opt && rm -f /opt/andro.zip
5752
#RUN cd /opt/androguard-${ANDROGUARD_VERSION} && pip3 install .[magic,GUI] && pip3 install --upgrade 'jedi<0.18.0' && rm -r ./docs ./examples ./tests ./lib*
58-
59-
# Apkfile library
60-
#RUN cd /opt && git clone https://github.com/CalebFenton/apkfile
53+
RUN pip install androguard==3.4.0a1
6154

6255
# APKiD
6356
RUN pip3 install apkid
64-
#RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel && \
65-
# pip3 wheel --quiet --no-cache-dir --wheel-dir=/tmp/yara-python --build-option="build" #--build-option="--enable-dex" git+https://github.com/VirusTotal/[email protected] && \
66-
# pip3 install --quiet --no-cache-dir --no-index --find-links=/tmp/yara-python yara-python && \
67-
# rm -rf /tmp/yara-python && \
68-
# cd /opt && git clone https://github.com/rednaga/APKiD/ && \
69-
# cd /opt/APKiD && python3 prep-release.py && pip3 install -e . && \
70-
# rm -rf tests docker Dockerfile
7157

58+
# Apksigtool
59+
RUN cd /opt && git clone https://github.com/obfusk/apksigtool
60+
RUN pip3 install pyasn1-modules && cd /opt/apksigtool && python3 setup.py install
7261

7362
# Apktool
7463
RUN mkdir -p /opt/apktool
@@ -78,16 +67,7 @@ RUN wget -q -O "/opt/apktool/apktool.jar" https://bitbucket.org/iBotPeaches/apkt
7867
ENV PATH $PATH:/opt/apktool
7968

8069
# AXMLPrinter
81-
RUN wget -q -O "/opt/axmlprinter.jar" https://github.com/rednaga/axmlprinter/releases/download/0.1.7/axmlprinter-${AXMLPRINTER_VERSION}.jar
82-
83-
# ByteCode Viewer
84-
#RUN wget -q -O "/opt/bytecode-viewer.jar" "https://github.com/Konloch/bytecode-viewer/releases/download/v2.9.22/Bytecode-Viewer-${BYTECODEVIEWER_VERSION}.jar"
85-
86-
# CFR
87-
#RUN wget -q -O "/opt/cfr_${CFR_VERSION}.jar" http://www.benf.org/other/cfr/cfr-${CFR_VERSION}.jar
88-
89-
# ClassyShark
90-
#RUN wget -q -O "/opt/ClassyShark.jar" https://github.com/google/android-classyshark/releases/download/${CLASSYSHARK_VERSION}/ClassyShark.jar
70+
RUN wget -q -O "/opt/axmlprinter.jar" https://github.com/rednaga/axmlprinter/releases/download/${AXMLPRINTER_VERSION}/axmlprinter-${AXMLPRINTER_VERSION}.jar
9171

9272
# Dex2Jar
9373
RUN wget -q -O "/opt/dex2jar.zip" https://github.com/pxb1988/dex2jar/files/1867564/dex-tools-${DEX2JAR_VERSION}.zip \
@@ -104,47 +84,24 @@ RUN cd /opt && git clone https://github.com/cryptax/droidlysis && cd /opt/droidl
10484
RUN chmod u+x /opt/droidlysis/droidlysis
10585
RUN sed -i 's#~/softs#/opt#g' /opt/droidlysis/conf/general.conf
10686
107-
# Enjarify
108-
RUN cd /opt && git clone https://github.com/Storyyeller/enjarify && ln -s /opt/enjarify/enjarify.sh /usr/bin/enjarify
109-
11087
# Frida, Frida Server and Frida-DEXDump
11188
RUN pip3 install frida frida-tools frida-dexdump
11289
COPY ./setup/install-frida-server.sh /opt
11390
RUN cd /opt \
11491
&& wget -q -O "/opt/frida-server.xz" https://github.com/frida/frida/releases/download/${FRIDA_VERSION}/frida-server-${FRIDA_VERSION}-android-arm.xz && unxz /opt/frida-server.xz && mv /opt/frida-server /opt/frida-server-android-arm && chmod u+x /opt/install-frida-server.sh
11592
116-
# Fridump
117-
RUN cd /opt && git clone https://github.com/Nightbringer21/fridump.git
118-
11993
# JADX
120-
#RUN wget -q -O "/opt/jadx.zip" https://github.com/skylot/jadx/releases/download/v${JADX_VERSION}/jadx-${JADX_VERSION}.zip \
121-
# && mkdir -p /opt/jadx \
122-
# && unzip /opt/jadx.zip -d /opt/jadx \
123-
# && rm -f /opt/jadx.zip
12494
COPY --from=build /opt/jadx/build /opt/jadx/
12595
12696
# JD-GUI
12797
COPY ./setup/extract.sh /opt/extract.sh
12898
RUN wget -q -O "/opt/jd-gui.jar" "https://github.com/java-decompiler/jd-gui/releases/download/v${JD_VERSION}/jd-gui-${JD_VERSION}.jar" && chmod +x /opt/extract.sh
12999
130-
# JEB Demo - requires JDK 11
131-
<<<<<<< HEAD
132-
# RUN wget -q -O "/opt/jeb.zip" https://www.pnfsoftware.com/dl?jebdemo && mkdir -p /opt/jeb && unzip /opt/jeb.zip -d ./opt/jeb && rm /opt/jeb.zip
133-
=======
134-
#RUN wget -q -O "/opt/jeb.zip" https://www.pnfsoftware.com/dl?jebdemo && mkdir -p /opt/jeb && unzip /opt/jeb.zip -d ./opt/jeb && rm /opt/jeb.zip
135-
>>>>>>> 2b694cd9427fe0c03c771e9cb27ac4ee5fdf06a3
100+
# LIEF
101+
RUN pip install lief
136102
137103
# Kavanoz
138-
RUN git clone https://github.com/eybisi/kavanoz.git && cd kavanoz && pip install -e . --user
139-
140-
# Oat2Dex
141-
RUN wget -q -O "/opt/oat2dex.py" https://github.com/jakev/oat2dex-python/blob/master/oat2dex.py
142-
143-
# Objection
144-
#RUN pip3 install objection
145-
146-
# Procyon (link broken, currently using an archive) - Does not work with Java 11. Works with Java 8
147-
RUN wget -q -O "/opt/procyon-decompiler.jar" "https://github.com/cryptax/droidlysis/raw/master/external/procyon-decompiler-${PROCYON_VERSION}.jar"
104+
RUN cd /opt && git clone https://github.com/eybisi/kavanoz && cd kavanoz && python3 -m venv kavanoz-venv && . ./kavanoz-venv/bin/activate && pip install -e . && deactivate
148105
149106
# Quark engine
150107
RUN pip3 install -U quark-engine

README.md

Lines changed: 44 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,21 @@
11
# What's this?
22

3-
This repository contains 3 _docker_ images for the reverse engineering of _Android_ applications.
3+
This repository contains 1 docker image for the reverse engineering of _Android_ applications:
44

5-
1. Android RE tools: `cryptax/android-re:2023.07` (1.7 GB). This image contains reverse engineering tools.
6-
2. Dexcalibur: `cryptax/dexcalibur:2023.01`. Contains Dexcalibur. Particularly useful for users whose OS does not support Dexcalibur...
7-
3. *Obsolete and broken*: Android emulators: `cryptax/android-emu:2021.01` (3.4 GB). This image contains the Android SDK and emulators.
5+
- Android RE tools: `cryptax/android-re:2023.07` (1.7 GB). This image contains reverse engineering tools.
86

7+
**The other images are obsolete and/or broken**: `cryptax/dexcalibur:2023.01` and `cryptax/android-emu:2021.01`.
98

109
**Disclaimer**: Please use responsibly.
1110

12-
# Download / Install
11+
# Quick Setup
1312

1413
You are expected to download those containers via `docker pull`:
1514

16-
- `docker pull cryptax/android-re:2023.07`
17-
- `docker pull cryptax/dexcalibur:2023.01`
15+
1. `docker pull cryptax/android-re:2023.07`
16+
2. `docker-compose up -d android-retools`
1817

19-
If you wish to *build the images locally*: `docker-compose build`. This will build both images. If you only want to build one, add its name (see `docker-compose.yml`) e.g `docker-compose build android-retools`
20-
21-
# Run the containers
22-
23-
## Running dexcalibur
24-
25-
`docker run --rm --network=host -v /tmp/dexcalibur:/workshop -it cryptax/dexcalibur:2023.01 /bin/bash`
26-
27-
## Running android-re or android-emu
28-
29-
Use `docker-compose`:
30-
31-
- Start Android RE tools container: `docker-compose up -d android-retools`
32-
- Start Android emulator container: `docker-compose up -d android-emulators`
33-
- Stop both containers: `docker-compose stop`
34-
- To stop only one container, same as starting it: add its name at the end of the command.
35-
36-
37-
# Using the containers
38-
39-
Note that:
40-
41-
- Each Docker container exports a *SSH* port and a *VNC* port.
42-
- The Android RE tools container exposes a port for NodeJS in addition.
43-
- It is useful to share a local directory with `/workshop` in the container to easily read/write files.
44-
45-
Once the containers are up and running, you can **connect using SSH or VNC**. The default credentials are `root/mypass` but you are encouraged to **modify this** (in `docker-compose.yml`).
46-
47-
For SSH:
48-
49-
- Be certain to specify the **port**. For SSH, it is `ssh -p PORT`, for scp `scp -P PORT`.
50-
- Make sure to use **X11 Forwarding**. This is `-X` option for ssh.
51-
52-
Example:
18+
Access by SSH:
5319

5420
```
5521
$ xhost +
@@ -62,57 +28,72 @@ For VNC, install a *VNC viewer*, then:
6228
$ vncviewer 127.0.0.1::5900
6329
```
6430

65-
# Android emulators image (`android-emu`)
66-
67-
It contains:
31+
Default password is `mypass`. See `docker_compose.yml` to change it.
6832

69-
- Android SDK
70-
- Android emulator 5.1 ARM
71-
- Android emulator 11 x86_64
33+
# Customization
7234

73-
See `~/.bashrc` for aliases to run those emulators.
74-
See `Dockerfile.emulators` if you wish to customize.
75-
76-
## Android x86_64 emulator
35+
If you wish to *build the images locally*: `docker-compose build`. This will build both images. If you only want to build one, add its name (see `docker-compose.yml`) e.g `docker-compose build android-retools`
7736

78-
The "normal" Android emulators emulate ARM architecture. If your host uses Intel x86 and supports hardware virtualization instructions, you can use the Android emulator for x86, which will be **much faster**. The Dockerfile installs the necessary packages, yet, for this option to work, you must:
37+
Ports for SSH and VNC can be customized.
7938

80-
- Have an Intel x86-64 processor on your host which supports virtualization (e.g Intel VT)
81-
- Launch the container with the `--privileged` option.
8239

8340
# Android tools image (`android-re`)
8441

8542
- [androguard](https://github.com/androguard/androguard)
86-
- [apkfile](https://github.com/CalebFenton/apkfile)
8743
- [apkid](https://github.com/rednaga/APKiD/)
8844
- [apkleaks](https://github.com/dwisiswant0/apkleaks)
8945
- [apktool](https://bitbucket.org/iBotPeaches/apktool)
9046
- [axmlprinter](https://github.com/rednaga/axmlprinter)
9147
- [baksmali / smali](https://github.com/JesusFreke/smali)
9248
- [dex2jar](https://github.com/pxb1988/dex2jar)
9349
- [droidlysis](https://github.com/cryptax/droidlysis)
94-
- [enjarify](https://github.com/Storyyeller/enjarify)
9550
- [frida](https://frida.re)
96-
- [frida-dexdump](https://github.com/hluwa/FRIDA-DEXDump)
9751
- [jadx](https://github.com/skylot/jadx)
9852
- [java decompiler](https://github.com/java-decompiler/jd-gui/)
99-
- [oat2dex](https://github.com/jakev/oat2dex-python)
100-
- [objection](https://github.com/sensepost/objection)
101-
- [procyon](https://github.com/mstrobel/procyon)
53+
- [kavanoz](https://github.com/eybisi/kavanoz)
10254
- [quark](https://github.com/quark-engine/quark-engine)
10355
- [radare2](https://radare.org)
10456
- [simplify](https://github.com/CalebFenton/simplify)
10557
- [uber apk signer](https://github.com/patrickfav/uber-apk-signer)
10658

10759
Those are open source tools, or free demos. They are installed in `/opt`.
10860

61+
## Interesting tools to install on the host (not in the container)
10962

110-
# Tweaks
63+
- [medusa](https://github.com/Ch0pin/medusa)
64+
- [objection](https://github.com/sensepost/objection): `pip3 install objection`
11165

112-
- Running a container locally (without SSH or VNC):
66+
67+
## Adding more tools
11368

11469
```
115-
$ docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix cryptax/android-re:latest /bin/bash
70+
# APKdiff
71+
RUN wget -q -O "/opt/apkdiffy.py" https://raw.githubusercontent.com/daniellockyer/apkdiff/master/apkdiff.py
72+
73+
# Apkfile
74+
RUN cd /opt && git clone https://github.com/CalebFenton/apkfile
75+
76+
# ByteCode Viewer
77+
RUN wget -q -O "/opt/bytecode-viewer.jar" "https://github.com/Konloch/bytecode-viewer/releases/download/v2.9.22/Bytecode-Viewer-${BYTECODEVIEWER_VERSION}.jar
78+
79+
# CFR
80+
RUN wget -q -O "/opt/cfr_${CFR_VERSION}.jar" http://www.benf.org/other/cfr/cfr-${CFR_VERSION}.jar
81+
82+
# ClassyShark
83+
RUN wget -q -O "/opt/ClassyShark.jar" https://github.com/google/android-classyshark/releases/download/${CLASSYSHARK_VERSION}/ClassyShark.jar
84+
85+
# Enjarify
86+
RUN cd /opt && git clone https://github.com/Storyyeller/enjarify && ln -s /opt/enjarify/enjarify.sh /usr/bin/enjarify
87+
88+
# Fridump
89+
RUN cd /opt && git clone https://github.com/Nightbringer21/fridump.git
90+
91+
# Oat2Dex
92+
RUN wget -q -O "/opt/oat2dex.py" https://github.com/jakev/oat2dex-python/blob/master/oat2dex.py
93+
94+
# Procyon (link broken, currently using an archive) - Does not work with Java 11. Works with Java 8
95+
RUN wget -q -O "/opt/procyon-decompiler.jar" "https://github.com/cryptax/droidlysis/raw/master/external/procyon-decompiler-${PROCYON_VERSION}.jar"
96+
11697
```
11798

11899

docker-compose.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,14 @@
11
---
22
version: "3"
33
services:
4-
android-emulators:
5-
build:
6-
context: .
7-
dockerfile: Dockerfile.emulators
8-
args:
9-
- SSH_PASSWORD=mypass
10-
- VNC_PASSWORD=mypass
11-
image: cryptax/android-emu:2021.03
12-
container_name: android-emulators
13-
ports:
14-
- "5022:22"
15-
- "5037:5037"
16-
- "5900:5900"
17-
- "5800:8000"
18-
privileged: true
19-
volumes:
20-
- /tmp/emulators:/workshop
21-
android-dexcalibur:
22-
build:
23-
context: .
24-
dockerfile: Dockerfile.dexcalibur
25-
image: cryptax/dexcalibur:2023.01
26-
container_name: android-dexcalibur
27-
network_mode: "host"
28-
volumes:
29-
- /tmp/dexcalibur:/workshop
304
android-retools:
315
build:
326
context: .
337
dockerfile: Dockerfile.re
348
args:
359
- SSH_PASSWORD=mypass
3610
- VNC_PASSWORD=mypass
37-
image: cryptax/android-re:2023.07
11+
image: cryptax/android-re:2024.01
3812
container_name: android-retools
3913
ports:
4014
- "6022:22"
File renamed without changes.
File renamed without changes.

obsolete/dexcalibur-obsolete.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Notes on the obsolete Dexcalibur Docker image
2+
3+
## Running dexcalibur
4+
5+
`docker run --rm --network=host -v /tmp/dexcalibur:/workshop -it cryptax/dexcalibur:2023.01 /bin/bash`

0 commit comments

Comments
 (0)