sql-injection

Prevent sqlite INJECTION ATTACKS on your own iPhone?

I always take precautions regarding SQL INJECTION ATTACKS when data is saved between someone's iPhone and a remote database on the cloud. But is it also necessary to do the same... when just saving data (using sqlite) from someone's cell phone, to a database that's just on their own phone? What's the worse they can do? Delete their ow...

how to find and clean wordpress from script/s that changes your blog posts titles on Google and yahoo with embarrassing "Vigra text"?

one day after managing to defend against a massive DDoS attack now http://arabcrunch.com is hacked by someone who seems to change the posts title into Viagra ad on google search engine look how they damaged us: .google.com/search?hl=en&client=safari&rls=en&q=Viagra+Online+Pharmacy+-+Buy+Online+Viagra%2C+Cialis%2C+Levitra+wordpress+hack...

Does CakePHP have built-in functions to check for MySQL injections?

Does CakePHP check inputs to see if they are valid and not injections? If not, how would I go about implementing functions to check inputs? Most of Cake's processes are done behind the scenes, so I'm unsure of where I would do that. ...

SQL Injection in a Non-Web Application.

Does someone know of a good example of a SQL Injection vulnerability that isn't in a web application? What is the user input for this attack? I am looking for a real vulnerability, not speculation. The following picture is an example of a speculated attack. ...

PHP -- automatic SQL injection protection?

I took over maintenance of a PHP app recently and I'm not super familiar with PHP but some of the things I've been seeing on the site are making me nervous that it could be vulnerable to a SQL injection attack. For example, see how this code for logging into the administrative section works: $password = md5(HASH_SALT . $_POST['logi...

Parameterized SQL statements vs. very simple method

When I started to write the first SQL-Statements in my programs I felt quite comfortable with protecting myself against SQL-Injection with a very simple method that a colleague showed me. It replaced all single quotes with two single quotes. So for example there is a searchfield in which you can enter a customername to search in the cus...

Successful SQL Injection despite PHP Magic Quotes

I have always read that Magic Quotes do not stop SQL Injections at all but I am not able to understand why not! As an example, let's say we have the following query: SELECT * FROM tablename WHERE email='$x'; Now, if the user input makes $x=' OR 1=1 --, the query would be: SELECT * FROM tablename WHERE email='\' OR 1=1 --'; The ...

injection attack (I thought I was protected!) <?php /**/eval(base64_decode( everywhere

I've got a fully custom PHP site with a lot of database calls. I just got injection hacked. This little chunk of code below showed up in dozens of my PHP pages. <?php /**/ eval(base64_decode(big string of code.... I've been pretty careful about my SQL calls and such; they're all in this format: $query = sprintf("UPDATE Sales SET `S...

Recovering From An SQL Injection

Let's not go so far as to say that I'm paranoid, but I've been spending hour after hour learning how to prevent SQL injections (and XSS for what it's worth). What I'm wondering is that a SQL injection doesn't seem like it would do permanent harm to my database if I've made daily backups. Doesn't importing yesterday's copy of my tables ...

url Query and Security

In url query with id I use is_numeric($_GET['id']) for security issues. But in query with for example category name, is urlencode() a right way for security? Thanks in advance. ...

codeigniter admin login hacked although I have used all security matters

hi friends, how come have the code before hacked with SQL Injection :( $query = $this->db->query("SELECT * FROM users WHERE username = ? AND password = ?", array(mysql_real_escape_string($this->input->post('username')), mysql_real_escape_string(MD5($this->input->post('password'))))); appreciate helps!! ...

Is this an injection attempt or a normal request?

In cPanel's Analog Stats statistics module, I've noticed countless requests to connect to the following example: /?x=19&y=15 The numbers are random, but its always setting x and y variables. Another category of mysterious requests: /?id=http://nic.bupt.edu.cn/media/j1.txt?? There are other attempts at injections in the request log...

Test my forms for proper query escaping

CodeIgniter claims do sanitize POST variables. I'm also using DataMapper which I believe also does it's own thing. I would like to double check to make sure it's doing what it's supposed to be doing. How can I do this? I'd like to test this without destroying anything, would typing random escaped characters work? What should I see enter...

MySQL INJECTION Solution...

I have been bothered for so long by the MySQL injections and was thinking of a way to eliminate this problem all together. I have came up with something below hope that many people will find this useful. The only Draw back I can think of this is the partial search: Jo =>returns "John" by using the like %% statement. Here is a php solu...

How do I protect against cross-site scripting?

I am using php, mysql with smarty and I places where users can put comments and etc. I've already escaped characters before inserting into database for SQL Injection. What else do I need to do? ...

Signs that a SQL statement is dangerous

Hi, I want to develop a function in PHP that checks how dangerous a SQL statement is. When i say dangerous i mean, certain symbols, characters or strings that are used to get data from a database that the user shouldnt see. For example: SELECT * FROM users WHERE userId = '1' can be injected in several ways. Although i clean the par...

Can PHP's PDO be limited to a single query?

PHP's PDO allows multiple querys to be executed at once, either via the query() method or as a prepared statement. Both of the following examples work: // Two SQL queries $query = "SELECT * FROM table; DROP table;" // Execute via query() $pdo->query($query); // Execute via prepared statement $stmt = $pdo->prepare($query); $stmt->execu...

Is this a secure way to structure a mysql_query in PHP

I have tried and tried to achieve an SQL injection by making custom queries to the server outside of firefox. Inside the php, all variables are passed into the query in a string like this. Note, by this stage, $_POST has not been touched. mysql_query('INSERT INTO users (password, username) VALUES(' . sha1($_POST['password']) . ',' . $...

i want to know about sql injection

hi, friends I want to know about sql injection So, please help me Thanks! ...

Prevent SQL injection from form-generated SQL - NO PreparedStmts

Hi all, I have a search table where user will be able to filter results with a filter of the type: Field [Name], Value [John], Remove Rule Field [Surname], Value [Blake], Remove Rule Field [Has Children], Value [Yes], Remove Rule Add Rule So the user will be able to set an arbitrary set of filters, which will result essentially in a...