include ctype h tolower include string h strcmp sfp
play

#include <ctype.h> // tolower #include <string.h> // - PowerPoint PPT Presentation

#include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); } login int verify(const char*


  1. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); } login int verify(const char* name) rip %esp { char user[256]; sfp %ebp verify() int i; 256 bytes %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; return strcmp(user, "xyzzy") == 0; } i int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; reveal_secret(); return 0; }

  2. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); } login int verify(const char* name) rip %esp { char user[256]; sfp %ebp verify() int i; 256 bytes %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; a0 return strcmp(user, "xyzzy") == 0; } i = 0 int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; reveal_secret(); return 0; }

  3. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); } login int verify(const char* name) rip %esp { char user[256]; sfp %ebp verify() int i; 256 bytes %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; c2 a0 return strcmp(user, "xyzzy") == 0; } i = 1 int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; reveal_secret(); return 0; }

  4. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); } login int verify(const char* name) rip %esp { char user[256]; sfp %ebp verify() int i; 256 bytes %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i = 2 int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; reveal_secret(); return 0; }

  5. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); } login int verify(const char* name) rip %esp { char user[256]; sfp %ebp verify() int i; 256 bytes %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i = 3 int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; reveal_secret(); return 0; }

  6. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; Exploit reveal_secret(); a0c2d782 return 0; ffa86db2 } 307abba9 ad7c

  7. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() name[i] { rip char login[512]; fgets(login, 512, stdin); sfp if (! verify(login)) return 1; reveal_secret(); return 0; }

  8. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() &"xyzzy" { user char login[512]; fgets(login, 512, stdin); rip if (! verify(login)) strcmp() sfp return 1; s reveal_secret(); t r c m p return 0; }

  9. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() &"xyzzy" { user char login[512]; fgets(login, 512, stdin); rip if (! verify(login)) sfp return 1; reveal_secret(); return 0; }

  10. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() &"xyzzy" { user char login[512]; fgets(login, 512, stdin); rip if (! verify(login)) sfp return 1; reveal_secret(); return 0; }

  11. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() &"xyzzy" { user char login[512]; fgets(login, 512, stdin); rip if (! verify(login)) sfp return 1; reveal_secret(); return 0; }

  12. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() &"xyzzy" { user char login[512]; fgets(login, 512, stdin); rip if (! verify(login)) sfp return 1; reveal_secret(); return 0; }

  13. #include <ctype.h> // tolower #include <string.h> // strcmp sfp main() #include <stdio.h> // fgets, fputs void reveal_secret() login { fputs("SUPER SECRET = 42\n", stdout); 00 93 f7 e1 } 7a 7b ab 62 int verify(const char* name) 08 64 ff 7e %esp { char user[256]; cc d5 70 e3 %ebp verify() int i; 256 bytes 91 06 b3 6b %eip for (i = 0; name[i] != '\0'; ++i) user[i] = tolower(name[i]); user user[i] = '\0'; 82 d7 c2 a0 return strcmp(user, "xyzzy") == 0; } i int main() &"xyzzy" { user char login[512]; fgets(login, 512, stdin); rip if (! verify(login)) sfp return 1; Exploit reveal_secret(); a0c2d782 return 0; ffa86db2 } 307abba9 ad7c

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend