LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 05: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, 06: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



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 02:44 AM
Troubleshooting Denial of Service vbsaltydog Linux - General 4 07-24-2008 11:51 PM
Web Server Crash - Denial of Service inspiredbymetal Linux - Server 3 11-11-2007 05:31 AM
how to disable TCP/IP Denial of Service mayankh Linux - Security 2 10-14-2006 04:01 AM
Denial Of Service Attacks Ozzman Mandriva 13 11-13-2003 12:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:10 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
Open Source Consulting | Domain Registration