how to modify pcap file for Additional Information in packet

Viewed 312

I have one Pcap File which consist of Some Information.

I need to modify the data in the file.

Example: wireshark details

As you can see There are details of packets and in Additional Record section I have TXT value fn=Room 110

Now please help me to change the TXT value

Example: from TXT: fn=Room 110 to TXT: fn=Room 1234

Example End

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 TXT: fn=Room 110 to TXT: fn=Room 123

But Can't Change from TXT: fn=Room 110 to TXT: fn=Room 1234 In this case, the generated pcap gets invalid.

Here is a sample working Screenshot Using Python

Python Program This code Changes The Destination Mac, Source IP and TXT=Room <value:3 digit> 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.

0 Answers
Related