1

This started with a simple task, send an ICMP package of type 8 and code 0 to a host in my network. Since I use my Mac for everything I installed nemesis using macports and tried the following command.

sudo nemesis icmp -i 8 -c 0 -P ./payload -D 172.16.148.133

This resulted in an error.

ERROR: Incomplete packet injection.  Only wrote -1 bytes.

ICMP Injection Failure

And ever since then I have not been able to use nemesis icmp at all from two known good mac computers, I always get this same exact error.

So my response when I noticed this was to simply compile it on a FreeBSD 8.2 system from ports, nemesis 1.4 build 26, same as on OS X.

Works just as it should, no errors, happy user. :)

But I don't want to login to a FreeBSD system everytime I want to use nemesis so what's wrong here? I've tried compiling nemesis 1.4 build 26 from the source code on sourceforge, linking to the libnet installed by macports in /opt, but it did not make a difference.

Note: I've tried running this nemesis command on both systems using a root terminal, not just through sudo that is.

1 Answers1

0

This looks like a failing of libnet. From the source code of nemesis:

if (got_link)
    n = libnet_write_link_layer(l2, device, pkt, icmp_packetlen);
else
    n = libnet_write_ip(sockfd, pkt, icmp_packetlen);

if (verbose == 2)
    nemesis_hexdump(pkt, icmp_packetlen, HEX_ASCII_DECODE);
if (verbose == 3)
    nemesis_hexdump(pkt, icmp_packetlen, HEX_RAW_DECODE);

if (n != icmp_packetlen)
{
    fprintf(stderr, "ERROR: Incomplete packet injection.  Only wrote "
            "%d bytes.\n", n);
}

So the failure is in libnet_write_ip() or libnet_write_link_layer().

I would recommend manually recompiling libnet from source and linking nemesis against that new copy.

Majenko
  • 32,964