from pwn import *
shell=ssh(host='pwnable.kr',user='random',password='guest',port=2222)
target=shell.process('./random')
#random value is always the same, check it in gdb, or write a C program, or use ctypes. I like the old school feel, so i went for a simple C program.
'''
#include<stdio.h>
#include<stdlib.h>

int main()
{
        unsigned int random;
        random=rand();
        unsigned int deadbeef=0xdeadbeef;
        unsigned int key;
        key=random^deadbeef;
        printf("%lu\n",key);
}
'''
target.sendline(str(3039230856))
print(target.recv())
shell.close()
