From 42b5a4fe58847856ea49fbb0c201d4f26c7b74a4 Mon Sep 17 00:00:00 2001 From: Centos 7 beef VM Date: Thu, 5 Dec 2019 10:22:35 -0800 Subject: [PATCH] should kill the issues with dns --- spec/beef/api/auth_rate_spec.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spec/beef/api/auth_rate_spec.rb b/spec/beef/api/auth_rate_spec.rb index 8af5eb78d6..6838ec0395 100644 --- a/spec/beef/api/auth_rate_spec.rb +++ b/spec/beef/api/auth_rate_spec.rb @@ -14,17 +14,23 @@ @config = BeEF::Core::Configuration.instance http_hook_server = BeEF::Core::Server.instance http_hook_server.prepare - BeEF::API::Registrar.instance.fire(BeEF::API::Server, 'pre_http_start', http_hook_server) + @pids = fork do + BeEF::API::Registrar.instance.fire(BeEF::API::Server, 'pre_http_start', http_hook_server) + end @pid = fork do http_hook_server.start end # wait for server to start sleep 1 end - - after(:all) do - Process.kill("INT",@pid) - end + # wait for server to start + + after(:all) do + + Process.kill("INT",@pid) + Process.kill("INT",@pids) + + end it 'adheres to auth rate limits' do passwds = (1..9).map { |i| "broken_pass"} @@ -59,7 +65,7 @@ # t0 = t end apis.shuffle! # new order for next iteration - apis.reverse if (apis[0].is_pass?(BEEF_PASSWD)) # prevent the first from having valid passwd + apis = apis.reverse if (apis[0].is_pass?(BEEF_PASSWD)) # prevent the first from having valid passwd end # multiple sets of auth attempts end