The oldest documents relating to the concepts of Ninjutsu (i.e. espionage, sabotage, etc.) can be traced to Sun Tzu’s military manual Art of War (孫子兵法) where he details the importance of intelligence gathering and misdirection in warfare. These concepts were imported to Japan.
According to the Shōninki (正忍記), Minamoto no Kuro Yoshitsune used Ninjutsu in the Gempai War (1180 to 1185). Natori Masatake wrote the Shōninki (正忍記) in 1691.
Ninjutsu reached it’s peak in ancient Japan during the Sengoku Period (戦国時代) from 1467 to 1603. This was also known as the Warring States Period. During this time, different kingdoms were constantly at war, making the skill set of the Shinobi extremely valuable. This is the period where Shinobi were most active in Japan.