Worm Hits Windows Machines Running MySQL 367
UnderAttack writes "A report on the Australian whirlpool forum suggest that a worm is currently taking out MySQL servers running on Windows. We have seen this happen with MSSQL before (not just 'Slammer', but also SQLSnake that used SA accounts without password). The SANS Internet Storm Center suggests that a
rise in port 3306 scans can be attributed to the new worm, and is asking for observations to help figure this out. It appears the worm creates a file called 'spoolcll.exe'."
Acronym madness clarification. (Score:5, Informative)
The SANS (SysAdmin, Audit, Network, Security) Institute provides information security training and certification. For more information, visit www.sans.org
What's an SA account?
The system administrator (SA) account is similar to the DBO except it is of the entire server. It has the same access and permissions as the DBO on all the databases in the server.
DBO account???
The DBO User Account The database owner (DBO) is the administrator for the database. It has full access to all operations and rights.
SQL Snake is an Internet worm, that scans for open Microsoft SQL 7 (MSSQL) and 2000 servers - which run on TCP Port 1433 by default. The worm attempts to log into the System Administrator (SA) account with no password. If successful, the worm downloads and hides some files and grabs system configuration and account names.
Before the MySQL bashers start, it should be noted that this is not a problem with MySQL.
From the article:
This bot does not use any vulnerability in mysql. The fundamental weakness it uses is a week 'root' account. The following mitigation methods will prevent exploitation:
Strong Password: Select a strong password, in particular for the 'root' account.
Restricted root account: Connections for any account can be limited to certain hosts in MySQL. This is in particular important for 'root'. If possible, 'root' should only be allowed to connect from the local host. MySQL will also allow you to force connections to use mysql's own SSL connection option.
Apply firewall rules: MySQL servers should not be exposed to the "wild outside". Block port 3306 and only allow access from selected hosts that require such access. Again, the use of ssh forwarding or SSL is highly recommended.
Re:Acronym madness clarification. (Score:2)
This is not a bash but... A server should not (by default at least) allow remote access to administrative or root accounts where no password has been specified.
Re:Acronym madness clarification. (Score:4, Informative)
Re:Acronym madness clarification. (Score:3, Funny)
A server should not have root accounts.
there, that's more like it
Re:Acronym madness clarification. (Score:3, Interesting)
This is a flaw in Windows version of MySQL. Your comment is entirely beside the point.
Don't do the editors job for him! (Score:2)
Shouldn't be a big deal (Score:4, Informative)
A hole in a program that communicates to the database and is accessable from the outside world would be a much more serious flaw I would imagine.
Re:Shouldn't be a big deal (Score:2)
I don't get it (Score:5, Interesting)
Come again?
Re:I don't get it (Score:5, Informative)
See the details on this [securiteam.com] for information about what exactly is happening. There are plenty of DLLs on windows laying around that do all sorts of stuff, once you define a function call in MySQL to use a dll that allows you to execute whatever you want on the system, you win.
Re:I don't get it (Score:2)
The default MySQL admin account only allows connections from localhost. So it sounds like it only affects people who purposely created an admin account with a host of '%' and no password.
Re:I don't get it (Score:3, Insightful)
mysql can load arbitrary dlls?
lol that's one of the dumbest features I ever heard!!
Re:I don't get it (Score:3, Insightful)
even when you redundantly explain it, it doesn't get any cleverer
arbitrary dlls == dumb
Re:I don't get it (Score:3, Insightful)
The key word is "arbitrary". The ability to load winsock.dll into mysql is dumb
You *could* compile against a set of headers to mark the dll as database server safe
You *could* compile against a set of headers to mark the dll as owned by the owner of a particular database
You could cryptographically sign the dlls and only accept signed dlls
"ooh but it's just sooo flexible"
just like activeX email
Re:I don't get it (Score:2)
Re:I don't get it (Score:2)
Things to do to keep from getting wormed:
1. Set a strong password for the root account.
2. Don't let root log in from an arbitrary host. Don't let root log in from anywhere but 127.0.0.1/localhost if at all possible.
(1 and 2 should be SOP for any MySQL installation as soon as you've verified that mysqld is actually running.)
3. Run MySQL on a port other than 3306.
4. Switch
Re:I don't get it (Score:2)
The bot uses the "MySQL UDF Dynamic Library Exploit".
UDF stands for "U Dumb Fscker" refering to those admins that don't bother setting up an admin password on their Mysql servers.
Not for the first time ... (Score:2, Informative)
SELECT INTO outfile was buggy up to 3.23.55
I got hit (Score:5, Informative)
When I got back to my machine at 19:20, I cleaned it down and found out what was happening.
All firewall logs etc and have archived the executable and dll files dropped.
One into the mysql data folder (app_result.dll), and the executable spoolcll.exe was dropped into windows.
Only now that I've gone into the archive folder has Norton picked it up and archived it (it had shutdown/ran the QConsole.exe NAV application to ensure Norton didn't find it, or it just wasn't in the definitions yesterday).
Its been detected as a href='http://securityresponse.symantec.com/avcent
Re:I got hit (Score:2)
Bandwidth comparison, please ? (Score:4, Funny)
For the stirring conclusion, stay tuned to Netcraft: As the Internet turns...
--LordPixie
Not surprising (Score:2, Interesting)
Re:Not surprising (Score:2)
Isn't this the point of Palladium ?
Ok, this is strange (Score:2, Interesting)
I am running mySQL 4.0.x...
I guess it's time to see what's going on.
I do keep all ports closed, all mySQL passwords are secure, no remote access to mySQL. It's just for dev purposes.
Not sure if there is a connection, but I'm going to look into it.
Re:Ok, this is strange (Score:5, Funny)
Re:Ok, this is strange (Score:2)
and never really had portscan detection go off.
so far, looks like nothing signifigant, don't see any connection.
Just coincidence I guess.
I want my money back! (Score:3, Funny)
MySQL a real DB? (Score:5, Funny)
Re:MySQL a real DB? (Score:2, Insightful)
Re:MySQL a real DB? (Score:3, Insightful)
What I think most people who talk about REAL DB'S are refering to is the ACID Test [about.com]. I have not checked recently but for the longest time MySQL failed those requirements.
Windows + Internet = Bad Things (Score:3, Insightful)
For both of these, there are exceptional requirements that can negate these general rules, but anyone who has these requirements should know better than to not take exceptional measures to protect the server.
Re:Windows + Internet = Bad Things (Score:2)
I run several MySQL servers on XP/w2k3server/linux boxes at work. All are closed to non-localhost access.
In fairness (Score:5, Insightful)
Don't connect ANY computer to the Internet, or any other hostile network, without a firewall.
Now, you can argue that, in the case of some operating systems, the firewall built into the OS, when properly configured, is enough.
You can also argue that a firewall should be a firewall, and a firewall ONLY, and that any other services should be provided by another machine BEHIND the firewall.
And depending upon the circumstances, either argument can win.
However, if you think in terms of "First the firewall, THEN the services", you will be miles ahead.
Connecting a Linux box, or a *BSD box, or a Mac, or an AS/400, or
The problem here is that the people who set up the MySQL servers on these boxes did not insure they were firewalled - this could have happened just as easily to a Linux box with a similarly bad setup.
Re:Windows + Internet = Bad Things (Score:2)
Re:Windows + Internet = Bad Things (Score:2)
That said, Windows, by default, has a lot of things going on that the user is unaware of. Does the average Windows user know that LSASS is running? Or the Messenger service? And why does Windows default to loading MSMessenger, and fight most attempts to disable it?
And the firewall is considered laughable by many sources I've read, including Windows zealot sites. It's ver
Re:Windows + Internet = Bad Things (Score:2)
The way to do this:
Re:Mod parent down (Score:2)
Just like so many worms exploit weak or non-existant administrator passwords in Windows XP to promote themselves to services. Weak passwords are worse than no password. At least no password means you know anyone can access your system. And Windows XP doesn't do much to discourage you from running as Administrator, and does a lot to prevent you from running as anything else (What? I can't sync my Palm Pilot without being an Administrator?!? DO IT!).
Don't keep the port open! (Score:5, Informative)
99.99% of people who run MySQL run it on the same machine as their webserver that queries it. Most people don't actually do queries across the network to the database server.
Just run MySQL with --skip-networking at startup (skip-networking in my.cnf), to disable MySQL from listening on port 3306. I know on most systems, its probably the default, but in almost all of the cases, its completely unnecessary.
And also, validate your input !! Don't just assume that whatever is passed on the URI field of a browser, is going to be correct. Check it. Then check it again.
Re:Don't keep the port open! (Score:2)
Re:Don't keep the port open! (Score:5, Interesting)
Re:Don't keep the port open! (Score:2)
What 'remote administration' tools are you referring to? No open network port is required for remote administration.
Re:Don't keep the port open! (Score:2)
Re:Don't keep the port open! (Score:2)
Almost right.
Since you should, as a good administrator, limit the number of ports open for potential exploits. This means using vnc-over-ssh (locked to specific incoming hosts, of course) to admin the box, instead of vnc (on 5900) and then 3306 for MySQL (which isn't secure anyway). This way, you keep one port open (22) instead of three ports (22, 3306, 5900).
But you can, and sho
Re:Don't keep the port open! (Score:2)
Re:Don't keep the port open! (Score:3, Informative)
I don't know about other services, but MySQL on Win32 supports named pipes, and can use those instead of TCP/IP. It even asks in the installer if you want to disable networking.
Some info (Score:5, Informative)
Damage appears to be low as it is more spyware than anything, and you are only at risk if you A) Have not firewalled the MySQL Port, B) Have a root account that is allowed to login from anywhere, not just localhost, and C) Have a weak root password.
So, the fix is this:
A) Firewall port 3306
B) Remove the root@% account, only allow root@localhost
C) Set a strong password
I have more info at http://www.openwin.org/mike/index.php/archives/20
Re:Some info (Score:2)
Does mysql on windows have root@%? (Score:2)
Who really creates an unpassworded root@% superuser account?
Re:Does mysql on windows have root@%? (Score:3, Informative)
Re:Does mysql on windows have root@%? (Score:2)
However, if you're foolish/ignorant enough to have root@% with no password, then anyone can connect to your database remotely and browse your data to their hearts content.
temporary fix (Score:5, Informative)
Open the Administrative Tools/Services app.
Find the "Event Monitor" service.
Open the Properties for this service.
You cannot pause or stop this service, so set the General/Startup Type to Disabled.
On the Recovery tab, set all 3 failure actions to Take No Actions.
Reboot.
Since the service didn't start, spoolcll.exe is not running.
Delete it (or whatever).
But, do not delete the service, as its existence will prevent new copies of the virus from activating.
Re:temporary fix (Score:2)
MySQL in practice (Score:5, Interesting)
I stood up MySQL on a Linux box and on a Win2k box to show that, unlike MSSQL, MySQL ran on more than one platform. One database could be deployed to both platforms with the ability to keep the application running even if one goes down. Instead of having the app be entirely offline, you can bring the other over very quickly. Did this just after the first MSSQL worm to show that there are alternatives and that entire sites don't have to go down because of one bug. Now we're working on deploying some Linux clusters.
People have their DB open to the world?! (Score:5, Informative)
MyWorm (Score:3, Interesting)
Re:MyWorm (Score:3, Insightful)
The worm doesn't use a hole within MySQL, but only bad admin passwords. In short, it's a problem with people not a technical one.
But there are mitigating factors:
- MySQL allows loading of libraries (UDF) for users with the right privileges (of which root usually is one, of course), which is a powerful feature and that power can be abused.
- The worm requires that MySQL is set up for networking, and that the port is freely reachable from the internet.
And, more
Re:MyWorm (Score:3, Interesting)
But let's assume people do what you say and your scenario would happen. Why would this be a vulnerablity? What is the problem? Actually, I see it as another advantage of OOS. With binary software, you *have* to use a work-ar
wooooo the scary worm is after me (Score:2, Insightful)
serious? (Score:5, Funny)
This makes MySQL look about as vulnerable as ssh.
Good (Score:2, Funny)
MySQL on Win32, market share (Score:4, Insightful)
Time to check auth.log and firewall rules... (Score:3, Informative)
D'oh! Didn't realize I had it open. At least I'm on Linux and don't have a blatantly obvious root password. PostgreSQL installed with IP off by default; I guess MySQL didn't. I don't even rememeber why MySQL's installed...some php toy I guess. PostreSQL and MSSQL ports are already blocked even though I don't have MSSQL.
Time to update the firewall (dedicated and local), MySQL config and revisit password strength. Maybe I should finally go to a deny by default policy....
Re:Windows (Score:5, Insightful)
Re:Windows (Score:4, Informative)
Re:Windows (Score:2)
Re:Windows (Score:2)
Re:Windows (Score:2)
Web browser, right? Wonder what ever happened to them...
Re:Windows (Score:2)
Or PostgreSQL.
Thinking of it, it would be possible to write a virus that would spread through PostgreSQL systems that were improperly secured (set to Trust authentication on network ports). It could then create a stored procedure using an untrusted language like plpythonu or plerlu if these are installed and create something that scans the network looking for others to infect.
Unfortunately no rdbms is likely to be fully immune except maybe Oracle and only
Re:Windows (Score:2)
As per SQL spec (relation and attribute names only, of course). Data is case sensitive by default.
Of course, most other databases default all case to lower, while Firebird/Interbase defaults all case to upper, so this does create a portability issue by different readings of the spec.
Actually, MySQL's behavior is the one which is broken.
Re:Windows (Score:2, Informative)
This is from MySQL 3.23.58 on Linux
So, yes it is case INsensitive. (But I can't really do anythi
Re:Windows (Score:2)
Re:Windows (Score:4, Informative)
MySql is expensive too (300 per client, unless you want to GPL all your software).
Re:Windows (Score:4, Informative)
Re:Windows (Score:2)
Re:Windows (Score:4, Informative)
Re:Windows (Score:4, Informative)
Exactly. There are something like seven developer systems running Windows that have MySQL and a web server on them for webapp development in the section I work for. Then, later, the webapp gets uploaded to a Solaris machine where the users actually use it.
I also have MySQL on my home Windows machine, since that's what my hosting provider offers. So I do some basic testing on Apache on Windows with MySQL as the database backend.
Re:Windows (Score:2)
Re:Windows (Score:5, Informative)
In linux by default in a lot of distributions being able to connect from network is disabled in mysql, or sets root password as php password, so the risk of that kind of worm (well, for systems that don't have even a basic firewall configured) is pretty low.
Re:Windows (Score:3, Interesting)
How does the installer do this, considering that root password is stored in hashed format, and thus should be theoretically unviewable ? Does the installer brute-force it, or does MySQL accept passwords in their hashed form, or does the installer simply ask the root password and then verify it ?
Re:Windows (Score:4, Informative)
Upshot: if you copy a scrambled password from one user to another, or out of
MySQL actually uses a different password hashing algorithm, unless you tweaked the source, but I think the parent is talking about PHPMyAdmin. This creates a standard
NB: it's generally a very bad idea to use the same password for login and database. One dodgy web hosting company I have experienced actually did this. The MySQL username and password have to be in your user directory somewhere, in plaintext, and they have to be world-readable so the Apache daemon can see them. Upshot: any user can see any other user's database username and password. {This is why the root/no password combination isn't so insecure as it looks.} Ordinarily, the PHP {or Perl or Python} interpreter gets them first, and the user only ever sees the output from the interpreter; but you can pay for an account with the same company, determine the directory structure reasonably easily, and use a simple PHP, Perl, Python or Bash script to traverse other users' directories looking for passwords. If the database username and password is the same as the UNIX password then you can have much fun, since these passwords are also good for FTP, POP3 and SSH.
I really need to remember to check the HTML option (Score:3, Informative)
The only reason I left it alone in the old PHPTriad package was that was how MySQL themselves ship the setup. The official MYSQL binaries have (unless it's changed very recently) *no* password on the root account unless you deliberately go and change it.
Re:Windows (Score:2)
Re:Windows (Score:2, Informative)
Re:Windows (Score:2)
What? (Score:2, Informative)
Re:What? (Score:2)
Not only that but the Cygwin port didn't scale too well. That was one of the real issues why the Windows port was so important even for those of us using Cygwin.
Re:That's why... (Score:4, Informative)
a) Are not firewalled to the world (who'd make a DB accessible directly to the Internet?)
b) Allow root/admin connections from the outside.
c) Have weak root/admin passwords.
You can chalk this one up to careless admins - something I'm sure PostgreSQL is not immune to either.
Re:That's why... (Score:5, Insightful)
Nothing is. Postgres folk can cry all they want, and so can MySQL, mSQL, Oracle, Informix, Sybase, Firebird, etc. It makes no difference. If you have no password, you can get into it.
Amazes me sometimes the rabidness of the db crowd. It's a database, folks. It stores data. It's not an AI.
Re:That's why... (Score:3, Insightful)
Re:That's why... (Score:3, Funny)
Solid reliability, transaction support, and a good security track record. Probably the best thing short of switching to an AS/400.
You are a chewley's gum representitive? and you're here stiring up all this commontion for what? To sell more gum?
Get outta here.
Re:That's why... (Score:2)
Vastly. By default, Postgres won't do anything. You need to actively administer it to accept even local connections, let alone activate TCP/IP.
Re:more windows problems on the way (Score:3)
I love that, they DO go together rather well.
I hope you see the irony of that =)
I can't believe some of those windows freaks that are still out there call themselves professionals.
Linux : by amateurs, for amateurs.
Re:That's why... (Score:3, Insightful)
That might be fine if your application uses only the features supported by all databases.
If you want more, you end up with a huge mess of bug-prone client side database operations. To ensure consistency of the data you have to do a HUGE amount of client side work because some databases don't support check constraints or constraint triggers. And all the other features it's the same deal: a huge amou
Re:Clarity (Score:3, Insightful)
Re:Clarity (Score:3, Insightful)
That'll be a tough one to patch...
Re:So it's the admins' fault? (Score:3, Funny)
When a clueless admin doesn't secure Windows, it's Windows' fault. But when a clueless admin doesn't secure an OSS application, it's the admin's fault.
Yes, you've got the drill down pat:
Whenever another windows security crisis arises, immediately try to make light of it with sarcasm like what you've written above. The whole idea is to start a flamewar, and divert attention away from the real issues. Extra points if you can m
Re:Clarity (Score:2, Insightful)
Nice try, but I you only took in a minor part of the equation, and so you fail
While it's true, the worm could probably intrude a *nix mySQL server that was open to the internet with a default password of ''... intrusion is only part of the game plan. The payload is the important part
In this case, I doubt that installing the exe on a *nix box is going to do much good. Even if the writer were to create a *nix specific script for the payload, I'm pretty sure it would be given the mysql uid/gid, and probabl
Re:Doesn't seem that vital of a worm (Score:2)
if you are downloading it and installing it then you obviously have a reson to use it, and are more likely to set an actual password.
I'd like to agree with you - I've installed MySQL (plus Apache and mod_php) on Windows boxes before now, for development (production server is a Solaris box, but my boss - for some bizarre reason - won't fork out for a Sparcstation for me ;) However - many developers I know believe that dev machines don't merit the same kind of hardening as production machines. "Hey! We're
Re:Doesn't seem that vital of a worm (Score:2, Insightful)
I'm not justifying what they're doing, but if they're behind a firewall then shouldn't they be safe from this worm? Surely the people getting infected are the people with MySQL ports open directly on the int0rweb *and* no hardening.
Maybe this'll serve as a wake-up call.
True!
Re:Doesn't seem that vital of a worm (Score:2)