Last active
January 4, 2016 19:27
-
-
Save gregarmer/11d67e5cb99f6290710f to your computer and use it in GitHub Desktop.
Junos Pulse Casper host checker workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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