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
0
votes
2 answers

avoiding char buffer overflow more efficiently

i wrote a simple in/out program whenever i run it and enter the input and exceed the char limit i get *** stack smashing detected ***: terminated Aborted (core dumped) i searched it up and found it was a gcc thing for safety,i heard it might lead to…
umar
  • 25
  • 5
0
votes
0 answers

How to use a buffer overflow to call another program?

I want to create a program exploit that calls testme.c to perform a buffer overflow operation which should call another program myname.c. The code for the testme.c program: #include #include int main(int argc, char **argv){ …
Sn.S
  • 9
  • 4
0
votes
1 answer

Got 'stack smashing detected' after counting words in file (using C)

#include #include #define SIZE 200 int main() { FILE *input = fopen("word_list_final.txt", "r"); char buffer[SIZE]; int counter = 0; if (input == NULL) { printf("Error! Could not open file\n"); …
0
votes
1 answer

exceve syscall is not working via payload

I am writing basic payload for execve syscall. In nasm the payload is: global _start 2 section .text 3 _start: 4 call payload 5 db '/bin/sh', 0, 'aaaaaaaa', 0 6 payload: 7 mov rax,rsp 8 mov rax, [rax] 9 …
Prvt_Yadav
  • 324
  • 1
  • 6
  • 20
0
votes
1 answer

Error "stack smashing detected" while prepending line numbers in a string

I'm taking a string as input for the function, and I'm trying to prepend line numbers to every new line in the string. I'm also returning a string but it keeps giving me this error: stack smashing detected. Here's the code: string prepend(string…
MR DZ
  • 11
  • 3
0
votes
3 answers

Problems to put the shellcode into an easy program

I want to take the control of EBP and ESP to finally, when the program doing the ret, EIP will addressed to a shellcode, but I have a problem. The program is that: #include #include #include int limit,c; int…
0
votes
2 answers

How do I get Linux to execute data on the stack?

I have a Core i7 720QM processor and am running Slackware 13.37 (32-bit) as a virtual machine. As a class assignment, I have to write a vulnerable program and smash the stack. However, on most computers this does not work as there is some kind of…
Lord Loh.
  • 2,437
  • 7
  • 39
  • 64
0
votes
1 answer

Message queue stack smashing

I'm trying to implement a message queue and I have named the one process server and the other one client (as you can see I wanted to stick with the conventional names). The is a piece of code above the server that you don't need to care about since…
qiu
  • 121
  • 7
0
votes
1 answer

Avoid NUL Terminating Character for Stack Smashing with strcpy()

I have recently been following aleph1's Smashing The Stack For Fun And Profit paper, and I've reached a part where I am unable to smash the stack with strcpy. In the chapter titled: "Writing an Exploit(or how to mung the stack)", aleph1 writes the…
0
votes
1 answer

Aborted Core Dumped C++ malloc sysmalloc

Case 1 Input 10 1 2 3 1 2 3 1 2 3 1 2 3 Case 1 Output a.out: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) > = MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end &…
0
votes
1 answer

Bufferoverflow stack canary location

I have i binary that can be exploited with a buffer overflow, but it has a stack canary I can get many addresses and values through a gets() call, but i cant locate the stack canary in pwndbg( version of gdb) so i can find out what of the values i…
Dejan Lisica
  • 33
  • 1
  • 5
0
votes
2 answers

Stack smashing detected : terminated Aborted (core dumped)

My array is of size 3x3 means i have values of index from 0 to 2 only. but when i traverse using for loop then why it is picking value of a[3][-3] on value of a[2][0] ??? and what is that error when i try a[3][3] it should give garbage value so why…
Kuldeep Soni
  • 43
  • 1
  • 6
0
votes
1 answer

Stack Smashing Detected C++ after I added new variables in my code along with some operations

I made a code for computational purpose. Everything was going well until I added these lines in my function in main code. Most of the threads I read about this issue have solution referring to cases where strings are being handled. None of them…
DS__ggg
  • 13
  • 4
0
votes
0 answers

stack smashing in C code about making a histogram

I need to make a c program that will make a histogram of all the letters present in a phrase the user gives. When I run it, I does it but gives a "* stack smashing detected *: terminated". Where would this error be coming from? (for ease right now…
0
votes
0 answers

Corrupted stack detected inside Tensorflow Lite Micro interpreter->Invoke() call with Mobilenet_V1_0.25_224_quant model

I am trying to use the quantized model with Tensorflow Lite Micro, and got a segmentation error inside interpreter->Invoke() call. Debugger showed that segmentation error occurred on returning from Eval() in conv.cc on Node 28 of CONV_2D, and stack…
Up Seattle
  • 11
  • 1