Advertisement
p4tcher

hex2shellcodebyte converter

Mar 10th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import sys
  2.  
  3. ##Bu script p4tcher terefinden "26 62 34" seklinde olan hex bytelari shellcode sekline "\x26\x62\x34' getirmek ucun python
  4. ##dilinde yigilib.
  5. ##Malware pdf analizi dersliyi ucun hazirlanib ve test edilib.
  6. ##Etrafli melumat ucun http://p3tcher.blogspot.com veya www.redhatz.org saytina muraciet edin.
  7.  
  8. if len(sys.argv) < 3:
  9.     sys.stderr.write('\n\aSehv eydana geldi.Zehmet olmasa asagidaki kimi daxil edin\nhex2shel.py malbyte_fayli output_save_fayli\n');
  10.  
  11. f_malware_byte = open(sys.argv[1],'r')
  12. malbytes = f_malware_byte.read() #read all
  13. f_malware_byte.close()
  14.  
  15. output_file = open(sys.argv[2],'w')
  16. output_file.write("\\x" + malbytes.replace(" ",r"\x"))
  17. output_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement