Skip to content

Instantly share code, notes, and snippets.

@gregarmer
Last active January 4, 2016 19:27
Show Gist options
  • Save gregarmer/11d67e5cb99f6290710f to your computer and use it in GitHub Desktop.
Save gregarmer/11d67e5cb99f6290710f to your computer and use it in GitHub Desktop.
Junos Pulse Casper host checker workaround
/*
* Compile with:
* $ cc -o anti-casper anti-casper.c
*
* and run with:
* $ ./anti-casper
*
* verify you have a process running that is named like this:
*
* /usr/local/jamf/bin/jamf
*
*/
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
// overwrite the process name
char *process_name = "/usr/local/jamf/bin/jamf";
memcpy(argv[0], process_name, strlen(process_name)+1);
// fork a child proc and exit (daemonize)
int pid = fork();
if (pid == 0) {
while(1) {
sleep(60);
}
}
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment