I'll give you a clue: Not Moses.
The first five books of the Old Testament, the Torah, the Pentateuch, or what the New Testament refers to as "The Law", drew from contemporary ideas of ethics and cosmology. It was the product of many people over an extended period of time. And it was written for a range of purposes.
Wikipedia provides some good starting points to find out more:
Who wrote it:
Some of their influences, and prior documents: