how to modify pcap file for Additional Information in packet
1
vote
1
answer
1346
views
I have one Pcap File which consist of Some Information.
-------------------------------------------------------
I need to modify the data in the file.
Example:
As you can see There are details of packets and in **Additional Record** section I have TXT value
## Things I have Done So Far ##
### 1. Used Scapy and Hex Editor To change the Metadata. ###
with Scapy I have done changes like Changing Destination address or mac address and ports.
But unable to change the TXT records with scapy.
With Hex I am able to change TXT value by converting the String to hex, but I face challenge in different length.
> Example: I can Chnage
This code Changes The Destination Mac, Source IP and TXT=Room
And That TXT value is being modified by Checking the HEX Value before and after the "TXT: fn=Room" of the packet.
### Any help regarding this Issue is very very appreciated ###
Thank you.

=Room 110
Now please help me to change the TXT value
> Example: from : fn=Room 110
to : fn=Room 1234

: fn=Room 110
to : fn=Room 123
> But Can't Change from : fn=Room 110
to : fn=Room 1234
In this case, the generated pcap gets invalid.
#### Here is a sample working Screenshot Using Python ####

Asked by Amogh Saxena - REXTER
(226 rep)
Jan 28, 2022, 12:31 PM
Last activity: Jan 28, 2022, 04:36 PM
Last activity: Jan 28, 2022, 04:36 PM