LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices



Reply
 
Search this Thread
Old 04-22-2010, 06:16 AM   #1
seaker79
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
how does mktemp prevent denial-of-service attack


Hello,

This is an excerpt from the Linux man page for mktemp command:
"mktemp is provided to allow shell scripts to safely use temporary files. Traditionally, many shell scripts take the name of the program with the PID as a suffix and use that as a temporary filename. This kind of naming scheme is predictable and the race condition it creates is easy for an attacker to win. A safer, though still inferior approach is to make a temporary directory using the same naming scheme. While this does allow one to guarantee that a temporary file will not be subverted, it still allows a simple denial of service attack. For these reasons it is suggested that mktemp be used instead."

- How can a denial-of-service attack be carried out if a directory name is known?
- Why is it important to use mktemp to generate a sufficiently random file/directory name for temporary files?

Thanks for your answer,
best regards,
Hari
 
Old 04-22-2010, 07:56 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by seaker79 View Post
- How can a denial-of-service attack be carried out if a directory name is known?
- Why is it important to use mktemp to generate a sufficiently random file/directory name for temporary files?
As I understand it, this is a matter of an attacker being able to guess the filename (or directory name) you wish to create and thereby block it by creating it first. I am sure you can come up with complicated scenarios about how this might happen and whether (under what circumstances) it is a problem. But mktemp is trying to bypass all of that by making it extremely unlikely that an attacker could guess the name. There are probably circumstances where this is relatively unimportant while there are other circumstances where it wold be crucial. But with such a tool as mktemp available, why would you want to not use it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
y2kupdate denial of service vulnerability Protector Linux - Security 1 11-15-2009 03:44 AM
Troubleshooting Denial of Service vbsaltydog Linux - General 4 07-25-2008 12:51 AM
Web Server Crash - Denial of Service inspiredbymetal Linux - Server 3 11-11-2007 06:31 AM
how to disable TCP/IP Denial of Service mayankh Linux - Security 2 10-14-2006 05:01 AM
Denial Of Service Attacks Ozzman Mandriva 13 11-13-2003 01:59 AM


All times are GMT -5. The time now is 08:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration