Skip to content

Instantly share code, notes, and snippets.

/poc.c Secret

Created December 28, 2016 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6d70a68a8bd4efc4c86c98b28c21f0c3 to your computer and use it in GitHub Desktop.
Save anonymous/6d70a68a8bd4efc4c86c98b28c21f0c3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <signal.h>
void main() {
int option;
scanf("%d", &option);
printf("%d\n", option);
if (option != 666) raise(SIGSEGV);
}
/*
* Test with:
* $ socat -v TCP4-LISTEN:8888,reuseaddr,fork EXEC:./program,stderr
* $ nc 0.0.0.0 8888
* 666
* 666
* $ nc 0.0.0.0 8888
* 9 // no response
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment