Wednesday, July 14, 2010


I have written a small sample code to get you started. You can download it here. to compile the code: gcc code.c -lpcap
and then execute the output file as: sudo ./a.out

Here is a code which generates an ICMP packet, you should follow the structure given in this code. Compile and run the code as mentioned above.


  1. Sorry, user dcn is not allowed to execute '/usr/bin/make install' as root on z3d-dcn.

    what to do???

    Hassaan Zaheer

  2. you need to run the output file as an admin. Use the following command

    sudo ./a.out

    As for the error it seems you tried to install something, you dont need to install any new libraries or stuff in order to run the code. just compile as mentioned in post and execute the output file as admin as mentioned.

  3. dcn@z3d-dcn:~/Desktop$ sudo ./a.out
    [sudo] password for dcn:
    Sorry, user dcn is not allowed to execute './a.out' as root on z3d-dcn.

  4. The image you took from university has this issue, either you can wait till Monday or you refer to my post