pig

A Linux packet crafting tool.
pig logo

Pig

A packet building and manipulation tool.


Usage

  • pig: Execute pig on interactive mode.
  • [ cat doc/shell.md ] : Shell command to execute pig commands.

Pig Tricks


From the Ethernet frame to the topmost layer...

Build up packets starting from the Ethernet frame, including support for cooked IPv6 and raw Ethernet building.


Testing Pig from Scratch

Save a "pigsty" file with the following data:

[ signature    =            "oink",
  ip.version   =                4,
  ip.ihl       =                5,
  ip.tos       =                0,
  ip.src       =        127.0.0.1,
  ip.dst       =  user-defined-ip,
  ip.protocol  =               17,
  udp.dst      =             1008,
  udp.src      =            32000,
  udp.payload  =         "Oink!!\n" ]

Run netcat in UDP mode and listen for connections on port 1008. Run pig using the "oink. pigsty", targeting the loopback:

pig --signatures=oink.pigsty --targets=127.0.0.1 \
  --gateway=10.0.2.2 --net-mask=255.255.255.0 --lo-iface=eth0

The netcat should start receiving several "oinks" and... yes, congratulations! Pig is up and running on your system!

Try to sniff your network to get more information about these UDP packets that are flowing around your interfaces...





> Visit pig Website <