Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Netcat inside DHCP chroot

Hi,

i want to add an option in dhcpd.conf:
  on commit {
    set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
    execute("/dhcpevent.sh", clhw);
  }

and a script /dhcpevent.sh with:
  #!/bin/sh
  echo $1 | nc -c 192.168.0.10 32123

This way i can inform a computer that a new device is in the network (for example a friend with his mobile phone) and fire an notification.

I copied all needed binaries (bash, nc) and libs in the chroot: /var/chroot-dhcps/
but when i try to send or receive something via netcat, it isn't working.
Netcat doesnt throw an error or exits, it does nothing.
Seems that the traffic is blocked.

2 Questions:
a: How i can i allow sending via netcat in chroot on a specific port?
b: When i do a firmware upgrade, will my files be overwritten?

Maybe there is an other way to do that, but i dont think so.
Generally i want to get a notification on my computer when a mobile phone connects to my network via wlan. Wlan is not handled via the Sophos UTM,
it is an normal consuper AP, connected to the internal LAN.

thanks for you help and excuse by bad english


This thread was automatically locked due to age.
  • Hi, 

    You need to add a Firewall Rule (looking at the firewall log probably would show some DROPs):

    From: Internal Interface Address (192.168.0.1 or whatever the firewall's address is)
    To: 192.168.0.10
    Service: create a service def for TCP src:1-65535 to dest:32123
    ALLOW

    Yes, your files may be overwritten by firmware updates.

    Also, you should be editing the dhcpd-defaults.conf file instead of dhcpd.conf; dhcpd.conf may be overwritten at any time by the configuration daemon.

    Barry
  • ok its working now, the firewall rule was it. i forgot that the firewall also blocks every outgoing traffic from itself. Thanks.

    can be closed