0x00 Preface
---
The third article in the series on setting up an Android penetration platform, introducing two methods to install Kali on the Android device OnePlus 6T, documenting the details.
Method 1: Installing Kali NetHunter (2022.1) on the Android System
Method 2: Installing the Linux Subsystem kali-linux on Win11 System
Test Device: OnePlus 6T 10GB+256GB McLaren Edition
Test Device System: Android 11 + Win11
0x01 Introduction
---
This article will cover the following:
- Installing Kali NetHunter (2022.1) on the Android System
- Installing the Linux Subsystem kali-linux on Win11 System
0x02 Installing Kali NetHunter (2022.1) on the Android System
---
The process can refer to the previous article 'Building an Android Penetration Platform - Installing Kali NetHunter on Nexus6P (2022.1)'
Method to switch from Win11 to Android:
Press Volume+ during boot, select UEFI BootMenu, then choose Reboot to other slot
1. Download files
(1) Kali NetHunter
Requires Android version 10 or Android version 11
Download link for OnePlus6T Android 11: https://kali.download/nethunter-images/kali-2022.1/nethunter-2022.1-oneplus6-oos-eleven-kalifs-full.zip
Download link for OnePlus6T Android 10: https://kali.download/nethunter-images/kali-2022.1/nethunter-2022.1-oneplus6-oos-ten-kalifs-full.zip
(2) Magisk
Download page: https://github.com/topjohnwu/Magisk
Select Magisk-v21.4.zip here, download link: https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-v21.4.zip
(3) TWRP
Download page: https://twrp.me/oneplus/oneplus6t.html
Download link:
https://dl.twrp.me/fajita/twrp-3.6.1_9-0-fajita.img
https://dl.twrp.me/fajita/twrp-installer-3.6.1_9-0-fajita.zip
Download the files twrp-3.6.1_9-0-fajita.img and twrp-installer-3.6.1_9-0-fajita.zip
twrp-3.6.1_9-0-fajita.img is used to boot TWRP via fastboot, while twrp-installer-3.6.1_9-0-fajita.zip is used for permanent installation of TWRP
2. Install Kali NetHunter
(1) Enter Recovery Mode
While the device is powered on, hold the power button, select Recovery Mode, and enter Recovery Mode
On the TWRP screen, select Install. For my OnePlus 6T running Android 11, choose nethunter-2022.1-oneplus6-oos-eleven-kalifs-full.zip
Deselect 'Reboot after installation is complete' to avoid automatic reboot after installation
After a long wait, the installation is successful
Install Magisk-v21.4.zip
On the TWRP screen, select Install, then choose Magisk-v21.4.zip
After successful installation, select Reboot System
At this point, Kali NetHunter installation is complete
In the app list, you can see the newly installed NetHunter, NetHunter Terminal, and NetHunterKeX
0x03 Install Kali Linux Subsystem on Windows 11
---
Method to switch from Android to Win11:
Enter Recovery mode, in TWRP, select Reboot -> SlotB
After entering the Win11 system, you can choose to search for kali in the Microsoft Store for installation. The specific process is as follows:
1. Enable the Linux subsystem
Powershell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux |
After installation, it will prompt to restart the operating system
2. Search for kali in the Microsoft Store and install it
Directly starting kali after installation will report error 0x80370102. Here, you need to manually set the wsl version to 1
wsl commands can be referred to: https://docs.microsoft.com/en-us/windows/wsl/basic-commands
3. Set wsl version to 1
The command is as follows:
wsl --set-default-version 1 |
The command to view installed systems is as follows:
wsl --list --verbose |
The result shows kali-linux
4. Configure Kali default login user
The command to set the default login user as root is as follows:
kali config --default-user root |
Configure root user password, the command is as follows:
kali |
5. Update kali
sudo apt update && sudo apt upgrade -y |
If unable to update, you can change to a domestic source
sudo vi /etc/apt/sources.list |
Add:
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib |
6. Install Kali GUI
Local Windows 11 can connect to Kali via Remote Desktop
First, enter kali in the command line to access the Kali console
(1) Install kali-desktop-xfce
sudo apt install kali-desktop-xfce -y |
(2) Install xrdp
sudo apt install xrdp -y |
(3) Change port to 3390
sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini |
(4) Start service
sudo service xrdp start |
(5) Connect to remote desktop
mstsc |
Note: Frequently Asked Questions
(1) Adjusting Kali resolution
In Kali, navigate sequentially to Settings -> Appearance -> Settings -> Window Scaling, change it to 2x
(2) Unable to open the command line terminal, error message: Failed to execute default Terminal Emulator. Input/output error.
First install the Xfce terminal:
sudo apt install xfce4-terminal |
In Kali, navigate sequentially to Settings -> Settings Manager -> Default Applications -> Utilities, set Terminal Emulator to Xfce Terminal
(3) Reconnecting to Kali remote desktop after Win11 restart
First, start the xrdp service:
sudo service xrdp restart |
(4) Restarting Win11 Linux subsystem
net stop LxssManager |
(5) Installing msfconsole
sudo apt install metasploit-framework |
(6) Start msfconsole
Need to add exclusion directory in Windows Defender: \\wsl.localhost\kali-linux
0x04 Summary
---
This article introduces two methods for installing Kali on the Android device OnePlus6T. Devices with Snapdragon 845 processors can choose to install Win11 first and then Kali, while other Android devices can opt to install Kali NetHunter.