From f5e0dddd3c6f1983652d80dc47f0f2a310f49581 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Fri, 13 Feb 2015 11:48:10 -0600 Subject: [PATCH] Correct authentication Can't always be true --- lib/nessus/nessus-xmlrpc.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/nessus/nessus-xmlrpc.rb b/lib/nessus/nessus-xmlrpc.rb index 40148f2c63..58e48e15c0 100644 --- a/lib/nessus/nessus-xmlrpc.rb +++ b/lib/nessus/nessus-xmlrpc.rb @@ -28,8 +28,12 @@ module Nessus :json => 1 } res = http_post(:uri=>"/session", :data=>payload) - @token = "token=#{res['token']}" - true + if res['token'] + @token = "token=#{res['token']}" + return true + else + false + end end def x_cookie