Showing posts with label LSB. Show all posts
Showing posts with label LSB. Show all posts

Tuesday, June 11, 2019

[Project] 1 - Bluestego

The LSB is old technique but still a most common in the CTF and special is in steganography. What is LSB?

The least significant bits have the useful property of changing rapidly if the number changes even slightly. For example, if 1 (binary 00000001) is added to 3 (binary 00000011), the result will be 4 (binary 00000100) and three of the least significant bits will change (011 to 100). By contrast, the three most significant bits (MSBs) stay unchanged (000 to 000).


And in my tool, I use it to hide the message into the picture, every pixel can hide 1 bit, so 8 pixels will compose to 1 byte.


But it too basically, and too easy with zsteg to read the message, so I add some cryptography to encrypt the message. The main cryptography technique I use is Vigenere cipher, I think it old but gold, and I do some stuffs to modify it.

And it can encrypt 2^12 = 4096 characters in a picture with large resolution, for small picture character number can calculate by formula:

Character = (Height * Width / 8) - 20

For example, I used an image sky.jpg to ecnrypt the string: "Hello Blue"



The output.png:


For decryption:


I think it's really easy to use, but still now it too simple, and in the future I hope I can make it better, like can encrypt file in image not only text like right now.

I pushed code on github as always: https://github.com/BinhHuynh2727/BlueStego

Sunday, May 20, 2018

[Writeup] VNPT-SECATHON 2018 - Misc


Simste

Trong bài này ban tổ chức cho chúng ta đoạn teaser trailer Chạy ngay đi của Sếp.




Ngay khi nhìn vào dung lượng của tập tin mp4, thì mình biết chắc chắn rằng nó đang giấu một file gì đó.

Mở file mp4 bằng binwalk hay foremost cũng không thấy gì khác biệt, nên mình đành làm nước cuối cùng đó là tải luôn đoạn teaser của Sếp về để xor, và ngay lập tức mình có được file wav đã bị đổi header. Và nó bị đổi header thì chúng ta phải sửa lại cho đúng

từ


thành


sau khi có được file wav, trong lúc thi mình có nghĩ đến kĩ thuật lsb và đã sử dụng wavesteg để lấy flag nhưng đáng buồn là mình chỉ sử dụng 1 lsb để decode và ra được 1 nữa flag.



 Cho đến lúc chiều khi ban tổ chức có hint là ack mình vẫn không biết đó là kĩ thuật gì. Sau khi cuộc thi kết thúc mình có hỏi và được mấy anh trong Zepto team thì mới biết đó là kĩ thuật dubstep data encoding, một kĩ thuật rất mới ( mình từng có lướt qua twitter của DEFCON và thấy kĩ thuật này nhưng hình như lúc đó đang cày quest book TI8 nên bỏ qua luôn thì phải 😭 ). Các bạn có thể tham khảo kĩ thuật này tại đây.