From 3266bd9ecda8ba9cdbb7cb3a1284ecd093d4c52e Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 18 Nov 2008 20:15:20 +0000 Subject: [PATCH] Add a better autofilter() / check() git-svn-id: file:///home/svn/framework3/trunk@5950 4d416f70-5f16-0410-b530-b9f4589650da --- .../linux/samba/lsa_transnames_heap.rb | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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