Coder Social home page Coder Social logo

seppzer0 / zero_kernel Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 7.0 641 KB

Advanced Android kernel builder with Kali NetHunter support.

License: GNU General Public License v3.0

Python 95.92% Dockerfile 1.25% Shell 2.83%
kali-nethunter lineageos oneplus5t kernel android aospa oneplus5 nethunter nethunter-kernel docker

zero_kernel's Introduction

zero_kernel

An advanced Android kernel builder with assets collection and Kali NetHunter support.

Contents

Important to Read

Important

- DISCLAIMER -

This kernel is made for educational purposes only.

I am not responsible for anything that may or may not happen to your device by installing any custom ROMs, kernels and/or any other forms of software.

Anything you do with this kernel and your device you do at your own risk. By using it, you take the responsibility upon yourself and in case of any issue you are not to blame me or other related contributors.

Note

- ROM artifacts in releases -

The contents of each release include ROM builds compatible with corresponding kernel builds. These ROM files are unmodified and mirrored from official sources.

This can be verified via the checksums, which should be identical to the ones presented on the ROM project's official web page.

You can always download the same ROM file from official sources if you'd like. The mirroring in this repository is only done due to the fact that some ROM projects remove their older builds once they become too outdated.

Description

The codebase of this project is an extensive build wrapper automating the entire Android kernel build process, starting from kernel source collection and ending with artifact packaging.

The key goal is to modify the kernel in such a way that enables unique features of Kali NetHunter โ€” a ROM layer designed to add extended functionality for penetration testing in a mobile form factor.

The architecture of this wrapper is trying to be as modular as possible, making it a little easier to add support for new devices.

Kernel Features

The kernel has the following features:

  • Kali NetHunter support;
  • RTL8812/21AU + RTL8814AU + RTL8187 Wi-Fi drivers;
  • packet injection support for internal Wi-Fi chipset;
  • optional KernelSU support.

Supported Devices & ROMs

OnePlus 5/T
  • 4.4 Linux kernel version:

    • LineageOS;
    • ParanoidAndroid;
    • x_kernel supported (universal)*.
  • 4.14 Linux kernel version:

    • ParanoidAndroid (unofficial & testing);
    • x-ft_kernel supported (universal)**.

* -- this is mostly relevant to ROMs based on LineageOS; however, technically speaking, this includes ParanoidAndroid as well, which makes x_kernel-based builds universal.

** -- this, in theory, is relevant to all 4.14-based ROMs for this device in existence.

Usage

The custom build wrapper (aka "builder") consists of 2 core components and 3 primary commands:

Components:

  • kernel_builder;
  • assets_collector.

Commands:

  • kernel;
  • assets;
  • bundle.
$ python3 builder --help
usage: builder [-h] [--clean] {kernel,assets,bundle} ...

A custom builder for the zero_kernel.

positional arguments:
  {kernel,assets,bundle}
    kernel              build the kernel
    assets              collect assets
    bundle              build the kernel + collect assets

optional arguments:
  -h, --help            show this help message and exit
  --clean               clean the root directory

Prerequisites

It is highly recommended to use docker option to run this tool. For that you need Docker Engine or Docker Desktop, depending on your OS.

Warning

Because of how specific Linux kernel source is, building it on Windows even with Docker (using WSL2 back-end) might be challenging.

To run this tool in a local environment, you will need:

  • a Debian-based Linux distribution (other types of distros are untested);
  • a few packages installed in your system.

You will also need to configure your Python installation, including some of the packages installation:

export PYTHONPATH=$(pwd)
python3 -m pip install poetry
python3 -m poetry install --no-root

Kernel

Kernel build process can be launched using the kernel subcommand.

$ python3 builder kernel --help
usage: builder kernel [-h] --build-env {local,docker,podman} --base
                      {los,pa,x,aosp} --codename CODENAME --lkv LKV [-c]
                      [--clean-image] [--log-level {normal,verbose,quiet}]
                      [-o OUTLOG] [--ksu]

options:
  -h, --help            show this help message and exit
  --build-env {local,docker,podman}
                        select build environment
  --base {los,pa,x,aosp}
                        select a kernel base for the build
  --codename CODENAME   select device codename
  --lkv LKV             select Linux Kernel Version
  -c, --clean           don't build anything, only clean kernel directories
  --clean-image         remove Docker/Podman image from the host machine after
                        build
  --log-level {normal,verbose,quiet}
                        select log level
  -o OUTLOG, --output OUTLOG
                        save logs to a file
  --ksu                 add KernelSU support

Assets

As mentioned, there is also an asset downloader, which can collect latest versions of ROM, TWRP, Magisk and it's modules, Kali Chroot etc.

$ python3 builder assets --help
usage: builder assets [-h] --build-env {local,docker,podman} --base
                      {los,pa,x,aosp} --codename CODENAME --chroot
                      {full,minimal} [--rom-only] [--clean-image] [--clean]
                      [--log-level {normal,verbose,quiet}] [-o OUTLOG] [--ksu]

options:
  -h, --help            show this help message and exit
  --build-env {local,docker,podman}
                        select build environment
  --base {los,pa,x,aosp}
                        select a kernel base for the build
  --codename CODENAME   select device codename
  --chroot {full,minimal}
                        select Kali chroot type
  --rom-only            download only the ROM as an asset
  --clean-image         remove Docker/Podman image from the host machine after
                        build
  --clean               autoclean 'assets' folder if it exists
  --log-level {normal,verbose,quiet}
                        select log level
  -o OUTLOG, --output OUTLOG
                        save logs to a file
  --ksu                 add KernelSU support

Bundle

The bundle command is a combined usage of kernel builder and assets collector core modules.

This is especially useful for linking the kernel build with the appropriate ROM build.

There are cases when an old kernel build is used with the newer ROM build. Such cases can ultimately lead to your system working improperly or breaking down completely, which is why it is important to use a specific kernel build with a corresponding ROM build.

Currently, there are three types of packaging available:

  • conan;
  • slim;
  • full.

Options full and conan collect all of the assets required to successfuly flash the kernel onto your device. The difference between the two is that full option places everything into a local directory, while conan organizes everything as a Conan package.

Option named slim is a much lighter version of full packaging, as only the ROM is collected from the asset list. This is done to reduce package sizes while ensuring the kernel+ROM compatibility.

$ python3 builder bundle --help
usage: builder bundle [-h] --build-env {local,docker,podman} --base
                      {los,pa,x,aosp} --codename CODENAME --lkv LKV
                      --package-type {conan,slim,full} [--conan-upload]
                      [--clean-image] [--log-level {normal,verbose,quiet}]
                      [-o OUTLOG] [--ksu]

options:
  -h, --help            show this help message and exit
  --build-env {local,docker,podman}
                        select build environment
  --base {los,pa,x,aosp}
                        select a kernel base for the build
  --codename CODENAME   select device codename
  --lkv LKV             select Linux Kernel Version
  --package-type {conan,slim,full}
                        select package type of the bundle
  --conan-upload        upload Conan packages to remote
  --clean-image         remove Docker/Podman image from the host machine after
                        build
  --log-level {normal,verbose,quiet}
                        select log level
  -o OUTLOG, --output OUTLOG
                        save logs to a file
  --ksu                 add KernelSU support

Examples

Here are some examples of commands:

(Recommended) Build kernel and collect ROM via Docker:

python3 builder bundle --build-env=docker --base=los --codename=dumpling --lkv=4.4 --package-type=slim

Build kernel locally:

python3 builder kernel --build-env=local --base=los --codename=dumpling --lkv=4.4

Collect all of the assets locally:

python3 builder assets --build-env=local --base=los --codename=dumpling --package-type=full

See also

Credits

zero_kernel's People

Contributors

seppzer0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zero_kernel's Issues

new device support: OP7/OP7P

I will try to test this on Oneplus 7 Pro based on LineageOS, it would be nice to have a better guide for customizing the diff model. I will document the issues I encountered during my attempts in this issue and hopefully I can contribute some PR!

Error while using Wifite

Installed (meanwhile 3 times and still get this errors):
Lineage
Kernel (zero-0.4.1...x4.4)
Magisk
DM-Verity and Force Disabler
After Config oft the system: Nethunter

With and without updates: if I start Wifite I get the errors attached as screenshot

Screenshot_20240226-161759_NetHunter Terminal
Screenshot_20240226-161807_NetHunter Terminal

Integrated Wi-Fi chipset's problems

I can't appoint channel when i use airodump-ng to monitoring any bssid, terminal shows fix to channel 0,so I can't use aireplay-ng.
Is it chipser's bug or kernel's bug?
should i buy a External USB wifi card like RTL8812/21AU + RTL8814AU + RTL8187 Wi-Fi drivers;

What files do I need for flashing a OnePlus5T?

Hello!

I want to flash a OnePlus5T with a new Kernel + LinageOS + Nethunter.
Is the file s0nh-dumplinger-pa-4.4.302-0.3.2.zip only for the OnePlus5 or also for the OnePlus5T?

As OP5 is dumpling and OP5T is cheeseburger I guess you made dumplinger out of them??!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.