3 ms·
> There is no issue of privilege here - if you are an attacker and you meet the privilege requirements, there you go, you can do these things. It still doesn't
by kelnos 7y ago
> There is no issue of privilege here - if you are an attacker and you meet the privilege requirements, there you go, you can do these things.
It still doesn't really make sense to me. The SUID examples all show you -- as root, via sudo -- copying a binary into the current directory, and then marking it u+s.
If you can do that, then you don't need your new SUID binary... you already somehow have root access, so you can do whatever you want.
> But if you can just leverage what's already on the system you can avoid detection more easily.
Outside of a heavily-contrived CTF type situation, what system is going to have a SUID `cat` lying around? Or really, a SUID anything-that-isn't-normally-SUID?
- caf 7y agoThe SUID ones are for cases like "something you have exploited gives you the opportunity to execute one command as root; how can you leverage that for persistent access?". So the idea is you make it SUID yourself, which gives you a partial way back in later.
- jcelerier 7y agobut if at some point you were root, you can most certainly install something in your victim's bootloader which is muuuch more effective
- caf 7y agoNot certainly - perhaps there's no device node available to you to open the device that contains the bootloader, and no mknod to create one?
- schoen 7y agoPerhaps then python -c 'import os; os.mknod("/tmp/yow", 0060000, 2048); os.chmod("/tmp/yow", 0777)' But clearly your point is right that a Unix environment could still prevent someone with root access from accessing the raw disk device, including at the kernel level.
- staticassertion 7y agoThat's not really something I expect from an attacker at all.