1、除了SQL注入外还要考虑XPTH的过滤。
File d = new File(dir); XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); InputSource inputSource = new InputSource(new FileInputStream(d)); String expression = "/employees/employee[loginID/text()=‘" + username + "‘ and passwd/text()=‘" + password + "‘]"; nodes = (NodeList) xPath.evaluate(expression, inputSource, XPathConstants.NODESET);
在用户名处注入 Smith‘ or 1=1 or ‘a‘=‘a,这将会显示你登录系统的第一个用户。密码是必须的字段,可以任意输入。
时间: 2024-08-03 03:47:31