When choosing prepositions, consider their traditional or idiomatic usage with specific verbs. "Hanker upon" is a common phrase used to express a deep craving.
The correct sentence should be "The greedy hanker upon the riches." The phrase "hanker upon" is used to indicate a strong desire or craving, typically in the context of something material.