This is a bash shell script, can defeat the nmap OS fingerprinting feature by changing the OS signature. It does this by modifying some file's content generated by kernel. But it's result depends on few thing, like the version of nmap are being used to scan and your platform (OS) etc. I have also included my test results along with the main script.
I do not give any warranty or guarantee of stability or the output of the program. I will not be responsible for any misuse of this program or any kind of damages done by this program. Thank You.