from pwn import * BINARY = '' IP, PORT = '', 8080 LOCAL = True if LOCAL: p = process(BINARY) # Makes pipe fd if not LOCAL p = remote(IP, PORT) # Makes socket fd p.recv(1024, timeout=3) # Accepts 1024 bytes from 'p' # If the pipe/socket is closed, p with return EOF Error # After 3 seconds, execution will continue, except if EOF Error occurs p.recvuntil('Zafirr', timeout=3) # Accepts all bytes until string "Zafirr" is found # If the pipe/socket is closed, p with return EOF Error # After 3 seconds, execution will continue, except if EOF Error occurs p.send("<3") # Will send "<3" to 'p' # If the pipe/socket is closed, p with return EOF Error p.sendline("<3") # Will send "<3\n" to 'p' # If the pipe/socket is closed, p with return EOF Error p.sendafter("Zafirr", "<3") # Will send "<3" to 'p' IF AND ONLY IF "Zafirr" is recieved first # If the pipe/socket is closed, p with return EOF Error p.sendlineafter("Zafirr", "<3") # Will send "<3\n" to 'p' IF AND ONLY IF "Zafirr" is recieved first # If the pipe/socket is closed, p with return EOF Error p.interactive() # Will dup pipe/socket fd's to /dev/tty # Will run even is p is closed p.close() # Closes 'p' p32(0x1) # Equivalent to struct.pack("