数据库漏洞


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;

猜你喜欢

转载自blog.csdn.net/steppppup/article/details/79573195
今日推荐