I not so recently bought a used IBM Thinkpad X30 on eBay and installed FreeBSD on it.
The specs:Many modern x86 CPUs support a feature called branch single stepping that changes the semantics of setting the TF (single step) flag in the EFLAGS register in such a way that the CPU will not generate exceptions on every instruction executed but only on branch instructions like JMP, JCC, CALL, RET, INT, ...
I am working on integrating some code into FreeBSD that will allow developers to utilize this feature through the ptrace() interface.
I have some ideas on how to use this feature to check branch targets for "legality" (to prevent control flow alteration by malicious user input), which I want to implement at some time in the future. I'm especially interested in what kind of impact these sanity checks will have on system performance.
Here is an initial patch for FreeBSD RELENG_6 and here a little toy program to play with it (it needs libdisasm).
a nice and challenging wargame at OverTheWire.org.
I created the following shellcode originally for level 3 of Vortex. It first determines the EUID and then sets EUID, RUID and SUID to that value to prevent the executed shell from dropping EUID. Instead of using the setresuid() system call, I could probably just use setuid() to save some bytes. I'd like to thank mark for the initial idea and commenting on my code.