[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cgi problem



I was working on a simple shell CGI script to report nimda/code red
infection attempts on my server. The problem is that everywhere there is
supposed to be a newline, it isn't printed. If I execute it from a
shell, it will work fine. I have tried 3 different webbrowser and get
the same results. I have read the manpage. Here is the script:
#!/bin/sh
echo Content-type: text/html
echo
echo 'Number of attempts to infect this server with Code Red/Nimbda: '
echo
grep .exe -c  /var/www/logs/access_log
echo
echo 'Hosts along with the number of times attempted: '
echo
grep .exe /var/www/logs/access_log | sed -e "s/[-].*//" | uniq -c

This is what I get:
Number of attempts to infect this server with the Code Red/Nimbda virus:
1967 Hosts along with the number of times attempted: 16 24.8.93.155 16
24.8.235.162 3 24.8.93.33 16 24.8.93.155 16 24.8.93.33 10 24.8.235.162
16 24.8.93.33 16 24.8.93.155 32 24.8.93.33