0

I don't understand how to modify the value at the address of memory.how we can exploit the code?.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char*argv[])
{
  int num1 = 1;
  char input[128];


  snprintf(input, sizeof input, argv[1]);
  input[sizeof (input) - 1] = 0;


  if(num1==1337){
    printf("Congrats\n");   
   }


  return 0;
  }
Lee Gun Mo
  • 11
  • 1
  • You may wish to read section 3.4.1 of [Exploiting Format String Vulnerabilities](https://crypto.stanford.edu/cs155old/cs155-spring08/papers/formatstring-1.2.pdf) – Michael Petch Mar 05 '17 at 05:55
  • Possible duplicate of [How to use Format String Attack](http://stackoverflow.com/questions/27018864/how-to-use-format-string-attack) – Bo Persson Mar 05 '17 at 14:31

0 Answers0