From 98643d648547d6c84d6fc1673391dcea771c8206 Mon Sep 17 00:00:00 2001 From: NasdaqGodzilla <26323326+NasdaqGodzilla@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:26:45 +0800 Subject: [PATCH] V1.7: Add Lamda --- Dockerfile | 11 +++++++++++ README.md | 1 + lamda_setup.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 lamda_setup.sh diff --git a/Dockerfile b/Dockerfile index e969c06..5b0c1ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -104,6 +104,17 @@ USER 1000 WORKDIR $HOME RUN pip3 install objection +# lamda +USER 0 +RUN apt install -y wget +USER 1000 +WORKDIR $HOME +ENV FILENAME_LAMDA_SETUP="lamda_setup.sh" +ENV FILENAME_LAMDA="arm64-v8a.tar.gz-install.sh" +ENV FILENAME_LAMDA_URL="https://github.com/rev1si0n/lamda/releases/download/3.0.47/arm64-v8a.tar.gz-install.sh" +RUN wget $FILENAME_LAMDA_URL +COPY "$FILENAME_LAMDA_SETUP" $HOME + # clean USER 0 RUN apt autoremove --purge -y && apt clean && apt autoclean && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index c925150..8249131 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Docker image for Android reverse engineering tools. Android逆向工程工具Doc 5. V1.4: Add frida-dexdump 6. V1.5: Add frida-server, Bash script to setup frida-server 7. V1.6: Add Objection +8. V1.7: Add Lamda # Usage diff --git a/lamda_setup.sh b/lamda_setup.sh new file mode 100644 index 0000000..ff13dc6 --- /dev/null +++ b/lamda_setup.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +function lamda_server_start() { + echo Lamda starting + # adb shell "nohup 2>&1 1&>/dev/null sh /data/local/tmp/arm64-v8a/bin/launch.sh" & +adb shell << EOF + sh /data/local/tmp/arm64-v8a/bin/launch.sh + exit +EOF +} + +function lamda_server_setup_then_start() { + echo Lamda setup + adb push $HOME/$FILENAME_LAMDA /data/local/tmp + # adb shell "nohup 2>&1 1&>/dev/null sh /data/local/tmp/$FILENAME_LAMDA" & +adb shell << EOF + sh /data/local/tmp/$FILENAME_LAMDA + exit +EOF +} + +function lamda_server_setup() { + local exists=`adb shell "[ -f /data/local/tmp/arm64-v8a/bin/launch.sh ] || echo 1"` + if [ -z "$exists" ]; then + echo "Lamda exists"; + lamda_server_start + else + echo "Lamda doesn't exist"; + lamda_server_setup_then_start + fi +} + +function lamda_server_clean() { + rm -rf /data/local/tmp/arm64-v8a + rm -rf /data/usr +} + +adb root + +lamda_server_setup & +pip3 install -U lamda -q 1>/dev/null +echo Waiting lamda server up... +wait +