This is basically the same logic from exploit/multi/handler without the timeout.