There are currently two ways of testing malicious cables. Pre-made testers and standard USB Testers that you can observe the current draw.
If you don’t know what I mean, check out the O.MG Cable, I will not go into the details of how you can visually tell them apart from other cables, and it depends on the cable brands and I guess both methods are evolving fast.
If you’re serious about making sure it’s malicious, I would recommend getting both or one that includes a current meter. If you’re like me and just want to double check a cable, a USB tester that shows current is enough.
How to Detect Malicious USB Spy Cables #TSCM #MurrayAssociatesTSCM – YouTube
O.MG Malicious Cable Detector – Lab401
The CuVoodoo USB Bug Detector Safely Ferrets Out Those Sneaky Malicious O.MG Cables – Hackster.io
FNIRSI-FNB58 Multi-function USB Voltage/Current Meter Type-C Fast Charge Tester
How to spot the difference between the O.MG Cable and a standard USB-A Cable – iFixit Repair Guide
USB Data Blocker Teardown