Last active
August 26, 2022 00:45
-
-
Save ninp0/29181a3cdc6653a0c8c684fccbfaaaaf to your computer and use it in GitHub Desktop.
Compile Netcat for Stock / Non-Rooted Android Phone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash --login | |
cd ~/Downloads && wget http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64.tar.bz2 | |
tar -xjvf android-ndk-r9b-linux-x86_64.tar.bz2 -C ~/Downloads | |
cd ~/Downloads && git clone https://android.googlesource.com/platform/external/netcat | |
cd ~/Downloads/netcat | |
export NDK=~/Downloads/android-ndk-r9b | |
export SYSROOT=$NDK/platforms/android-19/arch-arm | |
export CC="$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT" | |
$CC -DANDROID -c -o atomicio.o atomicio.c -fPIE -pie | |
$CC -DANDROID -c -o netcat.o netcat.c -fPIE -pie | |
$CC -o netcat atomicio.o netcat.o -fPIE -pie | |
adb push netcat /data/local/tmp/nc | |
adb shell chmod 755 /data/local/tmp/nc | |
adb shell /data/local/tmp/nc -h | |
echo "Cheers and happy hunting!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment