Chosen Solution

Let’s say I bought a non working Iphone off ebay from someone and they don’t know the password? How would I reset the phone without knowing the icloud info? I want to buy broken phones off ebay and then fix them and sell them. But some of the people don’t know the passcode or the devices are icloud locked.

If the device is iCloud locked, there is nothing you can do with that device. Only the person who owns the iCloud account can unlock it. If you can show proof of purchase, for example, the rightful owner has forgotten the password, then Apple can unlock it for you. Generally speaking, iCloud locked devices are either lost or stolen. They can always be used a source of parts (screens, cameras etc) if your confident of their provenance. For example, stores that take in exchanges/upgrades can often sell bulk phones, many of which the previous owner simply forgot to wipe beforehand.