how to protect web server against SQL Injection ?

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default how to protect web server against SQL Injection ?

    i didnt find any information where to start . please write something


    hoz Guest

  2. Similar Questions and Discussions

    1. SQL Injection
      Hi, I have to check all textboxes in my web application for SQL injection. Is there any ready product that detect SQL inhection patterns? A...
    2. What is CF injection?
      Hello people We are doing a security revision of our application, with the help of some consultants. They alerted us to the risc of ColdFusion...
    3. SQL Injection Vulnerabilities
      In the May 29th, 2005 listserv message from cflib.org, they mention this function, sqlSafe(): http://www.cflib.org/udf.cfm?id=1219 The function...
    4. Has ColdFusion MX taken care of SQL injection ?
      Has ColdFusion MX taken care of SQL injection ? The reason is that when I tried to test my own application without using <cfqueryparam ...> it...
    5. Preventing SQL Injection Attacks
      In article <qdu3gvs8qq052805u6rtb08gmc1bblv5oc@4ax.com>, James wrote: This is an option and most effective: $query = "select * from sample...
  3. #2

    Default Re: how to protect web server against SQL Injection ?

    just use stored procedures.. It is a certain solution...

    --
    Thanks,
    Yunus Emre ALPÖZEN



    "hoz" <ask@me.com> wrote in message
    news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    >i didnt find any information where to start . please write something
    >
    >

    Yunus Emre ALPÖZEN Guest

  4. #3

    Default Re: how to protect web server against SQL Injection ?

    Hi ,
    i have already used sp but i am not sure if this would be sufficient.
    I am going to read your articles .
    Saygilarla
    Hasan
    "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    > just use stored procedures.. It is a certain solution...
    >
    > --
    > Thanks,
    > Yunus Emre ALPÖZEN
    >
    >
    >
    > "hoz" <ask@me.com> wrote in message
    > news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    > >i didnt find any information where to start . please write something
    > >
    > >
    >
    >

    hoz Guest

  5. #4

    Default Re: how to protect web server against SQL Injection ?

    Use parametised queries and stored procedures. As long as you don't execute
    (using Exec()) arbitrary strings in your sprocs, you should be fine.

    Cheers
    Ken


    "hoz" <ask@me.com> wrote in message
    news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    > Hi ,
    > i have already used sp but i am not sure if this would be sufficient.
    > I am going to read your articles .
    > Saygilarla
    > Hasan
    > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    >> just use stored procedures.. It is a certain solution...
    >>
    >> --
    >> Thanks,
    >> Yunus Emre ALPÖZEN
    >>
    >>
    >>
    >> "hoz" <ask@me.com> wrote in message
    >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> >i didnt find any information where to start . please write something
    >> >
    >> >
    >>
    >>
    >
    >

    Ken Schaefer Guest

  6. #5

    Default Re: how to protect web server against SQL Injection ?

    Thanks for your answer .
    I think i have already solved my question at the begining , using sp's

    "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    news:ONpm0pNCFHA.3504@TK2MSFTNGP12.phx.gbl...
    > Use parametised queries and stored procedures. As long as you don't
    execute
    > (using Exec()) arbitrary strings in your sprocs, you should be fine.
    >
    > Cheers
    > Ken
    >
    >
    > "hoz" <ask@me.com> wrote in message
    > news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    > > Hi ,
    > > i have already used sp but i am not sure if this would be sufficient.
    > > I am going to read your articles .
    > > Saygilarla
    > > Hasan
    > > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    > > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    > >> just use stored procedures.. It is a certain solution...
    > >>
    > >> --
    > >> Thanks,
    > >> Yunus Emre ALPÖZEN
    > >>
    > >>
    > >>
    > >> "hoz" <ask@me.com> wrote in message
    > >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    > >> >i didnt find any information where to start . please write something
    > >> >
    > >> >
    > >>
    > >>
    > >
    > >
    >
    >

    hoz Guest

  7. #6

    Default Re: how to protect web server against SQL Injection ?

    Here is something to look at, I call this function and pass the typed in
    username and password to this function before hashing, calling any stored
    procedures, and doing any authentication that you might be doing. I think
    someone else passed this on to me previously....

    Public Function SafeSqlLikeClauseLiteral(ByVal inputSQL As String) As String

    ' Make the following replacements:

    ' ' becomes ''

    ' [ becomes [[]

    ' % becomes [%]

    ' _ becomes [_]

    Dim s As String = inputSQL

    s = inputSQL.Replace("'", "''")

    s = s.Replace("[", "[[]")

    s = s.Replace("%", "[%]")

    s = s.Replace("_", "[_]")

    Return (s)

    End Function





    "hoz" <ask@me.com> wrote in message
    news:OHgjZ%23QCFHA.3092@TK2MSFTNGP10.phx.gbl...
    > Thanks for your answer .
    > I think i have already solved my question at the begining , using sp's
    >
    > "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    > news:ONpm0pNCFHA.3504@TK2MSFTNGP12.phx.gbl...
    > > Use parametised queries and stored procedures. As long as you don't
    > execute
    > > (using Exec()) arbitrary strings in your sprocs, you should be fine.
    > >
    > > Cheers
    > > Ken
    > >
    > >
    > > "hoz" <ask@me.com> wrote in message
    > > news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    > > > Hi ,
    > > > i have already used sp but i am not sure if this would be sufficient.
    > > > I am going to read your articles .
    > > > Saygilarla
    > > > Hasan
    > > > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    > > > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    > > >> just use stored procedures.. It is a certain solution...
    > > >>
    > > >> --
    > > >> Thanks,
    > > >> Yunus Emre ALPÖZEN
    > > >>
    > > >>
    > > >>
    > > >> "hoz" <ask@me.com> wrote in message
    > > >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    > > >> >i didnt find any information where to start . please write something
    > > >> >
    > > >> >
    > > >>
    > > >>
    > > >
    > > >
    > >
    > >
    >
    >

    Andy G Guest

  8. #7

    Default Re: how to protect web server against SQL Injection ?

    Stored procedures are not enough.

    Parametised Queries are required as well.

    Cheers
    Ken


    "hoz" <ask@me.com> wrote in message
    news:OHgjZ%23QCFHA.3092@TK2MSFTNGP10.phx.gbl...
    > Thanks for your answer .
    > I think i have already solved my question at the begining , using sp's
    >
    > "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    > news:ONpm0pNCFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> Use parametised queries and stored procedures. As long as you don't
    > execute
    >> (using Exec()) arbitrary strings in your sprocs, you should be fine.
    >>
    >> Cheers
    >> Ken
    >>
    >>
    >> "hoz" <ask@me.com> wrote in message
    >> news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    >> > Hi ,
    >> > i have already used sp but i am not sure if this would be sufficient.
    >> > I am going to read your articles .
    >> > Saygilarla
    >> > Hasan
    >> > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    >> > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    >> >> just use stored procedures.. It is a certain solution...
    >> >>
    >> >> --
    >> >> Thanks,
    >> >> Yunus Emre ALPÖZEN
    >> >>
    >> >>
    >> >>
    >> >> "hoz" <ask@me.com> wrote in message
    >> >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> >> >i didnt find any information where to start . please write something
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >
    >>
    >>
    >
    >

    Ken Schaefer Guest

  9. #8

    Default Re: how to protect web server against SQL Injection ?

    I would say that trying to use functions like this is a waste of time...

    Cheers
    Ken


    "Andy G" <ajgould@iastate.edu> wrote in message
    news:eI19wEjCFHA.3592@TK2MSFTNGP09.phx.gbl...
    > Here is something to look at, I call this function and pass the typed in
    > username and password to this function before hashing, calling any stored
    > procedures, and doing any authentication that you might be doing. I think
    > someone else passed this on to me previously....
    >
    > Public Function SafeSqlLikeClauseLiteral(ByVal inputSQL As String) As
    > String
    >
    > ' Make the following replacements:
    >
    > ' ' becomes ''
    >
    > ' [ becomes [[]
    >
    > ' % becomes [%]
    >
    > ' _ becomes [_]
    >
    > Dim s As String = inputSQL
    >
    > s = inputSQL.Replace("'", "''")
    >
    > s = s.Replace("[", "[[]")
    >
    > s = s.Replace("%", "[%]")
    >
    > s = s.Replace("_", "[_]")
    >
    > Return (s)
    >
    > End Function
    >
    >
    >
    >
    >
    > "hoz" <ask@me.com> wrote in message
    > news:OHgjZ%23QCFHA.3092@TK2MSFTNGP10.phx.gbl...
    >> Thanks for your answer .
    >> I think i have already solved my question at the begining , using sp's
    >>
    >> "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    >> news:ONpm0pNCFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> > Use parametised queries and stored procedures. As long as you don't
    >> execute
    >> > (using Exec()) arbitrary strings in your sprocs, you should be fine.
    >> >
    >> > Cheers
    >> > Ken
    >> >
    >> >
    >> > "hoz" <ask@me.com> wrote in message
    >> > news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    >> > > Hi ,
    >> > > i have already used sp but i am not sure if this would be
    >> > > sufficient.
    >> > > I am going to read your articles .
    >> > > Saygilarla
    >> > > Hasan
    >> > > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    >> > > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    >> > >> just use stored procedures.. It is a certain solution...
    >> > >>
    >> > >> --
    >> > >> Thanks,
    >> > >> Yunus Emre ALPÖZEN
    >> > >>
    >> > >>
    >> > >>
    >> > >> "hoz" <ask@me.com> wrote in message
    >> > >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> > >> >i didnt find any information where to start . please write
    >> > >> >something
    >> > >> >
    >> > >> >
    >> > >>
    >> > >>
    >> > >
    >> > >
    >> >
    >> >
    >>
    >>
    >
    >

    Ken Schaefer Guest

  10. #9

    Default Re: how to protect web server against SQL Injection ?

    I don't agree with you. What happens if user try injection with escaped
    characters??? It depends on your database management system. Assume that
    your DBMS uses \ as escaped character. But just think about \' character.
    Your code will change this string as follows \'' which is valid for sql
    injection.
    To test SQL Injection generally use something like this:
    a' OR 1=1--
    For your case, it becomes as a\' OR 1=1

    And also i would like to ask something to Ken Schaefer. Is there any example
    that stored procedures are not enough?

    In MSDN TV, I watched something about MS SQL Server which introduces stored
    procedures as a unique solution for sql injection attacks.. Are u sure?
    --
    Thanks,
    Yunus Emre ALPÖZEN



    "Andy G" <ajgould@iastate.edu> wrote in message
    news:eI19wEjCFHA.3592@TK2MSFTNGP09.phx.gbl...
    > Here is something to look at, I call this function and pass the typed in
    > username and password to this function before hashing, calling any stored
    > procedures, and doing any authentication that you might be doing. I think
    > someone else passed this on to me previously....
    >
    > Public Function SafeSqlLikeClauseLiteral(ByVal inputSQL As String) As
    > String
    >
    > ' Make the following replacements:
    >
    > ' ' becomes ''
    >
    > ' [ becomes [[]
    >
    > ' % becomes [%]
    >
    > ' _ becomes [_]
    >
    > Dim s As String = inputSQL
    >
    > s = inputSQL.Replace("'", "''")
    >
    > s = s.Replace("[", "[[]")
    >
    > s = s.Replace("%", "[%]")
    >
    > s = s.Replace("_", "[_]")
    >
    > Return (s)
    >
    > End Function
    >
    >
    >
    >
    >
    > "hoz" <ask@me.com> wrote in message
    > news:OHgjZ%23QCFHA.3092@TK2MSFTNGP10.phx.gbl...
    >> Thanks for your answer .
    >> I think i have already solved my question at the begining , using sp's
    >>
    >> "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    >> news:ONpm0pNCFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> > Use parametised queries and stored procedures. As long as you don't
    >> execute
    >> > (using Exec()) arbitrary strings in your sprocs, you should be fine.
    >> >
    >> > Cheers
    >> > Ken
    >> >
    >> >
    >> > "hoz" <ask@me.com> wrote in message
    >> > news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    >> > > Hi ,
    >> > > i have already used sp but i am not sure if this would be
    >> > > sufficient.
    >> > > I am going to read your articles .
    >> > > Saygilarla
    >> > > Hasan
    >> > > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    >> > > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    >> > >> just use stored procedures.. It is a certain solution...
    >> > >>
    >> > >> --
    >> > >> Thanks,
    >> > >> Yunus Emre ALPÖZEN
    >> > >>
    >> > >>
    >> > >>
    >> > >> "hoz" <ask@me.com> wrote in message
    >> > >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    >> > >> >i didnt find any information where to start . please write
    >> > >> >something
    >> > >> >
    >> > >> >
    >> > >>
    >> > >>
    >> > >
    >> > >
    >> >
    >> >
    >>
    >>
    >
    >

    Yunus Emre ALPÖZEN Guest

  11. #10

    Default Re: how to protect web server against SQL Injection ?

    i am certainly sure if sp are enough .
    But i think also , Parametised Queries are waste of sources.
    if a user enters " ' " to try to replace . When user enters the ascii code
    of " ' " , what will happen ? and so on . you cant check it everything i
    think.

    "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    news:#01iqXoCFHA.3416@TK2MSFTNGP09.phx.gbl...
    > Stored procedures are not enough.
    >
    > Parametised Queries are required as well.
    >
    > Cheers
    > Ken
    >
    >
    > "hoz" <ask@me.com> wrote in message
    > news:OHgjZ%23QCFHA.3092@TK2MSFTNGP10.phx.gbl...
    > > Thanks for your answer .
    > > I think i have already solved my question at the begining , using sp's
    > >
    > > "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    > > news:ONpm0pNCFHA.3504@TK2MSFTNGP12.phx.gbl...
    > >> Use parametised queries and stored procedures. As long as you don't
    > > execute
    > >> (using Exec()) arbitrary strings in your sprocs, you should be fine.
    > >>
    > >> Cheers
    > >> Ken
    > >>
    > >>
    > >> "hoz" <ask@me.com> wrote in message
    > >> news:edVOgd4BFHA.1452@TK2MSFTNGP11.phx.gbl...
    > >> > Hi ,
    > >> > i have already used sp but i am not sure if this would be
    sufficient.
    > >> > I am going to read your articles .
    > >> > Saygilarla
    > >> > Hasan
    > >> > "Yunus Emre ALPÖZEN" <yemre@msakademik.net> wrote in message
    > >> > news:eA9WwV4BFHA.612@TK2MSFTNGP09.phx.gbl...
    > >> >> just use stored procedures.. It is a certain solution...
    > >> >>
    > >> >> --
    > >> >> Thanks,
    > >> >> Yunus Emre ALPÖZEN
    > >> >>
    > >> >>
    > >> >>
    > >> >> "hoz" <ask@me.com> wrote in message
    > >> >> news:u4%23$$y3BFHA.3504@TK2MSFTNGP12.phx.gbl...
    > >> >> >i didnt find any information where to start . please write
    something
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>
    > >
    > >
    >
    >

    hoz Guest

Posting Permissions

  • You may not post new threads
  • You may 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