Menu

#237 Download to pcap bug in base_payload.php, fix included

open
nobody
None
5
2010-04-20
2010-04-20
No

This affects BASE 1.4.5. When downloading to pcap, some packets have a fragment offset injected erroneously, and the IP flags disappear. The IP flags and offset are referenced with the wrong array indexes, and then the two fields are merely concatenated. When lines 350 and 351 in base_payload.php are replaced with the following, it seems to work correctly:

$data_header.= sprintf("%04s", dechex($ip[6]*8192+$ip[5]) ); // flags and offset; 8192 multiplier shifts the flags into the right position

Original code (with incorrect array indices):

$data_header.= sprintf("%02s", dechex($ip[5])); // flags
$data_header.= sprintf("%02s", dechex($ip[6])); // offset

Discussion