ספר הזהר, Balak Balak · יג
Zohar 309
י
It is found in the book of Ashmodai, which he gave to Solomon, that anyone who wants to do strong magic that is hidden from the eye — if he knows the boulder on which Balaam fell, he will find those snakes there which were [generated] from the bones of that wicked man. If he kills one of them, he can do supernal magic with its head, other magic with its body, and [still] other magic with its tail. There are three types of magic in each one.
יא
When the queen of Sheba came to Solomon, one of the things that she asked of Solomon: She said, "With what can the snake of three magics be caught?" Immediately, there was nothing that was hidden from the king which he did not tell her (I Kings 10:3). She asked about this, that she needed those snakes, but she was unable to grab one of them. What things which were in her heart was he able to answer for her? This is what he informed her, as it is written, And Solomon told her all of her matters: No person can subdue them without one secret thing. And what is it? Boiling semen.