Translate

2017年3月5日星期日

[root-me]Known plaintext - XOR

video:https://www.youtube.com/watch?v=1v4_dSQxoDI&feature=youtu.be&a

picture is better then the words










password:ICONOCLASTE



download xortool:
xortool requires docopt python dependency:
$ sudo pip install docopt
Then install xortool:
$ cd /data/src/
$ git clone https://github.com/hellman/xortool.git
$ cd xortool/
$ sudo python setup.py install

or

http://tw.softoware.net/apps/download-remnux-for-linux.html

or

  • download xortool from: https://github.com/hellman/xortool
  • in xortool directory run python setup.py install
  • run xortool -b ch3.bmp in terminal
  • wait until the process gives you a *.bmp image in the output directory
  • The encryption key is fallen

or

1 Lets get the key : 
using a hex editor from the header of the image we can see the key wich is : fallen
2 Lets decrypt the image : 
now you have the key you can use many tool that decrypt XORed files or you can use this python script below :
  1. from PIL import Image
  2. key = 'fallen'
  3. cypher = bytearray(open("ch3.bmp", "rb").read())
  4. for i in range(len(cypher)):
  5. cypher[i] ^= ord(key[i%len(key)])
  6. open("out.bmp","wb").write(cypher)
  7. try:
  8. im = Image.open("out.bmp")
  9. im.verify()
  10. except IOError:
  11. print 'Oopss something went wrong'
  12. else:
  13. print 'done'

沒有留言:

發佈留言