start/B while1
start/B printrdtsc 1
while1 is the name of a program; printrdtsc is also the name of another program. 1 is the argument for printrdtsc
#include <intrin.h> unsigned __int64 rdtsc() { return __rdtsc(); }
vim file1 file2 mark with ctrl+v and hit y to yank. :n or :next to switch to the next file p to paste :prev and :previous will switch to the previous file. you can also use :first and :last
buggy setuid program attacker
// create a file the attacker can access
touch /home/attack/bad
// check user permissions to file
if (access("/home/attack/bad", R_OK) != 0)
{
exit(1);
}
// remove file
rm /home/attacker/bad
// create a symbolic to link secrets
ln -s /top/secret /home/attack/bad
// use file
fd = open("/home/attacker/bad", O_RDONLY);
// Do something about fd...
Example2
buggy setuid program attacker // create a symbolic link to a file the attacker can access ln -s /home/attack/bad /home/attack/symlink // check user permissions to file if (access("/home/attack/symlink", R_OK) != 0) { exit(1); } // update symbolic link to a secret file ln -sf /top/secret /home/attack/symlink // use file fd = open("/home/attacker/symlink", O_RDONLY); // Do something about fd...
Why does this work?ARTICLE |
BLOGS |