serena zanetta wrote:
Hi,

I’ve got a problem with the packet injection. I’ve tried to send a packet by
the means of the nemesis suite. Everything works fine since I type the
command

“nemesis udp …”

on the command line.

If I tried to call the same command via the PHP exec()

exec("nemesis udp $message_to_send",$response);

the nemesis packet injection failed: “/dev/bpf0: Permission denied” !

sprintf(device, "/dev/bpf%d", i);

fd = open(device, O_RDWR);

Gives  fd = -1.


Is your PHP script called as user root or www (via Apache)?

bpf device is usable only by root (be default) unless you change the permissions:

# ls -al /dev/bpf0
crw-------  1 root  wheel    0, 170 Aug 25  2009 /dev/bpf0

Miroslav Lachman
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to