Questions tagged [stack-smash]

Stack smashing is a buffer overflow vulnerability which is characterized by writing data outside the size of a stack-allocated buffer, causing corruption of a neighboring stack frame and potentially permitting execution of malicious code. Use this tag for questions about `stack smashing detected` and similar runtime errors, code with vulnerable buffers and other security risks related to stack smashing. See also: [buffer-overflow] and [buffer-overrun].

In software, a stack buffer overflow (also known as stack smashing) 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).

This tag should be used for questions about stack smashing detected and similar runtime errors, code with vulnerable buffers and other security risks related to stack smashing. See also: and .

161 questions
1
vote
1 answer

Smashing the Stack for Fun and Profit: jmp offset

To create the shellcode, the author replaces the offset placeholders with their calculated values i.e. This jmp offset-to-call # 2 bytes popl %esi # 1 byte movl %esi,array-offset(%esi) # 3 bytes movb …
aallsskk
  • 13
  • 2
1
vote
1 answer

Is there any way to avoid terminating the program when stack smashing occurs?

I have write a program with 3 threads using pthread in C++. When buffer overflow occurs in one of the threads, whole the program terminates and other threads couldn't to be run and this message is shown: *** stack smashing detected ***: ./a.out…
1
vote
1 answer

Retrieve information using stack buffer overflow (C)

I found one interesting exercises on the net, it states that the specific input can overflow the buffer in such a way that the 'secret' will be printed to stdout. I tried to figure it out by my self but I haven't done well. Here is the…
ro.Loon
  • 11
  • 3
1
vote
1 answer

Absence of stack allocation on 64-bit system while working on Aleph One article

I've been messing up with "Smash the Stack for Fun and Profit" from Aleph One and found that, while compiling the code for my 64-bit processor, stack memory doesn't get allocated using the usual "sub $VALUE, %REG." This is the function source…
last
  • 11
  • 3
1
vote
3 answers

How can code be launched with smashed stack?

I have a very rudimentary understanding of C (though I do understand programming concepts in general). I have an assignment to create a buffer overflow that yields something (like access to unauthorized area, free money, etc.) and not just crash the…
ernieg92
  • 11
  • 1
1
vote
1 answer

*** stack smashing detected *** error at the return of a function using FEAST

I have a long program in which I have a function for calculating eigenvalues of a large matrix using FEAST. Right at the return of that function I get a * stack smashing detected * error and I lose all the results. Here is my the function void…
Ankush
  • 149
  • 5
1
vote
1 answer

segmentation error while injecting shellcode to stack smash

I have been trying to understand how stack overflow attacks work. So far I can successfully redirect the return address to an instruction inside the original code. I have written a shellcode launcher in assembly and got it work inside a c program.…
1
vote
0 answers

Simulating function return in kernel space

I am trying to set the instruction point (regs->ip) to a return address of a function in a loadable kernel module (for Linux 3.13). However, it throws stack smashing detection. My question is how to get around it. More specifically, before setting…
Richard
  • 14,642
  • 18
  • 56
  • 77
1
vote
0 answers

Modern stack-overflow (stack smash) exploit in C on Linux?

In small words I would like to do a simple, really basic exploit by executing the desired address on the stack. For this purpose I did some research: dissable randomize protection on linux: echo 0 > /proc/sys/kernel/randomize_va_space Enable stack…
Jorch914
  • 3,465
  • 2
  • 16
  • 21
1
vote
1 answer

Escaping null characters in shellcode

I'm trying to execute overflow1.c from the Smashing the Stack for Fun and Profit paper by Aleph One. Original overflow1.c code: char shellcode[] = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b" …
Karthik Balakrishnan
  • 4,353
  • 6
  • 37
  • 69
1
vote
0 answers

how to secure a MyCloud? Is it already too late?

My laptop is running Ubuntu 14.04 LTS. I have a WMD MyCloud that I am doing backups to with an rsync. The rsync calls usually end with an error. Some things I have observed. The MyCloud machine has a REST API and I see that someone has tried to hack…
Ray Kiddy
  • 3,521
  • 3
  • 25
  • 32
1
vote
1 answer

Why am I getting stack smashing detected?

#include #include typedef struct { char currency[80]; double exchangerate; } exchangeT; void main() { char from[10]; int i; printf("convert from: "); scanf("%s", &from[10]); //this seems to be where…
Apple
  • 401
  • 1
  • 4
  • 7
1
vote
1 answer

websocket.io is raising on method of undefined error

code var express = require('express') , wsio = require('websocket.io'); /** * Create express app. */ var app = express.createServer(); /** * Listen */ app.listen(3000); /** * Attach websocket server. */ var ws =…
user2167582
  • 5,986
  • 13
  • 64
  • 121
1
vote
1 answer

Smashing the Stack

So I'm working on an assignment for a security class and the assignment is to use a stack overflow to call the function oopsDidISmashTheStack that is never used it the program. #include #include int…
1
vote
1 answer

Buffer overflow example not working on Debian 2.6

I am trying to make the buffer exploitation example (example3.c from http://insecure.org/stf/smashstack.html) work on Debian Lenny 2.6 version. I know the gcc version and the OS version is different than the one used by Aleph One. I have disabled…
invinc4u
  • 1,125
  • 3
  • 15
  • 26