SHA2017 - Write up Pwn 200
Welcome to my blog.  Today, I will write up for SHA2017 CTF.   In here, I write for Pwn 200   This source file: FILE   System is running Ubuntu 16.04, ASLR is disabled.   nc megan35.stillhackinganyway.nl 3535    int __cdecl main(int a1) {   const char *v1; // eax@1   int v2; // edx@1   char s; // [sp+0h] [bp-21Ch]@1   char dest; // [sp+100h] [bp-11Ch]@1   int v6; // [sp+200h] [bp-1Ch]@1   int *v7; // [sp+214h] [bp-8h]@1    v7 = &a1;   v6 = *MK_FP(__GS__, 20);   puts("Decrypt your text with the MEGAN-35 encryption.");   fflush(stdout);   fgets(&s, 0xFF, stdin);   v1 = sub_804866B(&s, strlen(&s));   strcpy(&dest, v1);   printf(&dest);   v2 = *MK_FP(__GS__, 20) ^ v6;   return 0; }  In challenge input one megan-35 encode, program decode and print decoded text.   We can leak in  printf(&dest);  by format string.   First, I had source encode megan-35.py :    import base64, sys  megan35 = "3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABC...