(a) Court order required. — Except as provided in subsection (b) of this section, a person may not install or use a pen register or a trap and trace device without first obtaining a court order under § 2433 of this title.
(b) Exceptions. — Subsection (a) of this section does not apply to the use of a pen register or a trap and trace device by a provider of wire or electronic communication service:
(1) Relating to the operation, maintenance and testing of a wire or electronic service or to the protection of the rights or property of the provider, or to the protection of users of that service from abuse of service or unlawful use of service; or
(2) To record the fact that a wire or electronic communication was initiated or completed in order to protect the provider, another provider furnishing service toward the completion of the wire communication, or a user of that service from fraudulent, unlawful or abusive use of this service, or with the consent of the user of that service.
(c) Penalties. — A person who violates subsection (a) of this section shall be guilty of a class A misdemeanor and be fined not more than $5,000.