Updates to match the new Racket namespace

git-svn-id: file:///home/svn/framework3/trunk@8026 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-12-29 23:32:50 +00:00
parent 48c2184fb2
commit 68eb240639
20 changed files with 72 additions and 72 deletions

View File

@ -42,7 +42,7 @@ class Metasploit3 < Msf::Auxiliary
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = '0.0.0.0'
n.l3.dst_ip = rhost
n.l3.protocol = 17
@ -50,7 +50,7 @@ class Metasploit3 < Msf::Auxiliary
n.l3.ttl = 128
n.l3.flags = 2
n.l4 = Racket::UDP.new
n.l4 = Racket::L4::UDP.new
n.l4.src_port = 0
n.l4.dst_port = datastore['RPORT'].to_i
pkt = n.pack

View File

@ -56,14 +56,14 @@ class Metasploit3 < Msf::Auxiliary
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = datastore['LHOST']
n.l3.dst_ip = ip
n.l3.protocol = 17
n.l3.id = rand(0xffff)+1
n.l3.ttl = 255
n.l4 = Racket::UDP.new
n.l4 = Racket::L4::UDP.new
n.l4.src_port = 123
n.l4.dst_port = 123
n.l4.payload = ["\x17","\x97\x00\x00\x00"][rand(2)]

View File

@ -50,10 +50,10 @@ class Metasploit3 < Msf::Auxiliary
print_status("SYN flooding #{rhost}:#{rport}...")
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.dst_ip = rhost
n.l3.protocol = 6
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = rand(65535)+1
n.l4.dst_port = rport
n.l4.flag_syn = 1

View File

@ -42,13 +42,13 @@ class Metasploit3 < Msf::Auxiliary
connect_ip
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = datastore['SHOST'] || Rex::Socket.source_address(rhost)
n.l3.dst_ip = rhost
n.l3.protocol = 6
n.l3.id = rand(0x10000)
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.dst_port = rand(65535)+1
n.l4.seq = rand(0x100000000)
n.l4.ack = rand(0x100000000)

View File

@ -46,13 +46,13 @@ class Metasploit3 < Msf::Auxiliary
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = datastore['SHOST'] || Rex::Socket.source_address(rhost)
n.l3.dst_ip = rhost
n.l3.protocol = 6
n.l3.id = rand(0x10000)
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = rand(65535)+1
n.l4.seq = rand(0x100000000)
n.l4.ack = rand(0x100000000)

View File

@ -70,13 +70,13 @@ class Metasploit3 < Msf::Auxiliary
def buildprobe(shost, smac, dhost)
n = Racket::Racket.new
n.l2 = Racket::Ethernet.new(Racket::Misc.randstring(14))
n.l2 = Racket::L2::Ethernet.new(Racket::Misc.randstring(14))
n.l2.src_mac = smac
n.l2.dst_mac = 'ff:ff:ff:ff:ff:ff'
n.l2.ethertype = 0x0806
n.l3 = Racket::ARP.new
n.l3.opcode = Racket::ARP::ARPOP_REQUEST
n.l3 = Racket::L3::ARP.new
n.l3.opcode = Racket::L3::ARP::ARPOP_REQUEST
n.l3.sha = n.l2.src_mac
n.l3.tha = n.l2.dst_mac
n.l3.spa = shost
@ -88,11 +88,11 @@ class Metasploit3 < Msf::Auxiliary
pkt = capture.next
return if not pkt
eth = Racket::Ethernet.new(pkt)
eth = Racket::L2::Ethernet.new(pkt)
return if not eth.ethertype == 0x0806
arp = Racket::ARP.new(eth.payload)
return if not arp.opcode == Racket::ARP::ARPOP_REPLY
arp = Racket::L3::ARP.new(eth.payload)
return if not arp.opcode == Racket::L3::ARP::ARPOP_REPLY
{:raw => pkt, :eth => eth, :arp => arp}
end

View File

@ -167,14 +167,14 @@ class Metasploit3 < Msf::Auxiliary
def buildprobe(shost, sport, dhost, dport)
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = shost
n.l3.dst_ip = dhost
n.l3.protocol = 0x6
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = sport
n.l4.seq = rand(0x100000000)
n.l4.dst_port = dport
@ -191,14 +191,14 @@ class Metasploit3 < Msf::Auxiliary
begin
Timeout.timeout(to) do
pcap.each do |r|
eth = Racket::Ethernet.new(r)
eth = Racket::L2::Ethernet.new(r)
next if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if not ip.protocol == 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
reply = {:raw => r, :eth => eth, :ip => ip, :tcp => tcp}

View File

@ -108,14 +108,14 @@ class Metasploit3 < Msf::Auxiliary
def buildprobe(shost, sport, dhost, dport)
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = shost
n.l3.dst_ip = dhost
n.l3.protocol = 0x6
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = sport
n.l4.seq = rand(0x100000000)
n.l4.ack = rand(0x100000000)
@ -134,13 +134,13 @@ class Metasploit3 < Msf::Auxiliary
begin
Timeout.timeout(to) do
pcap.each do |r|
eth = Racket::Ethernet.new(r)
eth = Racket::L2::Ethernet.new(r)
next if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if not ip.protocol == 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
reply = {:raw => r, :eth => eth, :ip => ip, :tcp => tcp}

View File

@ -109,14 +109,14 @@ class Metasploit3 < Msf::Auxiliary
def buildprobe(shost, sport, dhost, dport)
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = shost
n.l3.dst_ip = dhost
n.l3.protocol = 0x6
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = sport
n.l4.seq = rand(0x100000000)
n.l4.ack = 0
@ -135,13 +135,13 @@ class Metasploit3 < Msf::Auxiliary
begin
Timeout.timeout(to) do
pcap.each do |r|
eth = Racket::Ethernet.new(r)
eth = Racket::L2::Ethernet.new(r)
next if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if not ip.protocol == 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
reply = {:raw => r, :eth => eth, :ip => ip, :tcp => tcp}

View File

@ -108,14 +108,14 @@ class Metasploit3 < Msf::Auxiliary
def buildprobe(shost, sport, dhost, dport)
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = shost
n.l3.dst_ip = dhost
n.l3.protocol = 0x6
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = sport
n.l4.seq = rand(0x100000000)
n.l4.flag_fin = 1
@ -135,13 +135,13 @@ class Metasploit3 < Msf::Auxiliary
begin
Timeout.timeout(to) do
pcap.each do |r|
eth = Racket::Ethernet.new(r)
eth = Racket::L2::Ethernet.new(r)
next if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if not ip.protocol == 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
reply = {:raw => r, :eth => eth, :ip => ip, :tcp => tcp}

View File

@ -66,13 +66,13 @@ class Metasploit3 < Msf::Auxiliary
end
def parse_reply(r)
eth = Racket::Ethernet.new(r)
eth = Racket::L2::Ethernet.new(r)
return if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
case ip.protocol
when 1
icmp = Racket::ICMP.new(ip.payload)
icmp = Racket::L4::ICMP.new(ip.payload)
reply = {:raw => r, :eth => eth, :ip => ip, :icmp => icmp}
reply[:type] = :icmp
return if(icmp.payload[4,2] != [datastore['ECHOID']].pack('n'))
@ -80,7 +80,7 @@ class Metasploit3 < Msf::Auxiliary
reply[:external] = ip.src_ip
return reply
when 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
reply = {:raw => r, :eth => eth, :ip => ip, :tcp => tcp}
reply[:type] = :tcp
reply[:internal] = Rex::Socket.addr_itoa(tcp.ack - 1)

View File

@ -55,14 +55,14 @@ class Metasploit3 < Msf::Auxiliary
def build_tcp_syn(dst)
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = datastore['EHOST']
n.l3.dst_ip = dst
n.l3.protocol = 0x6
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::TCP.new
n.l4 = Racket::L4::TCP.new
n.l4.src_port = datastore['CPORT'].to_i
n.l4.seq = Rex::Socket.addr_atoi(dst)
n.l4.dst_port = datastore['RPORT'].to_i
@ -76,14 +76,14 @@ class Metasploit3 < Msf::Auxiliary
def build_icmp(dst)
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = datastore['EHOST']
n.l3.dst_ip = dst
n.l3.protocol = 0x1
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::ICMP.new
n.l4 = Racket::L4::ICMP.new
n.l4.type = 8
n.l4.id = rand(0x10000)
n.l4.seq = 1

View File

@ -102,13 +102,13 @@ class Metasploit3 < Msf::Auxiliary
open_pcap
each_packet do |pkt|
eth = Racket::Ethernet.new(pkt)
eth = Racket::L2::Ethernet.new(pkt)
next if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if not ip.protocol == 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
next if !(tcp.payload and tcp.payload.length > 0)
data = {:raw => pkt, :eth => eth, :ip => ip, :tcp => tcp}

View File

@ -303,13 +303,13 @@ class Metasploit3 < Msf::Auxiliary
end
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = src_ip
n.l3.dst_ip = target
n.l3.protocol = 17
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::UDP.new
n.l4 = Racket::L4::UDP.new
n.l4.src_port = (rand((2**16)-1024)+1024).to_i
n.l4.dst_port = 53
n.l4.payload = req.encode

View File

@ -297,13 +297,13 @@ class Metasploit3 < Msf::Auxiliary
end
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = src_ip
n.l3.dst_ip = target
n.l3.protocol = 17
n.l3.id = rand(0x10000)
n.l3.ttl = 255
n.l4 = Racket::UDP.new
n.l4 = Racket::L4::UDP.new
n.l4.src_port = (rand((2**16)-1024)+1024).to_i
n.l4.dst_port = 53
n.l4.payload = req.encode

View File

@ -140,13 +140,13 @@ class Metasploit3 < Msf::Auxiliary
next if not d3
eth = Racket::Ethernet.new(d3)
eth = Racket::L2::Ethernet.new(d3)
next if eth.ethertype != 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if ip.protocol != 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
@http.each do |r|
hit = nil
@ -162,18 +162,18 @@ class Metasploit3 < Msf::Auxiliary
injpkt.bssid = pkt.bssid
response = Racket::Racket.new
response.l2 = Racket::Ethernet.new("01234567890123")
response.l2 = Racket::L2::Ethernet.new("01234567890123")
response.l2.dst_mac = eth.src_mac
response.l2.src_mac = eth.dst_mac
response.l2.ethertype = 0x0800
response.l3 = Racket::IPv4.new
response.l3 = Racket::L3::IPv4.new
response.l3.src_ip = ip.dst_ip
response.l3.dst_ip = ip.src_ip
response.l3.protocol = ip.protocol
response.l3.ttl = ip.ttl
response.l4 = Racket::TCP.new
response.l4 = Racket::L4::TCP.new
response.l4.src_port = tcp.dst_port
response.l4.dst_port = tcp.src_port
response.l4.window = tcp.window
@ -184,7 +184,7 @@ class Metasploit3 < Msf::Auxiliary
response.l4.flag_ack = 1
response.l4.flag_psh = 1
response.l5 = Racket::RawL5.new
response.l5 = Racket::L5::RawL5.new
response.l5.payload = r["txresponse"]
response.l4.fix!(response.l3.src_ip, response.l3.dst_ip, '')

View File

@ -74,13 +74,13 @@ class Metasploit3 < Msf::Auxiliary
next if not d3
eth = Racket::Ethernet.new(d3)
eth = Racket::L2::Ethernet.new(d3)
next if eth.ethertype != 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if ip.protocol != 0x11
udp = Racket::UDP.new(ip.payload)
udp = Racket::L4::UDP.new(ip.payload)
dns = Net::DNS::Packet::parse(udp.payload)
@ -101,18 +101,18 @@ class Metasploit3 < Msf::Auxiliary
injpkt.bssid = pkt.bssid
response = Racket::Racket.new
response.l2 = Racket::Ethernet.new("01234567890123")
response.l2 = Racket::L2::Ethernet.new("01234567890123")
response.l2.dst_mac = eth.src_mac
response.l2.src_mac = eth.dst_mac
response.l2.ethertype = 0x0800
response.l3 = Racket::IPv4.new
response.l3 = Racket::L3::IPv4.new
response.l3.src_ip = ip.dst_ip
response.l3.dst_ip = ip.src_ip
response.l3.protocol = ip.protocol
response.l3.ttl = ip.ttl
response.l4 = Racket::UDP.new
response.l4 = Racket::L4::UDP.new
response.l4.src_port = udp.dst_port
response.l4.dst_port = udp.src_port

View File

@ -44,13 +44,13 @@ class Metasploit3 < Msf::Auxiliary
print_status("Sniffing HTTP requests...")
each_packet() do |pkt|
eth = Racket::Ethernet.new(pkt)
eth = Racket::L2::Ethernet.new(pkt)
next if not eth.ethertype == 0x0800
ip = Racket::IPv4.new(eth.payload)
ip = Racket::L3::IPv4.new(eth.payload)
next if not ip.protocol == 6
tcp = Racket::TCP.new(ip.payload)
tcp = Racket::L4::TCP.new(ip.payload)
next if !(tcp.payload and tcp.payload.length > 0)
if (tcp.payload =~ /GET\s+([^\s]+)\s+HTTP/smi)

View File

@ -38,15 +38,15 @@ class Metasploit3 < Msf::Auxiliary
open_pcap()
r = Racket::Racket.new
r.l2 = Racket::Ethernet.new
r.l2 = Racket::L2::Ethernet.new
r.l2.ethertype = 0x0800
r.l2.src_mac = "00:41:41:41:41:41"
r.l2.dst_mac = "00:42:42:42:42:42"
r.l3 = Racket::IPv4.new
r.l3 = Racket::L3::IPv4.new
r.l3.src_ip = "41.41.41.41"
r.l3.dst_ip = "42.42.42.42"
r.l3.protocol = 17
r.l4 = Racket::UDP.new
r.l4 = Racket::L4::UDP.new
r.l4.src_port = 0x41
r.l4.dst_port = 0x42
r.l4.payload = "SPOOOOOFED"

View File

@ -35,14 +35,14 @@ class Metasploit3 < Msf::Auxiliary
n = Racket::Racket.new
n.l3 = Racket::IPv4.new
n.l3 = Racket::L3::IPv4.new
n.l3.src_ip = ip
n.l3.dst_ip = ip
n.l3.protocol = 17
n.l3.id = 0xdead
n.l3.ttl = 255
n.l4 = Racket::UDP.new
n.l4 = Racket::L4::UDP.new
n.l4.src_port = 53
n.l4.dst_port = 53
n.l4.payload = "HELLO WORLD"