
The exact origins are unknown, but their roles may have included sabotage, espionage, scouting and assassination missions as a way to destabilize and cause social chaos in enemy territory or against an opposing ruler, perhaps in the service of their feudal rulers (daimyo, shogun), or an underground ninja organization waging guerilla warfare.
Ninja as a group first began to be written about in 15th century feudal Japan as martial organizations predominately in the regions of Iga and Koga of central Japan, though the practice of guerrilla warfare and undercover espionage operations goes back much further.[citation needed]
At this time, the conflicts between the clans of daimyo that controlled small regions of land had established guerrilla warfare and assassination as a valuable alternative to frontal assault. Since BushidÅ, the samurai code, forbade such tactics as dishonorable, a daimyo could not expect his own troops to perform the tasks required; thus, he had to buy or broker the assistance of ninja to perform selective strikes, espionage, assassination, and infiltration of enemy strongholds.
In their history, ninja groups were small and structured around families and villages, later developing a more martial hierarchy that was able to mesh more closely with samurai and the daimyo. These certain ninjutsu trained groups were set in these villages for protection against raiders and robbers.
As a martial organization, it has been assumed that ninja would have had many rules, and keeping secret the ninja's clan and the daimyo who gave them their orders would have been one of the most important ones.
There is no evidence historical ninja wore all-black suits, in modern times, camouflage based upon dark colors such as dark red and dark blue is known to give better concealment at night. Some cloaks may have been reversible: dark colored on the outside for concealment during the night, and white colored on the inside for concealment in the snow.[citation needed] Some ninja may have worn the same armour or clothing as samurai or Japanese peasants.