diff --git a/README.md b/README.md index 045beec97b0..863ec98fa3b 100644 --- a/README.md +++ b/README.md @@ -1,257 +1,269 @@ -# ![logo][] PowerShell - -Welcome to the PowerShell GitHub Community! -[PowerShell](https://learn.microsoft.com/powershell/scripting/overview) is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized -for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. -It includes a command-line shell, an associated scripting language and a framework for processing cmdlets. - -[logo]: https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/ps_black_64.svg?sanitize=true - -## Windows PowerShell vs. PowerShell Core - -Although this repository started as a fork of the Windows PowerShell codebase, changes made in this repository do not make their way back to Windows PowerShell 5.1 automatically. -This also means that [issues tracked here][issues] are only for PowerShell Core 6 and higher. -Windows PowerShell specific issues should be reported with the [Feedback Hub app][feedback-hub], by choosing "Apps > PowerShell" in category. - -[issues]: https://github.com/PowerShell/PowerShell/issues -[feedback-hub]: https://support.microsoft.com/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332 - -## New to PowerShell? - -If you are new to PowerShell and would like to learn more, we recommend reviewing the [getting started][] documentation. - -[getting started]: https://learn.microsoft.com/powershell/scripting/learn/more-powershell-learning - -## Get PowerShell - -You can download and install a PowerShell package for any of the following platforms. - -| Supported Platform | Download (LTS) | Downloads (stable) | Downloads (preview) | How to Install | -| -------------------------------------------| ------------------------| ------------------------| ----------------------| ------------------------------| -| [Windows (x64)][corefx-win] | [.msi][lts-windows-64] | [.msi][rl-windows-64] | [.msi][pv-windows-64] | [Instructions][in-windows] | -| [Windows (x86)][corefx-win] | [.msi][lts-windows-86] | [.msi][rl-windows-86] | [.msi][pv-windows-86] | [Instructions][in-windows] | -| [Ubuntu 22.04][corefx-linux] | [.deb][lts-deb] | [.deb][rl-ubuntu22] | [.deb][pv-deb] | [Instructions][in-ubuntu22] | -| [Ubuntu 20.04][corefx-linux] | [.deb][lts-deb] | [.deb][rl-ubuntu20] | [.deb][pv-deb] | [Instructions][in-ubuntu20] | -| [Ubuntu 18.04][corefx-linux] | [.deb][lts-deb] | [.deb][rl-ubuntu18] | [.deb][pv-deb] | [Instructions][in-ubuntu18] | -| [Ubuntu 16.04][corefx-linux] | [.deb][lts-deb] | N/A | N/A | [Instructions][in-ubuntu16] | -| [Debian 10][corefx-linux] | [.deb][lts-deb] | [.deb][rl-debian10] | [.deb][pv-deb] | [Instructions][in-deb10] | -| [Debian 11][corefx-linux] | [.deb][lts-deb] | [.deb][rl-debian11] | [.deb][pv-deb] | | -| [CentOS 7][corefx-linux] | [.rpm][lts-rh] | [.rpm][rl-centos] | [.rpm][pv-rpm] | [Instructions][in-centos] | -| [CentOS 8][corefx-linux] | [.rpm][lts-rh] | [.rpm][rl-centos8] | [.rpm][pv-rpm] | | -| [Red Hat Enterprise Linux 7][corefx-linux] | [.rpm][lts-rh] | [.rpm][rl-centos] | [.rpm][pv-rpm] | [Instructions][in-rhel7] | -| [openSUSE 42.3][corefx-linux] | [.rpm][lts-rh] | [.rpm][rl-centos] | [.rpm][pv-rpm] | [Instructions][in-opensuse] | -| [Fedora 35][corefx-linux] | [.rpm][lts-rh] | [.rpm][rl-centos] | [.rpm][pv-rpm] | [Instructions][in-fedora] | -| [macOS 10.13+ (x64)][corefx-macos] | [.pkg][lts-macos] | [.pkg][rl-macos] | [.pkg][pv-macos] | [Instructions][in-macos] | -| [macOS 11+ (arm64)][corefx-macos] | [.pkg][lts-macos-arm64] | [.pkg][rl-macos-arm64] | [.pkg][pv-macos-arm64]| [Instructions][in-macos] | -| Docker | | | | [Instructions][in-docker] | - -You can download and install a PowerShell package for any of the following platforms, **which are supported by the community.** - -| Platform | Downloads (stable) | Downloads (preview) | How to Install | -| -------------------------| ------------------------| ----------------------------- | ------------------------------| -| Arch Linux | | | [Instructions][in-archlinux] | -| Kali Linux | [.deb][rl-deb] | [.deb][pv-deb] | [Instructions][in-kali] | -| Many Linux distributions | [Snapcraft][rl-snap] | [Snapcraft][pv-snap] | | - -You can also download the PowerShell binary archives for Windows, macOS and Linux. - -| Platform | Downloads (stable) | Downloads (preview) | How to Install | -| ---------------| --------------------------------------------------- | ------------------------------------------------| -----------------------------------------------| -| Windows | [32-bit][rl-winx86-zip]/[64-bit][rl-winx64-zip] | [32-bit][pv-winx86-zip]/[64-bit][pv-winx64-zip] | [Instructions][in-windows-zip] | -| macOS (x64) | [64-bit][rl-macos-tar] | [64-bit][pv-macos-tar] | [Instructions][in-tar-macos] | -| macOS (arm64) | [64-bit][rl-macos-tar-arm64] | [64-bit][pv-macos-tar-arm64] | [Instructions][in-tar-macos] | -| Linux | [64-bit][rl-linux-tar] | [64-bit][pv-linux-tar] | [Instructions][in-tar-linux] | -| Windows (ARM) | [64-bit][rl-winarm64] (preview) | [64-bit][pv-winarm64] | [Instructions][in-arm] | -| Raspbian (ARM) | [32-bit][rl-arm32]/[64-bit][rl-arm64] | [32-bit][pv-arm32]/[64-bit][pv-arm64] | [Instructions][in-raspbian] | - -[lts-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/PowerShell-7.2.14-win-x86.msi -[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/PowerShell-7.2.14-win-x64.msi -[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts_7.2.14-1.deb_amd64.deb -[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts-7.2.14-1.rh.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts-7.2.14-osx-x64.pkg -[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts-7.2.14-osx-arm64.pkg - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x86.msi -[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-1.rh.x86_64.rpm -[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-1.rh.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-x64.pkg -[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-arm64.pkg -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-x64.tar.gz -[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-arm64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-x64.tar.gz -[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-arm32.tar.gz -[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-arm64.tar.gz -[rl-snap]: https://snapcraft.io/powershell - -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x86.msi -[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-preview_7.4.0-preview.5-1.deb_amd64.deb -[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-preview-7.4.0_preview.5-1.rh.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-x64.pkg -[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-arm64.pkg -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-x64.tar.gz -[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-arm64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-arm64.tar.gz -[pv-snap]: https://snapcraft.io/powershell-preview - -[in-windows]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows -[in-ubuntu16]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1604 -[in-ubuntu18]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1804 -[in-ubuntu20]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-2004 -[in-ubuntu22]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.3#ubuntu -[in-deb10]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#debian-10 -[in-centos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#centos-7 -[in-rhel7]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#red-hat-enterprise-linux-rhel-7 -[in-opensuse]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#opensuse -[in-fedora]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#fedora -[in-archlinux]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#arch-linux -[in-macos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos -[in-docker]: https://github.com/PowerShell/PowerShell-Docker -[in-kali]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#kali -[in-windows-zip]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows#zip -[in-tar-linux]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#binary-archives -[in-tar-macos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos#binary-archives -[in-raspbian]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#raspbian -[in-arm]: https://learn.microsoft.com/powershell/scripting/install/powershell-core-on-arm -[corefx-win]:https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#windows -[corefx-linux]:https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#linux -[corefx-macos]:https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#macos - -To install a specific version, visit [releases](https://github.com/PowerShell/PowerShell/releases). - -## Community Dashboard - -[Dashboard](https://aka.ms/PSPublicDashboard) with visualizations for community contributions and project status using PowerShell, Azure, and PowerBI. - -For more information on how and why we built this dashboard, check out this [blog post](https://devblogs.microsoft.com/powershell/powershell-open-source-community-dashboard/). - -## Discussions - -[GitHub Discussions](https://docs.github.com/discussions/quickstart) is a feature to enable fluid and open discussions within the community -for topics that are not related to code, unlike issues. - -This is an experiment we are trying in our repositories to see if it helps move discussions out of issues so that issues remain actionable by the team or members of the community. -There should be no expectation that PowerShell team members are regular participants in the discussions. -Individual PowerShell team members may choose to participate in discussions, but the expectation is that community members help drive discussions so that team members -can focus on issues. - -Create or join a [discussion](https://github.com/PowerShell/PowerShell/discussions). - -## Chat - -Want to chat with other members of the PowerShell community? - -There are dozens of topic specific channels on our community-driven PowerShell Virtual User Group, which you can join on: - -* [Gitter](https://gitter.im/PowerShell/PowerShell) -* [Discord](https://discord.gg/PowerShell) -* [IRC](https://web.libera.chat/#powershell) on Libera.Chat -* [Slack](https://aka.ms/psslack) - -## Add-ons and libraries - -[Awesome PowerShell](https://github.com/janikvonrotz/awesome-powershell) has a great curated list of add-ons and resources. - -## Building the Repository - -| Linux | Windows | macOS | -|--------------------------|----------------------------|------------------------| -| [Instructions][bd-linux] | [Instructions][bd-windows] | [Instructions][bd-macOS] | - -If you have any problems building, consult the developer [FAQ][]. - -### Build status of nightly builds - -| Azure CI (Windows) | Azure CI (Linux) | Azure CI (macOS) | CodeFactor Grade | -|:-----------------------------------------|:-----------------------------------------------|:-----------------------------------------------|:-------------------------| -| [![windows-nightly-image][]][windows-nightly-site] | [![linux-nightly-image][]][linux-nightly-site] | [![macOS-nightly-image][]][macos-nightly-site] | [![cf-image][]][cf-site] | - -[bd-linux]: https://github.com/PowerShell/PowerShell/tree/master/docs/building/linux.md -[bd-windows]: https://github.com/PowerShell/PowerShell/tree/master/docs/building/windows-core.md -[bd-macOS]: https://github.com/PowerShell/PowerShell/tree/master/docs/building/macos.md - -[FAQ]: https://github.com/PowerShell/PowerShell/tree/master/docs/FAQ.md - -[windows-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=32 -[linux-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=23 -[macos-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=24 -[windows-nightly-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-Windows-daily -[linux-nightly-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-linux-daily?branchName=master -[macOS-nightly-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-macos-daily?branchName=master -[cf-site]: https://www.codefactor.io/repository/github/powershell/powershell -[cf-image]: https://www.codefactor.io/repository/github/powershell/powershell/badge +# Kali Linux Installation for Huawei Mate X3 -## Downloading the Source Code +## 📱 Overview -You can just clone the repository: +This is a complete automated installation system for Kali Linux on your Huawei Mate X3 smartphone via Termux. The installation creates a fully functional Kali Linux environment without requiring root access. -```sh -git clone https://github.com/PowerShell/PowerShell.git +## 🚀 Features + +- **Fully Automated Installation**: One-script installation process +- **No Root Required**: Works on non-rooted devices +- **Optimized for Mobile**: Battery-saving and performance modes +- **Termux Integration**: Seamless file sharing between Termux and Kali +- **Complete Toolset**: Pre-configured with essential penetration testing tools +- **Multiple Start Modes**: Full proot environment or lightweight mode + +## 📋 Prerequisites + +1. **Huawei Mate X3** with Android +2. **Termux** app installed from F-Droid (not Play Store) +3. **8GB+ free storage** space +4. **Stable internet connection** for downloading packages + +## 🔧 Installation + +### Step 1: Install Termux + +Download and install Termux from [F-Droid](https://f-droid.org/en/packages/com.termux/) + +### Step 2: Setup Termux + +Open Termux and run: +```bash +termux-setup-storage +pkg update && pkg upgrade -y +pkg install wget -y +``` + +### Step 3: Download Installation Script + +```bash +cd ~ +wget https://raw.githubusercontent.com/yourusername/kali-mate-x3/main/install_kali_x3.sh +chmod +x install_kali_x3.sh +``` + +Or manually create the script: +```bash +nano install_kali_x3.sh +# Copy and paste the installation script content +chmod +x install_kali_x3.sh ``` -See [working with the PowerShell repository](https://github.com/PowerShell/PowerShell/tree/master/docs/git) for more information. +### Step 4: Run Installation -## Developing and Contributing +```bash +./install_kali_x3.sh +``` + +The script will: +- Check storage requirements +- Install dependencies +- Download Kali Linux rootfs +- Configure the environment +- Create startup scripts -Please see the [Contribution Guide][] for how to develop and contribute. -If you are developing .NET Core C# applications targeting PowerShell Core, [check out our FAQ][] to learn more about the PowerShell SDK NuGet package. +Installation takes approximately 15-30 minutes depending on your internet speed. -Also, make sure to check out our [PowerShell-RFC repository](https://github.com/powershell/powershell-rfc) for request-for-comments (RFC) documents to submit and give comments on proposed and future designs. +## 📂 Directory Structure -[Contribution Guide]: https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md -[check out our FAQ]: https://github.com/PowerShell/PowerShell/tree/master/docs/FAQ.md#where-do-i-get-the-powershell-core-sdk-package +``` +/data/data/com.termux/files/home/ +├── KALI_ON_X3/ # Main Kali installation +│ └── kali-fs/ # Kali root filesystem +├── start-kali.sh # Start Kali (full environment) +├── start-kali-light.sh # Start Kali (lightweight) +├── update-kali.sh # Update Kali packages +├── uninstall-kali.sh # Remove Kali +└── kali_post_setup.sh # Post-installation setup +``` -## Support +## 🎯 Usage -For support, see the [Support Section][]. +### Starting Kali Linux -[Support Section]: https://github.com/PowerShell/PowerShell/tree/master/.github/SUPPORT.md +**Full Environment (Recommended):** +```bash +./start-kali.sh +``` + +**Lightweight Mode (Less resources):** +```bash +./start-kali-light.sh +``` -## Legal and Licensing +### First Time Setup -PowerShell is licensed under the [MIT license][]. +After starting Kali for the first time: + +```bash +# Inside Kali Linux +bash /root/initial_setup.sh +apt update && apt upgrade +passwd # Set root password +``` + +### Installing Additional Tools + +Run the post-setup configuration: +```bash +# From Termux +./kali_post_setup.sh + +# Then inside Kali +bash /root/setup_tools.sh +``` + +## 🛠️ Available Commands + +### In Termux +- `./start-kali.sh` - Start Kali Linux +- `./update-kali.sh` - Update Kali packages +- `./uninstall-kali.sh` - Remove Kali Linux + +### In Kali Linux +- `update-all` - Update system and packages +- `quickscan ` - Quick network scan +- `sysinfo` - Display system information +- `powersave` - Enable battery saving mode +- `performance` - Enable performance mode +- `termux-run ` - Run Termux commands + +## 📦 Pre-installed Tools + +### Network Tools +- Nmap - Network discovery and security auditing +- Netcat - Network utility for reading/writing network connections +- Tcpdump - Packet analyzer +- Wireshark - Network protocol analyzer +- Aircrack-ng - WiFi security auditing + +### Web Application Tools +- Burp Suite - Web vulnerability scanner +- SQLmap - SQL injection tool +- Nikto - Web server scanner +- Dirb - Web content scanner +- WPScan - WordPress vulnerability scanner + +### Exploitation Frameworks +- Metasploit Framework +- BeEF - Browser Exploitation Framework +- Social Engineering Toolkit (SET) + +### Password Tools +- John the Ripper - Password cracker +- Hashcat - Advanced password recovery +- Hydra - Network login cracker + +## 🔄 Updates + +To update Kali Linux: +```bash +./update-kali.sh +# Or inside Kali: +update-all +``` + +## 🗑️ Uninstallation + +To completely remove Kali Linux: +```bash +./uninstall-kali.sh +``` + +## 💡 Tips & Tricks + +### Access Termux Files from Kali +```bash +cd /home/termux +``` + +### Access SD Card from Kali +```bash +cd /sdcard +``` + +### Share Files Between Termux and Kali +Use the shared directory: +```bash +# In Kali +cd /root/termux-shared + +# In Termux +cd ~/kali-shared +``` + +### Battery Optimization +When on battery, enable power saving: +```bash +# Inside Kali +powersave +``` + +### Performance Mode +For intensive tasks: +```bash +# Inside Kali +performance +``` + +## 🚨 Troubleshooting + +### Installation Fails +- Ensure you have 8GB+ free space +- Check internet connection +- Try running: `pkg update && pkg upgrade` + +### Tools Not Working +```bash +# Inside Kali +apt --fix-broken install +apt update && apt upgrade +``` + +### Network Issues +```bash +# Inside Kali +echo "nameserver 8.8.8.8" > /etc/resolv.conf +service networking restart +``` + +### Permission Denied Errors +Ensure scripts have execute permissions: +```bash +chmod +x *.sh +``` -[MIT license]: https://github.com/PowerShell/PowerShell/tree/master/LICENSE.txt +## ⚠️ Important Notes -### Windows Docker Files and Images +1. **Legal Use Only**: Use these tools only on systems you own or have permission to test +2. **Battery Usage**: Running Kali Linux will consume more battery +3. **Storage**: Keep at least 1GB free space for smooth operation +4. **Updates**: Regularly update both Termux and Kali Linux +5. **No Root**: Some features may be limited without root access -License: By requesting and using the Container OS Image for Windows containers, you acknowledge, understand, and consent to the Supplemental License Terms available on Docker Hub: +## 📚 Additional Resources -- [Windows Server Core](https://hub.docker.com/r/microsoft/windowsservercore/) -- [Nano Server](https://hub.docker.com/r/microsoft/nanoserver/) +- [Kali Linux Documentation](https://www.kali.org/docs/) +- [Kali Tools](https://www.kali.org/tools/) +- [Termux Wiki](https://wiki.termux.com/) +- [Kali Linux Forums](https://forums.kali.org/) -### Telemetry +## 🤝 Contributing -Please visit our [about_Telemetry](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_telemetry) -topic to read details about telemetry gathered by PowerShell. +Feel free to submit issues, fork the repository, and create pull requests for any improvements. -## Governance +## 📄 License -The governance policy for the PowerShell project is described [here][]. +This project is provided as-is for educational purposes. Use at your own risk. -[here]: https://github.com/PowerShell/PowerShell/blob/master/docs/community/governance.md +## ⭐ Credits -## [Code of Conduct][conduct-md] +- Kali Linux Team for the amazing distribution +- Termux developers for the Android terminal emulator +- AnLinux project for rootfs resources +- Community contributors -This project has adopted the [Microsoft Open Source Code of Conduct][conduct-code]. -For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [opencode@microsoft.com][conduct-email] with any additional questions or comments. +--- -[conduct-code]: https://opensource.microsoft.com/codeofconduct/ -[conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/ -[conduct-email]: mailto:opencode@microsoft.com -[conduct-md]: https://github.com/PowerShell/PowerShell/tree/master/CODE_OF_CONDUCT.md +**Remember**: Always use these tools responsibly and legally. Happy ethical hacking! 🎯 \ No newline at end of file diff --git a/install_kali_x3.sh b/install_kali_x3.sh new file mode 100644 index 00000000000..0c313a36f2b --- /dev/null +++ b/install_kali_x3.sh @@ -0,0 +1,509 @@ +#!/data/data/com.termux/files/usr/bin/bash + +# ============================================================================ +# Kali Linux Installation Script for Huawei Mate X3 +# Version: 2.0 +# Author: Automated Installation System +# Date: October 2025 +# ============================================================================ + +set -e + +# Color codes for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +PURPLE='\033[0;35m' +CYAN='\033[0;36m' +WHITE='\033[1;37m' +NC='\033[0m' # No Color + +# Configuration +KALI_DIR="/data/data/com.termux/files/home/KALI_ON_X3" +KALI_ROOTFS_URL="https://github.com/EXALAB/AnLinux-Resources/releases/download/RootFS/kali-rootfs-arm64.tar.xz" +KALI_ROOTFS_SHA="https://github.com/EXALAB/AnLinux-Resources/releases/download/RootFS/kali-rootfs-arm64.tar.xz.sha512" +KALI_ROOTFS_FILE="kali-rootfs-arm64.tar.xz" +KALI_ROOTFS_SHA_FILE="kali-rootfs-arm64.tar.xz.sha512" +MIN_STORAGE_GB=8 +TERMUX_HOME="/data/data/com.termux/files/home" +TERMUX_PREFIX="/data/data/com.termux/files/usr" + +# Function to display banner +display_banner() { + clear + echo -e "${PURPLE}" + echo "╔══════════════════════════════════════════════════════════════╗" + echo "║ ║" + echo "║ KALI LINUX INSTALLATION FOR HUAWEI MATE X3 ║" + echo "║ ║" + echo "║ Automated Installation System v2.0 ║" + echo "║ ║" + echo "╚══════════════════════════════════════════════════════════════╝" + echo -e "${NC}" + echo +} + +# Function to display progress +show_progress() { + local message="$1" + echo -e "${CYAN}[$(date '+%H:%M:%S')] ${WHITE}➤ ${message}${NC}" +} + +# Function to display success +show_success() { + local message="$1" + echo -e "${GREEN}[$(date '+%H:%M:%S')] ✓ ${message}${NC}" +} + +# Function to display error +show_error() { + local message="$1" + echo -e "${RED}[$(date '+%H:%M:%S')] ✗ ERROR: ${message}${NC}" +} + +# Function to display warning +show_warning() { + local message="$1" + echo -e "${YELLOW}[$(date '+%H:%M:%S')] ⚠ WARNING: ${message}${NC}" +} + +# Function to check available storage +check_storage() { + show_progress "Checking available storage..." + + local available_gb=$(df -h "$TERMUX_HOME" | tail -1 | awk '{print $4}' | sed 's/G//') + + # Handle different units (M, K, etc.) + if [[ "$available_gb" == *"M"* ]]; then + available_gb=0 + elif [[ "$available_gb" == *"K"* ]]; then + available_gb=0 + fi + + # Convert to integer for comparison + available_gb=${available_gb%.*} + + if [ "$available_gb" -lt "$MIN_STORAGE_GB" ] 2>/dev/null; then + show_error "Insufficient storage space!" + echo -e "${WHITE}Required: ${MIN_STORAGE_GB}GB | Available: ${available_gb}GB${NC}" + exit 1 + fi + + show_success "Storage check passed (${available_gb}GB available)" +} + +# Function to check and install dependencies +install_dependencies() { + show_progress "Updating package repository..." + pkg update -y 2>/dev/null || apt update -y + + show_progress "Installing required packages..." + local packages=("wget" "proot" "tar" "xz-utils" "curl" "git") + + for package in "${packages[@]}"; do + if ! command -v "$package" &> /dev/null; then + show_progress "Installing $package..." + pkg install -y "$package" 2>/dev/null || apt install -y "$package" + else + show_success "$package already installed" + fi + done + + show_success "All dependencies installed" +} + +# Function to setup storage permissions +setup_storage() { + show_progress "Setting up storage permissions..." + + if [ ! -d "$TERMUX_HOME/storage" ]; then + termux-setup-storage + sleep 3 + fi + + show_success "Storage permissions configured" +} + +# Function to create Kali directory structure +create_directory_structure() { + show_progress "Creating Kali Linux directory structure..." + + if [ -d "$KALI_DIR" ]; then + show_warning "Kali directory already exists" + echo -e "${YELLOW}Do you want to remove it and start fresh? (y/n): ${NC}" + read -r response + if [[ "$response" =~ ^[Yy]$ ]]; then + show_progress "Removing existing installation..." + rm -rf "$KALI_DIR" + else + show_error "Installation aborted" + exit 1 + fi + fi + + mkdir -p "$KALI_DIR" + cd "$KALI_DIR" + + show_success "Directory structure created at $KALI_DIR" +} + +# Function to download Kali rootfs +download_rootfs() { + show_progress "Downloading Kali Linux rootfs (this may take a while)..." + + if [ -f "$KALI_ROOTFS_FILE" ]; then + show_warning "Rootfs file already exists, removing old file..." + rm -f "$KALI_ROOTFS_FILE" + fi + + # Download with progress bar + wget --show-progress -q "$KALI_ROOTFS_URL" -O "$KALI_ROOTFS_FILE" + + if [ $? -ne 0 ]; then + show_error "Failed to download rootfs" + exit 1 + fi + + show_success "Rootfs downloaded successfully" +} + +# Function to verify rootfs integrity +verify_rootfs() { + show_progress "Verifying rootfs integrity..." + + # Download SHA512 checksum + wget -q "$KALI_ROOTFS_SHA" -O "$KALI_ROOTFS_SHA_FILE" 2>/dev/null + + if [ -f "$KALI_ROOTFS_SHA_FILE" ]; then + if sha512sum -c "$KALI_ROOTFS_SHA_FILE" 2>/dev/null; then + show_success "Rootfs integrity verified" + else + show_warning "Checksum verification failed, continuing anyway..." + fi + rm -f "$KALI_ROOTFS_SHA_FILE" + else + show_warning "Could not download checksum file, skipping verification" + fi +} + +# Function to extract rootfs +extract_rootfs() { + show_progress "Extracting Kali Linux rootfs..." + + mkdir -p "$KALI_DIR/kali-fs" + cd "$KALI_DIR/kali-fs" + + show_progress "This may take several minutes..." + proot --link2symlink tar -xJf "../$KALI_ROOTFS_FILE" --exclude='dev' 2>/dev/null || \ + tar -xJf "../$KALI_ROOTFS_FILE" --exclude='dev' + + if [ $? -ne 0 ]; then + show_error "Failed to extract rootfs" + exit 1 + fi + + # Clean up rootfs archive + rm -f "../$KALI_ROOTFS_FILE" + + show_success "Rootfs extracted successfully" +} + +# Function to configure Kali environment +configure_kali() { + show_progress "Configuring Kali Linux environment..." + + # Create resolv.conf + echo "nameserver 8.8.8.8" > "$KALI_DIR/kali-fs/etc/resolv.conf" + echo "nameserver 8.8.4.4" >> "$KALI_DIR/kali-fs/etc/resolv.conf" + + # Create hosts file + cat > "$KALI_DIR/kali-fs/etc/hosts" < "$KALI_DIR/kali-fs/etc/profile.d/termux.sh" <<'EOF' +export TERM=xterm-256color +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export HOME=/root +export LANG=C.UTF-8 +export TZ=UTC + +# Kali Linux banner +if [ -f /etc/os-release ]; then + . /etc/os-release + echo "Welcome to $PRETTY_NAME" + echo "Running on Huawei Mate X3 via Termux" + echo +fi +EOF + + # Create initial setup script + cat > "$KALI_DIR/kali-fs/root/initial_setup.sh" <<'EOF' +#!/bin/bash +echo "Running initial Kali Linux setup..." + +# Update package lists +apt update + +# Fix any broken dependencies +apt --fix-broken install -y + +# Install essential tools +apt install -y sudo nano vim wget curl git python3 python3-pip + +# Clean package cache +apt clean + +echo "Initial setup complete!" +EOF + + chmod +x "$KALI_DIR/kali-fs/root/initial_setup.sh" + + show_success "Kali environment configured" +} + +# Function to create startup script +create_startup_script() { + show_progress "Creating Kali Linux startup script..." + + cat > "$TERMUX_HOME/start-kali.sh" <<'EOF' +#!/data/data/com.termux/files/usr/bin/bash + +# Kali Linux Starter Script for Huawei Mate X3 +# Auto-generated by installation script + +KALI_DIR="/data/data/com.termux/files/home/KALI_ON_X3" +KALI_FS="$KALI_DIR/kali-fs" + +# Color codes +GREEN='\033[0;32m' +BLUE='\033[0;34m' +NC='\033[0m' + +# Check if Kali is installed +if [ ! -d "$KALI_FS" ]; then + echo "Error: Kali Linux is not installed!" + echo "Please run: ./install_kali_x3.sh" + exit 1 +fi + +clear +echo -e "${BLUE}" +echo "╔══════════════════════════════════════════════════════════════╗" +echo "║ Starting Kali Linux on Huawei Mate X3 ║" +echo "╚══════════════════════════════════════════════════════════════╝" +echo -e "${NC}" +echo + +# Start Kali with proot +echo -e "${GREEN}Launching Kali Linux environment...${NC}" +echo + +unset LD_PRELOAD + +proot \ + --link2symlink \ + -0 \ + -r "$KALI_FS" \ + -b /dev \ + -b /proc \ + -b /sys \ + -b "$KALI_FS/root:/dev/shm" \ + -b /data/data/com.termux/files/home:/home/termux \ + -b /storage/emulated/0:/sdcard \ + -w /root \ + /usr/bin/env -i \ + HOME=/root \ + PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + TERM=xterm-256color \ + LANG=C.UTF-8 \ + /bin/bash --login + +echo +echo -e "${BLUE}Kali Linux session ended${NC}" +EOF + + chmod +x "$TERMUX_HOME/start-kali.sh" + + # Create alternative lightweight starter without proot + cat > "$TERMUX_HOME/start-kali-light.sh" <<'EOF' +#!/data/data/com.termux/files/usr/bin/bash + +# Lightweight Kali Linux Starter (chroot-style) +# For when proot is too resource-intensive + +KALI_DIR="/data/data/com.termux/files/home/KALI_ON_X3" +KALI_FS="$KALI_DIR/kali-fs" + +if [ ! -d "$KALI_FS" ]; then + echo "Error: Kali Linux is not installed!" + exit 1 +fi + +echo "Starting lightweight Kali environment..." +echo "Note: This mode has limited functionality" +echo + +cd "$KALI_FS" +export PATH="$KALI_FS/usr/bin:$KALI_FS/bin:$PATH" +export LD_LIBRARY_PATH="$KALI_FS/usr/lib:$KALI_FS/lib:$LD_LIBRARY_PATH" +export HOME="$KALI_FS/root" + +exec "$KALI_FS/bin/bash" --rcfile "$KALI_FS/etc/bash.bashrc" +EOF + + chmod +x "$TERMUX_HOME/start-kali-light.sh" + + show_success "Startup scripts created" +} + +# Function to create uninstall script +create_uninstall_script() { + show_progress "Creating uninstall script..." + + cat > "$TERMUX_HOME/uninstall-kali.sh" <<'EOF' +#!/data/data/com.termux/files/usr/bin/bash + +# Kali Linux Uninstaller for Huawei Mate X3 + +KALI_DIR="/data/data/com.termux/files/home/KALI_ON_X3" + +echo "This will completely remove Kali Linux from your device." +echo -n "Are you sure? (y/n): " +read -r response + +if [[ "$response" =~ ^[Yy]$ ]]; then + echo "Removing Kali Linux..." + rm -rf "$KALI_DIR" + rm -f ~/start-kali.sh + rm -f ~/start-kali-light.sh + rm -f ~/uninstall-kali.sh + echo "Kali Linux has been removed." +else + echo "Uninstall cancelled." +fi +EOF + + chmod +x "$TERMUX_HOME/uninstall-kali.sh" + + show_success "Uninstall script created" +} + +# Function to create update script +create_update_script() { + show_progress "Creating update script..." + + cat > "$TERMUX_HOME/update-kali.sh" <<'EOF' +#!/data/data/com.termux/files/usr/bin/bash + +# Kali Linux Update Script + +echo "Starting Kali Linux to perform updates..." +echo "Please run 'apt update && apt upgrade' once inside Kali." +echo +sleep 2 + +./start-kali.sh +EOF + + chmod +x "$TERMUX_HOME/update-kali.sh" + + show_success "Update script created" +} + +# Function to display installation summary +display_summary() { + echo + echo -e "${GREEN}╔══════════════════════════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ KALI LINUX INSTALLATION COMPLETED SUCCESSFULLY! ║${NC}" + echo -e "${GREEN}╚══════════════════════════════════════════════════════════════╝${NC}" + echo + echo -e "${WHITE}Installation Details:${NC}" + echo -e "${CYAN}• Location: ${WHITE}$KALI_DIR${NC}" + echo -e "${CYAN}• Size: ${WHITE}$(du -sh $KALI_DIR | cut -f1)${NC}" + echo + echo -e "${WHITE}Available Commands:${NC}" + echo -e "${GREEN}• ./start-kali.sh${NC} - Start Kali Linux (full environment)" + echo -e "${GREEN}• ./start-kali-light.sh${NC} - Start lightweight Kali (limited features)" + echo -e "${GREEN}• ./update-kali.sh${NC} - Update Kali Linux packages" + echo -e "${GREEN}• ./uninstall-kali.sh${NC} - Remove Kali Linux" + echo + echo -e "${YELLOW}First Time Setup:${NC}" + echo -e "1. Run: ${WHITE}./start-kali.sh${NC}" + echo -e "2. Inside Kali, run: ${WHITE}bash /root/initial_setup.sh${NC}" + echo -e "3. Update packages: ${WHITE}apt update && apt upgrade${NC}" + echo + echo -e "${BLUE}Tips:${NC}" + echo -e "• Your Termux home is accessible at: ${WHITE}/home/termux${NC}" + echo -e "• SD card is accessible at: ${WHITE}/sdcard${NC}" + echo -e "• Exit Kali by typing: ${WHITE}exit${NC}" + echo +} + +# Function to perform post-installation tasks +post_installation() { + show_progress "Performing post-installation tasks..." + + # Create shortcuts directory + mkdir -p "$TERMUX_HOME/.shortcuts" + + # Create widget shortcut for Kali + ln -sf "$TERMUX_HOME/start-kali.sh" "$TERMUX_HOME/.shortcuts/Kali Linux" + + # Create .hushlogin to suppress motd + touch "$KALI_DIR/kali-fs/root/.hushlogin" + + show_success "Post-installation tasks completed" +} + +# Main installation function +main() { + display_banner + + echo -e "${WHITE}This script will install Kali Linux on your Huawei Mate X3${NC}" + echo -e "${WHITE}Installation location: ${CYAN}$KALI_DIR${NC}" + echo -e "${WHITE}Required space: ${CYAN}~${MIN_STORAGE_GB}GB${NC}" + echo + echo -e "${YELLOW}Press Enter to continue or Ctrl+C to cancel...${NC}" + read -r + + # Installation steps + check_storage + install_dependencies + setup_storage + create_directory_structure + download_rootfs + verify_rootfs + extract_rootfs + configure_kali + create_startup_script + create_uninstall_script + create_update_script + post_installation + + display_summary + + echo -e "${GREEN}Installation completed in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds${NC}" + echo + echo -e "${WHITE}Would you like to start Kali Linux now? (y/n): ${NC}" + read -r response + + if [[ "$response" =~ ^[Yy]$ ]]; then + exec "$TERMUX_HOME/start-kali.sh" + fi +} + +# Error handler +trap 'show_error "Installation failed! Check the error messages above."; exit 1' ERR + +# Run main installation +main \ No newline at end of file diff --git a/kali_post_setup.sh b/kali_post_setup.sh new file mode 100644 index 00000000000..5faecbdce89 --- /dev/null +++ b/kali_post_setup.sh @@ -0,0 +1,539 @@ +#!/data/data/com.termux/files/usr/bin/bash + +# ============================================================================ +# Kali Linux Post-Installation Setup Script +# For Huawei Mate X3 - Termux Environment +# Version: 1.0 +# ============================================================================ + +set -e + +# Color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +PURPLE='\033[0;35m' +CYAN='\033[0;36m' +WHITE='\033[1;37m' +NC='\033[0m' + +KALI_DIR="/data/data/com.termux/files/home/KALI_ON_X3" +KALI_FS="$KALI_DIR/kali-fs" + +# Function to display banner +display_banner() { + clear + echo -e "${PURPLE}" + echo "╔══════════════════════════════════════════════════════════════╗" + echo "║ ║" + echo "║ KALI LINUX POST-INSTALLATION SETUP ║" + echo "║ For Huawei Mate X3 ║" + echo "║ ║" + echo "╚══════════════════════════════════════════════════════════════╝" + echo -e "${NC}" + echo +} + +# Function to show progress +show_progress() { + echo -e "${CYAN}[*] ${WHITE}$1${NC}" +} + +# Function to show success +show_success() { + echo -e "${GREEN}[✓] $1${NC}" +} + +# Function to show error +show_error() { + echo -e "${RED}[✗] ERROR: $1${NC}" +} + +# Check if Kali is installed +check_kali_installation() { + if [ ! -d "$KALI_FS" ]; then + show_error "Kali Linux is not installed!" + echo "Please run: ./install_kali_x3.sh first" + exit 1 + fi + show_success "Kali Linux installation found" +} + +# Function to setup Kali tools configuration +setup_kali_tools() { + show_progress "Setting up Kali tools configuration..." + + # Create tools directory + mkdir -p "$KALI_FS/opt/tools" + + # Create configuration for common tools + cat > "$KALI_FS/root/setup_tools.sh" <<'EOF' +#!/bin/bash + +echo "Setting up Kali Linux tools..." + +# Update package database +apt update + +# Install essential penetration testing tools +echo "Installing essential tools (this may take a while)..." + +# Core tools +apt install -y \ + nmap \ + netcat-traditional \ + tcpdump \ + john \ + hashcat \ + aircrack-ng \ + hydra \ + sqlmap \ + metasploit-framework \ + burpsuite \ + wireshark \ + nikto \ + dirb \ + gobuster \ + wfuzz \ + ffuf \ + enum4linux \ + smbclient \ + masscan \ + theharvester \ + recon-ng \ + maltego \ + beef-xss \ + set \ + wpscan \ + joomscan \ + davtest \ + whatweb \ + sslscan \ + sslyze \ + fierce \ + dnsenum \ + dnsrecon \ + sublist3r \ + amass \ + crackmapexec \ + responder \ + impacket-scripts \ + bloodhound \ + evil-winrm \ + powershell-empire \ + covenant \ + chisel \ + proxychains4 \ + tor \ + torsocks + +# Python tools +apt install -y \ + python3-pip \ + python3-dev \ + python3-setuptools + +# Install Python-based tools +pip3 install --upgrade \ + shodan \ + censys \ + pwntools \ + ropper \ + keystone-engine \ + capstone \ + unicorn \ + requests \ + beautifulsoup4 \ + lxml \ + paramiko \ + scapy + +echo "Basic tools installation complete!" +EOF + + chmod +x "$KALI_FS/root/setup_tools.sh" + show_success "Tools configuration script created" +} + +# Function to setup custom aliases +setup_aliases() { + show_progress "Setting up custom aliases..." + + cat >> "$KALI_FS/root/.bashrc" <<'EOF' + +# Custom aliases for Kali on Mate X3 +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' +alias update='apt update && apt upgrade' +alias install='apt install' +alias search='apt search' +alias ports='netstat -tulanp' +alias myip='curl ifconfig.me' +alias cls='clear' + +# Termux integration aliases +alias termux-home='cd /home/termux' +alias sdcard='cd /sdcard' + +# Security tools shortcuts +alias nmap-quick='nmap -sV -sC -O -T4' +alias nmap-full='nmap -sV -sC -O -p- -T4' +alias serve-http='python3 -m http.server' +alias serve-smb='impacket-smbserver share . -smb2support' + +# Network utilities +alias listen='nc -lvnp' +alias scan-local='nmap -sn 192.168.1.0/24' + +# Color support +export TERM=xterm-256color +export GREP_OPTIONS='--color=auto' + +# Custom prompt +PS1='\[\033[01;31m\]┌──[\[\033[01;37m\]Kali@MateX3\[\033[01;31m\]]-[\[\033[01;34m\]\w\[\033[01;31m\]]\n\[\033[01;31m\]└─\[\033[01;37m\]# \[\033[00m\]' +EOF + + show_success "Custom aliases configured" +} + +# Function to setup VNC server (optional) +setup_vnc() { + show_progress "Setting up VNC server configuration..." + + cat > "$KALI_FS/root/setup_vnc.sh" <<'EOF' +#!/bin/bash + +# VNC Server Setup for GUI access +echo "Setting up VNC server for remote GUI access..." + +# Install VNC and desktop environment +apt update +apt install -y \ + tightvncserver \ + xfce4 \ + xfce4-terminal \ + firefox-esr \ + dbus-x11 + +# Create VNC startup script +mkdir -p ~/.vnc +cat > ~/.vnc/xstartup <<'VNCEOF' +#!/bin/bash +xrdb $HOME/.Xresources +startxfce4 & +VNCEOF + +chmod +x ~/.vnc/xstartup + +echo "VNC server installed!" +echo "To start VNC: vncserver :1 -geometry 1920x1080 -depth 24" +echo "To stop VNC: vncserver -kill :1" +echo "Connect from Termux using: localhost:5901" +EOF + + chmod +x "$KALI_FS/root/setup_vnc.sh" + show_success "VNC setup script created" +} + +# Function to setup SSH server +setup_ssh() { + show_progress "Setting up SSH server configuration..." + + cat > "$KALI_FS/root/setup_ssh.sh" <<'EOF' +#!/bin/bash + +# SSH Server Setup +echo "Setting up SSH server..." + +# Install SSH server +apt update +apt install -y openssh-server + +# Configure SSH +sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config +sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config + +# Generate SSH keys +ssh-keygen -A + +echo "SSH server installed!" +echo "To start SSH: service ssh start" +echo "To enable on boot: systemctl enable ssh" +echo "Default port: 22" +EOF + + chmod +x "$KALI_FS/root/setup_ssh.sh" + show_success "SSH setup script created" +} + +# Function to create workspace directories +create_workspaces() { + show_progress "Creating workspace directories..." + + mkdir -p "$KALI_FS/root/workspace" + mkdir -p "$KALI_FS/root/workspace/exploits" + mkdir -p "$KALI_FS/root/workspace/wordlists" + mkdir -p "$KALI_FS/root/workspace/reports" + mkdir -p "$KALI_FS/root/workspace/scripts" + mkdir -p "$KALI_FS/root/workspace/captures" + + # Create README for workspace + cat > "$KALI_FS/root/workspace/README.txt" < "$KALI_FS/usr/local/bin/quickscan" <<'EOF' +#!/bin/bash +# Quick network scanner +if [ -z "$1" ]; then + echo "Usage: quickscan " + exit 1 +fi +echo "Starting quick scan of $1..." +nmap -sV -sC -O -T4 --top-ports 1000 $1 +EOF + chmod +x "$KALI_FS/usr/local/bin/quickscan" + + # Update all script + cat > "$KALI_FS/usr/local/bin/update-all" <<'EOF' +#!/bin/bash +# Update system and tools +echo "Updating Kali Linux..." +apt update +apt upgrade -y +apt dist-upgrade -y +apt autoremove -y +apt autoclean +echo "Update complete!" +EOF + chmod +x "$KALI_FS/usr/local/bin/update-all" + + # System info script + cat > "$KALI_FS/usr/local/bin/sysinfo" <<'EOF' +#!/bin/bash +# Display system information +echo "=== Kali Linux on Huawei Mate X3 ===" +echo "Kernel: $(uname -r)" +echo "Architecture: $(uname -m)" +echo "Hostname: $(hostname)" +echo "IP Address: $(hostname -I)" +echo "Memory: $(free -h | grep Mem | awk '{print $2}')" +echo "Disk Usage: $(df -h / | tail -1 | awk '{print $3 "/" $2}')" +echo "Running Processes: $(ps aux | wc -l)" +EOF + chmod +x "$KALI_FS/usr/local/bin/sysinfo" + + show_success "Custom scripts installed" +} + +# Function to optimize for mobile +optimize_for_mobile() { + show_progress "Optimizing Kali for mobile device..." + + # Create power saving script + cat > "$KALI_FS/usr/local/bin/powersave" <<'EOF' +#!/bin/bash +# Enable power saving mode +echo "Enabling power saving optimizations..." + +# Disable unnecessary services +service bluetooth stop 2>/dev/null +service cups stop 2>/dev/null +service avahi-daemon stop 2>/dev/null + +# Reduce swappiness +echo 10 > /proc/sys/vm/swappiness + +echo "Power saving mode enabled" +EOF + chmod +x "$KALI_FS/usr/local/bin/powersave" + + # Create performance mode script + cat > "$KALI_FS/usr/local/bin/performance" <<'EOF' +#!/bin/bash +# Enable performance mode +echo "Enabling performance optimizations..." + +# Increase swappiness +echo 60 > /proc/sys/vm/swappiness + +# Clear caches +sync && echo 3 > /proc/sys/vm/drop_caches + +echo "Performance mode enabled" +EOF + chmod +x "$KALI_FS/usr/local/bin/performance" + + show_success "Mobile optimizations configured" +} + +# Function to setup Termux integration +setup_termux_integration() { + show_progress "Setting up Termux integration..." + + # Create Termux command runner + cat > "$KALI_FS/usr/local/bin/termux-run" <<'EOF' +#!/bin/bash +# Run Termux commands from within Kali +if [ -z "$1" ]; then + echo "Usage: termux-run " + exit 1 +fi +chroot /data/data/com.termux/files /usr/bin/bash -c "$@" +EOF + chmod +x "$KALI_FS/usr/local/bin/termux-run" + + # Create shared directory + mkdir -p "$KALI_FS/root/termux-shared" + ln -sf "$KALI_FS/root/termux-shared" "/data/data/com.termux/files/home/kali-shared" 2>/dev/null + + show_success "Termux integration configured" +} + +# Function to create quick start guide +create_quick_start_guide() { + show_progress "Creating quick start guide..." + + cat > "$KALI_FS/root/QUICK_START_GUIDE.txt" <<'EOF' +================================================================================ + KALI LINUX ON HUAWEI MATE X3 + QUICK START GUIDE +================================================================================ + +FIRST TIME SETUP: +----------------- +1. Run: bash /root/setup_tools.sh # Install essential tools +2. Run: bash /root/setup_vnc.sh # Setup VNC (optional, for GUI) +3. Run: bash /root/setup_ssh.sh # Setup SSH (optional) +4. Run: passwd # Set root password + +BASIC COMMANDS: +--------------- +update-all - Update system and all packages +quickscan - Quick network scan +sysinfo - Display system information +powersave - Enable battery saving mode +performance - Enable performance mode +termux-run - Run Termux commands + +DIRECTORIES: +------------ +/root/workspace - Your working directory +/home/termux - Access Termux files +/sdcard - Access device storage +/root/termux-shared - Shared with Termux + +NETWORK TOOLS: +-------------- +nmap - Network scanner +netcat - Network utility +tcpdump - Packet analyzer +wireshark - Network protocol analyzer +aircrack-ng - WiFi security testing +metasploit - Exploitation framework + +WEB TOOLS: +---------- +burpsuite - Web application testing +sqlmap - SQL injection tool +nikto - Web server scanner +dirb - Web content scanner +wpscan - WordPress scanner + +PASSWORD TOOLS: +--------------- +john - Password cracker +hashcat - Advanced password recovery +hydra - Network login cracker + +USEFUL ALIASES: +--------------- +ll - Detailed file listing +update - Update packages +myip - Show public IP +ports - Show open ports +serve-http - Start HTTP server +listen - Start netcat listener + +TIPS: +----- +• Use 'exit' to return to Termux +• Your Termux home is at /home/termux +• SD card is accessible at /sdcard +• Run 'update-all' regularly to keep tools updated +• Use 'powersave' when on battery +• Use 'performance' for intensive tasks + +TROUBLESHOOTING: +---------------- +• If tools fail, run: apt --fix-broken install +• For network issues: service networking restart +• For DNS issues: echo "nameserver 8.8.8.8" > /etc/resolv.conf + +================================================================================ +EOF + + show_success "Quick start guide created" +} + +# Main setup function +main() { + display_banner + + echo -e "${WHITE}This script will configure your Kali Linux installation${NC}" + echo -e "${WHITE}for optimal use on Huawei Mate X3${NC}" + echo + echo -e "${YELLOW}Press Enter to continue...${NC}" + read -r + + check_kali_installation + setup_kali_tools + setup_aliases + setup_vnc + setup_ssh + create_workspaces + setup_custom_scripts + optimize_for_mobile + setup_termux_integration + create_quick_start_guide + + echo + echo -e "${GREEN}╔══════════════════════════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ POST-INSTALLATION SETUP COMPLETED SUCCESSFULLY! ║${NC}" + echo -e "${GREEN}╚══════════════════════════════════════════════════════════════╝${NC}" + echo + echo -e "${WHITE}Next Steps:${NC}" + echo -e "1. Start Kali: ${GREEN}./start-kali.sh${NC}" + echo -e "2. Run setup scripts inside Kali:" + echo -e " ${CYAN}• bash /root/setup_tools.sh${NC} (install tools)" + echo -e " ${CYAN}• bash /root/setup_vnc.sh${NC} (setup GUI access)" + echo -e " ${CYAN}• bash /root/setup_ssh.sh${NC} (setup SSH server)" + echo + echo -e "${WHITE}Quick Start Guide available at:${NC}" + echo -e "${GREEN}/root/QUICK_START_GUIDE.txt${NC} (inside Kali)" + echo +} + +# Run main function +main \ No newline at end of file diff --git a/quick_install.sh b/quick_install.sh new file mode 100644 index 00000000000..e4308e55a00 --- /dev/null +++ b/quick_install.sh @@ -0,0 +1,52 @@ +#!/data/data/com.termux/files/usr/bin/bash + +# ============================================================================ +# Quick One-Line Installation Script for Kali on Mate X3 +# This script downloads and runs the main installation automatically +# ============================================================================ + +echo "╔══════════════════════════════════════════════════════════════╗" +echo "║ KALI LINUX QUICK INSTALLER FOR HUAWEI MATE X3 ║" +echo "╚══════════════════════════════════════════════════════════════╝" +echo + +# Check if we're in Termux +if [ ! -d "/data/data/com.termux" ]; then + echo "Error: This script must be run in Termux!" + exit 1 +fi + +echo "This will install Kali Linux on your device." +echo "Required: 8GB+ free space and stable internet" +echo +echo "Press Enter to continue or Ctrl+C to cancel..." +read -r + +# Update Termux packages +echo "[1/5] Updating Termux packages..." +pkg update -y && pkg upgrade -y + +# Install wget if not present +echo "[2/5] Installing wget..." +pkg install wget -y + +# Download the main installation script +echo "[3/5] Downloading installation script..." +cd ~ +wget -O install_kali_x3.sh "https://raw.githubusercontent.com/yourusername/kali-mate-x3/main/install_kali_x3.sh" + +# Download post-setup script +echo "[4/5] Downloading post-setup script..." +wget -O kali_post_setup.sh "https://raw.githubusercontent.com/yourusername/kali-mate-x3/main/kali_post_setup.sh" + +# Make scripts executable +chmod +x install_kali_x3.sh +chmod +x kali_post_setup.sh + +# Run the installation +echo "[5/5] Starting Kali Linux installation..." +echo +./install_kali_x3.sh + +echo +echo "Installation complete! You can now start Kali with: ./start-kali.sh" \ No newline at end of file