added check function

bug/bundler_fix
caleBot 2017-10-20 14:28:52 -06:00 committed by GitHub
parent e9ad5a7dca
commit 85152b5f1e
1 changed files with 13 additions and 0 deletions

View File

@ -51,6 +51,19 @@ class MetasploitModule < Msf::Exploit::Remote
deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR') deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR')
end end
def check
s1 = connect(global = false)
buf1 = s1.get_once(-1).to_s
#parse out the bpd port returned
bpd_port = buf1[-8..-3].to_i
#check if it's a valid port number (1-65534)
if bpd_port && bpd_port >= 1 && bpd_port <= 65535
Exploit::CheckCode::Detected
else
Exploit::CheckCode::Safe
end
end
def execute_command(cmd, opts = {}) def execute_command(cmd, opts = {})