Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5. int i;
  6.  
  7. char *args[101] = {};
  8.  
  9. for (i=0; i<101; i++) args[i] = "A";
  10.  
  11. args['A'] = "\x00";
  12. args['B'] = "\x20\x0a\x0d";
  13. args['C'] = "6969";
  14. args[100] = NULL;
  15.  
  16. setenv("\xde\xad\xbe\xef", "\xca\xfe\xba\xbe", 1);
  17. extern char** environ;
  18. FILE* fp = fopen("\x0a", "w");
  19. fwrite("\x00\x00\x00\x00", 4, 1, fp);
  20. fclose(fp);
  21. execve("/home/input2/input", args, environ);
  22. }
  23.  
  24.  
  25. /* python script on different ssh terminal to do while socket.recv on input
  26.  
  27. import socket
  28.  
  29. s = socket.socket()
  30.  
  31. s.bind(('127.0.0.1', 1337))
  32. s.connect(('127.0.0.1', 6969))
  33. s.send('\xde\xad\xbe\xef')
  34.  
  35. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement