Spying in Japan dates as far back as Prince Shōtoku (572–622), although the origins of the Ninja date much earlier. According to Shōninki, the first open usage of ninjutsu during a military campaign was in the Gempei War, when Minamoto no Kuro Yoshitsune chose warriors to serve as shinobi during a battle; this manuscript goes on to say that, during the Kenmu era, Kusonoki Masashige used ninjutsu frequently. According to footnotes in this manuscript, the Gempei war lasted from 1180 to 1185, and the Kenmu Restoration occurred between 1333 and 1336. Ninjutsu was developed by groups of people mainly from the Iga Province and Kōka, Shiga of Japan. Throughout history the shinobi have been seen as assassins, scouts and spies who were hired mostly by territorial lords known as the Daimyo. They conducted operations that the samurai were forbidden to partake in. They are mainly noted for their use of stealth and deception. Throughout history many different schools (ryū) have taught their unique versions of ninjutsu. An example of these is the Togakure-ryū. This ryū was developed after a defeated samurai warrior called Daisuke Togakure escaped to the region of Iga. Later he came in contact with the warrior-monk Kain Doshi who taught him a new way of viewing life and the means of survival (ninjutsu).
Ninjutsu was developed as a collection of fundamental survivalist techniques in the warring state of feudal Japan. The ninja used their art to ensure their survival in a time of violent political turmoil. Ninjutsu included methods of gathering information, and techniques of non-detection, avoidance, and misdirection. Ninjutsu can also involve training in free running, disguise, escape, concealment, archery, and medicine.
Skills relating to espionage and assassination were highly useful to warring factions in feudal Japan. These persons were literally called “non-humans” (非人 hinin?). At some point the skills of espionage became known collectively as ninjutsu, and the people who specialized in these tasks were called shinobi no mono.
This information, and more about Ninjutsu, can be found at the following Wikipedia link; http://en.wikipedia.org/wiki/Ninjutsu