It has already passed in the hadith of Sayyiduna Anas bin Malik (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "The believers are Allah's witnesses on the earth."
And it has been narrated to us from Ata and al-Sha'bi (may Allah have mercy on them both) that they both said: "The testimony of a child born of zina (an illegitimate child) is permissible."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / Q21180
Al-Hasan (may Allah have mercy on him) said concerning a child born of zina that a child of legitimate lineage is superior to him only on the basis of taqwa (God-consciousness).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 21180
Abd al-Rahman bin Abi al-Zinad (may Allah have mercy on him) narrates from his father, and he from the authoritative jurists of Madinah, that a child born of zina has a bad origin; when his condition and his integrity (muru'ah) are good, he is fit to give testimony, and freeing him is also good.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 21181