I can totally relate to what you have! When I was a child and a teenager I would get thoughts that were either very nasty and sick (I didn't enjoy them at all, it was like my brain was making them up just to scare me) or I would be afraid that I'd do things like you said, killing somebody, behaving inappropriately etc. Also I would repeat certain phrases in my head, to cover the unwanted thoughts, but I still felt like a monster. It was the main reason why I was considering suicide in high school. Now I have these thoughts that say I want bad things to happen to me, like die, although I don't want to. Again, it's like my mind tries to scare me, and I'm afraid that just because I think of something, it's gonna happen, although I know it doesn't work like that. Anxiety is a tricky thing, it's like you have a logical person and a completely irrational one, in the same head.
Now, my advice for the bad and scary thoughts, is don't be afraid of them. And they'll stop. If I was thinking "what if I killed my mother" and that made me feel terrible, instead of avoiding the thought, I would repeat it in my head, till it was powerless. Like "ok, brain, gimme more, I'm not afraid". If you're not afraid, the disturbing thoughts stop. Also, if you feel guilty, remember that you are not your thoughts. The mind is a complicated thing. It's capable of thinking anything, from the best to the worst things. Just because you thought something, it doesn't mean you are in alignment with it.