From 58db858ae61b0c8e2aeaf563a6ce14210f07a861 Mon Sep 17 00:00:00 2001 From: Debojyoty Datta <39003020+BeingDatta@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:40:15 +0530 Subject: [PATCH 1/4] Add files via upload --- BUILD_FOR_NETHUNTER.md | 116 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 BUILD_FOR_NETHUNTER.md diff --git a/BUILD_FOR_NETHUNTER.md b/BUILD_FOR_NETHUNTER.md new file mode 100644 index 0000000..8e9e017 --- /dev/null +++ b/BUILD_FOR_NETHUNTER.md @@ -0,0 +1,116 @@ +## Driver version 5.6.4.2 + +## First Edit the ioctl_cfg80211.c file in this location rtl8812au/os_dep/linux/ioctl_cfg80211.c + + line no 2328 sinfo->bss_param.flags |= NL80211_STA_BSS_PARAM_SHORT_PREAMBLE; + line no 2331 sinfo->bss_param.flags |= NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME; + line no 2335 sinfo->bss_param.flags |= NL80211_STA_BSS_PARAM_CTS_PROT; + line no 2338 sinfo->bss_param.flags |= NL80211_STA_BSS_PARAM_DTIM_PERIOD; + + +## Some Important Points + +Do not change your kernel name or version in any manner while preparing the module or else it will not work and you will get errors like insmod 8188.ko >> fatal error exec format failed. This happens when you use build script from kali site and on the other hand you build your modules manually. + +For example say during the time of building kernel your situation was like /lib/modules/3.10.35-kali and while making the module your position is say /lib/modules/3.10.35_kali or anything else. This kind of thing will not work. So first built your kernel then just after that build your modules. + + +## Toolchain Used for building this module - gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf + +## 2.Your kernel should enabled below. check in /proc/config.gz or device_defconfig + +CONFIG_MODULES (loadable module support) + +CONFIG_MODULE_FORCE_LOAD (forced module loading) + +CONFIG_MODULE_UNLOAD (module unloading) + +CONFIG_MODULE_FORCE_UNLOAD (forced module loading) + +CONFIG_CFG80211_WEXT (wireless extension compability) + +CONFIG_MAC80211 (IEEE 802.11 Networking Stack) + + +## Step 1- Do the following: After building the kernel stay inside that directory so the first line is irrelevant. + + +Cd android kernel-sourcedirectory on your pc or laptop + +mkdir ../kernel-headers (make kernel-headers directory outside kernel source) + +make O=../kernel-headers someone_defconfig + +make O=../kernel-headers modules_prepare (prepare module) + +make O=../kernel-headers modules INSTALL_MOD_PATH=../kernel-headers (make modules) + +make O=../kernel-headers modules_install INSTALL_MOD_PATH=../kernel-headers(install modules) + + + +## Build Kernel Headers ( shown for armhf/arm only do changes for arm64) + +make headers_install CROSS_COMPILE=$path-your-cross-compiler ARCH=arm SUBARCH=arm INSTALL_HDR_PATH=../kernel-headers (install kernel headers on the same directory ie “kernel-headers”) + +-Note eg: CROSS_COMPILE= /home/user/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- + + +## Build RTL8188EUS driver/modules + +``` +cd ../ +git clone -b v5.6.4.2 https://github.com/aircrack-ng/rtl8812au.git +cd rtl8812au + + +Now enter rtl8188eus directory using your file manager and edit the “makefile” as follows: for armhf + +---------Platform Related (armhf/arm only for arm64 change respective line)------------ + +Line number 94-95 + +CONFIG_PLATFORM_I386_PC = n +CONFIG_PLATFORM_ANDROID_ARM64 = n (for arm64 make this y) +CONFIG_PLATFORM_ARM_RPI = y + +------------------For ARM ToolChain use Hardware FLOATING line number 1056-1165------------------- +(Again for armhf/arm do the following but for arm64 first find your respective section then do the + editing.) + +ifeq ($(CONFIG_PLATFORM_ARM_RPI), y) + +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN + +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT + +ARCH ?= arm + +CROSS_COMPILE ?=toolchain path (give urs) + +KVER ?= 3.18.35-kali (give urs version /lib/modules/) + +KSRC := fullpath not shown include it/kernel-headers/lib/modules/3.18.35-kali/build (give urs) + +MODDESTDIR := fullpath not shown include it/3.18.35-kali/kernel/drivers/net/wireless/ (give urs) + +INSTALL_PREFIX := leave as it is + +Endif + +## Step 4- from inside of rtl8188eus directory + +export ARCH=arm + +Make + +Done enjoy your 8188eu.ko inside this same directory. Transfer it to your nethunter by reflashing +kernel after including it inside /lib/modules/(uname -r)/. + +## Load the driver (8188eu.ko) +``` +su +cd /system/lib/modules +insmod 8188eu.ko +``` +ENJOY........ From 05a3e3a04df6542df5e458190e0cfb8549b36c35 Mon Sep 17 00:00:00 2001 From: Debojyoty Datta <39003020+BeingDatta@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:43:46 +0530 Subject: [PATCH 2/4] Add files via upload --- BUILD_FOR_NETHUNTER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD_FOR_NETHUNTER.md b/BUILD_FOR_NETHUNTER.md index 8e9e017..fc20c3e 100644 --- a/BUILD_FOR_NETHUNTER.md +++ b/BUILD_FOR_NETHUNTER.md @@ -98,7 +98,7 @@ INSTALL_PREFIX := leave as it is Endif -## Step 4- from inside of rtl8188eus directory +## Step 4- from inside of rtl8812au directory export ARCH=arm From 254d2f8e693b2248b193b03c7300d838a6103368 Mon Sep 17 00:00:00 2001 From: Debojyoty Datta <39003020+BeingDatta@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:50:56 +0530 Subject: [PATCH 3/4] Add files via upload Full Readme for Building Nethunter --- BUILD_FOR_NETHUNTER.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD_FOR_NETHUNTER.md b/BUILD_FOR_NETHUNTER.md index fc20c3e..466c764 100644 --- a/BUILD_FOR_NETHUNTER.md +++ b/BUILD_FOR_NETHUNTER.md @@ -104,10 +104,10 @@ export ARCH=arm Make -Done enjoy your 8188eu.ko inside this same directory. Transfer it to your nethunter by reflashing +Done enjoy your 8812au.ko inside this same directory. Transfer it to your nethunter by reflashing kernel after including it inside /lib/modules/(uname -r)/. -## Load the driver (8188eu.ko) +## Load the driver (8812au.ko) ``` su cd /system/lib/modules From a1ce9a47cf9bcce0600905f41b05206f95f01750 Mon Sep 17 00:00:00 2001 From: Debojyoty Datta <39003020+BeingDatta@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:52:14 +0530 Subject: [PATCH 4/4] Add files via upload