Mastodon, an alternative social network to Twitter, has a serious problem with child sexual abuse material according to researchers from Stanford University. In just two days, researchers found over 100 instances of known CSAM across over 325,000 posts on Mastodon. The researchers found hundreds of posts containing CSAM related hashtags and links pointing to CSAM trading and grooming of minors. One Mastodon server was even taken down for a period of time due to CSAM being posted. The researchers suggest that decentralized networks like Mastodon need to implement more robust moderation tools and reporting mechanisms to address the prevalence of CSAM.
That is the standard approach for detecing CSAM media.
It is often freely implemented with tools: https://blog.cloudflare.com/the-csam-scanning-tool/ (and this also gets into the how the hashes work).
The hashes themselves tend to be restricted to law enforcement agencies and trusted vendors/partners/services.