GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — SQL Inject SQL Inject
JoyChou edited this page
访问 正常访问 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `isAdmin` varchar(255) NOT NULL, `id` int(10) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Records of users -- ---------------------------- BEGIN; INSERT INTO `users` VALUES ('joychou', '123', '1', 1); INSERT INTO `users` VALUES ('wilson', '456', '0', 2); INSERT INTO `users` VALUES ('lightless', '789', '0', 3); COMMIT; SET FOREIGN_KEY_CHECKS = 1; SQL注入修复方式采用预处理方式,修复见代码。 预处理的修复原理:针对字符串类型的SQL注入,是在字符串两边加上一对单号哈 在使用了mybatis框架后,需要进行排序功能时,在mapper.xml文件中编写SQL语句时,注意orderBy后的变量要使用 根据下面的结果可以发现 select * from users order by 'username' desc -- 结果为 joychou wilson lightless select * from users -- 结果为 joychou wilson lightless select * from users order by username -- 结果为 joychou lightless wilson select * from users order by username desc -- 结果为 wilson lightless joychou Clone this wiki locally |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |