简体   繁体   English

将javascript函数的返回值粘贴到Excel中(字典“攻击”)

[英]Paste returns of a javascript function into Excel (dictionary “attack”)

I have a Website that use a javascript function to validate a 5 characters text. 我有一个使用javascript函数验证5个字符的文本的网站。

The HTML code is like this: HTML代码是这样的:

<p class="form-control-static ret">
            Input your Text:
            <input type="text" name="text_input" id="text_input" maxlength="5" value="">
            <button class="validate-button" id="btn">Check!</button>
          </p> 

<script type="text/javascript">
              $(document).ready(function(){
                $("#btn").click(function(e){ 
                  e.preventDefault();
                  location.href = "https://www.url_here?sc=" + $('#text_input').val();
                });
              });
              </script>

The 5 characters text goes directly in the URL. 5个字符的文本直接在URL中。

Examples: 例子:

https://www.url_here?sc=ABCDE https://www.url_here?sc = ABCDE

https://www.url_here?sc=ATTEF https://www.url_here?sc = ATTEF

Is is possible to make a Macro on Excel that try all URls with the given options and paste in a Spread sheet the texts that returned True? 是否可以在Excel上制作一个宏,以给定的选项尝试所有URls,并将返回True的文本粘贴到电子表格中?

Or, does it have an easiest way to do that? 或者,它有最简单的方法吗?

All i need is an automatically dictionary "attack". 我需要的只是一个自动词典“攻击”。

You need a remote controllable application to make http requests. 您需要一个可远程控制的应用程序才能发出http请求。 I'd recommend the command line tool "wget". 我建议使用命令行工具“ wget”。

Then write a VBA-script that reads the lines in excel and calls "wget" each time. 然后编写一个VBA脚本,该脚本读取excel中的行并每次都调用“ wget”。

If you want more options, you could have a look to the complex and sophisticated tool "JMeter". 如果您想要更多选择,可以看看复杂而复杂的工具“ JMeter”。

26^5 = 11881376 (only counting CAPITAL LETTERS), so your site would have to address this many service calls if you want to do it this way. 26 ^ 5 = 11881376(仅计算大写字母),因此,如果您要这样做,您的站点将不得不处理这么多服务调用。

If you want to test this, I would refactor the server side code, separate the validation function, and call it internally with a key generator. 如果要测试,我将重构服务器端代码,分离验证函数,并使用密钥生成器在内部对其进行调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM