Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What does this famous article mean - "Smashing the stack for fun and profit"?

Asked by Amit Raj Jan 5, 2022 852 views 1 answer
Share

About this question

 I was reading this famous article: Aleph One - Smashing The Stack For Fun And Profit and I have no idea how stack canaries/NX support/ASLR can avoid an attack like that. I'll try to explain me better. Stricly speaking:

stack canaries: random values before RET NX support: no x flag for stack (and heap) ASLR: address space randomization Considering this example: example3.c:

void function(int a, int b, int c) {
   char buffer1[5];
   char buffer2[10];
   int *ret;
   ret = buffer1 + 12;
   (*ret) += 8;
}
void main() {
  int x;
  x = 0;
  function(1,2,3);
  x = 1;
  printf("%dn",x);
}

In this case:

Stack canaries are bypassed (i change only the RET value)
NX support: useless
ASLR: useless (i bypass the instruction x = 1 adding an offset)

I don't understand how the remediations above can avoid an example like that.

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.