Two things-Lum Gwai-"Forest Ghosts", Lin Kuai in Manderin, were well known throughout Chinese History, but then again just like Ninjas, anyone who did their covert ops in the night were considered Ninja, or Lum-Gwai by commoners. Leung Ting, through his books , unfortunately has the ability to make anything he touches turn instantly to bullshido.
There was and still is a "Beggar's Society, or clan" many village styles such as Village Hung Kuen, and some Hakka systems are associated with them. So don't throw the baby out with the bathwater.
Now, according to Maasaki Hatsumi, Ninja were descended from the Yamabushi-Mountain Warrior Monks...who came to Japan from China (what a surprise)to avoid persecution, and hid out in the mountains of Iga prefecture.
Ninja were NEVER Samurai-they were from a different caste order, and had an entirely different code of ethics.