Race Attack

As with the other labs, this lab is about both attacks and protection. The focus is on exploiting races conditions and on protection against them.

The lab consists of two parts.

Part One

In part one, the scenario is a race attack on a simple password database. The attack is mounted by two principals Malin and Kalle (running as separate threads) that collaborate to exploit a race condition in order to overwrite the password of an honest principal Bob (which is yet another thread). You need to implement the vulnerable database operations, an attack, and fix the database operations.

Concretely, you need to write a Java program that includes classes Password, Principal, and PasswordApp. These classes can be described as follows:

Demands

Part Two

In part two, the scenario is a console password prompt in Java. As passwords are typed in the console they need to be hidden (by, for example, "*" characters). You need to evaluate multi-thread solutions offered by the Sun Developer Network.

Demands

Downloads

Notes

Unfortunately, CheckSync has no support for the Java 1.5 java.util.concurrent package. Please refrain from using it.

Please stick to the simple database structure provided in Password.java. No complex database representations are needed to illustrate race attacks and protection.

Reporting

Submitting instructions

Links

Check these before you start coding: