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.
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.
Sorry, user dcn is not allowed to execute '/usr/bin/make install' as root on z3d-dcn.
ReplyDeletewhat to do???
Hassaan Zaheer
you need to run the output file as an admin. Use the following command
ReplyDeletesudo ./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.
dcn@z3d-dcn:~/Desktop$ sudo ./a.out
ReplyDelete[sudo] password for dcn:
Sorry, user dcn is not allowed to execute './a.out' as root on z3d-dcn.
The image you took from university has this issue, either you can wait till Monday or you refer to my post http://zaidmunir.blogspot.com/2010/07/libpcap-in-ubuntu.html
ReplyDelete