I wrote a script to turn the light on these cockroaches who have nothing better to do with their time than to try and deface web sites. This script will decode your Apache log and see what commands were executed on your system through the phpBB vulnerability (if your system is vulnerable which if it's less than 2.0.11 it's vulnerable):
- Code: Select all
#!/usr/bin/php -q
<?
// Program: decode_phpbb_sploit.php
// created by Void Main - 2 Dec 2004
// updated by Void Main - 9 Jan 2005
//
// 1) make it executable
// 2) cat /var/www/httpd/access_log | ./decode_phpbb_sploit.php
function cvtchr($m) { return chr($m[1]); }
set_time_limit(0);
$stdin = fopen('php://stdin','r');
while ($cmd = trim(fgets($stdin))) {
if (preg_match("/system\(chr\(/i",$cmd) ) {
$cmd = preg_replace("/(.*) -.*[-\"].*\[(.*)\].*system\((.*)\).*HTTP.*/",
"\${1} - [\${2}] - \${3}",
preg_replace_callback("/\.*chr\((\d+)\)/i",cvtchr,
urldecode(urldecode($cmd))));
echo "$cmd\n";
} elseif (preg_match("/\&rush=%/i",$cmd)) {
$cmd = preg_replace("/(.*) -.*[-\"].*\[(.*)\].*\&rush=(.*).*HTTP.*/",
"\${1} - [\${2}] - \${3}",
urldecode(urldecode($cmd)));
echo "$cmd\n";
}
}
?>
I won't show all of my decoded logs (which are interesting) but here is a sample line:
This:
- Code: Select all
203.81.192.58 - - [01/Dec/2004:12:05:44 -0600] "GET /forums//viewtopic.php?t=2&highlight=%2527%252esystem(chr(101)%252echr(99)%252echr(104)%252echr(111)
%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(73)%252echr(78)%252echr(73)%252echr(67)
%252echr(73)%252echr(79)%252echr(95)%252echr(95)%252echr(95)%252echr(59)%252echr(117)%252echr(110)
%252echr(97)%252echr(109)%252echr(101)%252echr(32)%252echr(45)%252echr(97)%252echr(59)%252echr(105)
%252echr(100)%252echr(59)%252echr(119)%252echr(59)%252echr(101)%252echr(99)%252echr(104)%252echr(111)
%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(70)%252echr(73)%252echr(77)%252echr(95)%252
echr(95)%252echr(95)%252echr(59))%252e%2527 HTTP/1.0" 200 5484 "-" "Mozilla/3.0 (compatible; Indy Library)"
Becomes:
- Code: Select all
203.81.192.58 - [01/Dec/2004:12:05:44 -0600] - echo ___INICIO___;uname -a;id;w;echo ___FIM___;
The above line of commands "echo ___INICIO___;uname -a;id;w;echo ___FIM___;" is one of several lines of commands that were executed from the above address. There are several different addresses that have executed various commands including downloading a backdoor and attempting to execute it (BTW, their backdoor attemps were unsuccessful for several reasons I need not mention). Most of the addresses are out of Brazil. I got the source to the back door and there were three separate downloads of the same back door by 3 different brats. Two copies were the original version and one copy was the same program but translated into Portuguese. Of course in the echo commands in the line I quoted "INICIO" translates to "BEGIN" and "FIM" translates to "END". If someone can help me identify the little CeNsOrEd there may be a reward in it for you. Here are some of the IP addresses in question (could have been hacked sites, but these kids seem to be too stupid to hop in anonymously):
200.117.34.137
200.138.70.151
200.158.37.166
200.161.250.232
200.162.208.31
200.162.230.113
200.175.26.138
200.175.84.82
200.181.213.234
200.181.213.251
200.199.131.221
200.199.184.227
200.199.25.195
200.203.110.179
200.203.166.61
200.203.35.32
200.206.164.44
200.207.114.17
200.216.15.58
200.217.33.71
200.96.22.32
201.0.73.35
201.0.73.83
201.13.224.52
201.9.182.192
203.81.192.58
213.144.148.19
217.160.110.47
65.168.184.251
69.43.151.31
81.192.249.104
Which some have hostnames:
host137.200-117-34.telecom.net.ar
200-138-070-151.mganm7004.dsl.brasiltelecom.net.br
200-158-37-166.dsl.telesp.net.br
200-161-250-232.dsl.telesp.net.br
200-162-208-31.user.ajato.com.br
200.162.230.113.user.ajato.com.br
200.175.26.138.dialup.gvt.net.br
200.175.84.82.dialup.gvt.net.br
227.2-254.184.199.200.telemar.net.br
200-203-110-179.smace7006.dsl.brasiltelecom.net.br
200-203-035-032.paemt7005.dsl.brasiltelecom.net.br
200-206-164-44.dsl.telesp.net.br
200-207-114-17.dsl.telesp.net.br
200216015058.user.veloxzone.com.br
200-096-022-032.cscgo7001.dsl.brasiltelecom.net.br
201-0-73-35.dsl.telesp.net.br
201-0-73-83.dsl.telesp.net.br
201-13-224-52.dsl.telesp.net.br
201009182192.user.veloxzone.com.br
host58.worldcall.net.pk
kunden1.livenet.ch
p15096902.pureserver.info
adsl-104-249-192-81.adsl.iam.net.ma
If someone has been able to execute commands on your system through the phpBB vulnerabilities you'll probably also see interesting things in your /var/log/httpd/error_log.