The persons excepted from the benefits of the foregoing provisions are all who are, or shall have been, civil or diplomatic officers or agents of the so-called confederate government; all who have left judicial stations under the United States to aid the rebellion; all who are, or shall have been, military or naval officers of said so-called confederate government above the rank of colonel in the army, or of lieutenant in the navy; all who left seats in the United States Congress to aid the rebellion; all who resigned commissions in the army or navy of the United States, and afterwards aided the rebellion; and all who have engaged in any way in treating colored persons or white persons, in charge of such, otherwise than lawfully as prisoners of war, and which persons may have been found in the United States service, as soldiers, seamen, or in any other capacity.