Skip to content

Instantly share code, notes, and snippets.

@jbcrail
Last active December 17, 2015 02:39
Show Gist options
  • Save jbcrail/5537467 to your computer and use it in GitHub Desktop.
Save jbcrail/5537467 to your computer and use it in GitHub Desktop.
A short program designed to demonstrate how to remove program arguments from process listing.
// Compile: gcc -o incognito incognito.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
// Removes all program arguments from process listing
if (argc > 1) {
char *arg_end;
arg_end = argv[argc-1] + strlen(argv[argc-1]);
*arg_end = ' ';
}
sleep(30000);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment