0

i m writing a code for port scanner so i need to send a raw packet. i searched and found out that using dpkt library would be better but i didnt find any documentation that would help. So please anyone could help may explaining how to create a packet with customized TCP header i.e set the flags of tcp header as required.

Thank You

1

1 Answer 1

1

Well, this is a bit old but I'll answer anyway since I've been looking to do the same. The dpkt documentation is basically non-existant. The only thing they give you is some samples and Jon Oberheide, the co-developer, wrote some tutorials for it. So if you want to use dpkt it isn't difficult you can figure it out from one of these tutorials:

If you want an easier API, I've used both of these:

  1. The same guy that wrote dpkt wrote libdnet, which is used by the beastly security scanner Nmap and has python wrappings: http://libdnet.sourceforge.net/. It's got some pretty basic TCP and IP creation functions but the documentation is much better.

  2. Or use this python wrapper for libnet, http://pylibnet.sourceforge.net/. This is very robust and the documentation is great but I couldn't get injection working on OS X. Also every release so far is still beta.

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

Comments

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.