160 points · by SchizoDuckie · 12y ago · 71 comments
I ran the "nginx" binary thru strace in a vagrant vm and got some connection attempts to a clouldflare IP
connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("108.162.197.26")}, 16) = 0
but didn't see anything interesting being sent there... My tcpdump output showed it connects to a http server at 89.238.150.154:5 and exchanges some data there
sent >>> BUILD X86
recv >>> !* HTTP
recv >>> 190.93.240.15,190.93.241.15,141.101.112.16,190.93.243.15,190.93.242.15 pastebin.com /4HQ2w4AZ 80 2
recv >>> PING
sent >>> PONG
then it just goes to do ping/pong with the same server. At one point the process forks a separate process of itself and dies...
The pastebin link leads to an uploadcash.org file named hermoine_granger_jpg.jpg which I can assume is a payload of somekind...
FWIW, it doesn't appear to be a new bit of malware - the same strings match this pastebin from March - http://pastebin.com/xa87Gh7q
Anyhow, doesn't seem like it sends anything to Cloudflare. I think it just checks if the IP is alive (perhaps this is how it tests connectivity to the internet). It also checks my routing table and extracts the MAC address.
P.S as of now, the CC server at 89.238.150.154:5 is not accessible.
A get request is sent to the server with additional commands added to the content, which creates the file ./tmp/besh whose content comes from the ngix file from http://162.253.66.76/nginx. The executable flag is set and then the file gets executed.
The next three commands show information about the downloaded nginx file (check sums, file command info). For what reason? Is the file really an nginx server or is it just named like this to show that nginx is exploitable? I know that this is basically about the bash exploit, right?
Thanks
The title/description of the gist claims it is a kernel exploit with CnC (Command and Control) capabilities. So yeah, the file is only named nginx; it doesn't have anything to do with the popular web server software of the same name. Probably named that way to avoid suspicion
Correct, it is usually done to conceal the process in process listings (top / ps aux).
Discovering a case where wget shells out to bash while setting some env vars based on received headers. And then anonymously posting a supposed shellshock payload just begging to be downloaded with wget.
Why oh why would this ever happen?
This hole bug is way overblown. Not every small program on the planet "shells out to bash", and if they do, thats one seriously messed up program.
If you run a web server that generates its own CAPTCHA using something like ImageMagick, or call system() to gzip something, you could possibly be vulnerable.
Never underestimate vulnerabilities and the way people can use them, or even combine them, to exploit systems.
Are you serious, who the hell does that!?
Any half-assed language has a zip implementation, use that. Any non-boring language has image-magick binding to that library.
This bug affects complete idiots.
This information is, frankly, more interesting than the fact that ShellShock is being exploited in the wild. Really, it was only a matter of time.
http://www.kernelmode.info/forum/viewtopic.php?f=16&t=3505#p...
The most obvious answer is no.
Somone is going to make a fortune mining bitcoin in the coming weeks.
The far more likely way for this bug resulting in someone exfiltrating lots of bitcoins is them hitting every Bitcoin exchange looking for e.g. cPanel on a development box, Wordpress hosted on Nginx with fastcgi, etc etc. If they find one, they've got the hot wallet inside of five minutes later if it is on the same box, a bit more if it is somewhere else on the local network.
(I've got to admit, the first thing I did after patching my boxes, to relax about the stress, was grepping Bitcoin Core for system calls. No obvious ones that I could see, for what it is worth.)
If I can emphasize again, though: just because you don't engage in risky behaviors like e.g. transacting in bitcoins, doesn't mean your boxes are safe. Every. Server. On. The. Internet. Will be probed for a variety of exploits enabled by this vulnerability. There will be dozens of independently administered for loops probing for it within 24 hours.
# ls -l /bin/*sh
lrwxrwxrwx 1 root root 12 Feb 9 2014 /bin/ash -> /bin/busybox
lrwxrwxrwx 1 root root 12 Feb 9 2014 /bin/sh -> /bin/busybox
One can, of course, envision numerous ways to get data in and out without it being an IRC channel, but that is easy to implement, works across a wide variety of target environments, and plays well with the existing ratware ecosystem.
https://www.pcisecuritystandards.org/documents/PCI_DSS_v3.pd...
I wrote unix exploits for a living for years (All legit, in a pentest company) and for payloads I would normally use echo or printf to upload a binary and execute it. And those are built-in commands in the shell.
http://blog.sucuri.net/2014/09/bash-vulnerability-shell-shoc...
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
This should be displayed: bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a testEven if the CGI script is in some other language, think of how many .sh wrapper scripts there are out there.
EDIT: http://lcamtuf.blogspot.com/2014/09/quick-notes-about-bash-b... explains it better
This bug only affects people who dont care about security.
And those running code written by people who don't know any better...
If you are an admin for servers running third part code that you have not verified every line of, you need to be concerned about anything like this just in case said code does something that isn't considered best practise.
Also if the CGI code path uses affected functions, you are not going to be protected by avoiding using them in the code that is eventually called.