What is a Race Condition?A race condition occurs when multiple processes access and manipulate the same data concurrently, and the outcome of the execution depends on the particular order in which the access takes place. A race condition is of interest to a hacker when the race condition can be utilized to gain privileged system access. Consider the following code snippet which illustrates a race condition: if(access('/tmp/datafile',R_OK)==0){ fd=open('/tmp/datafile process(fd); close(fd); This code creates the temporary file /tmp/datafile and then opens it. The potential race condition occurs between the call to access() and the call to open(). If an attacker can replace the contents of /tmp/datafile between the access() and open() functions, he can manipulate the actions of the program which uses that datafile. This is the race. It can be difficult to exploit a race condition, because you may have to 'run the race' many times before you 'win.' You may have to run the vulnerable program and the vulnerability testing tool thousands of times before you get the expolit code to execute after the vulnerability opens and before the vulnerability closes. It is sometimes possible to give the attack an extra edge by using `nice` to lower the priority of the legitimate suid program. Improper use of the function calls access(), chown(), chgrp(), chmod(), mktemp(), tempnam(), tmpfile(), and tmpnam() are the normal causes of a race condition. |
Keywords from this article to read more on!
|
Speaking, how to improve your skills. If you need help to understand the various types of public speaking, and indeed the social importance of public speaking and why it is so very important in some careers to learn the basics of public s... | Growing eBay Sales with Top-Notch Customer Ser... Painters were at our house this weekend, doing the trim outside and a few rooms inside. My wife provided most of the direction, but I asked the head guy (and owner of the company) to pay attention to... | A Life Coach in Philadelphia PA Says "End... Our culture places great value on modesty. Children are commonly told not to 'get a swelled head' or 'toot your own horn'. When singing our own praises, many of us have been reproa... | The Publishing Business From the business perspective, publishing isn't just printing literature or information but also the development, marketing, distribution and even promotion of the printed works. It is not as sim... |

