cleaned out unused commented code
This commit is contained in:
@@ -108,15 +108,11 @@ RSpec.describe 'BeEF API Rate Limit' do
|
|||||||
passwds.push BEEF_PASSWD
|
passwds.push BEEF_PASSWD
|
||||||
apis = passwds.map { |pswd| BeefRestClient.new('http', ATTACK_DOMAIN, '3000', BEEF_USER, pswd) }
|
apis = passwds.map { |pswd| BeefRestClient.new('http', ATTACK_DOMAIN, '3000', BEEF_USER, pswd) }
|
||||||
l = apis.length
|
l = apis.length
|
||||||
#If this is failing with expect(test_api.auth()[:payload]["success"]).to be(true) expected true but received nil
|
|
||||||
#make sure in config.yaml the password = BEEF_PASSWD, which is currently 'beef'
|
|
||||||
(0..2).each do |again| # multiple sets of auth attempts
|
(0..2).each do |again| # multiple sets of auth attempts
|
||||||
# first pass -- apis in order, valid passwd on 9th attempt
|
# first pass -- apis in order, valid passwd on 9th attempt
|
||||||
# subsequent passes apis shuffled
|
# subsequent passes apis shuffled
|
||||||
puts "speed requesets" # all should return 401
|
puts "speed requesets" # all should return 401
|
||||||
(0..50).each do |i|
|
(0..50).each do |i|
|
||||||
# t = Time.now()
|
|
||||||
#puts "#{i} : #{t - t0} : #{apis[i%l].auth()[:payload]}"
|
|
||||||
test_api = apis[i%l]
|
test_api = apis[i%l]
|
||||||
expect(test_api.auth()[:payload]).to eql("401 Unauthorized") # all (unless the valid is first 1 in 10 chance)
|
expect(test_api.auth()[:payload]).to eql("401 Unauthorized") # all (unless the valid is first 1 in 10 chance)
|
||||||
# t0 = t
|
# t0 = t
|
||||||
@@ -124,8 +120,6 @@ RSpec.describe 'BeEF API Rate Limit' do
|
|||||||
# again with more time between calls -- there should be success (1st iteration)
|
# again with more time between calls -- there should be success (1st iteration)
|
||||||
puts "delayed requests"
|
puts "delayed requests"
|
||||||
(0..(l*2)).each do |i|
|
(0..(l*2)).each do |i|
|
||||||
# t = Time.now()
|
|
||||||
#puts "#{i} : #{t - t0} : #{apis[i%l].auth()[:payload]}"
|
|
||||||
test_api = apis[i%l]
|
test_api = apis[i%l]
|
||||||
if (test_api.is_pass?(BEEF_PASSWD))
|
if (test_api.is_pass?(BEEF_PASSWD))
|
||||||
expect(test_api.auth()[:payload]["success"]).to be(true) # valid pass should succeed
|
expect(test_api.auth()[:payload]["success"]).to be(true) # valid pass should succeed
|
||||||
|
|||||||
Reference in New Issue
Block a user