what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

FTP Bounce Port Scanner

FTP Bounce Port Scanner
Posted Sep 1, 2024
Authored by Kris Katterjohn | Site metasploit.com

Enumerate TCP services via the FTP bounce PORT/LIST method.

tags | exploit, tcp
SHA-256 | c4a12bd7e84df326bb8f7d95d1ef9ba9d1f95844094f776776f5f8dc4fbcc705

FTP Bounce Port Scanner

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary

# Order is important here
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
include Msf::Exploit::Remote::Ftp

def initialize
super(
'Name' => 'FTP Bounce Port Scanner',
'Description' => %q{
Enumerate TCP services via the FTP bounce PORT/LIST
method.
},
'Author' => 'kris katterjohn',
'License' => MSF_LICENSE
)

register_options([
OptString.new('PORTS', [true, "Ports to scan (e.g. 22-25,80,110-900)", "1-10000"]),
OptAddress.new('BOUNCEHOST', [true, "FTP relay host"]),
OptPort.new('BOUNCEPORT', [true, "FTP relay port", 21]),
OptInt.new('DELAY', [true, "The delay between connections, per thread, in milliseconds", 0]),
OptInt.new('JITTER', [true, "The delay jitter factor (maximum value by which to +/- DELAY) in milliseconds.", 0])
])

deregister_options('RPORT')
end

# No IPv6 support yet
def support_ipv6?
false
end

def rhost
datastore['BOUNCEHOST']
end

def rport
datastore['BOUNCEPORT']
end

def run_host(ip)
ports = Rex::Socket.portspec_crack(datastore['PORTS'])
if ports.empty?
raise Msf::OptionValidateError.new(['PORTS'])
end

jitter_value = datastore['JITTER'].to_i
if jitter_value < 0
raise Msf::OptionValidateError.new(['JITTER'])
end

delay_value = datastore['DELAY'].to_i
if delay_value < 0
raise Msf::OptionValidateError.new(['DELAY'])
end

return if not connect_login

ports.each do |port|
# Clear out the receive buffer since we're heavily dependent
# on the response codes. We need to do this between every
# port scan attempt unfortunately.
while true
r = sock.get_once(-1, 0.25)
break if not r or r.empty?
end

begin

# Add the delay based on JITTER and DELAY if needs be
add_delay_jitter(delay_value,jitter_value)

host = (ip.split('.') + [port / 256, port % 256]).join(',')
resp = send_cmd(["PORT", host])

if resp =~ /^5/
#print_error("Got error from PORT to #{ip}:#{port}")
next
elsif not resp
next
end

resp = send_cmd(["LIST"])

if resp =~ /^[12]/
print_good(" TCP OPEN #{ip}:#{port}")
report_service(:host => ip, :port => port)
end
rescue ::Exception
print_error("Unknown error: #{$!}")
end
end
end
end
Login or Register to add favorites

File Archive:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    20 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    0 Files
  • 8
    Oct 8th
    0 Files
  • 9
    Oct 9th
    0 Files
  • 10
    Oct 10th
    0 Files
  • 11
    Oct 11th
    0 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    0 Files
  • 15
    Oct 15th
    0 Files
  • 16
    Oct 16th
    0 Files
  • 17
    Oct 17th
    0 Files
  • 18
    Oct 18th
    0 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    0 Files
  • 22
    Oct 22nd
    0 Files
  • 23
    Oct 23rd
    0 Files
  • 24
    Oct 24th
    0 Files
  • 25
    Oct 25th
    0 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close