|
1 | 1 | # Deadnet APK
|
2 |
| -<p align="center"><img src="https://github.com/flashnuke/deadnet/assets/59119926/fbb72f10-764c-4272-aa8c-8623f34b8ba2" width="350" ></p> |
3 |
| -A simple GUI that runs Deadnet directly on Android devices. </br> </br> |
| 2 | +<p align="center"><img src="https://github.com/user-attachments/assets/c85eccf8-bbf8-4904-9327-9e1c2e064eea" width="450" ></p> |
4 | 3 |
|
5 |
| -The APK is stored inside [bin](https://github.com/flashnuke/deadnet/tree/main/apk/bin) directory, but it can be built manually as well. |
6 |
| -</br>The code that is supposed to open network sockets and send the spoofed packets is written in C++ and compiled into native binaries that are run explicitly by the Python app. |
| 4 | +A simple Android app that runs Deadnet directly on Android devices. </br> </br> |
| 5 | + |
| 6 | +The APK is stored inside [bin](https://github.com/flashnuke/deadnet/tree/main/apk/bin) directory, but can be built manually as well. |
| 7 | +</br>The attack is written in C++ and compiled into native binaries that are run explicitly by the Python app (see the `Notes.Permissions` section for more). </br> |
7 | 8 |
|
8 | 9 | # Requirements
|
9 |
| -* Device must be rooted |
10 |
| -* Most modern devices are ARM64. The native binaries are compiled for the following machine architecture types: (ARM, ARM64, x86, x86_64), see the building section in order to compile for a different architecture type and modify the code accordingly |
| 10 | +* Device must be rooted. |
| 11 | +* Most modern devices are ARM64. The native binaries are compiled for the following machine architecture types: (ARM, ARM64, x86, x86_64), see the building section in order to compile for a different architecture type. |
| 12 | + |
| 13 | +# Usage |
| 14 | +* Grant permissions. |
| 15 | +* Use the buttons - `Start`, `Stop` and `Refresh` (to refresh the current wifi connection info). |
| 16 | +* In case of an error, use the `Debug Logs` button to fetch the logs, and feel free to open a new [issue](https://github.com/flashnuke/deadnet/issues) with the debug logs included. |
11 | 17 |
|
| 18 | +### Permissions |
| 19 | +* Some parts were compiled into native binaries due to a lack of permissions that restrict the Python interpreter from directly creating raw sockets, even when running as root. |
| 20 | +* `ACCESS_FINE_LOCATION` permission is required in order to access SSID data (i.e. wifi network name). |
12 | 21 |
|
13 |
| -# Building |
| 22 | +# Building manually |
14 | 23 | Steps to build the app manually. </br>
|
15 | 24 | The following tools are required:
|
16 |
| -* NDK tools |
17 |
| -* Buildozer and Kivy library |
| 25 | +* NDK tools (to build the `.cpp` binaries) |
| 26 | +* Buildozer (to build the APK) |
| 27 | + |
| 28 | +### Cloning the library |
| 29 | +```bash |
| 30 | +# clone the project |
| 31 | +git clone https://github.com/flashnuke/deadnet.git |
| 32 | +``` |
18 | 33 |
|
19 | 34 | ### Compiling the C++ Binaries
|
20 | 35 | The C++ binaries source code files (`src/arp.cpp` for the ARP poisoning and `src/nra.cpp` for the dead router attack) should be compiled by NDK:
|
21 | 36 | ```bash
|
22 |
| -cd deadnet/apk |
23 |
| - |
24 |
| -$NDK_PATH/bin/aarch64-linux-android29-clang++ -static -o assets/nra.arm64 src/nra.cpp |
25 |
| -$NDK_PATH/bin/armv7a-linux-androideabi29-clang++ -static -o assets/nra.arm src/nra.cpp |
26 |
| -$NDK_PATH/bin/i686-linux-android29-clang++ -static -o assets/nra.x86 src/nra.cpp |
27 |
| -$NDK_PATH/bin/x86_64-linux-android29-clang++ -static -o assets/nra.x86_64 src/nra.cpp |
| 37 | +cd /tmp # DO NOT CLONE NDK INTO THE PROJECT DIRECTORY! it will mess with the build process |
| 38 | +mkdir android-ndk && cd android-ndk |
| 39 | +wget https://dl.google.com/android/repository/android-ndk-r26d-linux.zip |
| 40 | +unzip android-ndk-r26d-linux.zip |
| 41 | +export NDK_PATH=$(pwd)/android-ndk-r26d # NDK_PATH example: "NDK_PATH=/tmp/my-android-toolchain" |
28 | 42 |
|
29 |
| -$NDK_PATH/bin/aarch64-linux-android29-clang++ -static -o assets/arp.arm64 src/arp.cpp |
30 |
| -$NDK_PATH/bin/armv7a-linux-androideabi29-clang++ -static -o assets/arp.arm src/arp.cpp |
31 |
| -$NDK_PATH/bin/i686-linux-android29-clang++ -static -o assets/arp.x86 src/arp.cpp |
32 |
| -$NDK_PATH/bin/x86_64-linux-android29-clang++ -static -o assets/arp.x86_64 src/arp.cpp |
| 43 | +# compile binaries |
| 44 | +cd <path_to_deadnet_root>/apk |
| 45 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ -static -o assets/nra.arm64 src/nra.cpp |
| 46 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi29-clang++ -static -o assets/nra.arm src/nra.cpp |
| 47 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android29-clang++ -static -o assets/nra.x86 src/nra.cpp |
| 48 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android29-clang++ -static -o assets/nra.x86_64 src/nra.cpp |
33 | 49 |
|
34 |
| -# NDK_PATH example: "NDK_PATH=/home/ubuntu/my-android-toolchain" |
| 50 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ -static -o assets/arp.arm64 src/arp.cpp |
| 51 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi29-clang++ -static -o assets/arp.arm src/arp.cpp |
| 52 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android29-clang++ -static -o assets/arp.x86 src/arp.cpp |
| 53 | +$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android29-clang++ -static -o assets/arp.x86_64 src/arp.cpp |
35 | 54 | ```
|
36 | 55 |
|
| 56 | +The compiled binaries will be stored under `./assets`. |
| 57 | + |
37 | 58 | ### Building the APK
|
38 | 59 | ```bash
|
39 |
| -cd deadnet/apk |
| 60 | +# navigate to the apk directory |
| 61 | +cd <path_to_deadnet_root>/apk |
| 62 | + |
| 63 | +# make sure you have python 3.10 installed |
| 64 | +python3.10 --version |
| 65 | +python3.10 -m venv venv |
| 66 | +source venv/bin/activate |
| 67 | + |
| 68 | +# install buildozer - refer to ths official for more https://buildozer.readthedocs.io/en/latest/installation.html |
| 69 | + |
| 70 | +# build the apk |
40 | 71 | buildozer android debug # build in debug mode
|
41 | 72 | ```
|
| 73 | +The compiled APK will be stored under `./bin`. |
42 | 74 |
|
43 |
| -# Notes |
44 |
| -### Permissions |
45 |
| -* Some parts were compiled into native binaries due to lack of permissions to open raw sockets by the Python interpreter on Android (even when root) |
46 |
| -* `ACCESS_FINE_LOCATION` permission is requested in order to access the SSID (wifi network name) |
47 |
| - |
| 75 | +# Debugging |
| 76 | +### Debug Logs |
| 77 | +Quick debugging can be done using the `Debug Logs` button, which will display useful logs. </br> |
| 78 | +### ADB logcat |
| 79 | +If a more thorough debug process is needed, `adb` is the right for that. </br> |
| 80 | +Connecting the device to ADB and running `adb logcat` would show all the logs, which can be filtered further by using `adb logcat | grep -E 'python|DeadNet'`. |
48 | 81 |
|
49 | 82 | # Disclaimer
|
50 | 83 |
|
|
0 commit comments