sql-injection

SQL Injection Compromised site?

This may sound like a weird question but is there any where I can download a website that is vulnerable to sql injection the url kind not login bypass? I'm making a vulnerability scanner and I want to learn some SQLi so i can include it in my project. Thanks, it doesn't need to be fancy. Just enough to practice on. ...

MySQLi Prepared Statements?

Hi, I have decided to take the plunge into the improved MySQL by using MySQLI . Problem is i cannot find any in depth yet simply put tutorials online. The ones i have found are very short and or does not really explain anything. I know you have the php website but to tell you the truth it is really not a easy tutorial to follow, it's a...

PHP - Single Quotes Filtering

i have some HTML code saved in a PHP string $str = "<font size=2 color=#e0e0e0>you don't have a clue</font>"; i have to write this string to DB so the $str has to become part of the query.. now whatever my query... its working fine as long as there are no 'SINGLE QUOTES in the string.... any of the following two will solve my prob...

SQL injections with noSQL databases?

Hi guys, I am using mongoDB currently, and I am wondering what measures we should take to ensure that any data that could cause problems isn't stored. I believe that normal PHP functions like mysql_escape_string isn't going to help here... Is there SQL injections for noSQL databases and especially mongoDB? If so, what can we do to prot...

PHP function to sanitize all data

Is it a good, or stupid idea to sanitize all the data that could be sqlinjected? I wrote a function that should do it, but I've never seen it done and was wondering if it was a poor idea. The function I wrote: function sanitizeData() { $_SERVER['HTTP_USER_AGENT'] = mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']); foreach(...

How do I exploit "EXEC @sql"?

My co-worker is being unsafe with his code and is allowing a user to upload an SQL file to be run on the server. He strips out any key words in the file such as "EXEC", "DROP", "UPDATE", "INSERT", "TRUNC" I want to show him the error of his ways by exploiting his EXEC ( @sql ) My first attempt will be with 'EXEXECEC (N''SELECT ''You D...

Can I avoid all SQL-injection attacks by using parameters?

Can I avoid all SQL-injection attacks by using parameters? And don't worry about any thing in SQL injection in this case? Or are there some types of these attacks which require more care on the part of the programmer? ...

MYSQL disable SELECT BENCHMARK

Hi, how would I disable the mysql benchmark function, thus not being subject to blind sql injection attacks such as "select if( user() like 'root@%', benchmark(100000,sha1('test')), 'false' );" select * from func does not show up a function benchmark. Kind Regards Charles ...

Does using preparedStatement mean there will not be any SQL Injection?

I have read that to prevent SQL Injection one must use PreparedStatement. Does that mean if i am using perparedStatement then no one can perform SQL Injection in any of my page? Is it foolproof against SQL Injection? If not then please give some example to demonstrate this. ...

Need help with this XSS attack

Did anybody know more information about this attack ? I recently got this script injected in my web sites By the way dont go on this web site since it's the source of the infection </title><script src=http://google-stats50.**fo/***.php&gt; What kind of attack is it, SQL or CODE ? By the way dont go on this web site since it's the ...

Detect SQL Injection

I came to a company that already has a fully grown project... but coders that worked here before me didn't follow conventions and didn't use parametrized SQL queries... as a result there is over 1000 places in a very huge project that can possibly be vulnerable to SQL injection... I need to find a solution that will automatically detec...

Has anyone found out how this was done? SQL Injection

Since so many other websites have been hit I have to assume it is a bot! It has injected a script with: Yesterday: http://google-stats50.info/ur.php Today: http://google-stats49.info/ur.php It injected it into multiple tables. First, how did it identify the tables and columns? Second, what should I search for in the logs to identify...

Multiple rows for insert command - Apostrophe problem

I'm trying to insert multiple rows using SqlCommand from C# to SQL Server. I'm forming a simple query as below: Insert into temp(field1, field2) values (1, 'test'), (2, 'test1'), (3, 'test2') and so on till 100 rows. For the example purpose I only gave couple of fields here but it actually contains 25 fields and 20 out of this are strin...

XSS Attack on the ASP.NET Website

Hi All, I am in a very big trouble. Please help!!!!!!!!!! My website has been attacked by some malicious script < / title> < script src = http : // google-stats50.info/ur.php >. This script is appended to any column(s) of some table automatically. I have removed this script. But after a few hours, it re-appeared in some tables. But thi...

SQL Injection and Codeigniter

Some doubts regarding Codeigniter and its Input handling capabilities. Some may be a little weird but they are doubts none-the-less. If I use the Active Record Class functions in CodeIgniter, is my input prevented against SQL injection? I read somewhere that it does, but I don't understand it how? or why? Also does xssclean deal with S...

Have you ever done SQL injection?

Hi all, I want to know if you have ever performed injection on a website using SQL injection for ethical hacking. What tricks/techniques have you have used (especially mysql)? ...

How to accept programming code input for displaying purposes?

What is the safest way to accept user inputted programming code in PHP, store it in database and display it back with the HTML pre tag? I currently convert the input to HTML entities, but I somehow think it wouldn't be that easy... Any suggestions? ...

MySql Query:: How to solve the problem of 's in data, when query is fired

I am facing such problem in which 's is present in data. while searching it does not shows data. I wanna remove SQL injection issue Code :: @search_condition = "" if !search_text.nil? search_field = search_text.split("-") @search_condition = "( address_books.organization_name like '#{search_text}%' or...

quote marks in sql causing problems

Hello all, I have a simple html input textbox in a very simple form. the information form this form is transmitted to a mysql database with an sql string. Everything works slick, except when someone types " or '. I don't want to limit the users as to what they can type. Should I do a find and replace to the string before I run the que...

Is it possible to only allow img tags in html comment post?

I have a comment form on my website which, at the moment I filter out all html and turn it into plain text and also replace bad words with funny words. I want to be able to allow users to post images. I couldn't see how to incorporate this to the comment page so have set it up on a separate page just dedicated to users posting images. Bu...