From 1988085a94bdafa955fbf474b00a65eea4bdfd4c Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Wed, 18 Sep 2013 12:24:36 -0500 Subject: [PATCH] Fix possible port conflict --- .../exploits/linux/http/dlink_command_php_exec_noauth.rb | 2 +- modules/exploits/linux/http/dlink_dir300_exec_telnet.rb | 2 +- .../exploits/linux/http/dlink_upnp_exec_noauth_telnetd.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/exploits/linux/http/dlink_command_php_exec_noauth.rb b/modules/exploits/linux/http/dlink_command_php_exec_noauth.rb index c4e14dc200..8faa3859ba 100644 --- a/modules/exploits/linux/http/dlink_command_php_exec_noauth.rb +++ b/modules/exploits/linux/http/dlink_command_php_exec_noauth.rb @@ -77,7 +77,7 @@ class Metasploit3 < Msf::Exploit::Remote end def exploit - telnetport = rand(65535) + telnetport = rand(32767) + 32768 print_status("#{rhost}:#{rport} - Telnet port used: #{telnetport}") diff --git a/modules/exploits/linux/http/dlink_dir300_exec_telnet.rb b/modules/exploits/linux/http/dlink_dir300_exec_telnet.rb index cf826933f4..48ac991237 100644 --- a/modules/exploits/linux/http/dlink_dir300_exec_telnet.rb +++ b/modules/exploits/linux/http/dlink_dir300_exec_telnet.rb @@ -129,7 +129,7 @@ class Metasploit3 < Msf::Exploit::Remote end def exploit_telnet - telnetport = rand(65535) + telnetport = rand(32767) + 32768 print_status("#{rhost}:#{rport} - Telnetport: #{telnetport}") diff --git a/modules/exploits/linux/http/dlink_upnp_exec_noauth_telnetd.rb b/modules/exploits/linux/http/dlink_upnp_exec_noauth_telnetd.rb index 335d542b44..70395898a4 100644 --- a/modules/exploits/linux/http/dlink_upnp_exec_noauth_telnetd.rb +++ b/modules/exploits/linux/http/dlink_upnp_exec_noauth_telnetd.rb @@ -76,9 +76,9 @@ class Metasploit3 < Msf::Exploit::Remote def exploit @new_portmapping_descr = rand_text_alpha(8) - @new_external_port = rand(65535) - @new_internal_port = rand(65535) - telnetport = rand(65535) + @new_external_port = rand(32767) + 32768 + @new_internal_port = rand(32767) + 32768 + telnetport = rand(32767) + 32768 vprint_status("#{rhost}:#{rport} - Telnetport: #{telnetport}")