zGoal of exploit zCause a program to manipulate a file of attacker’s choosing zMitigation: verify the filename zSome difficulties zDifferent length restrictions, remote file systems & shares, etc. zDevice as a file (some OSs crash) zInclusion of substring “..” zGeneral mitigation: transform to canonical form
Surprisingly, we only need two things in our toolbox in order to exploit this function and inject the a-line into /etc/passwd: - a pencil and eraser that allows us to repeatedly write() and re-write() our own GECOS field (its length and last character in particular) in /etc/passwd: the userhelper program itself; - a pair of scissors that allows us to interrupt write() with byte precision and avoid ftruncate(): the resource limit RLIMIT_FSIZE, "The maximum size of files that the process may ...