From f88a522bf567fc0a38748349a639c2f588711b2d Mon Sep 17 00:00:00 2001 From: h00die Date: Sat, 18 Mar 2017 14:50:24 -0400 Subject: [PATCH] fix #8121 --- modules/auxiliary/scanner/printer/canon_iradv_pwd_extract.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auxiliary/scanner/printer/canon_iradv_pwd_extract.rb b/modules/auxiliary/scanner/printer/canon_iradv_pwd_extract.rb index 17e877aa0865..0e932348c29e 100644 --- a/modules/auxiliary/scanner/printer/canon_iradv_pwd_extract.rb +++ b/modules/auxiliary/scanner/printer/canon_iradv_pwd_extract.rb @@ -70,7 +70,7 @@ def login(ip) #grab Canon sessionid cookie idcookie = res.nil? ? nil : res.get_cookies - if res.code == 301 || res.code == 302 && res.headers.include?('Location') + if res && (res.code == 301 || res.code == 302 && res.headers.include?('Location')) print_good("#{rhost} - SUCCESSFUL login with USER='#{datastore['USER']}' : PASSWORD='#{datastore['PASSWD']}'") #grab Canon IR= session cookie