如何正确测试我的Ruby on Rails网站上的暴力?

我在我的网站上放置了一个蜜罐验证码,我想用暴力攻击来测试它。 所以我使用密码列表和我的实际密码来运行Hydra强力工具。 Hydra不会在我的网站上找到密码。
我尝试美杜莎和Ncrack,他们似乎也不太好。 我注意到这些程序似乎需要文件扩展名,例如www.website.com/login.php,而不仅仅是www.website.com/login目录。 Rails实际上是否在url中提供扩展? .html,.rb或类似的东西?
这对我来说似乎是件好事,但我知道有些东西可以运行暴力。 我很好奇我的登录页面会如何保留,因为我没有运行Devise来限制登录尝试。


如果你熟悉使用rspec,selenium,水豚等webkit进行测试,下面是我简单思考的例子:

scenario 'test brute force' do
  usernames = File.readlines('data/usernames.txt')
  passwords = File.readlines('data/passwords.txt')

  usernames.each do |username|
    passwords.each do |password|
      visit customer_login_path
      fill_in('Username', with: username.gsub(/n|r/,''))
      fill_in('Password', with: password.gsub(/n|r/,''))
      click_button('Login')
      expect(page).to have_css('.alert.in.alert-danger', text: 'Username or password is invalid')
    end
  end
end
链接地址: http://www.djcxy.com/p/21663.html

上一篇: How to test my Ruby on Rails website against brute force properly?

下一篇: How do big websites implement brute force login protection?