From 85152b5f1ec5276af748fd198848bd36394feeaf Mon Sep 17 00:00:00 2001 From: caleBot Date: Fri, 20 Oct 2017 14:28:52 -0600 Subject: [PATCH] added check function --- modules/exploits/linux/misc/ueb9_bpserverd.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/exploits/linux/misc/ueb9_bpserverd.rb b/modules/exploits/linux/misc/ueb9_bpserverd.rb index a2041e2adb..5830cf118c 100644 --- a/modules/exploits/linux/misc/ueb9_bpserverd.rb +++ b/modules/exploits/linux/misc/ueb9_bpserverd.rb @@ -51,6 +51,19 @@ class MetasploitModule < Msf::Exploit::Remote deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR') 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 = {})