From E-Budo.com:
…Due to the climate, local people’s temperament, the existence of many small local lords and the presence of many naturalized citizens who helped the natives absorb the progressive continental culture and frequent traffic of ascetics around the old shrines and temples which the region was infested with all of thee factors gave sufficient grounds for the birth, growth and polishing of ninjutsu, The fact is that many of the founders were originally ascetics. In fact, for the ninjutsu method of mind concentration and magic performance, the performers made a sign of kuji (lit. nine characters, a secret and sacred sign). For this reason, some believe that ninjutsu derived from the military practice if yamabushi (lit. mountain hermits) of the Shugendo sect.