Possessed? Like a jinn possessing your actions?
Any more symptoms? Then it must be just poor self control, lack of mental clarity and in need of meditation.
I don’t know if islamic magick had a sperate name but here some resources that you can read for more info