Found 'OR 1=1/* sql injection in my newsletter database

后端 未结 4 1436
北海茫月
北海茫月 2021-02-07 04:02

I found the following in the \"e-mail\" field of my newsletter subscriber database: \' OR 1=1/*

I know it\'s a SQL injection, but that\'s it. I\'ve goog

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 04:39

    'OR 1=1 is an attempt to make a query succeed no matter what
    The /* is an attempt to start a multiline comment so the rest of the query is ignored.

    An example would be

    SELECT userid 
    FROM users 
    WHERE username = ''OR 1=1/*' 
        AND password = ''
        AND domain = ''
    

    As you can see if you were to populate the username field without escaping the ' no matter what credentials the user passes in the query would return all userids in the system likely granting access to the attacker (possibly admin access if admin is your first user). You will also notice the remainder of the query would be commented out because of the /* including the real '.

    The fact that you can see the value in your database means that it was escaped and that particular attack did not succeed. However, you should investigate if any other attempts were made.

提交回复
热议问题