Fix code typo

This commit is contained in:
元炜
2017-02-20 14:10:24 +08:00
parent 349b1fdc97
commit b99eff3c90
5 changed files with 5 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ If the user inputs a user name or password as:
Then our SQL becomes the following: Then our SQL becomes the following:
SELECT * FROM user WHERE username='myuser' or 'foo'=='foo' --'' AND password='xxx' SELECT * FROM user WHERE username='myuser' or 'foo' = 'foo' --'' AND password='xxx'
In SQL, anything after `--` is a comment. Thus, inserting the `--` as the attacker did above alters the query in a fatal way, allowing an attacker to successfully login as a user without a valid password. In SQL, anything after `--` is a comment. Thus, inserting the `--` as the attacker did above alters the query in a fatal way, allowing an attacker to successfully login as a user without a valid password.

View File

@@ -32,7 +32,7 @@ If the user inputs a user name or password as:
Then our SQL becomes the following: Then our SQL becomes the following:
SELECT * FROM user WHERE username='myuser' or 'foo'=='foo' --'' AND password='xxx' SELECT * FROM user WHERE username='myuser' or 'foo' = 'foo' --'' AND password='xxx'
In SQL, anything after `--` is a comment. Thus, inserting the `--` as the attacker did above alters the query in a fatal way, allowing an attacker to successfully login as a user without a valid password. In SQL, anything after `--` is a comment. Thus, inserting the `--` as the attacker did above alters the query in a fatal way, allowing an attacker to successfully login as a user without a valid password.

View File

@@ -28,7 +28,7 @@ SQLインジェクションが発生する原因はプログラムがユーザ
我々のSQLは以下のようになります 我々のSQLは以下のようになります
SELECT * FROM user WHERE username='myuser' or 'foo'=='foo' --'' AND password='xxx' SELECT * FROM user WHERE username='myuser' or 'foo' = 'foo' --'' AND password='xxx'
SQLでは`--`はコメントを表します。そのため、検索クエリは途中で中断されます。攻撃者は合法的なユーザ名とパスワードを知らなくてもログインに成功します。 SQLでは`--`はコメントを表します。そのため、検索クエリは途中で中断されます。攻撃者は合法的なユーザ名とパスワードを知らなくてもログインに成功します。

View File

@@ -32,7 +32,7 @@ If the user inputs a user name or password as:
Then our SQL becomes the following: Then our SQL becomes the following:
SELECT * FROM user WHERE username='myuser' or 'foo'=='foo' --'' AND password='xxx' SELECT * FROM user WHERE username='myuser' or 'foo' = 'foo' --'' AND password='xxx'
In SQL, anything after `--` is a comment. Thus, inserting the `--` as the attacker did above alters the query in a fatal way, allowing an attacker to successfully login as a user without a valid password. In SQL, anything after `--` is a comment. Thus, inserting the `--` as the attacker did above alters the query in a fatal way, allowing an attacker to successfully login as a user without a valid password.

View File

@@ -35,7 +35,7 @@ SQL注入攻击SQL Injection简称注入攻击是Web开发中最常
那么我们的SQL变成了如下所示 那么我们的SQL变成了如下所示
```Go ```Go
SELECT * FROM user WHERE username='myuser' or 'foo'=='foo' --'' AND password='xxx' SELECT * FROM user WHERE username='myuser' or 'foo' = 'foo' --'' AND password='xxx'
``` ```
在SQL里面`--`是注释标记,所以查询语句会在此中断。这就让攻击者在不知道任何合法用户名和密码的情况下成功登录了。 在SQL里面`--`是注释标记,所以查询语句会在此中断。这就让攻击者在不知道任何合法用户名和密码的情况下成功登录了。