From 545ca853464f47db96f5adb99df35ff3c557253f Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Sun, 6 Sep 2015 16:08:54 +0300 Subject: add pcap file with wrong headers --- scripts/cap2/asa_exploit.pcap | Bin 0 -> 29728 bytes scripts/cap2/asa_explot1.yaml | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 scripts/cap2/asa_exploit.pcap create mode 100644 scripts/cap2/asa_explot1.yaml (limited to 'scripts/cap2') diff --git a/scripts/cap2/asa_exploit.pcap b/scripts/cap2/asa_exploit.pcap new file mode 100644 index 00000000..861d4037 Binary files /dev/null and b/scripts/cap2/asa_exploit.pcap differ diff --git a/scripts/cap2/asa_explot1.yaml b/scripts/cap2/asa_explot1.yaml new file mode 100644 index 00000000..6f08c49c --- /dev/null +++ b/scripts/cap2/asa_explot1.yaml @@ -0,0 +1,23 @@ +- duration : 0.1 + generator : + distribution : "seq" + clients_start : "16.0.0.1" + clients_end : "16.0.1.254" + servers_start : "48.0.0.1" + servers_end : "48.0.0.254" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 0 + udp_aging : 0 + mac : [0x00,0x00,0x00,0x01,0x00,0x00] + cap_ipg : false + cap_ipg_min : 100 + cap_override_ipg : 1000 + cap_info : + - name: cap2/asa_exploit.pcap + cps : 1.1 + ipg : 1.1 + rtt : 50000 + w : 1 + -- cgit 1.2.3-korg From f885ac59cebcf1e87b97b0e6ef6e9eb032f9f733 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 17 Sep 2015 21:44:53 +0300 Subject: fix some pcap load issues --- VERSION | 2 +- scripts/cap2/jumbo.pcap | Bin 0 -> 17791 bytes scripts/cap2/jumbo.yaml | 23 +++++++++++++++++++++++ scripts/cap2/wrong_ip.pcap | Bin 0 -> 1530 bytes scripts/cap2/wrong_ip.yaml | 23 +++++++++++++++++++++++ src/bp_sim.cpp | 16 +++++++++------- src/common/pcap.cpp | 3 ++- 7 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 scripts/cap2/jumbo.pcap create mode 100644 scripts/cap2/jumbo.yaml create mode 100644 scripts/cap2/wrong_ip.pcap create mode 100644 scripts/cap2/wrong_ip.yaml (limited to 'scripts/cap2') diff --git a/VERSION b/VERSION index 917f0173..fe509dde 100755 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -v1.75 +v1.76 diff --git a/scripts/cap2/jumbo.pcap b/scripts/cap2/jumbo.pcap new file mode 100644 index 00000000..2a7f7bde Binary files /dev/null and b/scripts/cap2/jumbo.pcap differ diff --git a/scripts/cap2/jumbo.yaml b/scripts/cap2/jumbo.yaml new file mode 100644 index 00000000..b45a6ca3 --- /dev/null +++ b/scripts/cap2/jumbo.yaml @@ -0,0 +1,23 @@ +- duration : 10.0 + generator : + distribution : "seq" + clients_start : "16.0.0.1" + clients_end : "16.0.1.255" + servers_start : "48.0.0.1" + servers_end : "48.0.0.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 1 + udp_aging : 1 + mac : [0x00,0x00,0x00,0x01,0x00,0x00] + #vlan : { enable : 1 , vlan0 : 100 , vlan1 : 200 } + #mac_override_by_ip : true + cap_info : + - name: cap2/jumbo.pcap + cps : 1.0 + ipg : 10000 + rtt : 10000 + w : 1 + + diff --git a/scripts/cap2/wrong_ip.pcap b/scripts/cap2/wrong_ip.pcap new file mode 100644 index 00000000..08cf8de8 Binary files /dev/null and b/scripts/cap2/wrong_ip.pcap differ diff --git a/scripts/cap2/wrong_ip.yaml b/scripts/cap2/wrong_ip.yaml new file mode 100644 index 00000000..7de3b82d --- /dev/null +++ b/scripts/cap2/wrong_ip.yaml @@ -0,0 +1,23 @@ +- duration : 10.0 + generator : + distribution : "seq" + clients_start : "16.0.0.1" + clients_end : "16.0.1.255" + servers_start : "48.0.0.1" + servers_end : "48.0.0.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 1 + udp_aging : 1 + mac : [0x00,0x00,0x00,0x01,0x00,0x00] + #vlan : { enable : 1 , vlan0 : 100 , vlan1 : 200 } + #mac_override_by_ip : true + cap_info : + - name: cap2/wrong_ip.pcap + cps : 1.0 + ipg : 10000 + rtt : 10000 + w : 1 + + diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index 555696f1..8a8bc5f9 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -1148,13 +1148,6 @@ void CPacketIndication::ProcessIpPacket(CPacketParser *parser, } offset += ip_header_length; - if (!l3.m_ipv4->isChecksumOK() ){ - m_cnt->m_ip_checksum_error++; - } - if( l3.m_ipv4->isMulticast() ){ - m_cnt->m_ip_multicast_error++; - return; - } if( l3.m_ipv4->getTimeToLive() ==0 ){ m_cnt->m_ip_ttl_is_zero_error++; @@ -1177,10 +1170,19 @@ void CPacketIndication::ProcessIpPacket(CPacketParser *parser, return; } + if ( m_packet->pkt_len > MAX_BUF_SIZE -FIRST_PKT_SIZE ){ + m_cnt->m_tcp_udp_pkt_length_error++; + printf("ERROR packet is too big, not supported jumbo packets that larger than %d \n",MAX_BUF_SIZE); + return; + } + // Set packet length and include padding if needed m_packet->pkt_len = l3.m_ipv4->getTotalLength() + getIpOffset(); if (m_packet->pkt_len < 60) { m_packet->pkt_len = 60; } + + + m_cnt->m_valid_udp_tcp++; m_payload_len = l3.m_ipv4->getTotalLength() - (payload_offset_from_ip); m_payload = (uint8_t *)(packetBase +offset); diff --git a/src/common/pcap.cpp b/src/common/pcap.cpp index 6dd54514..9b360a3e 100755 --- a/src/common/pcap.cpp +++ b/src/common/pcap.cpp @@ -156,7 +156,8 @@ bool LibPCapReader::ReadPacket(CCapPktRaw *lpPacket) } if (pkt_header.len > READER_MAX_PACKET_SIZE) { /* cannot read this packet */ - assert(0); + printf("ERROR packet is too big, bigger than %d \n",READER_MAX_PACKET_SIZE); + exit(-1); return false; } -- cgit 1.2.3-korg