If the master of any vessel shall obstruct or hinder, or shall intentionally cause any obstruction or hindrance to any officer in lawfully going on board such vessel, for the purpose of carrying into effect any of the revenue or navigation laws of the United States, he shall for every such offense be liable to a penalty of not more than $2,000 nor less than $500.