Professional Web Applications Themes

sql injection - MySQL

Hello, a couple of days ago I lost about 15% of the content of my db. I'm suspecting it was an sql injection problem... On that same day, I had users use up lots of bandwidth. Is it possible that somebody copied my database along with the pictures for each listing ? Are they able to grab all the info they want from the db if there possibility of sql injection, if so how would they do that, and how do i stop them from doing it? I mean I guess to stop them I need to fix all possible ...

  1. #1

    Default sql injection

    Hello, a couple of days ago I lost about 15% of the content of my db.
    I'm suspecting it was an sql injection problem... On that same day, I
    had users use up lots of bandwidth. Is it possible that somebody
    copied my database along with the pictures for each listing ? Are they
    able to grab all the info they want from the db if there possibility
    of sql injection, if so how would they do that, and how do i stop them
    from doing it? I mean I guess to stop them I need to fix all possible
    sql injections, but there are many ways to exploit this issue...
    thanks for your help.

    Kentor Guest

  2. #2

    Default Re: sql injection

    Kentor wrote: 

    What platform? What language? What are you doing?
    Have you read the "security" section of the MySQL manual?

    John Nagle
    John Guest

  3. #3

    Default Re: sql injection

    On Mar 30, 7:19 pm, John Nagle <com> wrote: 
    >
    > What platform? What language? What are you doing?
    > Have you read the "security" section of the MySQL manual?
    >
    > John Nagle[/ref]

    PHP/MYSQL/umm linux.../just want to see whos playing around with my db

    Kentor Guest

  4. #4

    Default Re: sql injection

    Kentor wrote: 
    >>
    >> What platform? What language? What are you doing?
    >>Have you read the "security" section of the MySQL manual?
    >>
    >> John Nagle[/ref]
    >
    >
    > PHP/MYSQL/umm linux.../just want to see whos playing around with my db[/ref]

    Ask in a PHP newsgroup. If there's a way to put SQL statements in
    via PHP, most of the problem is on the PHP side.

    John Nagle
    John Guest

  5. #5

    Default Re: sql injection

    Kentor wrote: 
    >> What platform? What language? What are you doing?
    >> Have you read the "security" section of the MySQL manual?
    >>
    >> John Nagle[/ref]
    >
    > PHP/MYSQL/umm linux.../just want to see whos playing around with my db
    >[/ref]

    If you have a form where the user can directly select a column/table name by
    typing it in a text box and you then use that without doing any checking

    example:

    mysql_query("SELECT * FROM ". $_POST['tablename']);

    By sending "; DROP TABLE SomeTableName" as table name and the following code
    would be executed at the mysql-server:
    SELECT * FROM ; DROP TABLE SomeTableName

    The first part would generate an error and the second part would delete from
    your table.

    If you have a way to generate some SQL files that the user can download, then
    they could have copied your database. Otherwise they could just have tried
    with force a load of dictionary words to find all the names for your tables.

    --

    //Aho
    J.O. Guest

  6. #6

    Default Re: sql injection

    J.O. Aho wrote: [/ref][/ref]
     

    Actually, no, not with MySQL and PHP. Multiple statements per
    "mysql_query" call are normally disabled for MySQL, and that includes
    calls from PHP. See

    http://dev.mysql.com/tech-resources/articles/guide-to-php-security-ch3.pdf

    It's possible to inject some SQL terms, such as to retrieve too much
    from the database, by adding some OR clause at the end that's always true.

    Of course, if your PHP code exposes the database passwords, you're toast.

    John Nagle
    John Guest

  7. #7

    Default Re: sql injection

    John Nagle wrote: [/ref]

    >
    > Actually, no, not with MySQL and PHP. Multiple statements per
    > "mysql_query" call are normally disabled for MySQL, and that includes
    > calls from PHP. See[/ref]

    I haven't noticed that there would be a such block, all mysql servers I have
    played with has nothing against to make more than one query.


    --

    //Aho
    J.O. Guest

Similar Threads

  1. SQL Injection
    By Arne in forum ASP.NET Security
    Replies: 5
    Last Post: May 6th, 02:56 AM
  2. SQL injection?
    By John in forum ASP.NET Data Grid Control
    Replies: 4
    Last Post: March 2nd, 12:58 AM
  3. Another Sql Injection
    By JR in forum ASP.NET Security
    Replies: 8
    Last Post: February 15th, 11:58 PM
  4. SQL Injection
    By A.M in forum Macromedia ColdFusion
    Replies: 24
    Last Post: August 22nd, 01:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139