SQL injection that gets around mysql_real_escape_string()

The short answer is yes, yes there is a way to get around mysql_real_escape_string(). #For Very OBSCURE EDGE CASES!!! The long answer isn’t so easy. It’s based off an attack demonstrated here. The Attack So, let’s start off by showing the attack… mysql_query(‘SET NAMES gbk’); $var = mysql_real_escape_string(“\xbf\x27 OR 1=1 /*”); mysql_query(“SELECT * FROM test … Read more

How Secure Is This Login System? (Using Cookies In PHP)

Here’s a non-exhaustive list of problems/solutions: Your code is difficult to read because it is not properly indented. You should use prepared statemens to guard against SQL-injection. You give hints to hackers by having different error messages. When the username is correct and the password wrong you say: “Login/Password Incorrect :(“, but if the username … Read more

How to secure javascript code from being run on other domain (stolen) ? need more ideas

No matter how complex you make your code, it can always be read, if necessary with abstract interpretation, i.e. automatically capturing the essence of your code. Code without knowledge of internals, variable names (I assume you’re already using minimization, for example with the YUI compressor), documentation, support, and generalization is worthless for anyone else. If … Read more