How To "Gaslight" A Binary

Some features may only be available on the original post . Here is a very simple C code: int main() { uid_t uid = getuid(); struct passwd *pw = getpwuid(uid); printf("uid: %d, user: %s\n", uid, pw->pw_name); return 0; } It simply prints your identity in the current session. Let's run it: [local@DouLen] ~ › ./whoami uid: 0, user: root The program says I'm root, but look at the prompt: I'm logged in…