You can get windows keys on ebay, for almost nothing, I don't understand the process completely but to my knowledge it's not illegal because reselling used software or keys is a right in the EU and it seems like Microsoft has implemented this practice worldwide, as in I'm sure they could revoke the license if they wanted but aren't doing it (as it would be against EU laws)
But this also means it's a gray area outside of the EU, it's just Microsoft specifically doesn't really do anything to prevent it ie it's defacto applying these rules worldwide to my understanding.