The Daily WTF
For a variety of reasons, Robert‘s company needed to ship a small linux box with a USB ethernet adapter. The driver for said adapter was giving him some issues with their setup, but fortunately the driver was open source, so Robert could at least try and diagnose the problems.
In the file inst.c, he found this:
#include <stdio.h> main() { system(“mkdir /usr/lib/smm9431”); system(“cp scm9431.ko /usr/lib/smm9431”); system(“insmod scm9431.ko”); system(“touch /tmp/nprtmp”); system(“grep -v ‘cd /usr/lib/smm9431’ /etc/rc.d/rc.local > /tmp/nprtmp”); system(“cp /tmp/nprtmp /etc/rc.d/rc.local > /dev/null 2>&1”); system(“rm -f /tmp/nprtmp > /dev/null 2>&1”); system(“echo ‘cd /usr/lib/smm9431’ >> /etc/rc.d/rc.local”); system(“ln -s /etc/rc.d/rc.local /etc/rc.local > /dev/null 2>&1”); system(“chmod 755 /etc/rc.d/rc.local”); system(“touch /tmp/nprtmp”); system(“grep -v smmdriver /etc/rc.d/rc.local > /tmp/nprtmp”); system(“cp /tmp/nprtmp /etc/rc.d/rc.local > /dev/null 2>&1”); system(“rm -f /tmp/nprtmp > /dev/null 2>&1”); system(“echo ‘insmod scm9431.ko ‘ >> /etc/rc.d/rc.local”); system(“ln -s /etc/rc.d/rc.local /etc/rc.local > /dev/null 2>&1”); system(“chmod 755 /etc/rc.d/rc.local”); }
This is, of course, a shell script with extra
To read the full article click on the 'post' link at the top.