For a POC, I want to use python or java to sniff network traffic packets, and respond to specific ones. Something like a MITM attack. The library should be able to capture ICMP packets as well. I've looked at jpcap but it can only sniff packets and can't be used to send your own response to packets.

1 Answer 1


The python Scapy library can:

  • Sniff packets in just about any format
  • Work in promiscuous mode (i.e. sniff traffic not addressed to you).
  • Create and Inject packets in just about any format, (including invalid formats).
  • Be used to respond to specific packets by sending responses or otherwise.
  • You can even build your own protocols!
  • Much more...
  • It works on Linux, Windows, OSX and on most Unixes with libpcap
  • Price: $0.00 (Free)
  • Open Source: GPL-2.0 License

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.