The CC pins are used for this but you can only know the state of the connector nearest to the device you have, not the total orientation of the cable.
Only one CC pin is connected through the cable to establish signal
orientation and the other CC pin is repurposed as VCONN for powering
electronics in the USB Type-C plug.
To establish the proper routing of the active USB data bus from host
to device, the standard USB Type-C cable is wired such that a single
CC wire is position aligned with the first USB SuperSpeed signal pairs
(SSTXp1/SSTXn1 and SSRXp1/SSRXn1) – in this way, the CC wire and USB
SuperSpeed data bus wires that are used for signaling within the cable
track with regard to the orientation and twist of the cable.
Source: https://www.silabs.com/community/mcu/8-bit/knowledge-base.entry.html/2016/09/26/what_s_the_role_ofc-kQYe
You won't be able to determine both sides of the configuration with passive methods, without some communication between the DFP and UFP, because the USB C connection is made to be symmetrical The devices can determine if they are flipped or not with the CC pins. But because of the symmetry the UFP can only determine if the cable on the UFP end is flipped or not. Likewise the DFP can only determine if the DFP is flipped or not.
With a controller however, the DFP can be determined from the UFP, but you'll have to get the configuration from the controller through the USB interface.
Source: https://www.richtek.com/assets/product_file/RT1730/DS1730-01.pdf