diff --git a/modules/exploits/linux/samba/lsa_transnames_heap.rb b/modules/exploits/linux/samba/lsa_transnames_heap.rb index 1647e940e2..e32e381b33 100644 --- a/modules/exploits/linux/samba/lsa_transnames_heap.rb +++ b/modules/exploits/linux/samba/lsa_transnames_heap.rb @@ -197,11 +197,28 @@ class Metasploit3 < Msf::Exploit::Remote ], self.class) end + + # Need to perform target detection + def autofilter + begin + connect() + smb_login() + disconnect() + if (smb_peer_lm() =~ /Samba/i) + true + else + false + end + rescue ::Exception + false + end + end + def check + autofilter() ? CheckCode::Detected : CheckCode::Safe + end def brute_exploit(target_addrs) - - if(not @nops) if (target['Nops'] > 0) @@ -318,4 +335,4 @@ class Metasploit3 < Msf::Exploit::Remote end -end \ No newline at end of file +end