Madmouse

A shellcode extractor script

Sep 14th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. #!/bin/bash
  2. ###############################################################################
  3. # A shellcode extractor
  4. # written by madmouse
  5. # ----------------------------------------------------------------------------
  6. # "THE BEER-WARE LICENSE" (Revision 43):
  7. # <[email protected]> wrote this file. As long as you retain this notice you
  8. # can do whatever you want with this stuff. If we meet some day, and you think
  9. # this stuff is worth it, you can buy me a beer in return Aaron R. Yool
  10. # ----------------------------------------------------------------------------
  11.  
  12. echo -ne '\n\n// C/C++\nconst char evil[] = "';
  13. for i in $(objdump -d $1 -M intel |grep "^ " |cut -f2);
  14.     do echo -n '\x'$i;
  15. done;echo -e '";\n\n'
  16.  
  17. echo -ne '# Python\nevil = "';
  18. for i in $(objdump -d $1 -M intel |grep "^ " |cut -f2);
  19.     do echo -n '\x'$i;
  20. done;echo -e '"\n\n'
  21.  
  22. echo -ne '# Bash\n./shellcode $(echo -en "';
  23. for i in $(objdump -d $1 -M intel |grep "^ " |cut -f2);
  24.     do echo -n '\x'$i;
  25. done;echo -e '")\n\n'
Advertisement
Add Comment
Please, Sign In to add comment