They’re called Q ships.
http://feraljundi.com/2009/04/08/history-the-q-ship-and-how-they-could-be-used-to-battle-pirates/
Good article about these Q ships.