翻訳と辞書
Words near each other
・ Stacie Orrico discography
・ Stacie Passon
・ Stacie Powell
・ Stacie Randall
・ Stacja Wieżyca
・ Stack
・ Stack (abstract data type)
・ Stack (C++)
・ Stack (geology)
・ Stack (mathematics)
・ Stack (surname)
・ Stack (unit)
・ Stack Attack
・ Stack Barn
・ Stack Bay
Stack buffer overflow
・ Stack cake
・ Stack effect
・ Stack Exchange
・ Stack Harbor
・ Stack interchange
・ Stack Is the New Black
・ Stack Island
・ Stack Island (Mississippi River)
・ Stack light
・ Stack Light Rifle
・ Stack machine
・ Stack magazine
・ Stack Overflow
・ Stack overflow


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Stack buffer overflow : ウィキペディア英語版
Stack buffer overflow

In software, a stack buffer overflow or stack buffer overrun occurs when a program writes to a memory address on the program's call stack outside of the intended data structure, which is usually a fixed-length buffer.
Stack buffer overflow bugs are caused when a program writes more data to a buffer located on the stack than what is actually allocated for that buffer. This almost always results in corruption of adjacent data on the stack, and in cases where the overflow was triggered by mistake, will often cause the program to crash or operate incorrectly. Stack buffer overflow is a type of the more general programming malfunction known as buffer overflow (or buffer overrun).〔 Overfilling a buffer on the stack is more likely to derail program execution than overfilling a buffer on the heap because the stack contains the return addresses for all active function calls.
Stack buffer overflow can be caused deliberately as part of an attack known as stack smashing. If the affected program is running with special privileges, or accepts data from untrusted network hosts (e.g. a webserver) then the bug is a potential security vulnerability. If the stack buffer is filled with data supplied from an untrusted user then that user can corrupt the stack in such a way as to inject executable code into the running program and take control of the process. This is one of the oldest and more reliable methods for attackers to gain unauthorized access to a computer.〔 (dead link)〕
==Exploiting stack buffer overflows==
The canonical method for exploiting a stack based buffer overflow is to overwrite the function return address with a pointer to attacker-controlled data (usually on the stack itself).〔 This is illustrated with strcpy() in the following example:

#include
void foo (char
*bar)
int main (int argc, char
*
*argv)

This code takes an argument from the command line and copies it to a local stack variable c. This works fine for command line arguments smaller than 12 characters (as you can see in figure B below). Any arguments larger than 11 characters long will result in corruption of the stack. (The maximum number of characters that is safe is one less than the size of the buffer here because in the C programming language strings are terminated by a zero byte character. A twelve-character input thus requires thirteen bytes to store, the input followed by the sentinel zero byte. The zero byte then ends up overwriting a memory location that's one byte beyond the end of the buffer.)
The program stack in foo() with various inputs:
Notice in figure C above, when an argument larger than 11 bytes is supplied on the command line foo() overwrites local stack data, the saved frame pointer, and most importantly, the return address. When foo() returns it pops the return address off the stack and jumps to that address (i.e. starts executing instructions from that address). Thus, the attacker has overwritten the return address with a pointer to the stack buffer char c(), which now contains attacker-supplied data. In an actual stack buffer overflow exploit the string of "A"'s would instead be shellcode suitable to the platform and desired function. If this program had special privileges (e.g. the SUID bit set to run as the superuser), then the attacker could use this vulnerability to gain superuser privileges on the affected machine.〔
The attacker can also modify internal variable values to exploit some bugs.
With this example:

#include
#include
void foo (char
*bar)
int main (int argc, char
*
*argv)


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Stack buffer overflow」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.