Under federal law, it is illegal to knowingly and willfully obtain a credit report under false pretenses. The federal Fair Credit Reporting Act imposes a maximum two-year prison sentence for the crime.
This is a crime, however...JFK
All the same, dumpster-diving still isn't a crime.