use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest140 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
String sql = //
"SELECT name, '******' password, createTime from user " + //
"where name like 'admin%' " + " AND 8600=CONVERT(INT,(SELECT CHAR(113)+CHAR(118)+CHAR(100)+CHAR(114)+CHAR(113)+(SELECT (CASE WHEN (8600=8600) THEN CHAR(49) ELSE CHAR(48) END))+CHAR(113)+CHAR(118)+CHAR(98)+CHAR(97)+CHAR(113))) AND '%'=''";
Assert.assertFalse(provider.checkValid(sql));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest141 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
String sql = "SELECT name, '******' password, createTime from user where length(name) = 999999.9 or ascii(substring((database()),1,1))=127";
Assert.assertFalse(provider.checkValid(sql));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest143 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
String sql = //
"SELECT" + //
" `Extent1`.`ID`, " + //
" `Extent1`.`State`, " + //
" `Extent1`.`CreateTime`, " + //
" `Extent1`.`UpdateTime`, " + //
" `Extent1`.`OpeningBank`, " + //
" `Extent1`.`BankAccount`, " + //
" `Extent1`.`BankAccountName`, " + //
" `Extent1`.`Zone`, " + //
" `Extent1`.`AccountantMobile`, " + //
" `Extent1`.`IsPublic`" + //
" FROM `paybank` AS `Extent1`" + //
" WHERE (`Extent1`.`State` > -1)" + " AND ((`Extent1`.`Zone`) = (CASE WHEN (1 IS NULL) THEN (1) ELSE (1) END))";
Assert.assertTrue(provider.checkValid(sql));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest43 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertFalse(//
provider.checkValid(//
"SELECT COUNT(1) AS count FROM `team` " + "WHERE `team_type` = 'normal' AND 1 = 1 AND `city_id` IN (0,10)"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest43 method test_false2.
public void test_false2() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertFalse(//
provider.checkValid(//
"SELECT COUNT(1) AS count FROM `team` " + "WHERE `team_type` = 'normal' AND 1 = 2 AND `city_id` IN (0,10)"));
Assert.assertEquals(1, provider.getTableStats().size());
}
Aggregations