3

I'm new to Python network programming. I want to modify the IPv4 header by eliminating some of its fields. Please give me hints where to start to read or some examples. What packages should I use?

Any help is very appreciated.

Sorry for my poor English.

1 Answer 1

1

first, you need to receive the packet using Socket module and then unpacking it using unpack module

then you would be able to anything

Sign up to request clarification or add additional context in comments.

2 Comments

Dose Socket module work on regular TCP/IP headers only? I mean, If I managed to modify the IP header fields, is it possible to use the Socket module?
i still don't understand you well but i guess you mean that you've got the packet from an external source like Wireshark and if you are trying to redirect the packet to another device that wouldn't work because you can't modify the destination and source if the packet from just the ipv4 header anyway if you have the packet from socket module use this setsockopt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.