数据库漏洞

xiaoxiao2021-02-28  46

String str = new Scanner(System.in).nextline;

System.out.println( statement.execute(("select * from test4 where (username=1 and usercode=")+str));

若用户输入 'aa') or 1=1 则 会构成完整语句:

select * from test4 where (username=1 and usercode=“aa”) or 1=1;

1=1为恒为true,因此整个where恒为true;

转载请注明原文地址: https://www.6miu.com/read-2623476.html

最新回复(0)