Nothing attacked them. They behaved strangely because (a) strange things were happening & (b) the characters didn't know each other well enough to have developed real trust. When these events happened, it hadn't been long since the Doctor had effectively kidnapped Ian & Barbara (in "An Unearthly Child") & had got them into serious difficulties on Skaro (in "The Daleks"). The strange things that were happening were, in fact, the TARDIS trying to convey a message without being able to speak to them.
The story may be clearer if you read the Tardis Data Core article "The Edge of Destruction" and watch "The Doctor's Wife" -- concentrating especially on the conversations between the Doctor & the TARDIS in the body of Idris, where they talk about not normally being able to talk to each other -- & then watch "The Edge..." again.