It would seem that Satan and other evil spirits did know Jesus was God, at least in some general way. Scripture reports: Whenever the evil spirits saw him, they fell down before him and cried out, "You are the Son of God" (Mk 3:11). Another time a demon cried out: I know who you are -- the Holy One of God!" (Mk 1:24). There are similar passages (e.g. Mk 1:34 and Luke 4:41).
That said, we ought not to conclude that Satan had a comprehensive or flawless knowledge of Jesus, and the full plan of salvation. Had Satan such a complete knowledge, especially of the plan of God, he would not have inspired the crucifixion of Jesus, the very means by which he (Satan) was defeated.
Hence, there is evidence that Satan had a basic understanding of Jesus’ divinity, and plan, but one that was limited, and likely flawed to some extent, due to his intellect being darkened by sin and rage.
However, when Satan tempted Jesus, it was only to his human nature and his human will that he could appeal, even though he knew Jesus also to be God.
"Building our Catholic faith one question at a time."