How to counter a pirate attack