Basic watermarking technique for image integrity using LSB

This is actually a lab exercise from my course ImSecu. We tried to implement basic algorithms for protecting image integrity using watermarking. The idea is to make use of the least significant bit (LSB) of the image to store some information of the image (checksum, compressed bits) and retrieve them for checking. This is a blind watermarking algorithm, which means that we don’t need the original image to verify the integrity.

Result of LSB random bit

Result of LSB random bit detection

Continue reading

Advertisements

Preventing against XSRF

After trying to exploit the XSRF (previous post), it is considerable to put in mind techniques to prevent against the this attack. This post will try to evolve from very basic protection and to better security approach by discussing their weaknesses. The technique discussed in this post including changing state by POST request, CAPCHA, prevention token and crytographic token.
Continue reading

A simple example of Cross-site request forgery attack using PHP

Cross-site request forgery (XSRF) is an attack which exploits websites that have weak authorization by taking the advantage of browser session and same-origin policy. To understand clearly about Cross-site request forgery, you can read the wiki page here. This post will demonstrate a simple exploitation using this technique.
Continue reading

Exploit stack-based buffer overflow using NOP-sled technique

Stack-based buffer overflow is a common programming error that I get when I started to learn programming but I did not know that it would be really dangerous. In this post, I will try to note down what I have learned after trying to exploit this vulnerability using the well-know NOP-sled technique.

Continue reading

Filesystem mazes race condition attack (2)

This post will demonstrate in detail how to exploit the TOCTTOU race condition of linux.
To understand basic idea of Filesystem mazes attack, read the first part here

In order to attack, we must first generate the maze and the trap and a program that calls the access and open call of kernel to generate race condition.
Continue reading

Filesystem mazes race condition attack (1)

One of the attack that usually happens in linux system is the attack that takes advantage of the TOCTTOU race condition. When a user wants to open a file, the OS will first checks the permission of the user, then grants/denies access to the file. Only after the authorization finished, OS will open the file. TOCTTOU (time of check to time of use) is the time different between the authorization of the file and the time when it is actually used. The attacker can exploit this race condition and change the link to file that he has permission to read to a private file during TOC and TOU.

Continue reading